map-core-func 0.2.10 → 0.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("maptalks"),require("three")):"function"==typeof define&&define.amd?define(["exports","maptalks","three"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).mapcore=t.mapcore||{},t.maptalks,t.THREE)}(this,(function(t,e,n){function r(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var i=r(e),o=r(n);function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e,n,r,i,o,s){try{var a=t[o](s),u=a.value}catch(t){return void n(t)}a.done?e(u):Promise.resolve(u).then(r,i)}function u(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function s(t){a(o,r,i,s,u,"next",t)}function u(t){a(o,r,i,s,u,"throw",t)}s(void 0)}))}}function l(t,e,n){return e=v(e),function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,A()?Reflect.construct(e,n||[],v(t).constructor):e.apply(t,n))}function h(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e,n){if(A())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&E(i,n.prototype),i}function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,T(r.key),r)}}function p(t,e,n){return e&&f(t.prototype,e),n&&f(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function d(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=P(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function g(t,e,n){return(e=T(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y(){return y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=C(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},y.apply(null,arguments)}function v(t){return v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},v(t)}function m(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&E(t,e)}function A(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(A=function(){return!!t})()}function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function x(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_(Object(n),!0).forEach((function(e){g(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function w(){w=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function h(t,e,n,r){var o=e&&e.prototype instanceof v?e:v,s=Object.create(o.prototype),a=new k(r||[]);return i(s,"_invoke",{value:S(t,n,a)}),s}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var f="suspendedStart",p="suspendedYield",d="executing",g="completed",y={};function v(){}function m(){}function A(){}var _={};l(_,s,(function(){return this}));var x=Object.getPrototypeOf,b=x&&x(x(P([])));b&&b!==n&&r.call(b,s)&&(_=b);var E=A.prototype=v.prototype=Object.create(_);function I(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function C(t,e){function n(i,o,s,a){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return n("throw",t,s,a)}))}a(u.arg)}var o;i(this,"_invoke",{value:function(t,r){function i(){return new e((function(e,i){n(t,r,e,i)}))}return o=o?o.then(i,i):i()}})}function S(e,n,r){var i=f;return function(o,s){if(i===d)throw Error("Generator is already running");if(i===g){if("throw"===o)throw s;return{value:t,done:!0}}for(r.method=o,r.arg=s;;){var a=r.delegate;if(a){var u=M(a,r);if(u){if(u===y)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===f)throw i=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var l=c(e,n,r);if("normal"===l.type){if(i=r.done?g:p,l.arg===y)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=g,r.method="throw",r.arg=l.arg)}}}function M(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,M(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=c(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var s=o.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function B(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(B,this),this.reset(!0)}function P(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(typeof e+" is not iterable")}return m.prototype=A,i(E,"constructor",{value:A,configurable:!0}),i(A,"constructor",{value:m,configurable:!0}),m.displayName=l(A,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,A):(t.__proto__=A,l(t,u,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},I(C.prototype),l(C.prototype,a,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var s=new C(h(t,n,r,i),o);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},I(E),l(E,u,"Generator"),l(E,s,(function(){return this})),l(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=P,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return a.type="throw",a.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return i("end");if(s.tryLoc<=this.prev){var u=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(u&&l){if(this.prev<s.catchLoc)return i(s.catchLoc,!0);if(this.prev<s.finallyLoc)return i(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return i(s.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return i(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:P(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function b(t,e,n,r){return b="undefined"!=typeof Reflect&&Reflect.set?Reflect.set:function(t,e,n,r){var i,o=C(t,e);if(o){if((i=Object.getOwnPropertyDescriptor(o,e)).set)return i.set.call(r,n),!0;if(!i.writable)return!1}if(i=Object.getOwnPropertyDescriptor(r,e)){if(!i.writable)return!1;i.value=n,Object.defineProperty(r,e,i)}else g(r,e,n);return!0},b(t,e,n,r)}function E(t,e){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},E(t,e)}function I(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,l=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(l)throw i}}return a}}(t,e)||P(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=v(t)););return t}function S(t,e,n,r){var i=y(v(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function M(t,e,n,r,i,o){return function(t,e,n,r,i){if(!b(t,e,n,r||t)&&i)throw new TypeError("failed to set property");return n}(v(o?t.prototype:t),e,n,r,i)}function B(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||P(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}function k(t){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k(t)}function P(t,e){if(t){if("string"==typeof t)return s(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(t,e):void 0}}const L=parseInt(o.REVISION.replace("dev",""));function R(t,e,n){return L>109?t.setAttribute(e,n):t.addAttribute(e,n),t}function D(){return o}function O(){return(t=D()).VertexColors?t.VertexColors:2;var t}function N(t,e,n){const r=D();return L>=144?new r.BoxGeometry(t,e,n):r.BoxBufferGeometry?new r.BoxBufferGeometry(t,e,n):r.BoxGeometry?new r.BoxGeometry(t,e,n):void 0}console.log(`maptalks.three log: current three.js version is %c${L}`,"color:red;font-size: 16px;font-weight: bold;");class F extends o.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),R(this,"position",new o.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),R(this,"uv",new o.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix(t){var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;return void 0!==e&&(t.applyToBufferAttribute(e),t.applyToBufferAttribute(n),e.data.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(t){var e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));var n=new o.InstancedInterleavedBuffer(e,6,1);return R(this,"instanceStart",new o.InterleavedBufferAttribute(n,3,0)),R(this,"instanceEnd",new o.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(t){var e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));var n=new o.InstancedInterleavedBuffer(e,6,1);return R(this,"instanceColorStart",new o.InterleavedBufferAttribute(n,3,0)),R(this,"instanceColorEnd",new o.InterleavedBufferAttribute(n,3,3)),this}fromWireframeGeometry(t){return this.setPositions(t.attributes.position.array),this}fromEdgesGeometry(t){return this.setPositions(t.attributes.position.array),this}fromMesh(t){return this.fromWireframeGeometry(new o.WireframeGeometry(t.geometry)),this}fromLineSegements(t){var e=t.geometry;return e.isGeometry?this.setPositions(e.vertices):e.isBufferGeometry&&this.setPositions(e.position.array),this}computeBoundingBox(){var t=new o.Box3;null===this.boundingBox&&(this.boundingBox=new o.Box3);var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;void 0!==e&&void 0!==n&&(this.boundingBox.setFromBufferAttribute(e),t.setFromBufferAttribute(n),this.boundingBox.union(t))}computeBoundingSphere(){var t=new o.Vector3;null===this.boundingSphere&&(this.boundingSphere=new o.Sphere),null===this.boundingBox&&this.computeBoundingBox();var e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(void 0!==e&&void 0!==n){var r=this.boundingSphere.center;this.boundingBox.getCenter(r);for(var i=0,s=0,a=e.count;s<a;s++)t.fromBufferAttribute(e,s),i=Math.max(i,r.distanceToSquared(t)),t.fromBufferAttribute(n,s),i=Math.max(i,r.distanceToSquared(t));this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}copy(t){return this}}const U={},Q={};U.line={linewidth:{value:1},resolution:{value:new o.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},Q.line={uniforms:o.UniformsUtils.merge([o.UniformsLib.common,o.UniformsLib.fog,U.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include <premultiplied_alpha_fragment>\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\n\t\t}\n\t\t"};class G extends o.ShaderMaterial{constructor(t){super({uniforms:o.UniformsUtils.clone(Q.line.uniforms),vertexShader:Q.line.vertexShader,fragmentShader:Q.line.fragmentShader}),this.dashed=!0,this.isLineMaterial=!0,this.type="LineMaterial",Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}}),this.setValues(t)}}class z extends o.Mesh{constructor(t,e){super(t,e),this.isLineSegments2=!0,this.type="LineSegments2",this.geometry=void 0!==t?t:new F,this.material=void 0!==e?e:new G({color:16777215*Math.random()})}computeLineDistances(){var t=new o.Vector3,e=new o.Vector3,n=this.geometry,r=n.attributes.instanceStart,i=n.attributes.instanceEnd;if(!r||!i)return this;for(var s=new Float32Array(2*r.data.count),a=0,u=0,l=r.data.count;a<l;a++,u+=2)t.fromBufferAttribute(r,a),e.fromBufferAttribute(i,a),s[u]=0===u?0:s[u-1],s[u+1]=s[u]+t.distanceTo(e);var h=new o.InstancedInterleavedBuffer(s,2,1);return R(n,"instanceDistanceStart",new o.InterleavedBufferAttribute(h,1,0)),R(n,"instanceDistanceEnd",new o.InterleavedBufferAttribute(h,1,1)),this}}class j extends F{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}fromLine(t){var e=t.geometry;return e.isGeometry?this.setPositions(e.vertices):e.isBufferGeometry&&this.setPositions(e.position.array),this}}class V extends z{constructor(t,e){super(t,e),this.isLine2=!0,this.type="Line2",this.geometry=void 0!==t?t:new j,this.material=void 0!==e?e:new G({color:16777215*Math.random()})}copy(t){return this}}const q={interactive:!0,altitude:0,minZoom:0,maxZoom:30,asynchronous:!1,bloom:!1,pickWeight:-1};function H(){}class W extends(i.Eventable(H)){constructor(t){super(),this.isAdd=!1,this._mouseover=!1,this._visible=!0,this._zoomVisible=!0,this.picked=!1,this.isBaseObject=!0,void 0===t&&(t=i.Util.GUID()),this.id=t}addTo(t){return t&&"ThreeLayer"===t.type?t.addMesh([this]):console.error("layer only support maptalks.ThreeLayer"),this}remove(){const t=this.getLayer();return t&&t.removeMesh([this]),this}getObject3d(){return this.object3d}getId(){return this.id}setId(t){const e=this.getId();return this.id=t,this._fire("idchange",{old:e,new:t,target:this}),this}getType(){return this.type}getOptions(){return this.options}getProperties(){return(this.options||{}).properties}setProperties(t){const e=Object.assign({},this.getProperties());return this.options.properties=t,this._fire("propertieschange",{old:e,new:t,target:this}),this}getLayer(){return this.options.layer}getMap(){const t=this.getLayer();if(t)return t.getMap()}getCenter(){const t=this.getOptions(),{coordinate:e,lineString:n,polygon:r}=t;if(e)return e instanceof i.Coordinate?e:new i.Coordinate(e);{const t=r||n;if(t&&t.getCenter)return t.getCenter()}}getAltitude(){return this.getOptions().altitude}setAltitude(t){if(i.Util.isNumber(t)){const e=this.getLayer().altitudeToVector3(t,t).x;if(this.getObject3d().position.z=e,this.options.altitude=t,this.pickObject3d&&(this.pickObject3d.position.z=e),this._baseObjects&&Array.isArray(this._baseObjects))for(let t=0,n=this._baseObjects.length;t<n;t++)this._baseObjects[t]&&(this._baseObjects[t].getObject3d().position.z=e)}return this}supportHeight(){return this.getOptions().heightEnable}getHeight(){const{height:t}=this.getOptions();return i.Util.isNumber(t)?t:0}setHeight(t){if(!i.Util.isNumber(t)||this._baseObjects||!this.supportHeight())return this;const e=this.getLayer();if(!e)return this;const{geometry:n}=this.getObject3d();if(n instanceof o.BufferGeometry){const{position:r}=n.attributes||{};if(!r)return this;const i=r.array;let o=1/0,s=-1/0;for(let t=0,e=i.length;t<e;t+=3){const e=i[t+2];o=Math.min(e,o),s=Math.max(e,s)}const a=(o+s)/2;let u=e.altitudeToVector3(t,t).x;u=Math.max(u,1e-6);for(let t=0,e=i.length;t<e;t+=3)i[t+2]>a&&(i[t+2]=u);n.attributes.position.needsUpdate=!0,n.computeBoundingBox(),n.computeBoundingSphere(),this.getOptions().height=t}return this}show(){return this._zoomVisible&&(this.getObject3d().visible=!0,this._fire("show")),this._visible=!0,this}hide(){return this.getObject3d().visible=!1,this._fire("hide"),this._visible=!1,this._hideUI(),this}isVisible(){return!!this.getObject3d().visible}getSymbol(){return this.getObject3d().material}setSymbol(t){if(t&&t instanceof o.Material){t.needsUpdate=!0,t.vertexColors=this.getObject3d().material.vertexColors;const e=this.getObject3d().material.clone();this.getObject3d().material=t,this._fire("symbolchange",{old:e,new:t,target:this})}return this}setInfoWindow(t){return this.removeInfoWindow(),this.infoWindow=new i.ui.InfoWindow(t),this.infoWindow.addTo(this),this}getInfoWindow(){return this.infoWindow}openInfoWindow(t){return(t=t||this.getCenter())instanceof i.Coordinate||(t=new i.Coordinate(t)),t&&this.infoWindow&&this.infoWindow.show(t),this}closeInfoWindow(){return this.infoWindow&&this.infoWindow.hide(),this}removeInfoWindow(){return this.infoWindow&&(this.infoWindow.remove(),delete this.infoWindow),this}setToolTip(t,e){return this.removeToolTip(),this.toolTip=new i.ui.ToolTip(t,e),this.toolTip.addTo(this),this}getToolTip(){return this.toolTip}openToolTip(t){return this}closeToolTip(){return this.toolTip&&this.toolTip.hide(),this}removeToolTip(){return this.toolTip&&(this.toolTip.remove(),delete this.toolTip),this}_hideUI(){return this.closeInfoWindow(),this.closeToolTip(),this}animateShow(t={},e){this._showPlayer&&this._showPlayer.cancel(),i.Util.isFunction(t)&&(e=t={});const n=t.duration||1e3,r=t.easing||"out",o=this._showPlayer=i.animation.Animation.animate({scale:1},{duration:n,easing:r},(t=>{const n=t.styles.scale;n>0&&(this.getObject3d().scale.z=n),e&&e(t,n)}));return o.play(),o}getMinZoom(){return this.getOptions().minZoom}getMaxZoom(){return this.getOptions().maxZoom}isAsynchronous(){return this.getOptions().asynchronous}get bloom(){return this.getOptions().bloom}fire(t,e){return this._fire(t,e),this._vt&&this._vt.onSelectMesh&&this._vt.onSelectMesh(t,e),this}config(){return this}setPickObject3d(t){return this.pickObject3d=t,this.pickObject3d.__parent=this,this}getPickObject3d(){return this.pickObject3d}_initOptions(t){return this.options=i.Util.extend({},q,t),this}_createMesh(t,e){return this.object3d=new o.Mesh(t,e),this.object3d.__parent=this,this}_createInstancedMesh(t,e,n){return this.object3d=new o.InstancedMesh(t,e,n),this.object3d.__parent=this,this}_createGroup(){return this.object3d=new o.Group,this.object3d.__parent=this,this}_createLine(t,e){return this.object3d=new o.Line(t,e),this._computeLineDistances(t),this.object3d.__parent=this,this}_createLine2(t,e){return this.object3d=new V(t,e),this.object3d.computeLineDistances(),this.object3d.__parent=this,this}_createPoints(t,e){return this.object3d=new o.Points(t,e),this.object3d.__parent=this,this}_createLineSegments(t,e){return this.object3d=new o.LineSegments(t,e),this._computeLineDistances(t),this.object3d.__parent=this,this}_computeLineDistances(t){const e=t.attributes.position.array,n=t.attributes.position.count,r=new Float32Array(n);r[0]=0;const i=new o.Vector3(0,0,0),s=new o.Vector3(0,0,0);for(let t=1;t<n;t++){const n=3*(t-1);i.x=e[n],i.y=e[n+1],i.z=e[n+2];const o=3*t;s.x=e[o],s.y=e[o+1],s.z=e[o+2];const a=s.distanceTo(i);r[t]=r[t-1]+a}R(t,"lineDistance",new o.BufferAttribute(r,1))}}const Y=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"];function X(t){return t.geometry?t.geometry.type:null}function J(t){const e=X(t);if(e)for(let t=0,n=Y.length;t<n;t++)if(Y[t]===e)return!0;return!1}function K(t){const e=X(t);return!(!e||e!==Y[4]&&e!==Y[5])}function Z(t){const e=X(t);return!(!e||e!==Y[2]&&e!==Y[3])}function $(t){const e=X(t);return!(!e||e!==Y[0]&&e!==Y[1])}function tt(t){const e=X(t);return!!(e&&e.indexOf("Multi")>-1)}function et(t){return t.geometry?t.geometry.coordinates:[]}function nt(t,e){const n=X(t);if(!n||!t.geometry)return null;const r=t.geometry.coordinates;if(!r)return null;let o=0,s=0,a=0;switch(n){case"Point":o=r[0],s=r[1],a++;break;case"MultiPoint":case"LineString":for(let t=0,e=r.length;t<e;t++)o+=r[t][0],s+=r[t][1],a++;break;case"MultiLineString":case"Polygon":for(let t=0,e=r.length;t<e;t++)for(let e=0,n=r[t].length;e<n;e++)o+=r[t][e][0],s+=r[t][e][1],a++;break;case"MultiPolygon":for(let t=0,e=r.length;t<e;t++)for(let e=0,n=r[t].length;e<n;e++)for(let n=0,i=r[t][e].length;n<i;n++)o+=r[t][e][n][0],s+=r[t][e][n][1],a++}const u=o/a,l=s/a;return e?(e.x=u,e.y=l,e):new i.Coordinate(u,l)}function rt(t){const e=X(t);if(!e||!t.geometry)return null;const n=t.geometry,r=t.properties||{},i=n.coordinates;if(!i)return null;const o=[];let s;switch(e){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}if(s)for(let t=0,e=i.length;t<e;t++)o.push({type:"Feature",geometry:{type:s,coordinates:i[t]},properties:r});else o.push(t);return o}
|
|
2
2
|
/*!
|
|
3
3
|
* poly-extrude v0.16.0
|
|
4
|
-
*/function it(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ot(t,e){return ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ot(t,e)}function st(t,e,n){void 0===n&&(n=2);var r,i,o,s=e&&e.length,a=s?e[0]*n:t.length,u=at(t,0,a,n,!0),l=[];if(!u||u.next===u.prev)return l;if(s&&(u=function(t,e,n,r){for(var i=[],o=0,s=e.length;o<s;o++){var a=at(t,e[o]*r,o<s-1?e[o+1]*r:t.length,r,!1);a===a.next&&(a.steiner=!0),i.push(mt(a))}i.sort(dt);for(var u=0;u<i.length;u++)n=gt(i[u],n);return n}(t,e,u,n)),t.length>80*n){r=1/0,i=1/0;for(var h=-1/0,c=-1/0,f=n;f<a;f+=n){var p=t[f],d=t[f+1];p<r&&(r=p),d<i&&(i=d),p>h&&(h=p),d>c&&(c=d)}o=0!==(o=Math.max(h-r,c-i))?32767/o:0}return lt(u,l,n,r,i,o,0),l}function at(t,e,n,r,i){var o;if(i===function(t,e,n,r){for(var i=0,o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}(t,e,n,r)>0)for(var s=e;s<n;s+=r)o=Bt(s/r|0,t[s],t[s+1],o);else for(var a=n-r;a>=e;a-=r)o=Bt(a/r|0,t[a],t[a+1],o);return o&&bt(o,o.next)&&(Tt(o),o=o.next),o}function ut(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!bt(r,r.next)&&0!==wt(r.prev,r,r.next))r=r.next;else{if(Tt(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function lt(t,e,n,r,i,o,s){if(t){!s&&o&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=vt(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n=1;do{var r=t,i=void 0;t=null;var o=null;for(e=0;r;){e++;for(var s=r,a=0,u=0;u<n&&(a++,s=s.nextZ);u++);for(var l=n;a>0||l>0&&s;)0!==a&&(0===l||!s||r.z<=s.z)?(i=r,r=r.nextZ,a--):(i=s,s=s.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=s}o.nextZ=null,n*=2}while(e>1)}(i)}(t,r,i,o);for(var a=t;t.prev!==t.next;){var u=t.prev,l=t.next;if(o?ct(t,r,i,o):ht(t))e.push(u.i,t.i,l.i),Tt(t),t=l.next,a=l.next;else if((t=l)===a){s?1===s?lt(t=ft(ut(t),e),e,n,r,i,o,2):2===s&&pt(t,e,n,r,i,o):lt(ut(t),e,n,r,i,o,1);break}}}}function ht(t){var e=t.prev,n=t,r=t.next;if(wt(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,s=r.x,a=e.y,u=n.y,l=r.y,h=Math.min(i,o,s),c=Math.min(a,u,l),f=Math.max(i,o,s),p=Math.max(a,u,l),d=r.next;d!==e;){if(d.x>=h&&d.x<=f&&d.y>=c&&d.y<=p&&_t(i,a,o,u,s,l,d.x,d.y)&&wt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function ct(t,e,n,r){var i=t.prev,o=t,s=t.next;if(wt(i,o,s)>=0)return!1;for(var a=i.x,u=o.x,l=s.x,h=i.y,c=o.y,f=s.y,p=Math.min(a,u,l),d=Math.min(h,c,f),g=Math.max(a,u,l),y=Math.max(h,c,f),v=vt(p,d,e,n,r),m=vt(g,y,e,n,r),A=t.prevZ,_=t.nextZ;A&&A.z>=v&&_&&_.z<=m;){if(A.x>=p&&A.x<=g&&A.y>=d&&A.y<=y&&A!==i&&A!==s&&_t(a,h,u,c,l,f,A.x,A.y)&&wt(A.prev,A,A.next)>=0)return!1;if(A=A.prevZ,_.x>=p&&_.x<=g&&_.y>=d&&_.y<=y&&_!==i&&_!==s&&_t(a,h,u,c,l,f,_.x,_.y)&&wt(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;A&&A.z>=v;){if(A.x>=p&&A.x<=g&&A.y>=d&&A.y<=y&&A!==i&&A!==s&&_t(a,h,u,c,l,f,A.x,A.y)&&wt(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;_&&_.z<=m;){if(_.x>=p&&_.x<=g&&_.y>=d&&_.y<=y&&_!==i&&_!==s&&_t(a,h,u,c,l,f,_.x,_.y)&&wt(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function ft(t,e){var n=t;do{var r=n.prev,i=n.next.next;!bt(r,i)&&Et(r,n,n.next,i)&&St(r,i)&&St(i,r)&&(e.push(r.i,n.i,i.i),Tt(n),Tt(n.next),n=t=i),n=n.next}while(n!==t);return ut(n)}function pt(t,e,n,r,i,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&xt(s,a)){var u=Mt(s,a);return s=ut(s,s.next),u=ut(u,u.next),lt(s,e,n,r,i,o,0),void lt(u,e,n,r,i,o,0)}a=a.next}s=s.next}while(s!==t)}function dt(t,e){var n=t.x-e.x;0===n&&(0===(n=t.y-e.y)&&(n=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)));return n}function gt(t,e){var n=function(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;if(bt(t,r))return r;do{if(bt(t,r.next))return r.next;if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s&&(s=a,n=r.x<r.next.x?r:r.next,a===i))return n}r=r.next}while(r!==e);if(!n)return null;var u=n,l=n.x,h=n.y,c=1/0;r=n;do{if(i>=r.x&&r.x>=l&&i!==r.x&&At(o<h?i:s,o,l,h,o<h?s:i,o,r.x,r.y)){var f=Math.abs(o-r.y)/(i-r.x);St(r,t)&&(f<c||f===c&&(r.x>n.x||r.x===n.x&&yt(n,r)))&&(n=r,c=f)}r=r.next}while(r!==u);return n}(t,e);if(!n)return e;var r=Mt(n,t);return ut(r,r.next),ut(n,n.next)}function yt(t,e){return wt(t.prev,t,e.prev)<0&&wt(e.next,t,t.next)<0}function vt(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function mt(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function At(t,e,n,r,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function _t(t,e,n,r,i,o,s,a){return!(t===s&&e===a)&&At(t,e,n,r,i,o,s,a)}function xt(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Et(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(St(t,e)&&St(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.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!==t);return r}(t,e)&&(wt(t.prev,t,e.prev)||wt(t,e.prev,e))||bt(t,e)&&wt(t.prev,t,t.next)>0&&wt(e.prev,e,e.next)>0)}function wt(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function bt(t,e){return t.x===e.x&&t.y===e.y}function Et(t,e,n,r){var i=Ct(wt(t,e,n)),o=Ct(wt(t,e,r)),s=Ct(wt(n,r,t)),a=Ct(wt(n,r,e));return i!==o&&s!==a||(!(0!==i||!It(t,n,e))||(!(0!==o||!It(t,r,e))||(!(0!==s||!It(n,t,r))||!(0!==a||!It(n,e,r)))))}function It(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Ct(t){return t>0?1:t<0?-1:0}function St(t,e){return wt(t.prev,t,t.next)<0?wt(t,e,t.next)>=0&&wt(t,t.prev,e)>=0:wt(t,e,t.prev)<0||wt(t,t.next,e)<0}function Mt(t,e){var n=kt(t.i,t.x,t.y),r=kt(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Bt(t,e,n,r){var i=kt(t,e,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 Tt(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function kt(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}var Pt=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=1),this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=r}t.slerpFlat=function(t,e,n,r,i,o,s){var a=n[r+0],u=n[r+1],l=n[r+2],h=n[r+3],c=i[o+0],f=i[o+1],p=i[o+2],d=i[o+3];if(0===s)return t[e+0]=a,t[e+1]=u,t[e+2]=l,void(t[e+3]=h);if(1===s)return t[e+0]=c,t[e+1]=f,t[e+2]=p,void(t[e+3]=d);if(h!==d||a!==c||u!==f||l!==p){var g=1-s,y=a*c+u*f+l*p+h*d,v=y>=0?1:-1,m=1-y*y;if(m>Number.EPSILON){var A=Math.sqrt(m),_=Math.atan2(A,y*v);g=Math.sin(g*_)/A,s=Math.sin(s*_)/A}var x=s*v;if(a=a*g+c*x,u=u*g+f*x,l=l*g+p*x,h=h*g+d*x,g===1-s){var w=1/Math.sqrt(a*a+u*u+l*l+h*h);a*=w,u*=w,l*=w,h*=w}}t[e]=a,t[e+1]=u,t[e+2]=l,t[e+3]=h},t.multiplyQuaternionsFlat=function(t,e,n,r,i,o){var s=n[r],a=n[r+1],u=n[r+2],l=n[r+3],h=i[o],c=i[o+1],f=i[o+2],p=i[o+3];return t[e]=s*p+l*h+a*f-u*c,t[e+1]=a*p+l*c+u*h-s*f,t[e+2]=u*p+l*f+s*c-a*h,t[e+3]=l*p-s*h-a*c-u*f,t};var e,n,r,i=t.prototype;return i.set=function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this},i.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)},i.copy=function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},i.setFromEuler=function(t,e){void 0===e&&(e=!0);var n=t._x,r=t._y,i=t._z,o=t._order,s=Math.cos,a=Math.sin,u=s(n/2),l=s(r/2),h=s(i/2),c=a(n/2),f=a(r/2),p=a(i/2);switch(o){case"XYZ":this._x=c*l*h+u*f*p,this._y=u*f*h-c*l*p,this._z=u*l*p+c*f*h,this._w=u*l*h-c*f*p;break;case"YXZ":this._x=c*l*h+u*f*p,this._y=u*f*h-c*l*p,this._z=u*l*p-c*f*h,this._w=u*l*h+c*f*p;break;case"ZXY":this._x=c*l*h-u*f*p,this._y=u*f*h+c*l*p,this._z=u*l*p+c*f*h,this._w=u*l*h-c*f*p;break;case"ZYX":this._x=c*l*h-u*f*p,this._y=u*f*h+c*l*p,this._z=u*l*p-c*f*h,this._w=u*l*h+c*f*p;break;case"YZX":this._x=c*l*h+u*f*p,this._y=u*f*h+c*l*p,this._z=u*l*p-c*f*h,this._w=u*l*h-c*f*p;break;case"XZY":this._x=c*l*h-u*f*p,this._y=u*f*h-c*l*p,this._z=u*l*p+c*f*h,this._w=u*l*h+c*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!0===e&&this._onChangeCallback(),this},i.setFromAxisAngle=function(t,e){var n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},i.setFromRotationMatrix=function(t){var e=t.elements,n=e[0],r=e[4],i=e[8],o=e[1],s=e[5],a=e[9],u=e[2],l=e[6],h=e[10],c=n+s+h;if(c>0){var f=.5/Math.sqrt(c+1);this._w=.25/f,this._x=(l-a)*f,this._y=(i-u)*f,this._z=(o-r)*f}else if(n>s&&n>h){var p=2*Math.sqrt(1+n-s-h);this._w=(l-a)/p,this._x=.25*p,this._y=(r+o)/p,this._z=(i+u)/p}else if(s>h){var d=2*Math.sqrt(1+s-n-h);this._w=(i-u)/d,this._x=(r+o)/d,this._y=.25*d,this._z=(a+l)/d}else{var g=2*Math.sqrt(1+h-n-s);this._w=(o-r)/g,this._x=(i+u)/g,this._y=(a+l)/g,this._z=.25*g}return this._onChangeCallback(),this},i.setFromUnitVectors=function(t,e){var n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()},i.rotateTowards=function(t,e){var n=this.angleTo(t);if(0===n)return this;var r=Math.min(1,e/n);return this.slerp(t,r),this},i.identity=function(){return this.set(0,0,0,1)},i.invert=function(){return this.conjugate()},i.conjugate=function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},i.dot=function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},i.lengthSq=function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},i.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},i.normalize=function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},i.multiply=function(t){return this.multiplyQuaternions(this,t)},i.premultiply=function(t){return this.multiplyQuaternions(t,this)},i.multiplyQuaternions=function(t,e){var n=t._x,r=t._y,i=t._z,o=t._w,s=e._x,a=e._y,u=e._z,l=e._w;return this._x=n*l+o*s+r*u-i*a,this._y=r*l+o*a+i*s-n*u,this._z=i*l+o*u+n*a-r*s,this._w=o*l-n*s-r*a-i*u,this._onChangeCallback(),this},i.slerp=function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,r=this._y,i=this._z,o=this._w,s=o*t._w+n*t._x+r*t._y+i*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var a=1-s*s;if(a<=Number.EPSILON){var u=1-e;return this._w=u*o+e*this._w,this._x=u*n+e*this._x,this._y=u*r+e*this._y,this._z=u*i+e*this._z,this.normalize(),this}var l=Math.sqrt(a),h=Math.atan2(l,s),c=Math.sin((1-e)*h)/l,f=Math.sin(e*h)/l;return this._w=o*c+this._w*f,this._x=n*c+this._x*f,this._y=r*c+this._y*f,this._z=i*c+this._z*f,this._onChangeCallback(),this},i.slerpQuaternions=function(t,e,n){return this.copy(t).slerp(e,n)},i.random=function(){var t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(t),r*Math.cos(t),i*Math.sin(e),i*Math.cos(e))},i.equals=function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},i.fromArray=function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},i.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},i.fromBufferAttribute=function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this},i.toJSON=function(){return this.toArray()},i._onChange=function(t){return this._onChangeCallback=t,this},i._onChangeCallback=function(){},e=t,(n=[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}])&&it(e.prototype,n),r&&it(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Lt=new Pt,Rt=function(){function t(t,e,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=n}var e=t.prototype;return e.set=function(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this},e.clone=function(){return new this.constructor(this.x,this.y,this.z)},e.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},e.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},e.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},e.sub=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},e.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this},e.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},e.multiply=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this},e.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},e.applyAxisAngle=function(t,e){return this.applyQuaternion(Lt.setFromAxisAngle(t,e))},e.applyMatrix4=function(t){var e=this.x,n=this.y,r=this.z,i=t.elements,o=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*o,this},e.applyQuaternion=function(t){var e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,s=t.z,a=t.w,u=a*e+o*r-s*n,l=a*n+s*e-i*r,h=a*r+i*n-o*e,c=-i*e-o*n-s*r;return this.x=u*a+c*-i+l*-s-h*-o,this.y=l*a+c*-o+h*-i-u*-s,this.z=h*a+c*-s+u*-o-l*-i,this},e.divide=function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},e.divideScalar=function(t){return this.multiplyScalar(1/t)},e.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},e.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},e.clamp=function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},e.clampScalar=function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},e.clampLength=function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},e.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},e.normalize=function(){return this.divideScalar(this.length()||1)},e.setLength=function(t){return this.normalize().multiplyScalar(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},e.lerpVectors=function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this},e.cross=function(t){return this.crossVectors(this,t)},e.crossVectors=function(t,e){var n=t.x,r=t.y,i=t.z,o=e.x,s=e.y,a=e.z;return this.x=r*a-i*s,this.y=i*o-n*a,this.z=n*s-r*o,this},e.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},e.fromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this},t}();function Dt(t){let e,n,r=0,i=1;const o=t.length;for(;i<o;)e=n||t[0],n=t[i],r+=(n[0]-e[0])*(n[1]+e[1]),i++;return r>0}function Ot(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Nt(t,e){const n=e[0],r=e[1],i=e[2],o=Math.sqrt(n*n+r*r+i*i)||1;return t[0]=n/o,t[1]=r/o,t[2]=i/o,t}function Ft(t,e,n){const r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],u=n[2];return t[0]=i*u-o*a,t[1]=o*s-r*u,t[2]=r*a-i*s,t}function Ut(t,e){function n(t,e,n,r){t[0]=e,t[1]=n,t[2]=r}const r=[],i=[],o=[],s=[],a=[],u=[],l=t.length,h=new Float32Array(e.length);let c=0;for(;c<l;){const l=3*t[c],f=3*t[c+1],p=3*t[c+2];n(r,e[l],e[l+1],e[l+2]),n(i,e[f],e[f+1],e[f+2]),n(o,e[p],e[p+1],e[p+2]),Ot(a,o,i),Ot(s,r,i),Ft(u,a,s);for(let t=0;t<3;t++)h[l+t]+=u[t],h[f+t]+=u[t],h[p+t]+=u[t];c+=3}let f=0;const p=h.length;for(;f<p;)n(u,h[f],h[f+1],h[f+2]),Nt(u,u),h[f]=u[0]||0,h[f+1]=u[1]||0,h[f+2]=u[2]||0,f+=3;return h}function Qt(t){if(1===t.length){return{position:t[0].position,normal:t[0].normal,uv:t[0].uv,indices:t[0].indices,results:t}}let e=0,n=0;for(let r=0,i=t.length;r<i;r++){const{position:i,indices:o}=t[r];e+=i.length,n+=o.length}const r={position:new Float32Array(e),normal:new Float32Array(e),uv:new Float32Array(e/3*2),indices:new Uint32Array(n),results:t};let i=0,o=0,s=0,a=0;for(let e=0,n=t.length;e<n;e++){const{position:n,indices:u,normal:l,uv:h}=t[e];r.position.set(n,i),r.normal.set(l,i),r.uv.set(h,a);let c=0;const f=u.length;for(;c<f;){const t=u[c]+o;r.indices[s]=t,s++,c++}a+=h.length,i+=n.length,o+=n.length/3}return r}function Gt(t){return 180*t/Math.PI}function zt(t){return t/180*Math.PI}function jt(t,e,n,r,i,o){const s=3*n,a=3*r,u=3*i,l=3*o,h=e[s],c=e[s+1],f=e[s+2],p=e[a],d=e[a+1],g=e[a+2],y=e[u],v=e[u+1],m=e[u+2],A=e[l],_=e[l+1],x=e[l+2];let w=t.length-1;Math.abs(c-d)<Math.abs(h-p)?(t[++w]=h,t[++w]=1-f,t[++w]=p,t[++w]=1-g,t[++w]=y,t[++w]=1-m,t[++w]=A,t[++w]=1-x):(t[++w]=c,t[++w]=1-f,t[++w]=d,t[++w]=1-g,t[++w]=v,t[++w]=1-m,t[++w]=_,t[++w]=1-x)}function Vt(t,e){e=Object.assign({},{depth:2,top:!0},e);const n=t.map((t=>{for(let e=0,n=t.length;e<n;e++){const n=t[e];qt(n),0===e?Dt(n)||(t[e]=n.reverse()):Dt(n)&&(t[e]=n.reverse()),Ht(n)&&n.splice(n.length-1,1)}const n=function(t,e){const n=function(t){let e=0,n=0;const r=t.length;for(;n<r;)e+=t[n].length,n++;return e}(t),r=t.length,i=[],o=new Float32Array(2*n),s=[],a=[],u=3*n,l=2*n,h=e.depth;let c=0,f=0,p=0;for(let e=0;e<r;e++){const n=t[e];e>0&&i.push(c/2);let r=0;const d=n.length;for(;r<d;){const t=n[r],e=t[0],i=t[1],d=t[2]||0;o[c++]=e,o[c++]=i,s[f]=e,s[f+1]=i,s[f+2]=h+d,s[u+f]=e,s[u+f+1]=i,s[u+f+2]=d,a[p]=e,a[p+1]=i,a[l+p]=e,a[l+p+1]=i,f+=3,p+=2,r++}}return{flatVertices:o,holes:i,points:s,count:n,uv:a}}(t,e);n.polygon=t;return function(t,e,n){const r=[],{count:i}=t,o=n.top;for(let t=0,n=e.length;t<n;t+=3){const s=e[t],a=e[t+1],u=e[t+2];o&&(r[t]=s,r[t+1]=a,r[t+2]=u);let l=n+t;const h=i+s,c=i+a,f=i+u;o||(l=t),r[l]=h,r[l+1]=c,r[l+2]=f}t.indices=r}(n,st(n.flatVertices,n.holes,2),e),function(t,e){const{points:n,indices:r,polygon:i,uv:o}=t,s=e.depth;let a=n.length-1,u=r.length-1;for(let t=0,e=i.length;t<e;t++){const e=i[t];let l=0;const h=e.length;for(;l<h;){const t=e[l];let i=e[l+1];l===h-1&&(i=e[0]);const c=n.length/3,f=t[0],p=t[1],d=t[2]||0,g=i[0],y=i[1],v=i[2]||0;n[++a]=f,n[++a]=p,n[++a]=d+s,n[++a]=g,n[++a]=y,n[++a]=v+s,n[++a]=f,n[++a]=p,n[++a]=d,n[++a]=g,n[++a]=y,n[++a]=v;const m=c+2,A=c+3,_=c,x=c+1;r[++u]=m,r[++u]=_,r[++u]=A,r[++u]=_,r[++u]=x,r[++u]=A,jt(o,n,m,A,_,x),l++}}}(n,e),n.position=new Float32Array(n.points),n.indices=new Uint32Array(n.indices),n.uv=new Float32Array(n.uv),n.normal=Ut(n.indices,n.position),n})),r=Qt(n);return r.polygons=t,r}function qt(t){Ht(t)||t.push(t[0])}function Ht(t){const e=t.length,[n,r]=t[0],[i,o]=t[e-1];return n===i&&r===o}function Wt(t,e){!function(t){t.lineWidth=Math.max(0,t.lineWidth),t.depth=Math.max(0,t.depth),t.sideDepth=Math.max(0,t.sideDepth)}(e=Object.assign({},{depth:2,lineWidth:1,bottomStickGround:!1,pathUV:!1},e));const n=t.map((t=>{const n=function(t,e){let n=e.lineWidth/2;e.isSlope&&(n*=2);const r=[],i=[],o=[],s=t.length;let a=0;for(;a<s;){let e=t[a],u=t[a+1];const l=t[a];a===s-1&&(e=t[s-2],u=t[s-1]);const h=u[1]-e[1],c=u[0]-e[0];let f=0;const p=Gt(Math.atan(h/c));if(0===a||a===s-1)f=p,f-=90;else{const n=t[a-1];Yt.x=n[0]-e[0],Yt.y=n[1]-e[1],Xt.x=u[0]-e[0],Xt.y=u[1]-e[1];f=p-Jt(Yt,Xt)/2}const d=zt(f),g=l,y=[Math.cos(d)+g[0],Math.sin(d)+g[1]],[v,m]=Zt(e,u,n);let A=$t(v[0],v[1],g,y),_=$t(m[0],m[1],g,y);if(!A||!_){const t=r.length,e=r[t-2],n=r[t-1];if(!e||!n)continue;A=[e[0],e[1]],_=[n[0],n[1]]}A[2]=l[2]||0,_[2]=l[2]||0,r.push(A,_),Kt(A,e,u)?(i.push(A),o.push(_)):(i.push(_),o.push(A)),a++}return{offsetPoints:r,leftPoints:i,rightPoints:o,line:t}}(t,e);return n.line=t,function(t,e){const n=e.bottomStickGround,r=e.depth,i=t.depths;let o=r,s=r;i&&(o=i[0],s=i[1]);const{leftPoints:a,rightPoints:u}=t,l=t.line,h=e.pathUV;if(h){!function(t){let e=0;for(let n=0,r=t.length;n<r;n++){const r=t[n],i=t[n+1];if(0===n&&(r.distance=0),r&&i){const[t,n,o]=r,[s,a,u]=i,l=t-s,h=n-a,c=(o||0)-(u||0);e+=Math.sqrt(l*l+h*h+c*c),i.distance=e}}}(l);for(let t=0,e=l.length;t<e;t++)a[t].distance=u[t].distance=l[t].distance}let c=0,f=a.length;const p=[],d=[],g=[];for(;c<f;){const t=3*c,[e,r,i]=a[c];p[t]=e,p[t+1]=r,p[t+2]=o+i;const[d,y,v]=u[c],m=3*f+t;p[m]=d,p[m+1]=y,p[m+2]=s+v;const A=2*f*3+t;p[A]=e,p[A+1]=r,p[A+2]=i,n&&(p[A+2]=0);const _=2*f*3+3*f+t;if(p[_]=d,p[_+1]=y,p[_+2]=v,n&&(p[_+2]=0),h){const t=l[c].distance,e=2*c;g[e]=t,g[e+1]=1;const n=2*f+e;g[n]=t,g[n+1]=0;const r=2*f*2+e;g[r]=t,g[r+1]=1;const i=2*f*2+2*f+e;g[i]=t,g[i+1]=0}c++}if(!h){c=0,f=p.length;let t=g.length-1;for(;c<f;){const e=p[c],n=p[c+1];g[++t]=e,g[++t]=n,c+=3}}c=0,f=a.length;let y=d.length-1;for(;c<f-1;){const t=c,e=c+1,n=t+f,r=e+f;d[++y]=t,d[++y]=n,d[++y]=e,d[++y]=n,d[++y]=r,d[++y]=e;const i=c+2*f,o=i+1,s=i+f,a=o+f;d[++y]=i,d[++y]=s,d[++y]=o,d[++y]=s,d[++y]=a,d[++y]=o,c++}if(t.indices=d,t.points=p,t.uv=g,i)for(f=a.length,c=0;c<f;)a[c].depth=o,u[c].depth=s,c++}(n,e),function(t,e){const{points:n,indices:r,leftPoints:i,rightPoints:o,uv:s}=t,a=e.depth,u=e.bottomStickGround,l=[i,o],h=t.depths,c=e.pathUV,f=e.lineWidth;let p=n.length-1,d=r.length-1,g=s.length-1;function y(t,e){const i=n.length/3,o=h?t.depth:a,l=h?e.depth:a;n[++p]=t[0],n[++p]=t[1],n[++p]=o+t[2],n[++p]=e[0],n[++p]=e[1],n[++p]=l+e[2],n[++p]=t[0],n[++p]=t[1],n[++p]=u?0:t[2],n[++p]=e[0],n[++p]=e[1],n[++p]=u?0:e[2];const y=i+2,v=i+3,m=i,A=i+1;r[++d]=y,r[++d]=m,r[++d]=v,r[++d]=m,r[++d]=A,r[++d]=v,c?(s[++g]=t.distance,s[++g]=o/f,s[++g]=e.distance,s[++g]=l/f,s[++g]=t.distance,s[++g]=0,s[++g]=e.distance,s[++g]=0):jt(s,n,y,v,m,A)}for(let t=0,e=l.length;t<e;t++){let e=l[t];t>0&&(e=e.map((t=>t)),e=e.reverse());let n=0;const r=e.length-1;for(;n<r;){y(e[n],e[n+1]),n++}}const v=i.length,m=[o[0],i[0],i[v-1],o[v-1]];for(let t=0;t<m.length;t+=2){y(m[t],m[t+1])}}(n,e),n.position=new Float32Array(n.points),n.indices=new Uint32Array(n.indices),n.uv=new Float32Array(n.uv),n.normal=Ut(n.indices,n.position),n})),r=Qt(n);return r.lines=t,r}const Yt={x:0,y:0},Xt={x:0,y:0};const Jt=({x:t,y:e},{x:n,y:r})=>{const i=t*n+e*r,o=t*r-e*n;return(Math.atan2(o,i)/Math.PI*180+360)%360};function Kt(t,e,n){const[r,i]=e,[o,s]=n,[a,u]=t;return(i-s)*a+(o-r)*u+r*s-o*i>0}function Zt(t,e,n){const r=e[1]-t[1],i=e[0]-t[0],o=Math.atan2(r,i),s=o+Math.PI/2;let a=Math.cos(s)*n,u=Math.sin(s)*n;const l=[t[0]+a,t[1]+u],h=[e[0]+a,e[1]+u],c=o-Math.PI/2;a=Math.cos(c)*n,u=Math.sin(c)*n;return[[l,h],[[t[0]+a,t[1]+u],[e[0]+a,e[1]+u]]]}function $t(t,e,n,r){const i=e[0]-t[0],o=e[1]-t[1],s=r[0]-n[0],a=r[1]-n[1];if(0===i&&0===s)return null;if(0===o&&0===a)return null;const u=o/i,l=a/s,h=t[1]-u*t[0],c=n[1]-l*n[0];let f,p;return 0===i?(f=t[0],p=l*f+c):0===s?(f=n[0],p=u*f+h):0===o?(p=t[1],f=(p-c)/l):0===a?(p=n[1],f=(p-h)/u):(f=(c-h)/(u-l),p=u*f+h),[f,p]}var te=function(){function t(){this.pos=new Rt,this.dir=new Rt,this.right=new Rt,this.up=new Rt,this.dist=0,this.widthScale=1,this.sharp=!1}var e=t.prototype;return e.lerpPathPoints=function(t,e,n){this.pos.lerpVectors(t.pos,e.pos,n),this.dir.lerpVectors(t.dir,e.dir,n),this.up.lerpVectors(t.up,e.up,n),this.right.lerpVectors(t.right,e.right,n),this.dist=(e.dist-t.dist)*n+t.dist,this.widthScale=(e.widthScale-t.widthScale)*n+t.widthScale},e.copy=function(t){this.pos.copy(t.pos),this.dir.copy(t.dir),this.up.copy(t.up),this.right.copy(t.right),this.dist=t.dist,this.widthScale=t.widthScale},t}(),ee=function(){function t(t,e,n,r,i,o,s,a,u,l,h,c,f,p,d,g){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,n,r,i,o,s,a,u,l,h,c,f,p,d,g)}var e=t.prototype;return e.set=function(t,e,n,r,i,o,s,a,u,l,h,c,f,p,d,g){var y=this.elements;return y[0]=t,y[4]=e,y[8]=n,y[12]=r,y[1]=i,y[5]=o,y[9]=s,y[13]=a,y[2]=u,y[6]=l,y[10]=h,y[14]=c,y[3]=f,y[7]=p,y[11]=d,y[15]=g,this},e.multiply=function(t){return this.multiplyMatrices(this,t)},e.makeRotationAxis=function(t,e){var n=Math.cos(e),r=Math.sin(e),i=1-n,o=t.x,s=t.y,a=t.z,u=i*o,l=i*s;return this.set(u*o+n,u*s-r*a,u*a+r*s,0,u*s+r*a,l*s+n,l*a-r*o,0,u*a-r*s,l*a+r*o,i*a*a+n,0,0,0,0,1),this},e.equals=function(t){for(var e=this.elements,n=t.elements,r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0},t}(),ne=function(){function t(){this.type="Curve",this.arcLengthDivisions=200}var e=t.prototype;return e.getPoint=function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},e.getPointAt=function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},e.getPoints=function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},e.getLength=function(){var t=this.getLengths();return t[t.length-1]},e.getLengths=function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n=[],r=this.getPoint(0),i=0;n.push(0);for(var o=1;o<=t;o++)i+=(e=this.getPoint(o/t)).distanceTo(r),n.push(i),r=e;return this.cacheArcLengths=n,n},e.getUtoTmapping=function(t,e){var n,r=this.getLengths(),i=0,o=r.length;n=e||t*r[o-1];for(var s,a=0,u=o-1;a<=u;)if((s=r[i=Math.floor(a+(u-a)/2)]-n)<0)a=i+1;else{if(!(s>0)){u=i;break}u=i-1}if(r[i=u]===n)return i/(o-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(o-1)},t}();function re(t,e,n,r){return function(t,e){var n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,r)}var ie=function(t){var e,n;function r(e,n,r){var i;return void 0===e&&(e=new Rt),void 0===n&&(n=new Rt),void 0===r&&(r=new Rt),(i=t.call(this)||this).isQuadraticBezierCurve3=!0,i.type="QuadraticBezierCurve3",i.v0=e,i.v1=n,i.v2=r,i}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,ot(e,n),r.prototype.getPoint=function(t,e){void 0===e&&(e=new Rt);var n=e,r=this.v0,i=this.v1,o=this.v2;return n.set(re(t,r.x,i.x,o.x),re(t,r.y,i.y,o.y),re(t,r.z,i.z,o.z)),n},r}(ne),oe=new Rt,se=new Rt,ae=new Rt,ue=new ee,le=new ie;var he=function(){function t(){this.array=[],this.count=0}var e=t.prototype;return e.set=function(t,e,n,r,i){if(void 0===e&&(e=.1),void 0===n&&(n=10),void 0===r&&(r=null),void 0===i&&(i=!1),(t=t.slice(0)).length<2)return console.warn("PathPointList: points length less than 2."),void(this.count=0);i&&!t[0].equals(t[t.length-1])&&t.push((new Rt).copy(t[0]));for(var o=0,s=t.length;o<s;o++)if(0===o)this._start(t[o],t[o+1],r);else if(o===s-1)if(i){this._corner(t[o],t[1],e,n,r);var a=this.array[0].dist;this.array[0].copy(this.array[this.count-1]),this.array[0].dist=a}else this._end(t[o]);else this._corner(t[o],t[o+1],e,n,r)},e.distance=function(){return this.count>0?this.array[this.count-1].dist:0},e._getByIndex=function(t){return this.array[t]||(this.array[t]=new te),this.array[t]},e._start=function(t,e,n){this.count=0;var r=this._getByIndex(this.count);if(r.pos.copy(t),r.dir.subVectors(e,t),n)r.up.copy(n);else{var i=Number.MAX_VALUE,o=Math.abs(r.dir.x),s=Math.abs(r.dir.y),a=Math.abs(r.dir.z);o<i&&(i=o,r.up.set(1,0,0)),s<i&&(i=s,r.up.set(0,1,0)),a<i&&r.up.set(0,0,1)}r.right.crossVectors(r.dir,r.up).normalize(),r.up.crossVectors(r.right,r.dir).normalize(),r.dist=0,r.widthScale=1,r.sharp=!1,r.dir.normalize(),this.count++},e._end=function(t){var e=this.array[this.count-1],n=this._getByIndex(this.count);n.pos.copy(t),n.dir.subVectors(t,e.pos);var r=n.dir.length();n.dir.normalize(),n.up.copy(e.up);var i=oe.crossVectors(e.dir,n.dir);if(i.length()>Number.EPSILON){i.normalize();var o=Math.acos(Math.min(Math.max(e.dir.dot(n.dir),-1),1));n.up.applyMatrix4(ue.makeRotationAxis(i,o))}n.right.crossVectors(n.dir,n.up).normalize(),n.dist=e.dist+r,n.widthScale=1,n.sharp=!1,this.count++},e._corner=function(t,e,n,r,i){if(n>0&&r>0){for(var o=function(t,e,n,r,i,o){var s=oe.subVectors(e,t),a=se.subVectors(n,e),u=s.length(),l=a.length();s.normalize(),a.normalize();var h=Math.min(.999999*(i?u/2:u),r);o.v0.copy(e).sub(s.multiplyScalar(h)),o.v1.copy(e);var c=Math.min(l/2*.999999,r);return o.v2.copy(e).add(a.multiplyScalar(c)),o}(this.array[this.count-1].pos,t,e,n,this.count-1==0,le),s=o.getPoints(r),a=0;a<r;a++)this._sharpCorner(s[a],s[a+1],i,0===a?1:0);s[r].equals(e)||this._sharpCorner(s[r],e,i,2)}else this._sharpCorner(t,e,i,0,!0)},e._sharpCorner=function(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=this.array[this.count-1],s=this._getByIndex(this.count),a=oe.subVectors(t,o.pos),u=se.subVectors(e,t),l=a.length();if(a.normalize(),u.normalize(),s.pos.copy(t),1===r?s.dir.copy(a):2===r?s.dir.copy(u):(s.dir.addVectors(a,u),s.dir.normalize()),n)1===s.dir.dot(n)?s.right.crossVectors(u,n).normalize():s.right.crossVectors(s.dir,n).normalize(),s.up.crossVectors(s.right,s.dir).normalize();else{s.up.copy(o.up);var h=ae.crossVectors(o.dir,s.dir);if(h.length()>Number.EPSILON){h.normalize();var c=Math.acos(Math.min(Math.max(o.dir.dot(s.dir),-1),1));s.up.applyMatrix4(ue.makeRotationAxis(h,c))}s.right.crossVectors(s.dir,s.up).normalize()}s.dist=o.dist+l;var f=a.dot(u);s.widthScale=Math.min(1/Math.sqrt((1+f)/2),1.415)||1,s.sharp=Math.abs(f-1)>.05&&i,this.count++},t}();const ce=new Rt(0,0,1),fe=new Rt,pe=new Rt,de=new Rt,ge=new Rt,ye=new Rt,ve=new Rt;function me(t,e){e=Object.assign({},{lineWidth:1,cornerRadius:0,cornerSplit:10},e);const n=t.map((t=>{const n=function(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n],[i,o,s]=r,a=new Rt(i,o,s||0);e[n]=a}return e}(t),r=new he;r.set(n,e.cornerRadius,e.cornerSplit,ce);const i=function(t,e){const n=e.lineWidth||.1,r=1,i=n/2,o=n,s=t.distance(),a=r*s;let u=0;const l=[],h=[],c=[],f=[];let p=0;if(0===s)return{position:l,normal:h,uv:c,indices:f,count:u};const d=i/o;let g,y=l.length-1,v=h.length-1,m=c.length-1,A=f.length-1;function _(t){const e=0===l.length,n=t.sharp&&!e,r=t.dist/o,s=t.dir,a=t.up,g=t.right;if(fe.copy(g).multiplyScalar(i*t.widthScale),pe.copy(g).multiplyScalar(-i*t.widthScale),fe.add(t.pos),pe.add(t.pos),n){de.fromArray(l,l.length-6).sub(pe),ge.fromArray(l,l.length-3).sub(fe);const t=de.length()-ge.length();let e,n;t>0?(e=de,n=pe):(e=ge,n=fe),ye.copy(e).setLength(Math.abs(t)).add(n);let i=ve.copy(n).sub(ye).normalize().dot(s)*ve.copy(n).sub(ye).length()*2;ve.copy(s).setLength(i).add(ye),t>0?(l[++y]=ye.x,l[++y]=ye.y,l[++y]=ye.z,l[++y]=fe.x,l[++y]=fe.y,l[++y]=fe.z,l[++y]=pe.x,l[++y]=pe.y,l[++y]=pe.z,l[++y]=fe.x,l[++y]=fe.y,l[++y]=fe.z,l[++y]=ve.x,l[++y]=ve.y,l[++y]=ve.z,l[++y]=fe.x,l[++y]=fe.y,l[++y]=fe.z,p+=6,f[++A]=p-6,f[++A]=p-8,f[++A]=p-7,f[++A]=p-6,f[++A]=p-7,f[++A]=p-5,f[++A]=p-4,f[++A]=p-6,f[++A]=p-5,f[++A]=p-2,f[++A]=p-4,f[++A]=p-1,u+=12):(l[++y]=pe.x,l[++y]=pe.y,l[++y]=pe.z,l[++y]=ye.x,l[++y]=ye.y,l[++y]=ye.z,l[++y]=pe.x,l[++y]=pe.y,l[++y]=pe.z,l[++y]=fe.x,l[++y]=fe.y,l[++y]=fe.z,l[++y]=pe.x,l[++y]=pe.y,l[++y]=pe.z,l[++y]=ve.x,l[++y]=ve.y,l[++y]=ve.z,p+=6,f[++A]=p-6,f[++A]=p-8,f[++A]=p-7,f[++A]=p-6,f[++A]=p-7,f[++A]=p-5,f[++A]=p-6,f[++A]=p-5,f[++A]=p-3,f[++A]=p-2,f[++A]=p-3,f[++A]=p-1,u+=12);for(let t=0;t<6;t++)h[++v]=a.x,h[++v]=a.y,h[++v]=a.z;c[++m]=r-d,c[++m]=0,c[++m]=r-d,c[++m]=1,c[++m]=r,c[++m]=0,c[++m]=r,c[++m]=1,c[++m]=r+d,c[++m]=0,c[++m]=r+d,c[++m]=1}else l[++y]=pe.x,l[++y]=pe.y,l[++y]=pe.z,l[++y]=fe.x,l[++y]=fe.y,l[++y]=fe.z,h[++v]=a.x,h[++v]=a.y,h[++v]=a.z,h[++v]=a.x,h[++v]=a.y,h[++v]=a.z,c[++m]=r,c[++m]=0,c[++m]=r,c[++m]=1,p+=2,e||(f[++A]=p-2,f[++A]=p-4,f[++A]=p-3,f[++A]=p-2,f[++A]=p-3,f[++A]=p-1,u+=6)}if(a>0)for(let e=0;e<t.count;e++){const n=t.array[e];if(n.dist>a){const r=t.array[e-1];g=new te;const i=(a-r.dist)/(n.dist-r.dist);g.lerpPathPoints(r,n,i),_(g);break}_(n)}else g=t.array[0];return{position:l,normal:h,uv:c,indices:f,count:u}}(r,e);return{position:new Float32Array(i.position),indices:new Uint32Array(i.indices),uv:new Float32Array(i.uv),normal:new Float32Array(i.normal),line:t,count:i.count}})),r=Qt(n);return r.lines=t,r}function Ae(t,e,n={}){return void 0===n[t]&&(n[t]=e.distanceToVector3(t,t).x),n[t]}function _e(t,e,n={}){return void 0===n[t]&&(n[t]=e.altitudeToVector3(t,t).x),n[t]}function xe(t=[]){let e=0,n=0;const r=t.length;for(let o=0;o<r;o++){const{coordinate:r,lnglat:s,lnglats:a,xy:u,xys:l}=t[o],h=r||s||a||u||l||t[o];let c,f;Array.isArray(h)?(c=h[0],f=h[1]):h instanceof i.Coordinate&&(c=h.x,f=h.y),e+=c,n+=f}return new i.Coordinate(e/r,n/r)}function we(t,e,n,r){if(void 0===e||"number"!=typeof e||0===e)return 0;let i;i=t instanceof o.BufferGeometry?t.attributes.position.array:Array.isArray(t)||t instanceof Float32Array?t:t.position;let s=0;if(i){r?(void 0===r[e]&&(r[e]=n.altitudeToVector3(e,e).x),s=r[e]):s=n.altitudeToVector3(e,e).x;const t=i.length;if(i[0]instanceof o.Vector3)for(let e=0;e<t;e++)i[e].z+=s;else for(let e=0;e<t;e+=3)i[e+2]+=s}return s}function be(t){const e=t.length;let n=0;for(let r=0;r<e;r++){const{count:e}=t[r].position;n+=e}return new Float32Array(3*n)}new Rt(0,0,1),new Rt;const Ee=new o.Vector3,Ie=new Map;function Ce(t=[],e){const n=t.length,r=!!e,i=r?3:2,o=new Float64Array(n*i);Ie.clear();for(let s=0;s<n;s++){let n,a;const u=t[s];let l;if(u.x?(n=u.x,a=u.y,l=u.z):(n=u[0],a=u[1],l=u[2]),o[s*i]=n,o[s*i+1]=a,l=l||0,r&&0!==l){if(!Ie.has(l)){const t=e.altitudeToVector3(l,l,null,Ee).x;Ie.set(l,t)}o[s*i+2]=Ie.get(l)}}return o.buffer}function Se(t){return(K(t)?t.properties:t.getProperties())||{}}function Me(t){return(Z(t)?t.properties:t.getProperties())||{}}const Be=new o.Color("#fff"),Te=new o.Color("#fff");function ke(t,e,n,r,i,o){const s=Le(t,n,r,i,!1);if(!s)return null;o?(null==o[e]&&(o[e]=n.altitudeToVector3(e,e).x),e=o[e]):e=n.altitudeToVector3(e,e).x;const{position:a,normal:u,uv:l,indices:h}=Vt(s,{depth:e});return{position:a,normal:u,uv:l,indices:h}}function Pe(t,e,n,r){void 0===r&&(r=0);const i=t.attributes.position.array,s=i.length;let a;if(Te.setStyle(e),Be.setStyle(n),Array.isArray(r)){let t=0;for(let e=0,n=r.length;e<n;e++){const{count:n}=r[e].position;t+=3*n}a=new Float32Array(t)}else a=new Float32Array(i.length);if(Array.isArray(r))for(let t=0,e=r.length;t<e;t++){const{middleZ:e,start:n,end:o}=r[t].position;for(let t=n;t<o;t+=3){i[t+2]>e?(a[t]=Be.r,a[t+1]=Be.g,a[t+2]=Be.b):(a[t]=Te.r,a[t+1]=Te.g,a[t+2]=Te.b)}}else for(let t=0;t<s;t+=3){i[t+2]>r?(a[t]=Be.r,a[t+1]=Be.g,a[t+2]=Be.b):(a[t]=Te.r,a[t+1]=Te.g,a[t+2]=Te.b)}return R(t,"color",new o.BufferAttribute(a,3,!0)),a}function Le(t,e,n,r,o=!1){if(!t)return null;let s=[];if(t instanceof i.MultiPolygon)s=t.getGeometries().map((i=>Re(i,e,n||t.getCenter(),r,o)));else if(t instanceof i.Polygon){const i=Re(t,e,n||t.getCenter(),r,o);s.push(i)}else if(K(t))if(tt(t)){const i=rt(t);for(let a=0,u=i.length;a<u;a++)s.push(Re(i[a],e,n||nt(t),r,o))}else{const i=Re(t,e,n||nt(t),r,o);s.push(i)}return s}function Re(t,e,n,r,o=!1){let s,a,u;if(K(t)){const e=et(t);s=e[0],a=e.slice(1,e.length),n=n||nt(t)}else t instanceof i.Polygon&&(s=t.getShell(),a=t.getHoles(),n=n||t.getCenter());r=r||e.coordinateToVector3(n),u=o?e.coordinatiesToGLFloatArray(s,r).positons2d:e.coordinatiesToGLArray(s,r);const l=[o?u.buffer:u];if(a&&a.length>0)for(let t=0,n=a.length;t<n;t++){let n;n=o?e.coordinatiesToGLFloatArray(a[t],r).positons2d:e.coordinatiesToGLArray(a[t],r),l.push(o?n.buffer:n)}return l}function De(t){if(!t)return null;let e=[];if(t instanceof i.MultiPolygon)e=t.getGeometries().map((t=>Oe(t,!1)));else if(t instanceof i.Polygon){const n=Oe(t,!1);e.push(n)}else if(K(t))if(tt(t)){const n=rt(t);for(let t=0,r=n.length;t<r;t++)e.push(Oe(n[t],!0))}else{const n=Oe(t,!0);e.push(n)}return e}function Oe(t,e){let n,r;if(e){const e=et(t);n=e[0],r=e.slice(1,e.length)}else t instanceof i.Polygon&&(n=t.getShell(),r=t.getHoles());const o=[Ce(n)];if(r&&r.length>0)for(let t=0,e=r.length;t<e;t++){const e=Ce(r[t]);o.push(e)}return o}const Ne=new Map,Fe=new o.Vector3;function Ue(t,e,n,r=!0){let s,a,u=[];if(Array.isArray(t)&&t[0]instanceof o.Vector3)u=t;else{Array.isArray(t)&&(t=new i.LineString(t));const o=0;let l,h;J(t)?(l=et(t),n||(h=nt(t))):t instanceof i.LineString&&(l=t.getCoordinates(),n||(h=t.getCenter()));const c=e.coordinateToVector3(n||h);if(r){Ne.clear();for(let t=0,n=l.length;t<n;t++){const n=l[t],r=n.z||n[2]||0;if(!Ne.has(r)){const t=e.altitudeToVector3(r,r,null,Fe).x;Ne.set(r,t)}const i=e.coordinateToVector3(n,o).sub(c);i.z+=Ne.get(r)||0,u.push(i)}}else{const t=e.coordinatiesToGLFloatArray(l,c,!0);s=t.positions,a=t.positons2d}}if(!r)return{positions:s,positionsV:u,positions2d:a,arrayBuffer:s.buffer};a=new Float32Array(2*u.length),s=new Float32Array(3*u.length);for(let t=0,e=u.length;t<e;t++){const e=3*t,n=u[t];s[e]=n.x,s[e+1]=n.y,s[e+2]=n.z;const r=2*t;a[r]=n.x,a[r+1]=n.y}return{positions:s,positionsV:u,positions2d:a,arrayBuffer:s.buffer}}function Qe(t,e,n,r){const i=[],o=[],s=[];let a,u;for(let n=0,l=t.length;n<l;n++){const l=t[n];for(let t=0,n=l.length;t<n;t++){const n=l[t],h=n.join(",").toString();a?(h!==a&&(u=e.coordinateToVector3(n,0).sub(r),i.push(u.x,u.y,u.z),o.push(u),s.push(n)),a=h):(s.push(n),a=h,u=e.coordinateToVector3(n,0).sub(r),i.push(u.x,u.y,u.z),o.push(u))}}return{positions:i,positionsV:o,lnglats:s}}function Ge(t){let e;const n=[];for(let r=0,i=t.length;r<i;r++){const i=t[r];for(let t=0,r=i.length;t<r;t++){const r=i[t],o=r.join(",").toString();e?(o!==e&&n.push(r),e=o):(n.push(r),e=o)}}return n}function ze(t,e=1,n=1,r,i){const o=Ue(t,r,i).positionsV,s=[];for(let t=0,e=o.length;t<e;t++){const e=o[t];s.push([e.x,e.y,e.z])}const{indices:a,position:u,normal:l,uv:h}=Wt([s],{lineWidth:e,depth:n});return{position:u,normal:l,indices:a,uv:h}}function je(t,e=1,n=1,r,i){const o=Ue(t,r,i).positionsV,s=[];for(let t=0,e=o.length;t<e;t++){const e=o[t];s.push([e.x,e.y,e.z])}const{indices:a,position:u,normal:l,uv:h}=me([s],{lineWidth:e,cornerRadius:n});return{position:u,normal:l,indices:a,uv:h}}function Ve(t){let e,n=[];return t instanceof i.MultiLineString?(n=t.getGeometries(),e=t.getCenter()):t instanceof i.LineString?(n.push(t),e=t.getCenter()):J(t)&&(e=nt(t),tt(t)?n=rt(t):n.push(t)),{lineStrings:n,center:e}}function qe(t){const e=new Float32Array(2*t.length-6);let n=0;for(let r=0,i=t.length/3;r<i;r++){const o=t[3*r],s=t[3*r+1],a=t[3*r+2];if(r>0&&r<i-1){const t=3*n;e[t]=o,e[t+1]=s,e[t+2]=a,n++}const u=3*n;e[u]=o,e[u+1]=s,e[u+2]=a,n++}return e}function He(t){let e=0;const n=t.length;if(1===n)return t[0];for(let r=0;r<n;r++)e+=t[r].length;const r=new Float32Array(e);let i=0;for(let e=0;e<n;e++)r.set(t[e],i),i+=t[e].length;return r}function We(t,e){return t instanceof i.LineString?Ce(t.getCoordinates(),e):Z(t)?Ce(t.geometry.coordinates,e):void 0}let Ye;function Xe(){return Ye||(Ye=new o.BufferGeometry,R(Ye,"position",new o.BufferAttribute(new Float32Array(3),3))),Ye}let Je;var Ke;function Ze(){return i.worker||console.error("maptalks.worker is not defined,You can't use ThreeVectorTileLayer"),!Ke&&Je&&(Ke=new Je("__maptalks.three__")),Ke}function $e(t,e,n={}){return void 0!==t&&"number"==typeof t&&0!==t?(void 0===n[t]&&(n[t]=e.distanceToVector3(t,t).x),n[t]):0}function tn(t,e,n={}){return void 0!==t&&"number"==typeof t&&0!==t?(void 0===n[t]&&(n[t]=e.altitudeToVector3(t,t).x),n[t]):0}function en(t,e){return e?Object.assign({},e,t):t||{}}function nn(t,e,n,r,i=[],o){const s=n.isMercator();let a,u,l;if(s){const t=n.getMap();a=t.getGLRes(),u=t.getSpatialReference().getTransformation().matrix}e&&(l=n.coordinateToVector3(e));const h=[],c=[],f={},p={},d=t.length;for(let a=0;a<d;a++){const u=t[a];let d=i[a]?i[a]:Me(r[a]);d=en(d,o),e||(l=n.coordinateToVector3(d.center));let g=d.width||1,y=d.height||1,v=d.cornerRadius||0,m=d.bottomHeight||0;const A=d.parentCenter;g=$e(g,n,f),v=$e(v,n,f),y=tn(y,n,p),m=tn(m,n,p);const _=[];for(let t=0,r=u.length;t<r;t++){const r=u[t];let i;i=s?We(r,n):Ue(r,n,A||e,!1).arrayBuffer,c.push(i),_.push(i)}const x={id:d.id,data:_,height:y,width:g,cornerRadius:v,bottomHeight:m};s&&(x.center=[l.x,l.y]),h.push(x)}return{datas:h,transfer:c,glRes:a,matrix:u,center:s?[l.x,l.y]:null}}function rn(t,e,n,r,i=[],o){const s=n.isMercator();let a,u,l;if(s){const t=n.getMap();a=t.getGLRes(),u=t.getSpatialReference().getTransformation().matrix}e&&(l=n.coordinateToVector3(e));const h=[],c=[],f={},p=t.length;for(let a=0;a<p;a++){const u=t[a];let p=i[a]?i[a]:Me(r[a]);p=en(p,o),e||(l=n.coordinateToVector3(p.center));let d=p.bottomHeight||0;d=tn(d,n,f);const g=[];for(let t=0,r=u.length;t<r;t++){const r=u[t];if(s){const t=We(r,n);c.push(t),g.push(t)}else{const t=Ue(r,n,e,!1).arrayBuffer;c.push(t),g.push(t)}}const y={id:p.id,data:g,bottomHeight:d};s&&(y.center=[l.x,l.y]),h.push(y)}return{datas:h,transfer:c,glRes:a,matrix:u,center:s?[l.x,l.y]:null}}function on(t){return t.map((t=>t.data))}function sn(t){return t.map((t=>t.option||t.baseObject.getOptions()))}i.worker&&(Je=class extends i.worker.Actor{test(t,e){this.send(t,null,e)}pushQueue(t={}){const{type:e,data:n,callback:r,layer:i,key:o,center:s,lineStrings:a,options:u,id:l,baseOptions:h}=t;let c;e.indexOf("ExtrudePolygon")>-1?c=function(t=[],e,n,r=[],i){const o=n.isMercator();let s,a,u;if(o){const t=n.getMap();s=t.getGLRes(),a=t.getSpatialReference().getTransformation().matrix}e&&(u=n.coordinateToVector3(e));const l=t.length,h=[],c=[],f={};for(let s=0;s<l;s++){const a=t[s],l=a;let p,d=r[s]?r[s]:Se(l);d=en(d,i),e||(u=n.coordinateToVector3(d.center)),p=o?De(a):Le(a,n,d.center||e,u,!0);for(let t=0,e=p.length;t<e;t++){const e=p[t];for(let t=0,n=e.length;t<n;t++)c.push(e[t])}let g=d.height||1,y=d.bottomHeight||0;g=tn(g,n,f),y=tn(y,n,f);const v={id:d.id,data:p,height:g,bottomHeight:y};o&&(v.center=[u.x,u.y]),h.push(v),l._properties&&delete l._properties}return{datas:h,transfer:c,glRes:s,matrix:a,center:o?[u.x,u.y]:null}}(n,s,i,u,h):"ExtrudeLines"===e||"Paths"===e?c=nn(n,s,i,a,u,h):"Point"===e||("Line"===e||"FatLine"===e||"Lines"===e||"FatLines"===e?c=rn(n,s,i,a,u,h):"ExtrudeLine"===e||"Path"===e?c=nn(n,s,i,a,u,h):"Bar"!==e&&"Bars"!==e||(c=function(t){const e=t.length,n=new Float32Array(7*e);let r=0;for(let i=0;i<e;i++){let{center:e,radialSegments:o,radius:s,height:a,altitude:u,id:l}=t[i];e=e||[0,0],n[r]=e[0],n[r+1]=e[1],n[r+2]=o||6,n[r+3]=s||1,n[r+4]=a,n[r+5]=u||0,n[r+6]=l,r+=7}const i=n.buffer;return{datas:i,transfer:[i]}}(n))),c?this.send({type:e,datas:c.datas,glRes:c.glRes,matrix:c.matrix,center:c.center},c.transfer,(function(t,e){t&&console.error(t),e.key=o,e.id=l,r(e)})):console.error(`No processing logic found for type:${e}`)}});class an{constructor(){this.queueMap={},this.tempQueue=[],this.time=this.getCurrentTime(),this.deQueueCount=5,this.resultQueue=[]}getActor(){return Ze()}getCurrentTime(){return i.Util.now()}loop(){this.deQueue()}push(t){return this.tempQueue.push(t),t.id&&(this.queueMap[t.id]=t),this}reset(){return this.time=this.getCurrentTime(),this.tempQueue=[],this}pushResult(t){if(t)return Array.isArray(t)||(t=[t]),t.forEach((t=>{this.resultQueue.push(t)})),this}deQueue(){if(!this.resultQueue.length)return this;const t=this.deQueueCount;return(this.resultQueue.slice(0,t)||[]).forEach((t=>{const{id:e}=t;if(this.queueMap[e]){const{baseObject:n}=this.queueMap[e];if(n&&n._workerLoad){n.getLayer()?n._workerLoad(t):console.warn(n," worker Processing completed but removed from the layer")}delete this.queueMap[e]}})),this.resultQueue.splice(0,t),this}}const un=new class extends an{constructor(){super(),this.deQueueCount=100}loop(){if((this.getCurrentTime()-this.time>=32||this.tempQueue.length>=1e3)&&this.tempQueue.length){Ze().pushQueue({type:"ExtrudePolygon",layer:this.tempQueue[0].layer,data:on(this.tempQueue),options:sn(this.tempQueue),callback:t=>{this.pushResult(t)}}),this.reset()}super.loop()}},ln=new class extends an{loop(){if(this.tempQueue.length){const t=Ze();this.tempQueue.forEach((e=>{t.pushQueue({id:e.id,type:"ExtrudePolygons",layer:e.layer,data:e.data,key:e.key,center:e.center,baseOptions:e.option,callback:t=>{this.pushResult(t)}})})),this.reset()}super.loop()}},hn=new class extends an{constructor(){super(),this.deQueueCount=100}loop(){if((this.getCurrentTime()-this.time>=32||this.tempQueue.length>=1e3)&&this.tempQueue.length){Ze().pushQueue({type:"ExtrudeLine",layer:this.tempQueue[0].layer,data:on(this.tempQueue),options:sn(this.tempQueue),lineStrings:this.tempQueue.map((t=>t.lineString)),callback:t=>{this.pushResult(t)}}),this.reset()}super.loop()}},cn=new class extends an{loop(){if(this.tempQueue.length){const t=Ze();this.tempQueue.forEach((e=>{t.pushQueue({id:e.id,type:"ExtrudeLines",layer:e.layer,data:e.data,key:e.key,lineStrings:e.lineStrings,center:e.center,baseOptions:e.option,callback:t=>{this.pushResult(t)}})})),this.reset()}super.loop()}},fn=new class extends an{constructor(){super(),this.deQueueCount=200}loop(){if((this.getCurrentTime()-this.time>=32||this.tempQueue.length>=1e3)&&this.tempQueue.length){Ze().pushQueue({type:"Line",layer:this.tempQueue[0].layer,data:on(this.tempQueue),options:sn(this.tempQueue),lineStrings:this.tempQueue.map((t=>t.lineString)),callback:t=>{this.pushResult(t)}}),this.reset()}super.loop()}},pn=new class extends an{loop(){if(this.tempQueue.length){const t=Ze();this.tempQueue.forEach((e=>{t.pushQueue({id:e.id,type:"Lines",layer:e.layer,data:e.data,key:e.key,lineStrings:e.lineStrings,center:e.center,baseOptions:e.option,callback:t=>{this.pushResult(t)}})})),this.reset()}super.loop()}},dn=new class extends an{constructor(){super(),this.deQueueCount=100}loop(){if((this.getCurrentTime()-this.time>=32||this.tempQueue.length>=1e3)&&this.tempQueue.length){Ze().pushQueue({type:"FatLine",layer:this.tempQueue[0].layer,data:on(this.tempQueue),options:sn(this.tempQueue),lineStrings:this.tempQueue.map((t=>t.lineString)),callback:t=>{this.pushResult(t)}}),this.reset()}super.loop()}},gn=new class extends an{loop(){if(this.tempQueue.length){const t=Ze();this.tempQueue.forEach((e=>{t.pushQueue({id:e.id,type:"FatLines",layer:e.layer,data:e.data,key:e.key,lineStrings:e.lineStrings,center:e.center,baseOptions:e.option,callback:t=>{this.pushResult(t)}})})),this.reset()}super.loop()}},yn=new class extends an{constructor(){super(),this.deQueueCount=100}loop(){if((this.getCurrentTime()-this.time>=32||this.tempQueue.length>=1e3)&&this.tempQueue.length){Ze().pushQueue({type:"Bar",layer:this.tempQueue[0].layer,data:on(this.tempQueue),options:sn(this.tempQueue),callback:t=>{this.pushResult(t)}}),this.reset()}super.loop()}},vn=new class extends an{constructor(){super(),this.deQueueCount=1}loop(){if(this.tempQueue.length){const t=Ze();this.tempQueue.forEach((e=>{t.pushQueue({id:e.id,type:"Bars",layer:e.layer,data:e.data,callback:t=>{this.pushResult(t)}})})),this.reset()}super.loop()}},mn=new class extends an{constructor(){super(),this.deQueueCount=100}loop(){if((this.getCurrentTime()-this.time>=32||this.tempQueue.length>=1e3)&&this.tempQueue.length){Ze().pushQueue({type:"Path",layer:this.tempQueue[0].layer,data:on(this.tempQueue),options:sn(this.tempQueue),lineStrings:this.tempQueue.map((t=>t.lineString)),callback:t=>{this.pushResult(t)}}),this.reset()}super.loop()}},An=new class extends an{loop(){if(this.tempQueue.length){const t=Ze();this.tempQueue.forEach((e=>{t.pushQueue({id:e.id,type:"Paths",layer:e.layer,data:e.data,key:e.key,lineStrings:e.lineStrings,center:e.center,baseOptions:e.option,callback:t=>{this.pushResult(t)}})})),this.reset()}super.loop()}},_n={isRunning:!1,tasks:[],addTask:t=>{t&&_n.tasks.push(t)},removeTask:t=>{_n.tasks.splice(_n.tasks.indexOf(t),1)},loop(){un.loop(),ln.loop(),hn.loop(),cn.loop(),fn.loop(),pn.loop(),dn.loop(),gn.loop(),yn.loop(),vn.loop(),mn.loop(),An.loop(),_n.tasks.forEach((t=>{t&&t.loop&&t.loop()})),i.Util.requestAnimFrame(_n.loop)},star(){_n.isRunning||(_n.isRunning=!0,_n.loop())}};function xn(t){const{position:e,normal:n,uv:r,indices:i}=wn(t),s=new o.BufferGeometry,a=new Float32Array(e.length);return a.fill(1,0,e.length),R(s,"color",new o.BufferAttribute(a,3)),R(s,"normal",new o.BufferAttribute(n,3)),R(s,"position",new o.BufferAttribute(e,3)),r&&r.length&&R(s,"uv",new o.BufferAttribute(r,2)),s.setIndex(new o.BufferAttribute(i,1)),s}function wn(t){const e={},n={};for(let r=0;r<t.length;++r){const i=t[r];for(const t in i)void 0===e[t]&&(e[t]=[],n[t]=0),e[t].push(i[t]),n[t]+=i[t].length}const r={};let i=0;const o=new Uint32Array(n.indices);for(const t in e)if("indices"===t){const n=e[t];let r=0;for(let t=0,s=n.length;t<s;t++){const s=n[t];for(let t=0,e=s.length;t<e;t++)o[r]=s[t]+i,r++;i+=e.position[t].length/3}}else{const i=bn(e[t],n[t]);if(!i)return null;r[t]=i}return r.indices=o,r}function bn(t,e){const n=new Float32Array(e);let r=0;for(let e=0;e<t.length;++e)n.set(t[e],r),r+=t[e].length;return n}function En(t){const{position:e,normal:n,uv:r,indices:i}=t,s=new o.BufferGeometry;return R(s,"normal",new o.BufferAttribute(new Float32Array(n),3)),R(s,"position",new o.BufferAttribute(new Float32Array(e),3)),R(s,"uv",new o.BufferAttribute(new Float32Array(r),2)),s.setIndex(new o.BufferAttribute(new Uint32Array(i),1)),s}function In(t){const e=new o.BufferGeometry;return R(e,"normal",t.getAttribute("normal")),R(e,"position",t.getAttribute("position").clone()),e.setIndex(t.getIndex()),e}let Cn;function Sn(){if(!Cn){const t=1e-6;Cn=N(t,t,t)}return Cn}Sn();const Mn=N(1,1,1);Mn.translate(0,0,.5);const Bn=new o.Color("#fff"),Tn=new o.Color("#fff");function kn(t){const{position:e,normal:n,uv:r,indices:i}=function(t,e){e=Object.assign({},{radius:1,height:2,radialSegments:6},e);const n=Math.round(Math.max(4,e.radialSegments));let{radius:r,height:i}=e;const o=360/n/360*Math.PI*2,s=n+1,a=new Float32Array(3*s*2),[u,l]=t;let h=0,c=0;const f=3*s,p=2*s,d=[],g=[];let y=d.length-1;for(let t=-1;t<n;t++){const e=o*t,n=Math.cos(e)*r+u,s=Math.sin(e)*r+l;a[h]=n,a[h+1]=s,a[h+2]=0,a[h+f]=n,a[h+1+f]=s,a[h+2+f]=i;let v=0,m=0;v=.5+n/r/2,m=.5+s/r/2,g[c]=v,g[c+1]=m,g[c+p]=v,g[c+1+p]=m,h+=3,c+=2,t>1&&(d[++y]=0,d[++y]=t-1,d[++y]=t)}h-=3,a[h]=a[0],a[h+1]=a[1],a[h+2]=a[2];const v=a.length;a[v-3]=a[0],a[v-2]=a[1],a[v-1]=i;const m=d.length;y=d.length-1;for(let t=0;t<m;t++){const e=d[t];d[++y]=e+s}const A=new Float32Array(2*(3*s*2-6));let _=-1;h=2*s,c=0,y=d.length-1;let x=g.length-1;for(let t=0,e=a.length/2;t<e-3;t+=3){const e=a[t],n=a[t+1],o=a[t+3],u=a[t+4];A[++_]=e,A[++_]=n,A[++_]=i,A[++_]=o,A[++_]=u,A[++_]=i,A[++_]=e,A[++_]=n,A[++_]=0,A[++_]=o,A[++_]=u,A[++_]=0;const l=h+2,f=h+3,p=h,v=h+1;d[++y]=p,d[++y]=l,d[++y]=v,d[++y]=l,d[++y]=f,d[++y]=v,h+=4;const m=c/s,w=(c+1)/s;g[++x]=m,g[++x]=i/r/2,g[++x]=w,g[++x]=i/r/2,g[++x]=m,g[++x]=0,g[++x]=w,g[++x]=0,c++}const w=new Float32Array(a.length+A.length);w.set(a,0),w.set(A,a.length);const b=Ut(d,w);return{points:a,indices:new Uint32Array(d),position:w,normal:b,uv:new Float32Array(g)}}(t.center||[0,0],t),s=new o.BufferGeometry;return R(s,"normal",new o.BufferAttribute(n,3)),R(s,"position",new o.BufferAttribute(e,3)),R(s,"uv",new o.BufferAttribute(r,2)),s.setIndex(new o.BufferAttribute(i,1)),s}function Pn(t){const e=Object.assign({},t);return e._radius&&(e.radius=e._radius),kn(e)}function Ln(t,e,n,r="y",i=0){let s=0;"y"===r?s=1:"z"===r&&(s=2);const a=t.attributes.position.array,u=a.length;Tn.setStyle(e),Bn.setStyle(n);const l=new Float32Array(u);if(Array.isArray(i))for(let t=0,e=i.length;t<e;t++){const{middleZ:e,start:n,end:r}=i[t].position;for(let t=n;t<r;t+=3){a[t+2]>e?(l[t]=Bn.r,l[t+1]=Bn.g,l[t+2]=Bn.b):(l[t]=Tn.r,l[t+1]=Tn.g,l[t+2]=Tn.b)}}else for(let t=0;t<u;t+=3){a[t+s]>i?(l[t]=Bn.r,l[t+1]=Bn.g,l[t+2]=Bn.b):(l[t]=Tn.r,l[t+1]=Tn.g,l[t+2]=Tn.b)}return R(t,"color",new o.BufferAttribute(l,3,!0)),l}function Rn(t){const e=[],n=t.length;let r=0;for(let e=0;e<n;e++){const{color:n}=t[e].attributes;n&&(r+=n.array.length)}const i=new Float32Array(r);let s=0;for(let n=0,r=t.length;n<r;n++){const{color:r,normal:o,position:a,uv:u}=t[n].attributes,l=t[n].index;r&&(i.set(r.array,s),s+=r.array.length),e.push({normal:o.array,uv:u.array,position:a.array,indices:l.array})}const a=xn(e);i.length&&R(a,"color",new o.BufferAttribute(i,3,!0));for(let e=0,n=t.length;e<n;e++)t[e].dispose();return a}function Dn(){return Mn}const On={radius:10,height:100,radialSegments:6,altitude:0,topColor:"",bottomColor:"#2d2f61",heightEnable:!0};class Nn extends W{constructor(t,e,n,r){e=i.Util.extend({},On,e,{layer:r,coordinate:t}),super(),this._initOptions(e);const{height:o,radius:s,topColor:a,bottomColor:u,altitude:l,asynchronous:h}=e;let c;if(e.height=r.altitudeToVector3(o,o).x,e.radius=r.distanceToVector3(s,s).x,h){c=Sn();const t=i.Util.GUID();this.getOptions().id=t,yn.push({data:{radius:e.radius,height:e.height,radialSegments:e.radialSegments,id:t},layer:r,id:t,baseObject:this})}else c=Pn(e),a&&(Ln(c,u,a,"z",e.height/2),n.vertexColors=O());this._createMesh(c,n);const f=r.altitudeToVector3(l,l).x,p=r.coordinateToVector3(t,f);this.getObject3d().position.copy(p),this.type="Bar"}_workerLoad(t){const e=En(t),{topColor:n,bottomColor:r,height:i}=this.getOptions(),o=this.getObject3d(),s=o.material;if(n){Ln(e,r,n,"z",this.getLayer().altitudeToVector3(i,i).x/2),s.vertexColors=O()}o.geometry=e,o.material.needsUpdate=!0,this._fire("workerload",{target:this})}}function Fn(t){const e=[];return t&&t.length&&t.forEach((t=>{t=t instanceof o.Color?t:new o.Color(t),e.push(t.r,t.g,t.b)})),e}const Un={altitude:0,bottomHeight:0,colors:null};class Qn extends W{constructor(t,e,n,r){e=i.Util.extend({},Un,e,{layer:r,lineString:t}),super(),this._initOptions(e);const{lineStrings:s,center:a}=Ve(t),{asynchronous:u}=e;let l;if(u){l=Xe();const n=i.Util.GUID();this.getOptions().id=n,this.getOptions().center=a,fn.push({id:n,data:s,layer:r,key:e.key,lineString:t,baseObject:this})}else{const t=[];for(let e=0,n=s.length;e<n;e++){const n=s[e],{positions:i}=Ue(n,r,a,!1);t.push(qe(i))}const i=He(t);l=new o.BufferGeometry,R(l,"position",new o.BufferAttribute(i,3)),we(l,e.bottomHeight,r);const u=Fn(e.colors);u&&u.length&&(R(l,"color",new o.Float32BufferAttribute(u,3)),n.vertexColors=O())}this._createLineSegments(l,n);const{altitude:h}=e,c=r.altitudeToVector3(h,h).x,f=r.coordinateToVector3(a,c);this.getObject3d().position.copy(f),this.type="Line"}_workerLoad(t){const e=new o.BufferGeometry;R(e,"position",new o.BufferAttribute(new Float32Array(t.position),3));const n=Fn(this.getOptions().colors),r=this.getObject3d(),i=r.material;n&&n.length&&(R(e,"color",new o.Float32BufferAttribute(n,3)),i.vertexColors=O()),this._computeLineDistances(e),r.geometry=e,r.material.needsUpdate=!0,this._fire("workerload",{target:this})}}const Gn={bottomHeight:0,width:3,height:1,altitude:0,topColor:null,bottomColor:"#2d2f61",heightEnable:!0};class zn extends W{constructor(t,e,n,r){e=i.Util.extend({},Gn,e,{layer:r,lineString:t}),super(),this._initOptions(e);const{height:o,width:s,bottomColor:a,topColor:u,bottomHeight:l,altitude:h,asynchronous:c}=e,f=r.altitudeToVector3(o,o).x,p=r.distanceToVector3(s,s).x,{lineStrings:d,center:g}=Ve(t);let y;if(c){y=Sn();const e=i.Util.GUID();this.getOptions().id=e,this.getOptions().center=g,hn.push({id:e,data:d,layer:r,center:g,lineString:t,baseObject:this})}else{const t=[];let e=0;const i={};for(let n=0,o=d.length;n<o;n++){const o=ze(d[n],p,f,r,g);e=we(o,l,r,i),t.push(o)}y=xn(t),u&&(Pe(y,a,u,e+f/2),n.vertexColors=O())}this._createMesh(y,n);const v=r.altitudeToVector3(h,h).x,m=r.coordinateToVector3(g,v);this.getObject3d().position.copy(m),this.type="ExtrudeLine"}_workerLoad(t){const e=En(t),{topColor:n,bottomColor:r,bottomHeight:i,height:o}=this.getOptions(),s=this.getObject3d(),a=s.material;if(n){const t=this.getLayer();Pe(e,r,n,t.altitudeToVector3(i,i).x+t.altitudeToVector3(o,o).x/2),a.vertexColors=O()}s.geometry=e,s.material.needsUpdate=!0,this._fire("workerload",{target:this})}}const jn={altitude:0,height:1,bottomHeight:0,topColor:null,bottomColor:"#2d2f61",heightEnable:!0};class Vn extends W{constructor(t,e,n,r){e=i.Util.extend({},jn,e,{layer:r,polygon:t}),super(),this._initOptions(e);const{height:s,topColor:a,bottomColor:u,altitude:l,bottomHeight:h,asynchronous:c}=e;let f;const p=K(t)?nt(t):t.getCenter();if(c){f=Sn();const e=i.Util.GUID();this.getOptions().id=e,this.getOptions().center=p,un.push({data:t,layer:r,id:e,baseObject:this})}else{f=function(t,e,n,r){const{position:i,normal:s,uv:a,indices:u}=ke(t,e,n,r),l=new Float32Array(i.length);l.fill(1,0,i.length);const h=new o.BufferGeometry;return R(h,"color",new o.BufferAttribute(l,3)),R(h,"normal",new o.BufferAttribute(s,3)),R(h,"position",new o.BufferAttribute(i,3)),R(h,"uv",new o.BufferAttribute(a,2)),h.setIndex(new o.BufferAttribute(u,1)),h}(t,s,r);const e=we(f,h,r);if(a){Pe(f,u,a,e+r.altitudeToVector3(s,s).x/2),n.vertexColors=O()}}this._createMesh(f,n);const d=r.altitudeToVector3(l,l).x,g=r.coordinateToVector3(p,d);this.getObject3d().position.copy(g),this.type="ExtrudePolygon"}_workerLoad(t){const e=En(t),{topColor:n,bottomColor:r,bottomHeight:i,height:o}=this.getOptions(),s=this.getObject3d(),a=s.material;if(n){const t=this.getLayer();Pe(e,r,n,t.altitudeToVector3(i,i).x+t.altitudeToVector3(o,o).x/2),a.vertexColors=O()}s.geometry=e,s.material.needsUpdate=!0,this._fire("workerload",{target:this})}}const qn={altitude:0,coordinate:null};class Hn extends W{constructor(t,e={},n){e.coordinate||(console.warn("coordinate is null,it is important to locate the model"),e.coordinate=n.getMap().getCenter()),e=i.Util.extend({},qn,e,{layer:n,model:t}),super(),this._initOptions(e),this._createGroup(),this.getObject3d().add(t);const{altitude:r,coordinate:o}=e,s=n.altitudeToVector3(r,r).x,a=n.coordinateToVector3(o,s);this.getObject3d().position.copy(a),this.type="Model"}getCoordinates(){const t=this.options.coordinate,e=this.options.altitude,n=new i.Coordinate(t);return n.z=e,n}}const Wn=Math.PI/180;function Yn(t){return t*Wn}function Xn(t,e){if(!t||!e)return 0;Array.isArray(t)||(t=t.toArray()),Array.isArray(e)||(e=e.toArray());let n=Yn(t[1]);const r=Yn(e[1]),i=n-r,o=Yn(t[0])-Yn(e[0]);return n=2*Math.asin(Math.sqrt(Math.pow(Math.sin(i/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(o/2),2))),n*=6378137,Math.round(1e5*n)/1e5}function Jn(t,e){const{len:n,c1:r,c2:i}=t,o=i[0]-r[0],s=i[1]-r[1],a=e/n;return[r[0]+a*o,r[1]+a*s]}const Kn=1e3;const Zn={trail:5,chunkLength:50,width:2,height:1,speed:1,altitude:0,interactive:!1,heightEnable:!0};class $n extends W{constructor(t,e,n,r){e=i.Util.extend({},Zn,e,{layer:r,lineString:t}),super(),this._initOptions(e);const{width:s,height:a,altitude:u,speed:l,chunkLength:h,trail:c}=e;let f,p;J(t)?(f=nt(t),p=et(t)):(f=t.getCenter(),p=t);const d=function(t,e=10){e=Math.max(e,.1),Array.isArray(t)||(t=t.getCoordinates().map((t=>t.toArray())));const n=t.length;let r=[],i=0;for(let e=0;e<n-1;e++){const n=Xn(t[e],t[e+1]),o=Math.floor(n);r.push({c1:t[e],len:o,c2:t[e+1]}),i+=o}if(i<=e)return r.map((t=>[t.c1,t.c2]));if(1===r.length&&r[0].len<=e)return[[r[0].c1,r[0].c2]];const o=r.length;let s,a=0,u=0;const l=[];let h=[r[0].c1];for(;a<o;){const{len:t,c2:n}=r[a];if(u+=t,u<e&&(h.push(n),a===o-1&&l.push(h),a++),u===e&&(h.push(n),u=0,l.push(h),h=[n],a++),u>e){const n=t-u+e;s=Jn(r[a],n),h.push(s),l.push(h),u=0,r[a].c1=s,r[a].len=t-n,h=[],h.push(s)}}return l}(p,h),g=r.coordinateToVector3(f),y=new o.BufferGeometry,v=new Float32Array(3e3),m=new Float32Array(3e3),A=new Uint16Array(Kn);R(y,"position",new o.BufferAttribute(v,3)),R(y,"normal",new o.BufferAttribute(m,3)),y.setIndex(new o.BufferAttribute(A,1));const _=r.distanceToVector3(s,s).x,x=r.altitudeToVector3(a,a).x;this._createMesh(y,n);const w=r.altitudeToVector3(u,u).x,b=r.coordinateToVector3(f,w);this.getObject3d().position.copy(b),this._params={index:0,chunkLines:d,geometries:[],layer:r,trail:Math.max(1,c),lineWidth:_,depth:x,speed:Math.min(1,l),idx:0,loaded:!0,center:f,centerPt:g,workerInitCount:0},this._init(this._params),this.type="ExtrudeLineTrail"}_init(t){const{layer:e,trail:n,lineWidth:r,depth:o,chunkLines:s,positionMap:a,centerPt:u,center:l}=t,h=s.length,c=[];if(this.options.asynchronous){t.loaded=!1;const r=i.Util.GUID();for(let t=0;t<h;t++){const o={type:"Feature",geometry:{type:"LineString",coordinates:Ge(s.slice(t,t+n))}},a=`${r}-${t}`,u=i.Util.extend({},this.options);u.parentCenter=l,u.id=a,u.center=l,hn.push({id:a,data:[o],layer:e,center:l,lineString:o,baseObject:this,option:u})}}else for(let t=0;t<h;t++){const i=Qe(s.slice(t,t+n),e,0,u).positionsV;c.push(ze(i,r,o,e))}}_animation(){const{index:t,geometries:e,speed:n,idx:r,chunkLines:i,trail:o,lineWidth:s,depth:a,loaded:u,layer:l,positionMap:h,centerPt:c}=this._params;if(!u)return;const f=Math.round(t);if(f>r&&f<=i.length-1){this._params.idx++;let t=e[f];if(!t){t=ze(Qe(i.slice(f,f+o),l,0,c).positionsV,s,a,l),e[f]=t}const n=this.getObject3d();!function(t,e,n,r){const i=e.length;t.attributes.normal.count=i,t.attributes.position.count=i;const o=t.attributes.position.array,s=t.attributes.normal.array;for(let t=0;t<i;t++)o[t]=e[t],s[t]=n[t];t.index.count=r.length;for(let e=0,n=r.length;e<n;e++)t.index.array[e]=r[e]}(n.geometry,t.position,t.normal,t.indices),n.geometry.attributes.position.needsUpdate=!0,n.geometry.attributes.normal.needsUpdate=!0,n.geometry.index.needsUpdate=!0}t>=i.length-1&&(this._params.index=-1,this._params.idx=-1),this._params.index+=n}_workerLoad(t){if(!t)return this;const{id:e,indices:n,position:r,normal:o,uv:s}=t;if(!(e&&n&&r&&o&&s))return;let a=e.split("-")[1];if(a=parseInt(a),i.Util.isNumber(a)){this._params.geometries[a]={indices:new Uint32Array(n),position:new Float32Array(r),uv:new Float32Array(s),normal:new Float32Array(o)},this._params.workerInitCount++}this._params.workerInitCount===this._params.chunkLines.length&&(this._params.loaded=!0,this._fire("workerload",{target:this}))}}const tr=["click","mousemove","mousedown","mouseup","dblclick","contextmenu"].join(" ").toString(),er=new o.MeshBasicMaterial;er.vertexColors=O();const nr=t=>class extends t{_initBaseObjectsEvent(t){if(t&&Array.isArray(t)&&t.length)for(let e=0,n=t.length;e<n;e++){const n=t[e];this._proxyEvent(n)}return this}_proxyEvent(t){t.on("add",(t=>{this._showGeometry(t.target,!0)})),t.on("remove",(t=>{this._showGeometry(t.target,!1)})),t.on("mouseout",(t=>{this._mouseover=!1,this.fire("mouseout",Object.assign({},t,{target:this,selectMesh:this.getSelectMesh?this.getSelectMesh():null}))})),t.on(tr,(t=>{this.fire(t.type,Object.assign({},t,{target:this,selectMesh:this.getSelectMesh?this.getSelectMesh():null}))}))}_getHideGeometryIndex(t){const e=[];let n=0;for(let r=0,i=this._geometriesAttributes.length;r<i;r++)!0===this._geometriesAttributes[r].hide&&(e.push(r),n+=this._geometriesAttributes[r][t].count);return{indexs:e,count:n}}_updateAttribute(t,e){const{indexs:n}=this._getHideGeometryIndex(e),r=this._geometryCache.attributes[e].array,i=r.length;for(let e=0;e<i;e++)t.array[e]=r[e];let s=NaN;this.getObject3d()instanceof o.LineSegments&&(s=0);for(let r=0;r<n.length;r++){const i=n[r],{start:o,end:a}=this._geometriesAttributes[i][e];for(let e=o;e<a;e++)t.array[e]=s}return this}_showGeometry(t,e){let n;if(t&&(n=t.getOptions().index),null!=n){const t=this._geometriesAttributes[n],{hide:r}=t;if(r===e)return this;t.hide=e;const i=this.getObject3d().geometry;this._updateAttribute(i.attributes.position,"position"),i.attributes.position.needsUpdate=!0,this.isHide=e}return this}getSelectMesh(){const t=this._getIndex();if(null!=t)return{data:this._datas[t],baseObject:this._baseObjects[t]}}_getIndex(t){return null==t&&(t=this.faceIndex||this.index),t}_init(){const t=this.getLayer().getPick();this.on("add",(()=>{t.add(this.pickObject3d)})),this.on("remove",(()=>{t.remove(this.pickObject3d)}))}_setPickObject3d(){if(!this._colorMap)return;const t=this._geometryCache||this.getObject3d().geometry.clone(),e=this.getLayer().getPick(),{_geometriesAttributes:n}=this,r=n.length,i=be(n);let s=0;for(let t=0;t<r;t++){const r=e.getColor(),o=r.getHex();this._colorMap[o]=t;const{count:a}=n[t].position;this._datas[t].colorIndex=o;for(let t=0;t<a;t++)i[s]=r.r,i[s+1]=r.g,i[s+2]=r.b,s+=3}R(t,"color",new o.BufferAttribute(i,3,!0));const a=e.getColor().getHex(),u=new o.Mesh(t,er);u.position.copy(this.getObject3d().position),u._colorIndex=a,this.setPickObject3d(u)}},rr={altitude:0,height:1,bottomHeight:0,topColor:null,bottomColor:"#2d2f61"},ir=new i.Coordinate(0,0);class or extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const o=t.length;0===o&&console.error("polygons is empty");let s=1/0,a=1/0,u=-1/0,l=-1/0;for(let e=0;e<o;e++){const n=t[e],r=n.getCenter?n.getCenter():nt(n,ir);let o,h;Array.isArray(r)?(o=r[0],h=r[1]):r instanceof i.Coordinate&&(o=r.x,h=r.y),s=Math.min(s,o),a=Math.min(a,h),u=Math.max(u,o),l=Math.max(l,h)}const h=new i.Coordinate((s+u)/2,(a+l)/2);e=i.Util.extend({},rr,e,{layer:r,polygons:t,coordinate:h});const{topColor:c,bottomColor:f,altitude:p,asynchronous:d}=e;let g;const y=[],v=[];if(super(),d)g=Sn(),ln.push({id:i.Util.GUID(),layer:r,key:e.key,center:h,data:t,baseObject:this,option:e});else{const s=r.coordinateToVector3(h),a=[];let u=0;const l={};for(let n=0;n<o;n++){const o=t[n],c=i.Util.extend({},e,Se(o)),f=c.height||1,p=c.bottomHeight||0,d=ke(o,f,r,h,s,l);a.push(d);const g=we(d,p,r,l),{position:y,normal:m,uv:A,indices:_}=d;_.length;const x=y.length/3;m.length,A.length,v[n]={position:{middleZ:g+l[f]/2,count:x,start:u,end:u+3*x},hide:!1},u+=3*x}g=xn(a),c&&(Pe(g,f,c,v),n.vertexColors=O())}this._initOptions(e),this._createMesh(g,n);const m=r.altitudeToVector3(p,p).x,A=r.coordinateToVector3(h,m);this.getObject3d().position.copy(A),this._baseObjects=y,this._datas=t,this._geometriesAttributes=v,this.faceIndex=null,this._geometryCache=In(g),this.isHide=!1,this._colorMap={},this._initBaseObjectsEvent(y),d||(this._setPickObject3d(),this._init()),this.type="ExtrudePolygons"}getSelectMesh(){const t=this._getIndex();if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],n=Object.assign({},this.options,K(e)?e.properties:e.getProperties(),{index:t});this._baseObjects[t]=new Vn(e,n,this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}identify(t){return this.picked}_workerLoad(t){const{geometriesAttributes:e}=t;this._geometriesAttributes=e;const n=En(t);this._geometryCache=In(n);const{topColor:r,bottomColor:i}=this.getOptions(),o=this.getObject3d(),s=o.material;if(r&&(Pe(n,i,r,e),s.vertexColors=O()),o.geometry=n,o.material.needsUpdate=!0,this._setPickObject3d(),this._init(),this.isAdd){this.getLayer().getPick().add(this.pickObject3d)}this._fire("workerload",{target:this})}}function sr(t,e,n){const r=t.project(n),i=e.width/2,o=e.height/2;return{x:Math.round(r.x*i+i),y:Math.round(-r.y*o+o)}}const ar={altitude:0,height:0,color:null},ur=new o.Vector3;class lr extends W{constructor(t,e,n,r){e=i.Util.extend({},ar,e,{layer:r,coordinate:t}),super();let{height:s,altitude:a,color:u,size:l}=e;const h=[],c=[];u&&(u=u instanceof o.Color?u:new o.Color(u),c.push(u.r,u.g,u.b));const f=r.altitudeToVector3(s,s).x,p=r.coordinateToVector3(t,f);h.push(0,0,p.z);const d=new o.BufferGeometry;R(d,"position",new o.Float32BufferAttribute(h,3,!0)),c.length&&R(d,"color",new o.Float32BufferAttribute(c,3,!0)),void 0!==l&&R(d,"size",new o.Float32BufferAttribute([l],1,!0)),e.positions=p,this._initOptions(e),this._createPoints(d,n);const g=r.altitudeToVector3(a,a).x,y=new o.Vector3(p.x,p.y,g);this.getObject3d().position.copy(y),this.type="Point"}identify(t){const e=this.getLayer(),n=this.getMap().getSize(),r=this.getLayer().getCamera(),i=this.getOptions().positions,o=this.getOptions().altitude;let s=this.getObject3d().material.size;void 0===s&&(s=this.options.size||1);const a=this.getMap().coordToContainerPoint(t),u=e.altitudeToVector3(o,o).x;ur.x=i.x,ur.y=i.y,ur.z=i.z+u;const l=sr(ur,n,r);return Math.sqrt(Math.pow(a.x-l.x,2)+Math.pow(a.y-l.y,2))<=s/2}}function hr(t,e){const{minx:n,miny:r,maxx:i,maxy:o}=t,[s,a]=e;return n<=s&&s<=i&&r<=a&&a<=o}class cr{constructor(t,e,n,r){this.minlng=t,this.minlat=e,this.maxlng=n,this.maxlat=r,this.minx=1/0,this.miny=1/0,this.maxx=-1/0,this.maxy=-1/0,this.coordinates=[],this.positions=[],this.indexs=[],this.key=null}updateBBoxPixel(t){let e=1/0,n=1/0,r=-1/0,o=-1/0;const{minlng:s,minlat:a,maxlng:u,maxlat:l}=this;return[[s,a],[s,l],[u,a],[u,l]].map((t=>new i.Coordinate(t))).map((e=>t.coordToContainerPoint(e))).forEach((t=>{e=Math.min(e,t.x),n=Math.min(n,t.y),r=Math.max(r,t.x),o=Math.max(o,t.y)})),this.minx=e,this.miny=n,this.maxx=r,this.maxy=o,this}containsCoordinate(t){let e,n;Array.isArray(t)?(e=t[0],n=t[1]):t instanceof i.Coordinate&&(e=t.x,n=t.y);const{minlng:r,minlat:o,maxlng:s,maxlat:a}=this;return r<=e&&e<=s&&o<=n&&n<=a}isRecCross(t,e){const{x:n,y:r}=t,i={minx:n-e/2,miny:r-e/2,maxx:n+e/2,maxy:r+e/2},{minx:o,miny:s,maxx:a,maxy:u}=i;return!!(hr(this,[o,s])||hr(this,[o,u])||hr(this,[a,s])||hr(this,[a,u])||hr(i,[this.minx,this.miny])||hr(i,[this.minx,this.maxy])||hr(i,[this.maxx,this.miny])||hr(i,[this.maxx,this.maxy]))}static initGrids(t,e,n,r){const i=[],o=(n-t)/30,s=(r-e)/30;let a=t,u=e;for(let n=0;n<30;n++){a=t+n*o;for(let t=0;t<30;t++){u=e+t*s;const r=new cr(a,u,a+o,u+s);r.key=t+"-"+n,i.push(r)}}return{grids:i,averageX:o,averageY:s,ROWS:30,COLS:30}}}const fr={altitude:0},pr=new o.Vector3;function dr(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}class gr extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]),e=i.Util.extend({},fr,e,{layer:r,points:t});let s=1/0,a=1/0,u=-1/0,l=-1/0;for(let e=0,n=t.length;e<n;e++){const{coordinate:n}=t[e];let r,o;Array.isArray(n)?(r=n[0],o=n[1]):n instanceof i.Coordinate&&(r=n.x,o=n.y),t[e].coords=[r,o],s=Math.min(s,r),a=Math.min(a,o),u=Math.max(u,r),l=Math.max(l,o)}const h=r.coordinateToVector3([(s+u)/2,(a+l)/2]),{grids:c,averageX:f,averageY:p,ROWS:d,COLS:g}=cr.initGrids(s,a,u,l);c.length;const y=new Float32Array(3*t.length),v=[],m=new Float32Array(3*t.length),A=new Float32Array(t.length),_=[],x=[],w={};let b=0,E=!1,I=!1;const C=new o.Vector3(0,0,0);for(let e=0,n=t.length;e<n;e++){let{coordinate:n,height:i,color:u,size:l,coords:g}=t[e];const _=3*e;u&&(E=!0,u=u instanceof o.Color?u:new o.Color(u),m[_]=u.r,m[_+1]=u.g,m[_+2]=u.b),l&&(I=!0,A[e]=l,b=Math.max(b,l));const S=_e(i,r,w),M=r.coordinateToVector3(n,S);C.x=M.x,C.y=M.y,C.z=M.z,C.sub(h),y[_]=C.x,y[_+1]=C.y,y[_+2]=C.z,v.push(M),x[e]={position:{count:1,start:3*e,end:3*e+3},hide:!1};let B=dr((g[1]-a)/p,4),T=dr((g[0]-s)/f,4);B-=1,T-=1,B=Math.max(0,B),T=Math.max(0,T),B=Math.ceil(B),T=Math.ceil(T);const k=T*d+B;c[k]&&(c[k].positions.push(M),c[k].indexs.push(e))}const S=new o.BufferGeometry;R(S,"position",new o.BufferAttribute(y,3,!0)),E&&R(S,"color",new o.BufferAttribute(m,3,!0)),I&&R(S,"size",new o.BufferAttribute(A,1,!0)),e.positions=v,super(),this._initOptions(e),this._createPoints(S,n);const M=e.altitude,B=r.altitudeToVector3(M,M).x,T=h.clone();T.z=B,this.getObject3d().position.copy(T),this._baseObjects=_,this._datas=t,this.faceIndex=null,this._geometriesAttributes=x,this._geometryCache=S.clone(),this.isHide=!1,this._initBaseObjectsEvent(_),this._grids=c,this._bindMapEvents(),this.type="Points",this.maxSize=b}_bindMapEvents(){const t=this.getMap(),e="zoomstart zooming zoomend movestart moving moveend pitch rotate";this.on("add",(()=>{this._updateGrids(),t.on(e,this._updateGrids,this)})),this.on("remove",(()=>{t.off(e,this._updateGrids,this)}))}_updateGrids(){const t=this.getMap();this._grids.forEach((e=>{e.indexs.length&&e.updateBBoxPixel(t)}))}getSelectMesh(){const t=this.faceIndex;if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],{coordinate:n,height:r,color:i,size:o}=e;this._baseObjects[t]=new lr(n,{height:r,index:t,color:i,size:o},this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}identify(t){const e=this.getLayer(),n=this.getMap().getSize(),r=this.getLayer().getCamera(),i=this.getOptions().altitude,o=this.getMap(),s=e.altitudeToVector3(i,i).x;let a=this.getObject3d().material.size;const u=void 0===a,l=o.coordToContainerPoint(t),h=[];if(this._grids.forEach((t=>{t.indexs.length&&t.isRecCross(l,u?this.maxSize:a)&&h.push(t)})),h.length<1)return!1;for(let t=0,e=h.length;t<e;t++)for(let e=h[t].positions.length-1;e>=0;e--){u&&(a=this._datas[h[t].indexs[e]].size||1);const i=h[t].positions[e];pr.x=i.x,pr.y=i.y,pr.z=i.z+s;const o=sr(pr,n,r);if(Math.sqrt(Math.pow(l.x-o.x,2)+Math.pow(l.y-o.y,2))<=a/2)return this.faceIndex=h[t].indexs[e],!0}return!1}}const yr={coordinate:"",radius:10,height:100,radialSegments:6,altitude:0,topColor:"",bottomColor:"#2d2f61"};class vr extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const s=t.length,a=xe(t),u=r.coordinateToVector3(a),l=[],h=[],c=[];let f=0;const p={},d={};let g;super(),e=i.Util.extend({},{altitude:0,layer:r,points:t},yr,e),this._initOptions(e);const y=new o.Vector3;if(e.asynchronous){g=Sn();const n=i.Util.GUID();this.getOptions().id=n;const o=[];for(let n=0;n<s;n++){const s=i.Util.extend({index:n},e,t[n]),{radius:a,radialSegments:l,altitude:h,height:c,coordinate:f}=s,g=Ae(a,r,p);t[n]._radius=g;const v=_e(c,r,d),m=_e(h,r,d),A=r.coordinateToVector3(f,0,y).sub(u);o.push({radialSegments:l,radius:g,height:v,center:[A.x,A.y],altitude:m})}vn.push({id:n,data:o,layer:r,baseObject:this})}else{for(let o=0;o<s;o++){const s=i.Util.extend({index:o},e,t[o]),{radius:a,radialSegments:g,altitude:v,topColor:m,bottomColor:A,height:_,coordinate:x}=s,w=Ae(a,r,p),b=_e(_,r,d),E=_e(v,r,d),I=r.coordinateToVector3(x,0,y).sub(u),C=Pn({radius:w,height:b,radialSegments:g,center:[I.x,I.y]});m&&(Ln(C,A,m,"z",b/2),n.vertexColors=O());const S=C.attributes.position.array;for(let t=0,e=S.length;t<e;t+=3)S[t+2]+=E;l.push(C);const M=new Nn(x,s,n,r);h.push(M),C.index.count;const B=C.attributes.position.count;C.attributes.normal.count,C.attributes.uv.count,c[o]={position:{count:B,start:f,end:f+3*B},hide:!1},f+=3*B}g=Rn(l)}this._createMesh(g,n);const v=e.altitude,m=r.altitudeToVector3(v,v).x,A=u.clone();A.z=m,this.getObject3d().position.copy(A),this._baseObjects=h,this._datas=t,this._geometriesAttributes=c,this.faceIndex=null,this._geometryCache=In(g),this.isHide=!1,this._colorMap={},this._initBaseObjectsEvent(h),e.asynchronous||(this._setPickObject3d(),this._init()),this.type="Bars"}identify(){return this.picked}getSelectMesh(){const t=this._getIndex();if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],n=Object.assign({},this.options,e,{index:t,asynchronous:!1});this._baseObjects[t]=new Nn(e.coordinate,n,this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}_workerLoad(t){const{geometriesAttributes:e}=t;this._geometriesAttributes=e;const n=En(t);this._geometryCache=In(n);const{topColor:r,bottomColor:i}=this.getOptions(),o=this.getObject3d(),s=o.material;if(r&&(Ln(n,i,r,"z",e),s.vertexColors=O()),o.geometry=n,o.material.needsUpdate=!0,this._setPickObject3d(),this._init(),this.isAdd){this.getLayer().getPick().add(this.pickObject3d)}this._fire("workerload",{target:this})}}const mr={width:3,height:1,altitude:0,topColor:null,bottomColor:"#2d2f61"};class Ar extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const o=[],s=[],a=t.length;for(let e=0;e<a;e++){const n=Ve(t[e]);o.push(n.center),s.push(n.lineStrings)}const u=xe(o);e=i.Util.extend({},mr,e,{layer:r,lineStrings:t,coordinate:u});const{altitude:l,topColor:h,bottomColor:c,asynchronous:f}=e;let p;const d=[],g=[];if(super(),f)p=Sn(),cn.push({id:i.Util.GUID(),layer:r,key:e.key,center:u,data:s,lineStrings:t,baseObject:this,option:e});else{const o=[];let l=0;const f={},d={};for(let n=0;n<a;n++){const a=t[n],h=i.Util.extend({},e,Me(a),{index:n}),{height:c,width:p,bottomHeight:y}=h,v=Ae(p,r,f),m=_e(c,r,d),A=s[n],_=[];let x=0;for(let t=0,e=A.length;t<e;t++){const e=ze(A[t],v,m,r,u);x=we(e,y,r,f),_.push(e)}const w=wn(_);o.push(w);const{position:b,normal:E,indices:I}=w;I.length;const C=b.length/3;E.length,g[n]={position:{middleZ:x+m/2,count:C,start:l,end:l+3*C},hide:!1},l+=3*C}p=xn(o),h&&(Pe(p,c,h,g),n.vertexColors=O())}this._initOptions(e),this._createMesh(p,n);const y=r.altitudeToVector3(l,l).x,v=r.coordinateToVector3(u,y);this.getObject3d().position.copy(v),this._baseObjects=d,this._datas=t,this._geometriesAttributes=g,this.faceIndex=null,this._geometryCache=In(p),this.isHide=!1,this._colorMap={},this._initBaseObjectsEvent(d),f||(this._setPickObject3d(),this._init()),this.type="ExtrudeLines"}getSelectMesh(){const t=this._getIndex();if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],n=Object.assign({},this.options,Z(e)?e.properties:e.getProperties(),{index:t});this._baseObjects[t]=new zn(e,n,this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}identify(t){return this.picked}_workerLoad(t){const{geometriesAttributes:e}=t;this._geometriesAttributes=e;const n=En(t);this._geometryCache=In(n);const{topColor:r,bottomColor:i,bottomHeight:o,height:s}=this.getOptions(),a=this.getObject3d().material;if(r&&(Pe(n,i,r,e),a.vertexColors=O()),this.getObject3d().geometry=n,this.getObject3d().material.needsUpdate=!0,this._setPickObject3d(),this._init(),this.isAdd){this.getLayer().getPick().add(this.pickObject3d)}this._fire("workerload",{target:this})}}const _r={altitude:0,colors:null};class xr extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const s=[],a=[],u=t.length;for(let e=0;e<u;e++){const n=Ve(t[e]);s.push(n.center),a.push(n.lineStrings)}const l=xe(s);e=i.Util.extend({},_r,e,{layer:r,lineStrings:t,coordinate:l}),super(),this._initOptions(e);const{asynchronous:h}=e;let c;const f=[],p={};let d=[],g=0,y=[];if(h)c=Xe(),pn.push({id:i.Util.GUID(),layer:r,key:e.key,center:l,data:a,lineStrings:t,baseObject:this,option:e});else{for(let t=0;t<u;t++){const n=a[t];let o=0;for(let t=0,s=n.length;t<s;t++){const s=Me(n[t]),a=i.Util.extend({},e,s),{positions:u}=Ue(n[t],r,l,!1);we(u,a.bottomHeight,r,p),o+=u.length/3*2-2,y.push(qe(u))}d[t]={position:{count:o,start:g,end:g+3*o},hide:!1},g+=3*o}const t=He(y);c=new o.BufferGeometry,R(c,"position",new o.BufferAttribute(t,3))}this._createLineSegments(c,n);const{altitude:v}=e,m=r.altitudeToVector3(v,v).x,A=r.coordinateToVector3(l,m);this.getObject3d().position.copy(A),this._baseObjects=f,this._datas=t,this._geometriesAttributes=d,this.faceIndex=null,this.index=null,this._geometryCache=c.clone(),this.isHide=!1,this._colorMap={},this._initBaseObjectsEvent(f),h||(this._setPickObject3d(),this._init()),this.type="Lines"}getSelectMesh(){const t=this._getIndex();if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],n=i.Util.extend({},this.getOptions(),{index:t},Z(e)?e.properties:e.getProperties());this._baseObjects[t]=new Qn(e,n,this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}_setPickObject3d(){if(!this._colorMap)return;const t=this._geometryCache||this.getObject3d().geometry.clone(),e=this.getLayer().getPick(),{_geometriesAttributes:n}=this,r=n.length,i=be(n);let s=0;for(let t=0;t<r;t++){const r=e.getColor(),o=r.getHex();this._colorMap[o]=t;const{count:a}=n[t].position;this._datas[t].colorIndex=o;for(let t=0;t<a;t++)i[s]=r.r,i[s+1]=r.g,i[s+2]=r.b,s+=3}R(t,"color",new o.BufferAttribute(i,3,!0));const a=this.getObject3d().material.clone();a.color.set("#fff"),a.vertexColors=O();const u=e.getColor().getHex(),l=new o.LineSegments(t,a);l.position.copy(this.getObject3d().position),l._colorIndex=u,this.setPickObject3d(l)}identify(t){return this.picked}_workerLoad(t){const{position:e,geometriesAttributes:n}=t;this._geometriesAttributes=n;const r=new o.BufferGeometry;if(R(r,"position",new o.BufferAttribute(new Float32Array(e),3)),this._computeLineDistances(r),this._geometryCache=r.clone(),this.getObject3d().geometry=r,this.getObject3d().material.needsUpdate=!0,this._setPickObject3d(),this._init(),this.isAdd){this.getLayer().getPick().add(this.pickObject3d)}this._fire("workerload",{target:this})}}const wr=[],br=[];function Er(){return{waitingQueue:wr,currentQueue:br}}function Ir(t,e){for(let n=0,r=t.length;n<r;n++){const r=t[n];if(r){const{key:i,callback:o}=r;if(e===i)return t.splice(n,1),o}}return null}const Cr=document.createElement("canvas");let Sr;function Mr(t,e=!1){if(Sr)return Sr;const n=Cr.getContext("2d");return n.clearRect(0,0,256,256),n.save(),Sr=Cr.toDataURL(),Sr}function Br(t=1,e=1){let n;return"undefined"==typeof document||(n=document.createElement("canvas"),t&&(n.width=t),e&&(n.height=e)),n}Cr.width=Cr.height=256;class Tr extends i.TileLayer{constructor(t,e={}){super(i.Util.GUID(),i.Util.extend({urlTemplate:t},e)),this._opts=null,this._layer=null,this.material=null,this.getMaterial=null,this._baseObjectKeys={},this._loadTiles={},this._add=null,this._layerLaodTime=(new Date).getTime()}isAsynchronous(){return this._opts.worker}getBaseObjects(){const t=this._loadTiles,e=[];for(let n in t){const t=this._baseObjectKeys[n];if(t&&Array.isArray(t)&&t.length)for(let n=0,r=t.length;n<r;n++)e.push(t[n])}return e}onSelectMesh(t,e){}formatBaseObjects(t,e){return[]}loopMessage(t){}getTileData(t){const{key:e,url:n,callback:r,img:o}=t;i.Ajax.getJSON(n,{},(function(t,n){t?(console.error(t),r(e,null,o)):r(e,n,o)}))}_getCurentTileKeys(){const t=this.getTiles().tileGrids||[],e=[],n={};for(let r=0,i=t.length;r<i;r++){const i=t[r].tiles||[];for(let t=0,r=i.length;t<r;t++){const{id:r}=i[t];e.push(r),n[r]=!0}}return{keys:e,keysMap:n}}_isLoad(){const{keys:t}=this._getCurentTileKeys(),e=Object.keys(this._renderer.tilesInView);return t.length===e.length}_layerOnLoad(){const t=(new Date).getTime();if(t-this._layerLaodTime<20)return;this._layerLaodTime=t;const e=this._renderer.tilesInView,n=this._loadTiles,r=this._layer,i=this._baseObjectKeys,o=Object.keys(e).length,s=Object.keys(n).length,a=[];if(o&&s)for(let t in n)e[t]||i[t]&&(i[t]||[]).forEach((t=>{a.push(t)}));if(a.length&&r.removeMesh(a,!1),o&&s)for(let t in e)if(!n[t])if(i[t]){const e=i[t];r.addMesh(e)}else{const{x:e,y:n,z:r}=this._getXYZOfIndex(t);this.getTileUrl(e,n,r)}this._loadTiles=Object.assign({},e),this._diffCache()}_init(){}_workerLoad(t){const e=t.target._img;e.currentCount++,e.currentCount===e.needCount&&(e.src=Mr(e._key,this._opts.debug))}_generateBaseObjects(t,e,n){if(e&&n){const{keysMap:r}=this._getCurentTileKeys();if(!r[t])return void(n.src=Mr(0,this._opts.debug));const i=this.formatBaseObjects(t,e);if(i.length){n.needCount=i.length,n.currentCount=0;for(let e=0,r=i.length;e<r;e++){const r=i[e];r._img=n,r._vt=this,this.isVisible()||r.hide(),this._cachetile(t,r),r.isAsynchronous()||n.currentCount++}this._layer.addMesh(i,!1),n.needCount===n.currentCount&&(n.src=Mr(0,this._opts.debug)),this.isAsynchronous()?i.filter((t=>t.isAsynchronous())).forEach((t=>{t.on("workerload",this._workerLoad,this)})):n.src=Mr(0,this._opts.debug)}else n.src=Mr(0,this._opts.debug);this._loadTiles[t]=!0}else n&&(n.src=Mr(0,this._opts.debug))}_diffCache(){if(Object.keys(this._baseObjectKeys).length>this._renderer.tileCache.max){const t=this._renderer.tileCache.data,e=this._renderer.tilesInView,n=[];for(let r in this._baseObjectKeys)t[r]||e[r]||((this._baseObjectKeys[r]||[]).forEach((t=>{t.isAdd&&n.push(t)})),this._diposeBaseObject(r),delete this._baseObjectKeys[r]);n.length&&this._layer.removeMesh(n,!1)}}_diposeBaseObject(t){const e=this._baseObjectKeys[t];e&&e.length&&e.forEach((t=>{t.getObject3d().geometry.dispose(),t._geometryCache&&t._geometryCache.dispose();const e=t._baseObjects;e&&e.length&&e.forEach((t=>{t.getObject3d().geometry.dispose(),t=null})),t._datas=null,t._geometriesAttributes=null,t._faceMap=null,t._colorMap=null,t.pickObject3d&&t.pickObject3d.geometry.dispose(),t=null}))}_cachetile(t,e){this._baseObjectKeys[t]||(this._baseObjectKeys[t]=[]),this._baseObjectKeys[t].push(e)}_getXYZOfIndex(t){const e=t.indexOf("_")>-1?"_":"-";let[n,r,i]=t.split(e).slice(1,4);return{x:parseInt(r),y:parseInt(n),z:parseInt(i)}}_getTileExtent(t,e,n){const r=this.getMap()._getResolution(n);return this._getTileConfig().getTilePrjExtent(t,e,r)}_getTileLngLatExtent(t,e,n){const r=this._getTileExtent(t,e,n);let o=r.getMax(),s=r.getMin();const a=this.getMap().getProjection();return s=a.unproject(s),o=a.unproject(o),new i.Extent(s,o)}}const kr={worker:!1};class Pr extends Tr{constructor(t,e={},n,r){super(i.Util.GUID(),i.Util.extend({urlTemplate:t},kr,e)),this._opts=e,this._layer=r,this.getMaterial=n,this._baseObjectKeys={},this._loadTiles={},this._add=null,this._layerLaodTime=(new Date).getTime(),this._init()}formatBaseObjects(t,e){const n=this._opts,r=[],s=this.isAsynchronous();for(let a in e){const u=e[a]||{};let l;if(Array.isArray(u)?l=u:"FeatureCollection"===u.type&&(l=u.features),l&&l.length){const e=[],h=[],c=[];for(let t=0,n=l.length;t<n;t++){const n=l[t];if(K(n))e.push(n);else if(Z(n)){const t=rt(n);for(let e=0,n=t.length;e<n;e++)h.push(t[e])}else if($(n)){const t=rt(n);for(let e=0,n=t.length;e<n;e++)c.push(i.Util.extend({},t[e].properties,t[e],{coordinate:et(t[e])}))}}if(e.length){const o=this._getMaterial(a,e,t,u);if(o){const u=this._layer.toExtrudePolygons(e,i.Util.extend({},{topColor:"#fff",layerName:a,asynchronous:s,key:t},n),o);r.push(u)}}if(h.length){const e=this._getMaterial(a,h,t,u);if(e&&(e instanceof o.LineBasicMaterial||e instanceof o.LineDashedMaterial)){const t=this._layer.toLines(h,i.Util.extend({},{layerName:a,asynchronous:s},n),e);r.push(t)}}if(c.length){const e=this._getMaterial(a,c,t,u);if(e&&e instanceof o.PointsMaterial){const t=this._layer.toPoints(c,i.Util.extend({},{layerName:a,asynchronous:s},n),e);r.push(t)}}}}return r}loopMessage(t){const{currentQueue:e}=Er();e.length>0&&this.getTileData(t)}_init(){this.on("layerload",this._layerOnLoad),this.on("add",(()=>{if(!1===this._add){const t=this.getBaseObjects();this._layer.addMesh(t)}this._add=!0,this.intervalId=setInterval((()=>{this._isLoad()&&!this._layer.getMap().isInteracting()&&this.fire("layerload")}),1e3)})),this.on("remove",(()=>{this._add=!1;const t=this.getBaseObjects();this._layer.removeMesh(t),clearInterval(this.intervalId)})),this.on("show",(()=>{this.getBaseObjects().forEach((t=>{t.show()}));for(let t in this._baseObjectKeys){(this._baseObjectKeys[t]||[]).forEach((t=>{t.show()}))}})),this.on("hide",(()=>{this.getBaseObjects().forEach((t=>{t.hide()}));for(let t in this._baseObjectKeys){(this._baseObjectKeys[t]||[]).forEach((t=>{t.hide()}))}})),this.on("renderercreate",(t=>{t.renderer.loadTile=function(t){var e=this.layer.getTileSize(),n=new Image;return n.width=e.width,n.height=e.height,n.onload=this.onTileLoad.bind(this,n,t),n.onerror=this.onTileError.bind(this,n,t),this.loadTileImage(n,t.url,t.id),n},t.renderer.deleteTile=function(t){if(!t||!t.image)return;t.image.onload=null,t.image.onerror=null;!function(t){const e=Ir(wr,t);e&&e(t)}((t.info||{}).id)},t.renderer.loadTileImage=(t,e,n)=>{t._key=n,function(t,e,n,r,i){const o={key:t,url:e,callback:n,img:r,vt:i};br.length<10?(br.push(o),i.loopMessage(o)):wr.push(o)}(n,e,((t,e,n)=>{this._generateBaseObjects(t,e,n),function(t,e){if(Ir(br,t),wr.length){br.push(wr[0]),wr.splice(0,1);const t=br[br.length-1];e.loopMessage(t)}}(t,this)}),t,this)}}))}_getMaterial(t,e,n,r){return this.getMaterial&&i.Util.isFunction(this.getMaterial)?this.getMaterial(t,e,n,r):null}}function Lr(t,e,n,r){const{position:i,uv:s,normal:a,indexs:u}=function(t,e,n,r){const i=t/n,o=e/r,s=-t/2,a=e/2,u=-e/2,l=(n+1)*(r+1),h=new Float32Array(3*l),c=new Float32Array(2*l),f=new Float32Array(3*l),p=new Uint32Array(10*l);let d=0,g=0,y=0;for(let l=0;l<=r;l++)for(let v=0;v<=n;v++){const m=s+i*v,A=a-o*l;h[d]=m,h[d+1]=A,h[d+2]=0,f[d]=0,f[d+1]=0,f[d+2]=1;const _=(m-s)/t,x=(A-u)/e;if(c[g]=_,c[g+1]=x,d+=3,g+=2,v<n&&l<r){const t=l*(n+1)+v,e=t+1,r=(n+1)*(l+1)+v,i=r+1;p[y]=t,p[y+1]=r,p[y+2]=e,p[y+3]=r,p[y+4]=i,p[y+5]=e,y+=6}}const v=new Uint32Array(y);for(let t=0,e=v.length;t<e;t++)v[t]=p[t];return{position:h,uv:c,normal:f,indexs:v}}(t,e,n,r),l=new o.BufferGeometry;return R(l,"position",new o.BufferAttribute(i,3)),R(l,"normal",new o.BufferAttribute(a,3)),R(l,"uv",new o.BufferAttribute(s,2)),l.setIndex(new o.BufferAttribute(u,1)),l}const Rr=new o.TextureLoader,Dr=document.createElement("canvas");function Or(t){if(!t)return null;let e;return"string"==typeof t?(e=new Image,e.src=t):t instanceof HTMLCanvasElement?(e=new Image,e.src=t.toDataURL()):t instanceof Image&&(e=new Image,e.src=t.src,e.crossOrigin=t.crossOrigin),e&&!e.crossOrigin&&(e.crossOrigin="Anonymous"),e}const Nr=new Map;function Fr(t,e,n,r){if(!e||!n)return;const{imageWidth:i,imageHeight:s,flaserBoundary:a}=r;let u;if(u=t instanceof Uint32Array||t instanceof Uint8ClampedArray?t:function(t,e=256,n=256){Dr.width=e,Dr.height=n;const r=Dr.getContext("2d");return r.drawImage(t,0,0,e,n),r.getImageData(0,0,e,n).data}(t,i,s),!u)return void console.error("image is error type data",t);let l=0,h=0,c=0;const f=new o.Vector3,p=Nr;for(let t=0,r=u.length;t<r;t+=4){const r=.1*(256*u[t]*256+256*u[t+1]+u[t+2])-1e4;let o=0;if(0!==h&&h+1!==s&&0!==c&&c+1!==i||!a){const t=p.get(r);void 0!==t?o=t:(o=n.altitudeToVector3(r,r,null,f).x,p.set(r,o))}e.attributes.position.array[3*l+2]=o,l++,c++,c===i&&(h++,c=0)}e.attributes.position.needsUpdate=!0}const Ur={interactive:!1,altitude:0,image:null,imageWidth:256,imageHeight:256,texture:null,flaserBoundary:!0,bufferPixel:1};class Qr extends W{constructor(t,e,n,r){e=i.Util.extend({},Ur,e,{layer:r,extent:t});const{texture:o,image:s,altitude:a,imageHeight:u,imageWidth:l,flaserBoundary:h,bufferPixel:c}=e;t instanceof i.Extent||(t=new i.Extent(t));const{xmin:f,ymin:p,xmax:d,ymax:g}=t;let y=1/0,v=1/0,m=-1/0,A=-1/0;[[f,p],[f,g],[d,g],[d,p]].forEach((t=>{const e=r.coordinateToVector3(t),{x:n,y:i}=e;y=Math.min(n,y),v=Math.min(i,v),m=Math.max(n,m),A=Math.max(i,A)}));const _=(m-y)/l,x=(A-v)/u;y-=_*c,m+=_*c,v-=x*c,A+=x*c;const w=Math.abs(m-y),b=Math.abs(A-v),E=Or(s),I=Or(o),C=Lr(w,b,l-1,u-1);super(),this._initOptions(e),this._createMesh(C,n);const S=r.altitudeToVector3(a,a).x,M=r.coordinateToVector3(t.getCenter(),S);this.getObject3d().position.copy(M),n.transparent=!0,E&&(E.onload=()=>{Fr(E,C,r,{imageWidth:l,imageHeight:u,flaserBoundary:h}),this.fire("dataload",{})},E.onerror=function(){console.error(`not load ${E.src}`),this.fire("dataerror",{})}),I?(n.opacity=0,Rr.load(I.src,(t=>{n.map=t,n.opacity=1,n.needsUpdate=!0,this.fire("textureload",{})}))):n.opacity=1,this.type="Terrain"}updateData(t){return Fr(t,this.getObject3d().geometry,this.getLayer(),this.getOptions()),this.fire("updatedata",{}),this}}const Gr={scale:1,tileDivisor:4};class zr extends Tr{constructor(t,e={},n,r){super(i.Util.GUID(),i.Util.extend({urlTemplate:t},Gr,e)),this._opts=e,this._layer=r,this.material=n,this._baseObjectKeys={},this._loadTiles={},this._add=null,this._imgQueue={},this._layerLaodTime=(new Date).getTime(),this._init()}isAsynchronous(){return!1}formatBaseObjects(t,e){const n=this.options,r=[],{scale:i,tileDivisor:o}=n,{x:s,y:a,z:u}=this._getXYZOfIndex(t),l=this.getMap().getZoom(),h=this.getTileUrl(s,a,u),[c,f]=this.options.tileSize,p=this._getTileLngLatExtent(s,a,u),d=this.material.clone();if(u+1>=Math.round(l)){const t=new Qr(p,{image:e,imageWidth:c/o,imageHeight:f/o,texture:h},d,this._layer);t.getObject3d().scale.set(i,i,1),r.push(t)}return r}loopMessage(t){this.getTileData(t)}_init(){this.on("layerload",this._layerOnLoad),this.on("add",(()=>{if(!1===this._add){const t=this.getBaseObjects();this._layer.addMesh(t)}this._add=!0,this.intervalId=setInterval((()=>{this._isLoad()&&!this._layer.getMap().isInteracting()&&this.fire("layerload")}),1e3)})),this.on("remove",(()=>{this._add=!1;const t=this.getBaseObjects();this._layer.removeMesh(t),clearInterval(this.intervalId)})),this.on("show",(()=>{this.getBaseObjects().forEach((t=>{t.show()}));for(let t in this._baseObjectKeys){(this._baseObjectKeys[t]||[]).forEach((t=>{t.show()}))}})),this.on("hide",(()=>{this.getBaseObjects().forEach((t=>{t.hide()}));for(let t in this._baseObjectKeys){(this._baseObjectKeys[t]||[]).forEach((t=>{t.hide()}))}})),this.on("renderercreate",(t=>{t.renderer.loadTile=function(t){var e=this.layer.getTileSize(),n=new Image;return n.width=e.width,n.height=e.height,n.onload=this.onTileLoad.bind(this,n,t),n.onerror=this.onTileError.bind(this,n,t),this.loadTileImage(n,t.url,t.id),n},t.renderer.deleteTile=t=>{if(!t||!t.image)return;t.image.onload=null,t.image.onerror=null;const e=t.info||{},n=this._imgQueue[e.id];n&&(n.src="",n.onload=null,n.onerror=null,delete this._imgQueue[e.id])},t.renderer.loadTileImage=(t,e,n)=>{t._key=n;const r=new Image;this._imgQueue[n]=r;const i={key:n,url:e,rgbImage:r,callback:(t,e,n)=>{this._generateBaseObjects(t,e,n)},img:t,vt:this};this.loopMessage(i)}}))}}
|
|
4
|
+
*/function it(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ot(t,e){return ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ot(t,e)}function st(t,e,n){void 0===n&&(n=2);var r,i,o,s=e&&e.length,a=s?e[0]*n:t.length,u=at(t,0,a,n,!0),l=[];if(!u||u.next===u.prev)return l;if(s&&(u=function(t,e,n,r){for(var i=[],o=0,s=e.length;o<s;o++){var a=at(t,e[o]*r,o<s-1?e[o+1]*r:t.length,r,!1);a===a.next&&(a.steiner=!0),i.push(mt(a))}i.sort(dt);for(var u=0;u<i.length;u++)n=gt(i[u],n);return n}(t,e,u,n)),t.length>80*n){r=1/0,i=1/0;for(var h=-1/0,c=-1/0,f=n;f<a;f+=n){var p=t[f],d=t[f+1];p<r&&(r=p),d<i&&(i=d),p>h&&(h=p),d>c&&(c=d)}o=0!==(o=Math.max(h-r,c-i))?32767/o:0}return lt(u,l,n,r,i,o,0),l}function at(t,e,n,r,i){var o;if(i===function(t,e,n,r){for(var i=0,o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}(t,e,n,r)>0)for(var s=e;s<n;s+=r)o=Bt(s/r|0,t[s],t[s+1],o);else for(var a=n-r;a>=e;a-=r)o=Bt(a/r|0,t[a],t[a+1],o);return o&&bt(o,o.next)&&(Tt(o),o=o.next),o}function ut(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!bt(r,r.next)&&0!==wt(r.prev,r,r.next))r=r.next;else{if(Tt(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function lt(t,e,n,r,i,o,s){if(t){!s&&o&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=vt(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n=1;do{var r=t,i=void 0;t=null;var o=null;for(e=0;r;){e++;for(var s=r,a=0,u=0;u<n&&(a++,s=s.nextZ);u++);for(var l=n;a>0||l>0&&s;)0!==a&&(0===l||!s||r.z<=s.z)?(i=r,r=r.nextZ,a--):(i=s,s=s.nextZ,l--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;r=s}o.nextZ=null,n*=2}while(e>1)}(i)}(t,r,i,o);for(var a=t;t.prev!==t.next;){var u=t.prev,l=t.next;if(o?ct(t,r,i,o):ht(t))e.push(u.i,t.i,l.i),Tt(t),t=l.next,a=l.next;else if((t=l)===a){s?1===s?lt(t=ft(ut(t),e),e,n,r,i,o,2):2===s&&pt(t,e,n,r,i,o):lt(ut(t),e,n,r,i,o,1);break}}}}function ht(t){var e=t.prev,n=t,r=t.next;if(wt(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,s=r.x,a=e.y,u=n.y,l=r.y,h=Math.min(i,o,s),c=Math.min(a,u,l),f=Math.max(i,o,s),p=Math.max(a,u,l),d=r.next;d!==e;){if(d.x>=h&&d.x<=f&&d.y>=c&&d.y<=p&&_t(i,a,o,u,s,l,d.x,d.y)&&wt(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function ct(t,e,n,r){var i=t.prev,o=t,s=t.next;if(wt(i,o,s)>=0)return!1;for(var a=i.x,u=o.x,l=s.x,h=i.y,c=o.y,f=s.y,p=Math.min(a,u,l),d=Math.min(h,c,f),g=Math.max(a,u,l),y=Math.max(h,c,f),v=vt(p,d,e,n,r),m=vt(g,y,e,n,r),A=t.prevZ,_=t.nextZ;A&&A.z>=v&&_&&_.z<=m;){if(A.x>=p&&A.x<=g&&A.y>=d&&A.y<=y&&A!==i&&A!==s&&_t(a,h,u,c,l,f,A.x,A.y)&&wt(A.prev,A,A.next)>=0)return!1;if(A=A.prevZ,_.x>=p&&_.x<=g&&_.y>=d&&_.y<=y&&_!==i&&_!==s&&_t(a,h,u,c,l,f,_.x,_.y)&&wt(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;A&&A.z>=v;){if(A.x>=p&&A.x<=g&&A.y>=d&&A.y<=y&&A!==i&&A!==s&&_t(a,h,u,c,l,f,A.x,A.y)&&wt(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;_&&_.z<=m;){if(_.x>=p&&_.x<=g&&_.y>=d&&_.y<=y&&_!==i&&_!==s&&_t(a,h,u,c,l,f,_.x,_.y)&&wt(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function ft(t,e){var n=t;do{var r=n.prev,i=n.next.next;!bt(r,i)&&Et(r,n,n.next,i)&&St(r,i)&&St(i,r)&&(e.push(r.i,n.i,i.i),Tt(n),Tt(n.next),n=t=i),n=n.next}while(n!==t);return ut(n)}function pt(t,e,n,r,i,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&xt(s,a)){var u=Mt(s,a);return s=ut(s,s.next),u=ut(u,u.next),lt(s,e,n,r,i,o,0),void lt(u,e,n,r,i,o,0)}a=a.next}s=s.next}while(s!==t)}function dt(t,e){var n=t.x-e.x;0===n&&(0===(n=t.y-e.y)&&(n=(t.next.y-t.y)/(t.next.x-t.x)-(e.next.y-e.y)/(e.next.x-e.x)));return n}function gt(t,e){var n=function(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;if(bt(t,r))return r;do{if(bt(t,r.next))return r.next;if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s&&(s=a,n=r.x<r.next.x?r:r.next,a===i))return n}r=r.next}while(r!==e);if(!n)return null;var u=n,l=n.x,h=n.y,c=1/0;r=n;do{if(i>=r.x&&r.x>=l&&i!==r.x&&At(o<h?i:s,o,l,h,o<h?s:i,o,r.x,r.y)){var f=Math.abs(o-r.y)/(i-r.x);St(r,t)&&(f<c||f===c&&(r.x>n.x||r.x===n.x&&yt(n,r)))&&(n=r,c=f)}r=r.next}while(r!==u);return n}(t,e);if(!n)return e;var r=Mt(n,t);return ut(r,r.next),ut(n,n.next)}function yt(t,e){return wt(t.prev,t,e.prev)<0&&wt(e.next,t,t.next)<0}function vt(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function mt(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function At(t,e,n,r,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function _t(t,e,n,r,i,o,s,a){return!(t===s&&e===a)&&At(t,e,n,r,i,o,s,a)}function xt(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Et(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(St(t,e)&&St(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.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!==t);return r}(t,e)&&(wt(t.prev,t,e.prev)||wt(t,e.prev,e))||bt(t,e)&&wt(t.prev,t,t.next)>0&&wt(e.prev,e,e.next)>0)}function wt(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function bt(t,e){return t.x===e.x&&t.y===e.y}function Et(t,e,n,r){var i=Ct(wt(t,e,n)),o=Ct(wt(t,e,r)),s=Ct(wt(n,r,t)),a=Ct(wt(n,r,e));return i!==o&&s!==a||(!(0!==i||!It(t,n,e))||(!(0!==o||!It(t,r,e))||(!(0!==s||!It(n,t,r))||!(0!==a||!It(n,e,r)))))}function It(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Ct(t){return t>0?1:t<0?-1:0}function St(t,e){return wt(t.prev,t,t.next)<0?wt(t,e,t.next)>=0&&wt(t,t.prev,e)>=0:wt(t,e,t.prev)<0||wt(t,t.next,e)<0}function Mt(t,e){var n=kt(t.i,t.x,t.y),r=kt(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Bt(t,e,n,r){var i=kt(t,e,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 Tt(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function kt(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}var Pt=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=1),this.isQuaternion=!0,this._x=t,this._y=e,this._z=n,this._w=r}t.slerpFlat=function(t,e,n,r,i,o,s){var a=n[r+0],u=n[r+1],l=n[r+2],h=n[r+3],c=i[o+0],f=i[o+1],p=i[o+2],d=i[o+3];if(0===s)return t[e+0]=a,t[e+1]=u,t[e+2]=l,void(t[e+3]=h);if(1===s)return t[e+0]=c,t[e+1]=f,t[e+2]=p,void(t[e+3]=d);if(h!==d||a!==c||u!==f||l!==p){var g=1-s,y=a*c+u*f+l*p+h*d,v=y>=0?1:-1,m=1-y*y;if(m>Number.EPSILON){var A=Math.sqrt(m),_=Math.atan2(A,y*v);g=Math.sin(g*_)/A,s=Math.sin(s*_)/A}var x=s*v;if(a=a*g+c*x,u=u*g+f*x,l=l*g+p*x,h=h*g+d*x,g===1-s){var w=1/Math.sqrt(a*a+u*u+l*l+h*h);a*=w,u*=w,l*=w,h*=w}}t[e]=a,t[e+1]=u,t[e+2]=l,t[e+3]=h},t.multiplyQuaternionsFlat=function(t,e,n,r,i,o){var s=n[r],a=n[r+1],u=n[r+2],l=n[r+3],h=i[o],c=i[o+1],f=i[o+2],p=i[o+3];return t[e]=s*p+l*h+a*f-u*c,t[e+1]=a*p+l*c+u*h-s*f,t[e+2]=u*p+l*f+s*c-a*h,t[e+3]=l*p-s*h-a*c-u*f,t};var e,n,r,i=t.prototype;return i.set=function(t,e,n,r){return this._x=t,this._y=e,this._z=n,this._w=r,this._onChangeCallback(),this},i.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)},i.copy=function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},i.setFromEuler=function(t,e){void 0===e&&(e=!0);var n=t._x,r=t._y,i=t._z,o=t._order,s=Math.cos,a=Math.sin,u=s(n/2),l=s(r/2),h=s(i/2),c=a(n/2),f=a(r/2),p=a(i/2);switch(o){case"XYZ":this._x=c*l*h+u*f*p,this._y=u*f*h-c*l*p,this._z=u*l*p+c*f*h,this._w=u*l*h-c*f*p;break;case"YXZ":this._x=c*l*h+u*f*p,this._y=u*f*h-c*l*p,this._z=u*l*p-c*f*h,this._w=u*l*h+c*f*p;break;case"ZXY":this._x=c*l*h-u*f*p,this._y=u*f*h+c*l*p,this._z=u*l*p+c*f*h,this._w=u*l*h-c*f*p;break;case"ZYX":this._x=c*l*h-u*f*p,this._y=u*f*h+c*l*p,this._z=u*l*p-c*f*h,this._w=u*l*h+c*f*p;break;case"YZX":this._x=c*l*h+u*f*p,this._y=u*f*h+c*l*p,this._z=u*l*p-c*f*h,this._w=u*l*h-c*f*p;break;case"XZY":this._x=c*l*h-u*f*p,this._y=u*f*h-c*l*p,this._z=u*l*p+c*f*h,this._w=u*l*h+c*f*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!0===e&&this._onChangeCallback(),this},i.setFromAxisAngle=function(t,e){var n=e/2,r=Math.sin(n);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(n),this._onChangeCallback(),this},i.setFromRotationMatrix=function(t){var e=t.elements,n=e[0],r=e[4],i=e[8],o=e[1],s=e[5],a=e[9],u=e[2],l=e[6],h=e[10],c=n+s+h;if(c>0){var f=.5/Math.sqrt(c+1);this._w=.25/f,this._x=(l-a)*f,this._y=(i-u)*f,this._z=(o-r)*f}else if(n>s&&n>h){var p=2*Math.sqrt(1+n-s-h);this._w=(l-a)/p,this._x=.25*p,this._y=(r+o)/p,this._z=(i+u)/p}else if(s>h){var d=2*Math.sqrt(1+s-n-h);this._w=(i-u)/d,this._x=(r+o)/d,this._y=.25*d,this._z=(a+l)/d}else{var g=2*Math.sqrt(1+h-n-s);this._w=(o-r)/g,this._x=(i+u)/g,this._y=(a+l)/g,this._z=.25*g}return this._onChangeCallback(),this},i.setFromUnitVectors=function(t,e){var n=t.dot(e)+1;return n<Number.EPSILON?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()},i.rotateTowards=function(t,e){var n=this.angleTo(t);if(0===n)return this;var r=Math.min(1,e/n);return this.slerp(t,r),this},i.identity=function(){return this.set(0,0,0,1)},i.invert=function(){return this.conjugate()},i.conjugate=function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},i.dot=function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},i.lengthSq=function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},i.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},i.normalize=function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},i.multiply=function(t){return this.multiplyQuaternions(this,t)},i.premultiply=function(t){return this.multiplyQuaternions(t,this)},i.multiplyQuaternions=function(t,e){var n=t._x,r=t._y,i=t._z,o=t._w,s=e._x,a=e._y,u=e._z,l=e._w;return this._x=n*l+o*s+r*u-i*a,this._y=r*l+o*a+i*s-n*u,this._z=i*l+o*u+n*a-r*s,this._w=o*l-n*s-r*a-i*u,this._onChangeCallback(),this},i.slerp=function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var n=this._x,r=this._y,i=this._z,o=this._w,s=o*t._w+n*t._x+r*t._y+i*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=o,this._x=n,this._y=r,this._z=i,this;var a=1-s*s;if(a<=Number.EPSILON){var u=1-e;return this._w=u*o+e*this._w,this._x=u*n+e*this._x,this._y=u*r+e*this._y,this._z=u*i+e*this._z,this.normalize(),this}var l=Math.sqrt(a),h=Math.atan2(l,s),c=Math.sin((1-e)*h)/l,f=Math.sin(e*h)/l;return this._w=o*c+this._w*f,this._x=n*c+this._x*f,this._y=r*c+this._y*f,this._z=i*c+this._z*f,this._onChangeCallback(),this},i.slerpQuaternions=function(t,e,n){return this.copy(t).slerp(e,n)},i.random=function(){var t=2*Math.PI*Math.random(),e=2*Math.PI*Math.random(),n=Math.random(),r=Math.sqrt(1-n),i=Math.sqrt(n);return this.set(r*Math.sin(t),r*Math.cos(t),i*Math.sin(e),i*Math.cos(e))},i.equals=function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},i.fromArray=function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},i.toArray=function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},i.fromBufferAttribute=function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this._onChangeCallback(),this},i.toJSON=function(){return this.toArray()},i._onChange=function(t){return this._onChangeCallback=t,this},i._onChangeCallback=function(){},e=t,(n=[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}])&&it(e.prototype,n),r&&it(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}(),Lt=new Pt,Rt=function(){function t(t,e,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=n}var e=t.prototype;return e.set=function(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this},e.clone=function(){return new this.constructor(this.x,this.y,this.z)},e.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},e.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},e.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this},e.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},e.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},e.sub=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},e.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this},e.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},e.multiply=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this},e.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},e.multiplyVectors=function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},e.applyAxisAngle=function(t,e){return this.applyQuaternion(Lt.setFromAxisAngle(t,e))},e.applyMatrix4=function(t){var e=this.x,n=this.y,r=this.z,i=t.elements,o=1/(i[3]*e+i[7]*n+i[11]*r+i[15]);return this.x=(i[0]*e+i[4]*n+i[8]*r+i[12])*o,this.y=(i[1]*e+i[5]*n+i[9]*r+i[13])*o,this.z=(i[2]*e+i[6]*n+i[10]*r+i[14])*o,this},e.applyQuaternion=function(t){var e=this.x,n=this.y,r=this.z,i=t.x,o=t.y,s=t.z,a=t.w,u=a*e+o*r-s*n,l=a*n+s*e-i*r,h=a*r+i*n-o*e,c=-i*e-o*n-s*r;return this.x=u*a+c*-i+l*-s-h*-o,this.y=l*a+c*-o+h*-i-u*-s,this.z=h*a+c*-s+u*-o-l*-i,this},e.divide=function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},e.divideScalar=function(t){return this.multiplyScalar(1/t)},e.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},e.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},e.clamp=function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},e.clampScalar=function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},e.clampLength=function(t,e){var n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},e.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},e.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z},e.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},e.normalize=function(){return this.divideScalar(this.length()||1)},e.setLength=function(t){return this.normalize().multiplyScalar(t)},e.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},e.lerpVectors=function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this},e.cross=function(t){return this.crossVectors(this,t)},e.crossVectors=function(t,e){var n=t.x,r=t.y,i=t.z,o=e.x,s=e.y,a=e.z;return this.x=r*a-i*s,this.y=i*o-n*a,this.z=n*s-r*o,this},e.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},e.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},e.fromArray=function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},e.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this},t}();function Dt(t){let e,n,r=0,i=1;const o=t.length;for(;i<o;)e=n||t[0],n=t[i],r+=(n[0]-e[0])*(n[1]+e[1]),i++;return r>0}function Ot(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Nt(t,e){const n=e[0],r=e[1],i=e[2],o=Math.sqrt(n*n+r*r+i*i)||1;return t[0]=n/o,t[1]=r/o,t[2]=i/o,t}function Ft(t,e,n){const r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],u=n[2];return t[0]=i*u-o*a,t[1]=o*s-r*u,t[2]=r*a-i*s,t}function Ut(t,e){function n(t,e,n,r){t[0]=e,t[1]=n,t[2]=r}const r=[],i=[],o=[],s=[],a=[],u=[],l=t.length,h=new Float32Array(e.length);let c=0;for(;c<l;){const l=3*t[c],f=3*t[c+1],p=3*t[c+2];n(r,e[l],e[l+1],e[l+2]),n(i,e[f],e[f+1],e[f+2]),n(o,e[p],e[p+1],e[p+2]),Ot(a,o,i),Ot(s,r,i),Ft(u,a,s);for(let t=0;t<3;t++)h[l+t]+=u[t],h[f+t]+=u[t],h[p+t]+=u[t];c+=3}let f=0;const p=h.length;for(;f<p;)n(u,h[f],h[f+1],h[f+2]),Nt(u,u),h[f]=u[0]||0,h[f+1]=u[1]||0,h[f+2]=u[2]||0,f+=3;return h}function Qt(t){if(1===t.length){return{position:t[0].position,normal:t[0].normal,uv:t[0].uv,indices:t[0].indices,results:t}}let e=0,n=0;for(let r=0,i=t.length;r<i;r++){const{position:i,indices:o}=t[r];e+=i.length,n+=o.length}const r={position:new Float32Array(e),normal:new Float32Array(e),uv:new Float32Array(e/3*2),indices:new Uint32Array(n),results:t};let i=0,o=0,s=0,a=0;for(let e=0,n=t.length;e<n;e++){const{position:n,indices:u,normal:l,uv:h}=t[e];r.position.set(n,i),r.normal.set(l,i),r.uv.set(h,a);let c=0;const f=u.length;for(;c<f;){const t=u[c]+o;r.indices[s]=t,s++,c++}a+=h.length,i+=n.length,o+=n.length/3}return r}function Gt(t){return 180*t/Math.PI}function zt(t){return t/180*Math.PI}function jt(t,e,n,r,i,o){const s=3*n,a=3*r,u=3*i,l=3*o,h=e[s],c=e[s+1],f=e[s+2],p=e[a],d=e[a+1],g=e[a+2],y=e[u],v=e[u+1],m=e[u+2],A=e[l],_=e[l+1],x=e[l+2];let w=t.length-1;Math.abs(c-d)<Math.abs(h-p)?(t[++w]=h,t[++w]=1-f,t[++w]=p,t[++w]=1-g,t[++w]=y,t[++w]=1-m,t[++w]=A,t[++w]=1-x):(t[++w]=c,t[++w]=1-f,t[++w]=d,t[++w]=1-g,t[++w]=v,t[++w]=1-m,t[++w]=_,t[++w]=1-x)}function Vt(t,e){e=Object.assign({},{depth:2,top:!0},e);const n=t.map((t=>{for(let e=0,n=t.length;e<n;e++){const n=t[e];qt(n),0===e?Dt(n)||(t[e]=n.reverse()):Dt(n)&&(t[e]=n.reverse()),Ht(n)&&n.splice(n.length-1,1)}const n=function(t,e){const n=function(t){let e=0,n=0;const r=t.length;for(;n<r;)e+=t[n].length,n++;return e}(t),r=t.length,i=[],o=new Float32Array(2*n),s=[],a=[],u=3*n,l=2*n,h=e.depth;let c=0,f=0,p=0;for(let e=0;e<r;e++){const n=t[e];e>0&&i.push(c/2);let r=0;const d=n.length;for(;r<d;){const t=n[r],e=t[0],i=t[1],d=t[2]||0;o[c++]=e,o[c++]=i,s[f]=e,s[f+1]=i,s[f+2]=h+d,s[u+f]=e,s[u+f+1]=i,s[u+f+2]=d,a[p]=e,a[p+1]=i,a[l+p]=e,a[l+p+1]=i,f+=3,p+=2,r++}}return{flatVertices:o,holes:i,points:s,count:n,uv:a}}(t,e);n.polygon=t;return function(t,e,n){const r=[],{count:i}=t,o=n.top;for(let t=0,n=e.length;t<n;t+=3){const s=e[t],a=e[t+1],u=e[t+2];o&&(r[t]=s,r[t+1]=a,r[t+2]=u);let l=n+t;const h=i+s,c=i+a,f=i+u;o||(l=t),r[l]=h,r[l+1]=c,r[l+2]=f}t.indices=r}(n,st(n.flatVertices,n.holes,2),e),function(t,e){const{points:n,indices:r,polygon:i,uv:o}=t,s=e.depth;let a=n.length-1,u=r.length-1;for(let t=0,e=i.length;t<e;t++){const e=i[t];let l=0;const h=e.length;for(;l<h;){const t=e[l];let i=e[l+1];l===h-1&&(i=e[0]);const c=n.length/3,f=t[0],p=t[1],d=t[2]||0,g=i[0],y=i[1],v=i[2]||0;n[++a]=f,n[++a]=p,n[++a]=d+s,n[++a]=g,n[++a]=y,n[++a]=v+s,n[++a]=f,n[++a]=p,n[++a]=d,n[++a]=g,n[++a]=y,n[++a]=v;const m=c+2,A=c+3,_=c,x=c+1;r[++u]=m,r[++u]=_,r[++u]=A,r[++u]=_,r[++u]=x,r[++u]=A,jt(o,n,m,A,_,x),l++}}}(n,e),n.position=new Float32Array(n.points),n.indices=new Uint32Array(n.indices),n.uv=new Float32Array(n.uv),n.normal=Ut(n.indices,n.position),n})),r=Qt(n);return r.polygons=t,r}function qt(t){Ht(t)||t.push(t[0])}function Ht(t){const e=t.length,[n,r]=t[0],[i,o]=t[e-1];return n===i&&r===o}function Wt(t,e){!function(t){t.lineWidth=Math.max(0,t.lineWidth),t.depth=Math.max(0,t.depth),t.sideDepth=Math.max(0,t.sideDepth)}(e=Object.assign({},{depth:2,lineWidth:1,bottomStickGround:!1,pathUV:!1},e));const n=t.map((t=>{const n=function(t,e){let n=e.lineWidth/2;e.isSlope&&(n*=2);const r=[],i=[],o=[],s=t.length;let a=0;for(;a<s;){let e=t[a],u=t[a+1];const l=t[a];a===s-1&&(e=t[s-2],u=t[s-1]);const h=u[1]-e[1],c=u[0]-e[0];let f=0;const p=Gt(Math.atan(h/c));if(0===a||a===s-1)f=p,f-=90;else{const n=t[a-1];Yt.x=n[0]-e[0],Yt.y=n[1]-e[1],Xt.x=u[0]-e[0],Xt.y=u[1]-e[1];f=p-Jt(Yt,Xt)/2}const d=zt(f),g=l,y=[Math.cos(d)+g[0],Math.sin(d)+g[1]],[v,m]=Zt(e,u,n);let A=$t(v[0],v[1],g,y),_=$t(m[0],m[1],g,y);if(!A||!_){const t=r.length,e=r[t-2],n=r[t-1];if(!e||!n)continue;A=[e[0],e[1]],_=[n[0],n[1]]}A[2]=l[2]||0,_[2]=l[2]||0,r.push(A,_),Kt(A,e,u)?(i.push(A),o.push(_)):(i.push(_),o.push(A)),a++}return{offsetPoints:r,leftPoints:i,rightPoints:o,line:t}}(t,e);return n.line=t,function(t,e){const n=e.bottomStickGround,r=e.depth,i=t.depths;let o=r,s=r;i&&(o=i[0],s=i[1]);const{leftPoints:a,rightPoints:u}=t,l=t.line,h=e.pathUV;if(h){!function(t){let e=0;for(let n=0,r=t.length;n<r;n++){const r=t[n],i=t[n+1];if(0===n&&(r.distance=0),r&&i){const[t,n,o]=r,[s,a,u]=i,l=t-s,h=n-a,c=(o||0)-(u||0);e+=Math.sqrt(l*l+h*h+c*c),i.distance=e}}}(l);for(let t=0,e=l.length;t<e;t++)a[t].distance=u[t].distance=l[t].distance}let c=0,f=a.length;const p=[],d=[],g=[];for(;c<f;){const t=3*c,[e,r,i]=a[c];p[t]=e,p[t+1]=r,p[t+2]=o+i;const[d,y,v]=u[c],m=3*f+t;p[m]=d,p[m+1]=y,p[m+2]=s+v;const A=2*f*3+t;p[A]=e,p[A+1]=r,p[A+2]=i,n&&(p[A+2]=0);const _=2*f*3+3*f+t;if(p[_]=d,p[_+1]=y,p[_+2]=v,n&&(p[_+2]=0),h){const t=l[c].distance,e=2*c;g[e]=t,g[e+1]=1;const n=2*f+e;g[n]=t,g[n+1]=0;const r=2*f*2+e;g[r]=t,g[r+1]=1;const i=2*f*2+2*f+e;g[i]=t,g[i+1]=0}c++}if(!h){c=0,f=p.length;let t=g.length-1;for(;c<f;){const e=p[c],n=p[c+1];g[++t]=e,g[++t]=n,c+=3}}c=0,f=a.length;let y=d.length-1;for(;c<f-1;){const t=c,e=c+1,n=t+f,r=e+f;d[++y]=t,d[++y]=n,d[++y]=e,d[++y]=n,d[++y]=r,d[++y]=e;const i=c+2*f,o=i+1,s=i+f,a=o+f;d[++y]=i,d[++y]=s,d[++y]=o,d[++y]=s,d[++y]=a,d[++y]=o,c++}if(t.indices=d,t.points=p,t.uv=g,i)for(f=a.length,c=0;c<f;)a[c].depth=o,u[c].depth=s,c++}(n,e),function(t,e){const{points:n,indices:r,leftPoints:i,rightPoints:o,uv:s}=t,a=e.depth,u=e.bottomStickGround,l=[i,o],h=t.depths,c=e.pathUV,f=e.lineWidth;let p=n.length-1,d=r.length-1,g=s.length-1;function y(t,e){const i=n.length/3,o=h?t.depth:a,l=h?e.depth:a;n[++p]=t[0],n[++p]=t[1],n[++p]=o+t[2],n[++p]=e[0],n[++p]=e[1],n[++p]=l+e[2],n[++p]=t[0],n[++p]=t[1],n[++p]=u?0:t[2],n[++p]=e[0],n[++p]=e[1],n[++p]=u?0:e[2];const y=i+2,v=i+3,m=i,A=i+1;r[++d]=y,r[++d]=m,r[++d]=v,r[++d]=m,r[++d]=A,r[++d]=v,c?(s[++g]=t.distance,s[++g]=o/f,s[++g]=e.distance,s[++g]=l/f,s[++g]=t.distance,s[++g]=0,s[++g]=e.distance,s[++g]=0):jt(s,n,y,v,m,A)}for(let t=0,e=l.length;t<e;t++){let e=l[t];t>0&&(e=e.map((t=>t)),e=e.reverse());let n=0;const r=e.length-1;for(;n<r;){y(e[n],e[n+1]),n++}}const v=i.length,m=[o[0],i[0],i[v-1],o[v-1]];for(let t=0;t<m.length;t+=2){y(m[t],m[t+1])}}(n,e),n.position=new Float32Array(n.points),n.indices=new Uint32Array(n.indices),n.uv=new Float32Array(n.uv),n.normal=Ut(n.indices,n.position),n})),r=Qt(n);return r.lines=t,r}const Yt={x:0,y:0},Xt={x:0,y:0};const Jt=({x:t,y:e},{x:n,y:r})=>{const i=t*n+e*r,o=t*r-e*n;return(Math.atan2(o,i)/Math.PI*180+360)%360};function Kt(t,e,n){const[r,i]=e,[o,s]=n,[a,u]=t;return(i-s)*a+(o-r)*u+r*s-o*i>0}function Zt(t,e,n){const r=e[1]-t[1],i=e[0]-t[0],o=Math.atan2(r,i),s=o+Math.PI/2;let a=Math.cos(s)*n,u=Math.sin(s)*n;const l=[t[0]+a,t[1]+u],h=[e[0]+a,e[1]+u],c=o-Math.PI/2;a=Math.cos(c)*n,u=Math.sin(c)*n;return[[l,h],[[t[0]+a,t[1]+u],[e[0]+a,e[1]+u]]]}function $t(t,e,n,r){const i=e[0]-t[0],o=e[1]-t[1],s=r[0]-n[0],a=r[1]-n[1];if(0===i&&0===s)return null;if(0===o&&0===a)return null;const u=o/i,l=a/s,h=t[1]-u*t[0],c=n[1]-l*n[0];let f,p;return 0===i?(f=t[0],p=l*f+c):0===s?(f=n[0],p=u*f+h):0===o?(p=t[1],f=(p-c)/l):0===a?(p=n[1],f=(p-h)/u):(f=(c-h)/(u-l),p=u*f+h),[f,p]}var te=function(){function t(){this.pos=new Rt,this.dir=new Rt,this.right=new Rt,this.up=new Rt,this.dist=0,this.widthScale=1,this.sharp=!1}var e=t.prototype;return e.lerpPathPoints=function(t,e,n){this.pos.lerpVectors(t.pos,e.pos,n),this.dir.lerpVectors(t.dir,e.dir,n),this.up.lerpVectors(t.up,e.up,n),this.right.lerpVectors(t.right,e.right,n),this.dist=(e.dist-t.dist)*n+t.dist,this.widthScale=(e.widthScale-t.widthScale)*n+t.widthScale},e.copy=function(t){this.pos.copy(t.pos),this.dir.copy(t.dir),this.up.copy(t.up),this.right.copy(t.right),this.dist=t.dist,this.widthScale=t.widthScale},t}(),ee=function(){function t(t,e,n,r,i,o,s,a,u,l,h,c,f,p,d,g){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,e,n,r,i,o,s,a,u,l,h,c,f,p,d,g)}var e=t.prototype;return e.set=function(t,e,n,r,i,o,s,a,u,l,h,c,f,p,d,g){var y=this.elements;return y[0]=t,y[4]=e,y[8]=n,y[12]=r,y[1]=i,y[5]=o,y[9]=s,y[13]=a,y[2]=u,y[6]=l,y[10]=h,y[14]=c,y[3]=f,y[7]=p,y[11]=d,y[15]=g,this},e.multiply=function(t){return this.multiplyMatrices(this,t)},e.makeRotationAxis=function(t,e){var n=Math.cos(e),r=Math.sin(e),i=1-n,o=t.x,s=t.y,a=t.z,u=i*o,l=i*s;return this.set(u*o+n,u*s-r*a,u*a+r*s,0,u*s+r*a,l*s+n,l*a-r*o,0,u*a-r*s,l*a+r*o,i*a*a+n,0,0,0,0,1),this},e.equals=function(t){for(var e=this.elements,n=t.elements,r=0;r<16;r++)if(e[r]!==n[r])return!1;return!0},t}(),ne=function(){function t(){this.type="Curve",this.arcLengthDivisions=200}var e=t.prototype;return e.getPoint=function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},e.getPointAt=function(t,e){var n=this.getUtoTmapping(t);return this.getPoint(n,e)},e.getPoints=function(t){void 0===t&&(t=5);for(var e=[],n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},e.getLength=function(){var t=this.getLengths();return t[t.length-1]},e.getLengths=function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,n=[],r=this.getPoint(0),i=0;n.push(0);for(var o=1;o<=t;o++)i+=(e=this.getPoint(o/t)).distanceTo(r),n.push(i),r=e;return this.cacheArcLengths=n,n},e.getUtoTmapping=function(t,e){var n,r=this.getLengths(),i=0,o=r.length;n=e||t*r[o-1];for(var s,a=0,u=o-1;a<=u;)if((s=r[i=Math.floor(a+(u-a)/2)]-n)<0)a=i+1;else{if(!(s>0)){u=i;break}u=i-1}if(r[i=u]===n)return i/(o-1);var l=r[i];return(i+(n-l)/(r[i+1]-l))/(o-1)},t}();function re(t,e,n,r){return function(t,e){var n=1-t;return n*n*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,n)+function(t,e){return t*t*e}(t,r)}var ie=function(t){var e,n;function r(e,n,r){var i;return void 0===e&&(e=new Rt),void 0===n&&(n=new Rt),void 0===r&&(r=new Rt),(i=t.call(this)||this).isQuadraticBezierCurve3=!0,i.type="QuadraticBezierCurve3",i.v0=e,i.v1=n,i.v2=r,i}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,ot(e,n),r.prototype.getPoint=function(t,e){void 0===e&&(e=new Rt);var n=e,r=this.v0,i=this.v1,o=this.v2;return n.set(re(t,r.x,i.x,o.x),re(t,r.y,i.y,o.y),re(t,r.z,i.z,o.z)),n},r}(ne),oe=new Rt,se=new Rt,ae=new Rt,ue=new ee,le=new ie;var he=function(){function t(){this.array=[],this.count=0}var e=t.prototype;return e.set=function(t,e,n,r,i){if(void 0===e&&(e=.1),void 0===n&&(n=10),void 0===r&&(r=null),void 0===i&&(i=!1),(t=t.slice(0)).length<2)return console.warn("PathPointList: points length less than 2."),void(this.count=0);i&&!t[0].equals(t[t.length-1])&&t.push((new Rt).copy(t[0]));for(var o=0,s=t.length;o<s;o++)if(0===o)this._start(t[o],t[o+1],r);else if(o===s-1)if(i){this._corner(t[o],t[1],e,n,r);var a=this.array[0].dist;this.array[0].copy(this.array[this.count-1]),this.array[0].dist=a}else this._end(t[o]);else this._corner(t[o],t[o+1],e,n,r)},e.distance=function(){return this.count>0?this.array[this.count-1].dist:0},e._getByIndex=function(t){return this.array[t]||(this.array[t]=new te),this.array[t]},e._start=function(t,e,n){this.count=0;var r=this._getByIndex(this.count);if(r.pos.copy(t),r.dir.subVectors(e,t),n)r.up.copy(n);else{var i=Number.MAX_VALUE,o=Math.abs(r.dir.x),s=Math.abs(r.dir.y),a=Math.abs(r.dir.z);o<i&&(i=o,r.up.set(1,0,0)),s<i&&(i=s,r.up.set(0,1,0)),a<i&&r.up.set(0,0,1)}r.right.crossVectors(r.dir,r.up).normalize(),r.up.crossVectors(r.right,r.dir).normalize(),r.dist=0,r.widthScale=1,r.sharp=!1,r.dir.normalize(),this.count++},e._end=function(t){var e=this.array[this.count-1],n=this._getByIndex(this.count);n.pos.copy(t),n.dir.subVectors(t,e.pos);var r=n.dir.length();n.dir.normalize(),n.up.copy(e.up);var i=oe.crossVectors(e.dir,n.dir);if(i.length()>Number.EPSILON){i.normalize();var o=Math.acos(Math.min(Math.max(e.dir.dot(n.dir),-1),1));n.up.applyMatrix4(ue.makeRotationAxis(i,o))}n.right.crossVectors(n.dir,n.up).normalize(),n.dist=e.dist+r,n.widthScale=1,n.sharp=!1,this.count++},e._corner=function(t,e,n,r,i){if(n>0&&r>0){for(var o=function(t,e,n,r,i,o){var s=oe.subVectors(e,t),a=se.subVectors(n,e),u=s.length(),l=a.length();s.normalize(),a.normalize();var h=Math.min(.999999*(i?u/2:u),r);o.v0.copy(e).sub(s.multiplyScalar(h)),o.v1.copy(e);var c=Math.min(l/2*.999999,r);return o.v2.copy(e).add(a.multiplyScalar(c)),o}(this.array[this.count-1].pos,t,e,n,this.count-1==0,le),s=o.getPoints(r),a=0;a<r;a++)this._sharpCorner(s[a],s[a+1],i,0===a?1:0);s[r].equals(e)||this._sharpCorner(s[r],e,i,2)}else this._sharpCorner(t,e,i,0,!0)},e._sharpCorner=function(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=this.array[this.count-1],s=this._getByIndex(this.count),a=oe.subVectors(t,o.pos),u=se.subVectors(e,t),l=a.length();if(a.normalize(),u.normalize(),s.pos.copy(t),1===r?s.dir.copy(a):2===r?s.dir.copy(u):(s.dir.addVectors(a,u),s.dir.normalize()),n)1===s.dir.dot(n)?s.right.crossVectors(u,n).normalize():s.right.crossVectors(s.dir,n).normalize(),s.up.crossVectors(s.right,s.dir).normalize();else{s.up.copy(o.up);var h=ae.crossVectors(o.dir,s.dir);if(h.length()>Number.EPSILON){h.normalize();var c=Math.acos(Math.min(Math.max(o.dir.dot(s.dir),-1),1));s.up.applyMatrix4(ue.makeRotationAxis(h,c))}s.right.crossVectors(s.dir,s.up).normalize()}s.dist=o.dist+l;var f=a.dot(u);s.widthScale=Math.min(1/Math.sqrt((1+f)/2),1.415)||1,s.sharp=Math.abs(f-1)>.05&&i,this.count++},t}();const ce=new Rt(0,0,1),fe=new Rt,pe=new Rt,de=new Rt,ge=new Rt,ye=new Rt,ve=new Rt;function me(t,e){e=Object.assign({},{lineWidth:1,cornerRadius:0,cornerSplit:10},e);const n=t.map((t=>{const n=function(t){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n],[i,o,s]=r,a=new Rt(i,o,s||0);e[n]=a}return e}(t),r=new he;r.set(n,e.cornerRadius,e.cornerSplit,ce);const i=function(t,e){const n=e.lineWidth||.1,r=1,i=n/2,o=n,s=t.distance(),a=r*s;let u=0;const l=[],h=[],c=[],f=[];let p=0;if(0===s)return{position:l,normal:h,uv:c,indices:f,count:u};const d=i/o;let g,y=l.length-1,v=h.length-1,m=c.length-1,A=f.length-1;function _(t){const e=0===l.length,n=t.sharp&&!e,r=t.dist/o,s=t.dir,a=t.up,g=t.right;if(fe.copy(g).multiplyScalar(i*t.widthScale),pe.copy(g).multiplyScalar(-i*t.widthScale),fe.add(t.pos),pe.add(t.pos),n){de.fromArray(l,l.length-6).sub(pe),ge.fromArray(l,l.length-3).sub(fe);const t=de.length()-ge.length();let e,n;t>0?(e=de,n=pe):(e=ge,n=fe),ye.copy(e).setLength(Math.abs(t)).add(n);let i=ve.copy(n).sub(ye).normalize().dot(s)*ve.copy(n).sub(ye).length()*2;ve.copy(s).setLength(i).add(ye),t>0?(l[++y]=ye.x,l[++y]=ye.y,l[++y]=ye.z,l[++y]=fe.x,l[++y]=fe.y,l[++y]=fe.z,l[++y]=pe.x,l[++y]=pe.y,l[++y]=pe.z,l[++y]=fe.x,l[++y]=fe.y,l[++y]=fe.z,l[++y]=ve.x,l[++y]=ve.y,l[++y]=ve.z,l[++y]=fe.x,l[++y]=fe.y,l[++y]=fe.z,p+=6,f[++A]=p-6,f[++A]=p-8,f[++A]=p-7,f[++A]=p-6,f[++A]=p-7,f[++A]=p-5,f[++A]=p-4,f[++A]=p-6,f[++A]=p-5,f[++A]=p-2,f[++A]=p-4,f[++A]=p-1,u+=12):(l[++y]=pe.x,l[++y]=pe.y,l[++y]=pe.z,l[++y]=ye.x,l[++y]=ye.y,l[++y]=ye.z,l[++y]=pe.x,l[++y]=pe.y,l[++y]=pe.z,l[++y]=fe.x,l[++y]=fe.y,l[++y]=fe.z,l[++y]=pe.x,l[++y]=pe.y,l[++y]=pe.z,l[++y]=ve.x,l[++y]=ve.y,l[++y]=ve.z,p+=6,f[++A]=p-6,f[++A]=p-8,f[++A]=p-7,f[++A]=p-6,f[++A]=p-7,f[++A]=p-5,f[++A]=p-6,f[++A]=p-5,f[++A]=p-3,f[++A]=p-2,f[++A]=p-3,f[++A]=p-1,u+=12);for(let t=0;t<6;t++)h[++v]=a.x,h[++v]=a.y,h[++v]=a.z;c[++m]=r-d,c[++m]=0,c[++m]=r-d,c[++m]=1,c[++m]=r,c[++m]=0,c[++m]=r,c[++m]=1,c[++m]=r+d,c[++m]=0,c[++m]=r+d,c[++m]=1}else l[++y]=pe.x,l[++y]=pe.y,l[++y]=pe.z,l[++y]=fe.x,l[++y]=fe.y,l[++y]=fe.z,h[++v]=a.x,h[++v]=a.y,h[++v]=a.z,h[++v]=a.x,h[++v]=a.y,h[++v]=a.z,c[++m]=r,c[++m]=0,c[++m]=r,c[++m]=1,p+=2,e||(f[++A]=p-2,f[++A]=p-4,f[++A]=p-3,f[++A]=p-2,f[++A]=p-3,f[++A]=p-1,u+=6)}if(a>0)for(let e=0;e<t.count;e++){const n=t.array[e];if(n.dist>a){const r=t.array[e-1];g=new te;const i=(a-r.dist)/(n.dist-r.dist);g.lerpPathPoints(r,n,i),_(g);break}_(n)}else g=t.array[0];return{position:l,normal:h,uv:c,indices:f,count:u}}(r,e);return{position:new Float32Array(i.position),indices:new Uint32Array(i.indices),uv:new Float32Array(i.uv),normal:new Float32Array(i.normal),line:t,count:i.count}})),r=Qt(n);return r.lines=t,r}function Ae(t,e,n={}){return void 0===n[t]&&(n[t]=e.distanceToVector3(t,t).x),n[t]}function _e(t,e,n={}){return void 0===n[t]&&(n[t]=e.altitudeToVector3(t,t).x),n[t]}function xe(t=[]){let e=0,n=0;const r=t.length;for(let o=0;o<r;o++){const{coordinate:r,lnglat:s,lnglats:a,xy:u,xys:l}=t[o],h=r||s||a||u||l||t[o];let c,f;Array.isArray(h)?(c=h[0],f=h[1]):h instanceof i.Coordinate&&(c=h.x,f=h.y),e+=c,n+=f}return new i.Coordinate(e/r,n/r)}function we(t,e,n,r){if(void 0===e||"number"!=typeof e||0===e)return 0;let i;i=t instanceof o.BufferGeometry?t.attributes.position.array:Array.isArray(t)||t instanceof Float32Array?t:t.position;let s=0;if(i){r?(void 0===r[e]&&(r[e]=n.altitudeToVector3(e,e).x),s=r[e]):s=n.altitudeToVector3(e,e).x;const t=i.length;if(i[0]instanceof o.Vector3)for(let e=0;e<t;e++)i[e].z+=s;else for(let e=0;e<t;e+=3)i[e+2]+=s}return s}function be(t){const e=t.length;let n=0;for(let r=0;r<e;r++){const{count:e}=t[r].position;n+=e}return new Float32Array(3*n)}new Rt(0,0,1),new Rt;const Ee=new o.Vector3,Ie=new Map;function Ce(t=[],e){const n=t.length,r=!!e,i=r?3:2,o=new Float64Array(n*i);Ie.clear();for(let s=0;s<n;s++){let n,a;const u=t[s];let l;if(u.x?(n=u.x,a=u.y,l=u.z):(n=u[0],a=u[1],l=u[2]),o[s*i]=n,o[s*i+1]=a,l=l||0,r&&0!==l){if(!Ie.has(l)){const t=e.altitudeToVector3(l,l,null,Ee).x;Ie.set(l,t)}o[s*i+2]=Ie.get(l)}}return o.buffer}function Se(t){return(K(t)?t.properties:t.getProperties())||{}}function Me(t){return(Z(t)?t.properties:t.getProperties())||{}}const Be=new o.Color("#fff"),Te=new o.Color("#fff");function ke(t,e,n,r,i,o,s){const a=Le(t,r,i,o,!1);if(!a)return null;s?(null==s[e]&&(s[e]=r.altitudeToVector3(e,e).x),e=s[e]):e=r.altitudeToVector3(e,e).x;const{position:u,normal:l,uv:h,indices:c}=Vt(a,{depth:e,top:n});return{position:u,normal:l,uv:h,indices:c}}function Pe(t,e,n,r){void 0===r&&(r=0);const i=t.attributes.position.array,s=i.length;let a;if(Te.setStyle(e),Be.setStyle(n),Array.isArray(r)){let t=0;for(let e=0,n=r.length;e<n;e++){const{count:n}=r[e].position;t+=3*n}a=new Float32Array(t)}else a=new Float32Array(i.length);if(Array.isArray(r))for(let t=0,e=r.length;t<e;t++){const{middleZ:e,start:n,end:o}=r[t].position;for(let t=n;t<o;t+=3){i[t+2]>e?(a[t]=Be.r,a[t+1]=Be.g,a[t+2]=Be.b):(a[t]=Te.r,a[t+1]=Te.g,a[t+2]=Te.b)}}else for(let t=0;t<s;t+=3){i[t+2]>r?(a[t]=Be.r,a[t+1]=Be.g,a[t+2]=Be.b):(a[t]=Te.r,a[t+1]=Te.g,a[t+2]=Te.b)}return R(t,"color",new o.BufferAttribute(a,3,!0)),a}function Le(t,e,n,r,o=!1){if(!t)return null;let s=[];if(t instanceof i.MultiPolygon)s=t.getGeometries().map((i=>Re(i,e,n||t.getCenter(),r,o)));else if(t instanceof i.Polygon){const i=Re(t,e,n||t.getCenter(),r,o);s.push(i)}else if(K(t))if(tt(t)){const i=rt(t);for(let a=0,u=i.length;a<u;a++)s.push(Re(i[a],e,n||nt(t),r,o))}else{const i=Re(t,e,n||nt(t),r,o);s.push(i)}return s}function Re(t,e,n,r,o=!1){let s,a,u;if(K(t)){const e=et(t);s=e[0],a=e.slice(1,e.length),n=n||nt(t)}else t instanceof i.Polygon&&(s=t.getShell(),a=t.getHoles(),n=n||t.getCenter());r=r||e.coordinateToVector3(n),u=o?e.coordinatiesToGLFloatArray(s,r).positons2d:e.coordinatiesToGLArray(s,r);const l=[o?u.buffer:u];if(a&&a.length>0)for(let t=0,n=a.length;t<n;t++){let n;n=o?e.coordinatiesToGLFloatArray(a[t],r).positons2d:e.coordinatiesToGLArray(a[t],r),l.push(o?n.buffer:n)}return l}function De(t){if(!t)return null;let e=[];if(t instanceof i.MultiPolygon)e=t.getGeometries().map((t=>Oe(t,!1)));else if(t instanceof i.Polygon){const n=Oe(t,!1);e.push(n)}else if(K(t))if(tt(t)){const n=rt(t);for(let t=0,r=n.length;t<r;t++)e.push(Oe(n[t],!0))}else{const n=Oe(t,!0);e.push(n)}return e}function Oe(t,e){let n,r;if(e){const e=et(t);n=e[0],r=e.slice(1,e.length)}else t instanceof i.Polygon&&(n=t.getShell(),r=t.getHoles());const o=[Ce(n)];if(r&&r.length>0)for(let t=0,e=r.length;t<e;t++){const e=Ce(r[t]);o.push(e)}return o}const Ne=new Map,Fe=new o.Vector3;function Ue(t,e,n,r=!0){let s,a,u=[];if(Array.isArray(t)&&t[0]instanceof o.Vector3)u=t;else{Array.isArray(t)&&(t=new i.LineString(t));const o=0;let l,h;J(t)?(l=et(t),n||(h=nt(t))):t instanceof i.LineString&&(l=t.getCoordinates(),n||(h=t.getCenter()));const c=e.coordinateToVector3(n||h);if(r){Ne.clear();for(let t=0,n=l.length;t<n;t++){const n=l[t],r=n.z||n[2]||0;if(!Ne.has(r)){const t=e.altitudeToVector3(r,r,null,Fe).x;Ne.set(r,t)}const i=e.coordinateToVector3(n,o).sub(c);i.z+=Ne.get(r)||0,u.push(i)}}else{const t=e.coordinatiesToGLFloatArray(l,c,!0);s=t.positions,a=t.positons2d}}if(!r)return{positions:s,positionsV:u,positions2d:a,arrayBuffer:s.buffer};a=new Float32Array(2*u.length),s=new Float32Array(3*u.length);for(let t=0,e=u.length;t<e;t++){const e=3*t,n=u[t];s[e]=n.x,s[e+1]=n.y,s[e+2]=n.z;const r=2*t;a[r]=n.x,a[r+1]=n.y}return{positions:s,positionsV:u,positions2d:a,arrayBuffer:s.buffer}}function Qe(t,e,n,r){const i=[],o=[],s=[];let a,u;for(let n=0,l=t.length;n<l;n++){const l=t[n];for(let t=0,n=l.length;t<n;t++){const n=l[t],h=n.join(",").toString();a?(h!==a&&(u=e.coordinateToVector3(n,0).sub(r),i.push(u.x,u.y,u.z),o.push(u),s.push(n)),a=h):(s.push(n),a=h,u=e.coordinateToVector3(n,0).sub(r),i.push(u.x,u.y,u.z),o.push(u))}}return{positions:i,positionsV:o,lnglats:s}}function Ge(t){let e;const n=[];for(let r=0,i=t.length;r<i;r++){const i=t[r];for(let t=0,r=i.length;t<r;t++){const r=i[t],o=r.join(",").toString();e?(o!==e&&n.push(r),e=o):(n.push(r),e=o)}}return n}function ze(t,e=1,n=1,r=!1,i,o){const s=Ue(t,i,o).positionsV,a=[];for(let t=0,e=s.length;t<e;t++){const e=s[t];a.push([e.x,e.y,e.z])}const{indices:u,position:l,normal:h,uv:c}=Wt([a],{lineWidth:e,depth:n,pathUV:r});return{position:l,normal:h,indices:u,uv:c}}function je(t,e=1,n=1,r,i){const o=Ue(t,r,i).positionsV,s=[];for(let t=0,e=o.length;t<e;t++){const e=o[t];s.push([e.x,e.y,e.z])}const{indices:a,position:u,normal:l,uv:h}=me([s],{lineWidth:e,cornerRadius:n});return{position:u,normal:l,indices:a,uv:h}}function Ve(t){let e,n=[];return t instanceof i.MultiLineString?(n=t.getGeometries(),e=t.getCenter()):t instanceof i.LineString?(n.push(t),e=t.getCenter()):J(t)&&(e=nt(t),tt(t)?n=rt(t):n.push(t)),{lineStrings:n,center:e}}function qe(t){const e=new Float32Array(2*t.length-6);let n=0;for(let r=0,i=t.length/3;r<i;r++){const o=t[3*r],s=t[3*r+1],a=t[3*r+2];if(r>0&&r<i-1){const t=3*n;e[t]=o,e[t+1]=s,e[t+2]=a,n++}const u=3*n;e[u]=o,e[u+1]=s,e[u+2]=a,n++}return e}function He(t){let e=0;const n=t.length;if(1===n)return t[0];for(let r=0;r<n;r++)e+=t[r].length;const r=new Float32Array(e);let i=0;for(let e=0;e<n;e++)r.set(t[e],i),i+=t[e].length;return r}function We(t,e){return t instanceof i.LineString?Ce(t.getCoordinates(),e):Z(t)?Ce(t.geometry.coordinates,e):void 0}let Ye;function Xe(){return Ye||(Ye=new o.BufferGeometry,R(Ye,"position",new o.BufferAttribute(new Float32Array(3),3))),Ye}let Je;var Ke;function Ze(){return i.worker||console.error("maptalks.worker is not defined,You can't use ThreeVectorTileLayer"),!Ke&&Je&&(Ke=new Je("__maptalks.three__")),Ke}function $e(t,e,n={}){return void 0!==t&&"number"==typeof t&&0!==t?(void 0===n[t]&&(n[t]=e.distanceToVector3(t,t).x),n[t]):0}function tn(t,e,n={}){return void 0!==t&&"number"==typeof t&&0!==t?(void 0===n[t]&&(n[t]=e.altitudeToVector3(t,t).x),n[t]):0}function en(t,e){return e?Object.assign({},e,t):t||{}}function nn(t,e,n,r,i=[],o){const s=n.isMercator();let a,u,l;if(s){const t=n.getMap();a=t.getGLRes(),u=t.getSpatialReference().getTransformation().matrix}e&&(l=n.coordinateToVector3(e));const h=[],c=[],f={},p={},d=t.length;for(let a=0;a<d;a++){const u=t[a];let d=i[a]?i[a]:Me(r[a]);d=en(d,o),e||(l=n.coordinateToVector3(d.center));let g=d.width||1,y=d.height||1,v=d.cornerRadius||0,m=d.bottomHeight||0;const A=d.pathUV,_=d.parentCenter;g=$e(g,n,f),v=$e(v,n,f),y=tn(y,n,p),m=tn(m,n,p);const x=[];for(let t=0,r=u.length;t<r;t++){const r=u[t];let i;i=s?We(r,n):Ue(r,n,_||e,!1).arrayBuffer,c.push(i),x.push(i)}const w={id:d.id,data:x,height:y,width:g,cornerRadius:v,bottomHeight:m,pathUV:A};s&&(w.center=[l.x,l.y]),h.push(w)}return{datas:h,transfer:c,glRes:a,matrix:u,center:s?[l.x,l.y]:null}}function rn(t,e,n,r,i=[],o){const s=n.isMercator();let a,u,l;if(s){const t=n.getMap();a=t.getGLRes(),u=t.getSpatialReference().getTransformation().matrix}e&&(l=n.coordinateToVector3(e));const h=[],c=[],f={},p=t.length;for(let a=0;a<p;a++){const u=t[a];let p=i[a]?i[a]:Me(r[a]);p=en(p,o),e||(l=n.coordinateToVector3(p.center));let d=p.bottomHeight||0;d=tn(d,n,f);const g=[];for(let t=0,r=u.length;t<r;t++){const r=u[t];if(s){const t=We(r,n);c.push(t),g.push(t)}else{const t=Ue(r,n,e,!1).arrayBuffer;c.push(t),g.push(t)}}const y={id:p.id,data:g,bottomHeight:d};s&&(y.center=[l.x,l.y]),h.push(y)}return{datas:h,transfer:c,glRes:a,matrix:u,center:s?[l.x,l.y]:null}}function on(t){return t.map((t=>t.data))}function sn(t){return t.map((t=>t.option||t.baseObject.getOptions()))}i.worker&&(Je=class extends i.worker.Actor{test(t,e){this.send(t,null,e)}pushQueue(t={}){const{type:e,data:n,callback:r,layer:i,key:o,center:s,lineStrings:a,options:u,id:l,baseOptions:h}=t;let c;e.indexOf("ExtrudePolygon")>-1?c=function(t=[],e,n,r=[],i){const o=n.isMercator();let s,a,u;if(o){const t=n.getMap();s=t.getGLRes(),a=t.getSpatialReference().getTransformation().matrix}e&&(u=n.coordinateToVector3(e));const l=t.length,h=[],c=[],f={};for(let s=0;s<l;s++){const a=t[s],l=a;let p,d=r[s]?r[s]:Se(l);d=en(d,i),e||(u=n.coordinateToVector3(d.center)),p=o?De(a):Le(a,n,d.center||e,u,!0);for(let t=0,e=p.length;t<e;t++){const e=p[t];for(let t=0,n=e.length;t<n;t++)c.push(e[t])}let g=d.height||1,y=d.bottomHeight||0;const v=d.top;g=tn(g,n,f),y=tn(y,n,f);const m={id:d.id,data:p,height:g,bottomHeight:y,top:v};o&&(m.center=[u.x,u.y]),h.push(m),l._properties&&delete l._properties}return{datas:h,transfer:c,glRes:s,matrix:a,center:o?[u.x,u.y]:null}}(n,s,i,u,h):"ExtrudeLines"===e||"Paths"===e?c=nn(n,s,i,a,u,h):"Point"===e||("Line"===e||"FatLine"===e||"Lines"===e||"FatLines"===e?c=rn(n,s,i,a,u,h):"ExtrudeLine"===e||"Path"===e?c=nn(n,s,i,a,u,h):"Bar"!==e&&"Bars"!==e||(c=function(t){const e=t.length,n=new Float32Array(7*e);let r=0;for(let i=0;i<e;i++){let{center:e,radialSegments:o,radius:s,height:a,altitude:u,id:l}=t[i];e=e||[0,0],n[r]=e[0],n[r+1]=e[1],n[r+2]=o||6,n[r+3]=s||1,n[r+4]=a,n[r+5]=u||0,n[r+6]=l,r+=7}const i=n.buffer;return{datas:i,transfer:[i]}}(n))),c?this.send({type:e,datas:c.datas,glRes:c.glRes,matrix:c.matrix,center:c.center},c.transfer,(function(t,e){t&&console.error(t),e.key=o,e.id=l,r(e)})):console.error(`No processing logic found for type:${e}`)}});class an{constructor(){this.queueMap={},this.tempQueue=[],this.time=this.getCurrentTime(),this.deQueueCount=5,this.resultQueue=[]}getActor(){return Ze()}getCurrentTime(){return i.Util.now()}loop(){this.deQueue()}push(t){return this.tempQueue.push(t),t.id&&(this.queueMap[t.id]=t),this}reset(){return this.time=this.getCurrentTime(),this.tempQueue=[],this}pushResult(t){if(t)return Array.isArray(t)||(t=[t]),t.forEach((t=>{this.resultQueue.push(t)})),this}deQueue(){if(!this.resultQueue.length)return this;const t=this.deQueueCount;return(this.resultQueue.slice(0,t)||[]).forEach((t=>{const{id:e}=t;if(this.queueMap[e]){const{baseObject:n}=this.queueMap[e];if(n&&n._workerLoad){n.getLayer()?n._workerLoad(t):console.warn(n," worker Processing completed but removed from the layer")}delete this.queueMap[e]}})),this.resultQueue.splice(0,t),this}}const un=new class extends an{constructor(){super(),this.deQueueCount=100}loop(){if((this.getCurrentTime()-this.time>=32||this.tempQueue.length>=1e3)&&this.tempQueue.length){Ze().pushQueue({type:"ExtrudePolygon",layer:this.tempQueue[0].layer,data:on(this.tempQueue),options:sn(this.tempQueue),callback:t=>{this.pushResult(t)}}),this.reset()}super.loop()}},ln=new class extends an{loop(){if(this.tempQueue.length){const t=Ze();this.tempQueue.forEach((e=>{t.pushQueue({id:e.id,type:"ExtrudePolygons",layer:e.layer,data:e.data,key:e.key,center:e.center,baseOptions:e.option,callback:t=>{this.pushResult(t)}})})),this.reset()}super.loop()}},hn=new class extends an{constructor(){super(),this.deQueueCount=100}loop(){if((this.getCurrentTime()-this.time>=32||this.tempQueue.length>=1e3)&&this.tempQueue.length){Ze().pushQueue({type:"ExtrudeLine",layer:this.tempQueue[0].layer,data:on(this.tempQueue),options:sn(this.tempQueue),lineStrings:this.tempQueue.map((t=>t.lineString)),callback:t=>{this.pushResult(t)}}),this.reset()}super.loop()}},cn=new class extends an{loop(){if(this.tempQueue.length){const t=Ze();this.tempQueue.forEach((e=>{t.pushQueue({id:e.id,type:"ExtrudeLines",layer:e.layer,data:e.data,key:e.key,lineStrings:e.lineStrings,center:e.center,baseOptions:e.option,callback:t=>{this.pushResult(t)}})})),this.reset()}super.loop()}},fn=new class extends an{constructor(){super(),this.deQueueCount=200}loop(){if((this.getCurrentTime()-this.time>=32||this.tempQueue.length>=1e3)&&this.tempQueue.length){Ze().pushQueue({type:"Line",layer:this.tempQueue[0].layer,data:on(this.tempQueue),options:sn(this.tempQueue),lineStrings:this.tempQueue.map((t=>t.lineString)),callback:t=>{this.pushResult(t)}}),this.reset()}super.loop()}},pn=new class extends an{loop(){if(this.tempQueue.length){const t=Ze();this.tempQueue.forEach((e=>{t.pushQueue({id:e.id,type:"Lines",layer:e.layer,data:e.data,key:e.key,lineStrings:e.lineStrings,center:e.center,baseOptions:e.option,callback:t=>{this.pushResult(t)}})})),this.reset()}super.loop()}},dn=new class extends an{constructor(){super(),this.deQueueCount=100}loop(){if((this.getCurrentTime()-this.time>=32||this.tempQueue.length>=1e3)&&this.tempQueue.length){Ze().pushQueue({type:"FatLine",layer:this.tempQueue[0].layer,data:on(this.tempQueue),options:sn(this.tempQueue),lineStrings:this.tempQueue.map((t=>t.lineString)),callback:t=>{this.pushResult(t)}}),this.reset()}super.loop()}},gn=new class extends an{loop(){if(this.tempQueue.length){const t=Ze();this.tempQueue.forEach((e=>{t.pushQueue({id:e.id,type:"FatLines",layer:e.layer,data:e.data,key:e.key,lineStrings:e.lineStrings,center:e.center,baseOptions:e.option,callback:t=>{this.pushResult(t)}})})),this.reset()}super.loop()}},yn=new class extends an{constructor(){super(),this.deQueueCount=100}loop(){if((this.getCurrentTime()-this.time>=32||this.tempQueue.length>=1e3)&&this.tempQueue.length){Ze().pushQueue({type:"Bar",layer:this.tempQueue[0].layer,data:on(this.tempQueue),options:sn(this.tempQueue),callback:t=>{this.pushResult(t)}}),this.reset()}super.loop()}},vn=new class extends an{constructor(){super(),this.deQueueCount=1}loop(){if(this.tempQueue.length){const t=Ze();this.tempQueue.forEach((e=>{t.pushQueue({id:e.id,type:"Bars",layer:e.layer,data:e.data,callback:t=>{this.pushResult(t)}})})),this.reset()}super.loop()}},mn=new class extends an{constructor(){super(),this.deQueueCount=100}loop(){if((this.getCurrentTime()-this.time>=32||this.tempQueue.length>=1e3)&&this.tempQueue.length){Ze().pushQueue({type:"Path",layer:this.tempQueue[0].layer,data:on(this.tempQueue),options:sn(this.tempQueue),lineStrings:this.tempQueue.map((t=>t.lineString)),callback:t=>{this.pushResult(t)}}),this.reset()}super.loop()}},An=new class extends an{loop(){if(this.tempQueue.length){const t=Ze();this.tempQueue.forEach((e=>{t.pushQueue({id:e.id,type:"Paths",layer:e.layer,data:e.data,key:e.key,lineStrings:e.lineStrings,center:e.center,baseOptions:e.option,callback:t=>{this.pushResult(t)}})})),this.reset()}super.loop()}},_n={isRunning:!1,tasks:[],addTask:t=>{t&&_n.tasks.push(t)},removeTask:t=>{const e=_n.tasks.indexOf(t);e>-1&&_n.tasks.splice(e,1)},loop(){un.loop(),ln.loop(),hn.loop(),cn.loop(),fn.loop(),pn.loop(),dn.loop(),gn.loop(),yn.loop(),vn.loop(),mn.loop(),An.loop(),_n.tasks.forEach((t=>{t&&t.loop&&t.loop()})),requestAnimationFrame(_n.loop)},star(){_n.isRunning||(_n.isRunning=!0,_n.loop())}};function xn(t){const{position:e,normal:n,uv:r,indices:i}=wn(t),s=new o.BufferGeometry,a=new Float32Array(e.length);return a.fill(1,0,e.length),R(s,"color",new o.BufferAttribute(a,3)),R(s,"normal",new o.BufferAttribute(n,3)),R(s,"position",new o.BufferAttribute(e,3)),r&&r.length&&R(s,"uv",new o.BufferAttribute(r,2)),s.setIndex(new o.BufferAttribute(i,1)),s}function wn(t){const e={},n={};for(let r=0;r<t.length;++r){const i=t[r];for(const t in i)void 0===e[t]&&(e[t]=[],n[t]=0),e[t].push(i[t]),n[t]+=i[t].length}const r={};let i=0;const o=new Uint32Array(n.indices);for(const t in e)if("indices"===t){const n=e[t];let r=0;for(let t=0,s=n.length;t<s;t++){const s=n[t];for(let t=0,e=s.length;t<e;t++)o[r]=s[t]+i,r++;i+=e.position[t].length/3}}else{const i=bn(e[t],n[t]);if(!i)return null;r[t]=i}return r.indices=o,r}function bn(t,e){const n=new Float32Array(e);let r=0;for(let e=0;e<t.length;++e)n.set(t[e],r),r+=t[e].length;return n}function En(t){const{position:e,normal:n,uv:r,indices:i}=t,s=new o.BufferGeometry;return R(s,"normal",new o.BufferAttribute(new Float32Array(n),3)),R(s,"position",new o.BufferAttribute(new Float32Array(e),3)),R(s,"uv",new o.BufferAttribute(new Float32Array(r),2)),s.setIndex(new o.BufferAttribute(new Uint32Array(i),1)),s}function In(t){const e=new o.BufferGeometry;return R(e,"normal",t.getAttribute("normal")),R(e,"position",t.getAttribute("position").clone()),e.setIndex(t.getIndex()),e}let Cn;function Sn(){if(!Cn){const t=1e-6;Cn=N(t,t,t)}return Cn}Sn();const Mn=N(1,1,1);Mn.translate(0,0,.5);const Bn=new o.Color("#fff"),Tn=new o.Color("#fff");function kn(t){const{position:e,normal:n,uv:r,indices:i}=function(t,e){e=Object.assign({},{radius:1,height:2,radialSegments:6},e);const n=Math.round(Math.max(4,e.radialSegments));let{radius:r,height:i}=e;const o=360/n/360*Math.PI*2,s=n+1,a=new Float32Array(3*s*2),[u,l]=t;let h=0,c=0;const f=3*s,p=2*s,d=[],g=[];let y=d.length-1;for(let t=-1;t<n;t++){const e=o*t,n=Math.cos(e)*r+u,s=Math.sin(e)*r+l;a[h]=n,a[h+1]=s,a[h+2]=0,a[h+f]=n,a[h+1+f]=s,a[h+2+f]=i;let v=0,m=0;v=.5+n/r/2,m=.5+s/r/2,g[c]=v,g[c+1]=m,g[c+p]=v,g[c+1+p]=m,h+=3,c+=2,t>1&&(d[++y]=0,d[++y]=t-1,d[++y]=t)}h-=3,a[h]=a[0],a[h+1]=a[1],a[h+2]=a[2];const v=a.length;a[v-3]=a[0],a[v-2]=a[1],a[v-1]=i;const m=d.length;y=d.length-1;for(let t=0;t<m;t++){const e=d[t];d[++y]=e+s}const A=new Float32Array(2*(3*s*2-6));let _=-1;h=2*s,c=0,y=d.length-1;let x=g.length-1;for(let t=0,e=a.length/2;t<e-3;t+=3){const e=a[t],n=a[t+1],o=a[t+3],u=a[t+4];A[++_]=e,A[++_]=n,A[++_]=i,A[++_]=o,A[++_]=u,A[++_]=i,A[++_]=e,A[++_]=n,A[++_]=0,A[++_]=o,A[++_]=u,A[++_]=0;const l=h+2,f=h+3,p=h,v=h+1;d[++y]=p,d[++y]=l,d[++y]=v,d[++y]=l,d[++y]=f,d[++y]=v,h+=4;const m=c/s,w=(c+1)/s;g[++x]=m,g[++x]=i/r/2,g[++x]=w,g[++x]=i/r/2,g[++x]=m,g[++x]=0,g[++x]=w,g[++x]=0,c++}const w=new Float32Array(a.length+A.length);w.set(a,0),w.set(A,a.length);const b=Ut(d,w);return{points:a,indices:new Uint32Array(d),position:w,normal:b,uv:new Float32Array(g)}}(t.center||[0,0],t),s=new o.BufferGeometry;return R(s,"normal",new o.BufferAttribute(n,3)),R(s,"position",new o.BufferAttribute(e,3)),R(s,"uv",new o.BufferAttribute(r,2)),s.setIndex(new o.BufferAttribute(i,1)),s}function Pn(t){const e=Object.assign({},t);return e._radius&&(e.radius=e._radius),kn(e)}function Ln(t,e,n,r="y",i=0){let s=0;"y"===r?s=1:"z"===r&&(s=2);const a=t.attributes.position.array,u=a.length;Tn.setStyle(e),Bn.setStyle(n);const l=new Float32Array(u);if(Array.isArray(i))for(let t=0,e=i.length;t<e;t++){const{middleZ:e,start:n,end:r}=i[t].position;for(let t=n;t<r;t+=3){a[t+2]>e?(l[t]=Bn.r,l[t+1]=Bn.g,l[t+2]=Bn.b):(l[t]=Tn.r,l[t+1]=Tn.g,l[t+2]=Tn.b)}}else for(let t=0;t<u;t+=3){a[t+s]>i?(l[t]=Bn.r,l[t+1]=Bn.g,l[t+2]=Bn.b):(l[t]=Tn.r,l[t+1]=Tn.g,l[t+2]=Tn.b)}return R(t,"color",new o.BufferAttribute(l,3,!0)),l}function Rn(t){const e=[],n=t.length;let r=0;for(let e=0;e<n;e++){const{color:n}=t[e].attributes;n&&(r+=n.array.length)}const i=new Float32Array(r);let s=0;for(let n=0,r=t.length;n<r;n++){const{color:r,normal:o,position:a,uv:u}=t[n].attributes,l=t[n].index;r&&(i.set(r.array,s),s+=r.array.length),e.push({normal:o.array,uv:u.array,position:a.array,indices:l.array})}const a=xn(e);i.length&&R(a,"color",new o.BufferAttribute(i,3,!0));for(let e=0,n=t.length;e<n;e++)t[e].dispose();return a}function Dn(){return Mn}const On={radius:10,height:100,radialSegments:6,altitude:0,topColor:"",bottomColor:"#2d2f61",heightEnable:!0};class Nn extends W{constructor(t,e,n,r){e=i.Util.extend({},On,e,{layer:r,coordinate:t}),super(),this._initOptions(e);const{height:o,radius:s,topColor:a,bottomColor:u,altitude:l,asynchronous:h}=e;let c;if(e.height=r.altitudeToVector3(o,o).x,e.radius=r.distanceToVector3(s,s).x,h){c=Sn();const t=i.Util.GUID();this.getOptions().id=t,yn.push({data:{radius:e.radius,height:e.height,radialSegments:e.radialSegments,id:t},layer:r,id:t,baseObject:this})}else c=Pn(e),a&&(Ln(c,u,a,"z",e.height/2),n.vertexColors=O());this._createMesh(c,n);const f=r.altitudeToVector3(l,l).x,p=r.coordinateToVector3(t,f);this.getObject3d().position.copy(p),this.type="Bar"}_workerLoad(t){const e=En(t),{topColor:n,bottomColor:r,height:i}=this.getOptions(),o=this.getObject3d(),s=o.material;if(n){Ln(e,r,n,"z",this.getLayer().altitudeToVector3(i,i).x/2),s.vertexColors=O()}o.geometry=e,o.material.needsUpdate=!0,this._fire("workerload",{target:this})}}function Fn(t){const e=[];return t&&t.length&&t.forEach((t=>{t=t instanceof o.Color?t:new o.Color(t),e.push(t.r,t.g,t.b)})),e}const Un={altitude:0,bottomHeight:0,colors:null};class Qn extends W{constructor(t,e,n,r){e=i.Util.extend({},Un,e,{layer:r,lineString:t}),super(),this._initOptions(e);const{lineStrings:s,center:a}=Ve(t),{asynchronous:u}=e;let l;if(u){l=Xe();const n=i.Util.GUID();this.getOptions().id=n,this.getOptions().center=a,fn.push({id:n,data:s,layer:r,key:e.key,lineString:t,baseObject:this})}else{const t=[];for(let e=0,n=s.length;e<n;e++){const n=s[e],{positions:i}=Ue(n,r,a,!1);t.push(qe(i))}const i=He(t);l=new o.BufferGeometry,R(l,"position",new o.BufferAttribute(i,3)),we(l,e.bottomHeight,r);const u=Fn(e.colors);u&&u.length&&(R(l,"color",new o.Float32BufferAttribute(u,3)),n.vertexColors=O())}this._createLineSegments(l,n);const{altitude:h}=e,c=r.altitudeToVector3(h,h).x,f=r.coordinateToVector3(a,c);this.getObject3d().position.copy(f),this.type="Line"}_workerLoad(t){const e=new o.BufferGeometry;R(e,"position",new o.BufferAttribute(new Float32Array(t.position),3));const n=Fn(this.getOptions().colors),r=this.getObject3d(),i=r.material;n&&n.length&&(R(e,"color",new o.Float32BufferAttribute(n,3)),i.vertexColors=O()),this._computeLineDistances(e),r.geometry=e,r.material.needsUpdate=!0,this._fire("workerload",{target:this})}}const Gn={bottomHeight:0,width:3,height:1,altitude:0,topColor:null,bottomColor:"#2d2f61",heightEnable:!0,pathUV:!1};class zn extends W{constructor(t,e,n,r){e=i.Util.extend({},Gn,e,{layer:r,lineString:t}),super(),this._initOptions(e);const{height:o,width:s,bottomColor:a,topColor:u,bottomHeight:l,altitude:h,asynchronous:c,pathUV:f}=e,p=r.altitudeToVector3(o,o).x,d=r.distanceToVector3(s,s).x,{lineStrings:g,center:y}=Ve(t);let v;if(c){v=Sn();const e=i.Util.GUID();this.getOptions().id=e,this.getOptions().center=y,hn.push({id:e,data:g,layer:r,center:y,lineString:t,baseObject:this})}else{const t=[];let e=0;const i={};for(let n=0,o=g.length;n<o;n++){const o=ze(g[n],d,p,f,r,y);e=we(o,l,r,i),t.push(o)}v=xn(t),u&&(Pe(v,a,u,e+p/2),n.vertexColors=O())}this._createMesh(v,n);const m=r.altitudeToVector3(h,h).x,A=r.coordinateToVector3(y,m);this.getObject3d().position.copy(A),this.type="ExtrudeLine"}_workerLoad(t){const e=En(t),{topColor:n,bottomColor:r,bottomHeight:i,height:o}=this.getOptions(),s=this.getObject3d(),a=s.material;if(n){const t=this.getLayer();Pe(e,r,n,t.altitudeToVector3(i,i).x+t.altitudeToVector3(o,o).x/2),a.vertexColors=O()}s.geometry=e,s.material.needsUpdate=!0,this._fire("workerload",{target:this})}}const jn={altitude:0,height:1,bottomHeight:0,topColor:null,bottomColor:"#2d2f61",heightEnable:!0,top:!0};class Vn extends W{constructor(t,e,n,r){e=i.Util.extend({},jn,e,{layer:r,polygon:t}),super(),this._initOptions(e);const{height:s,topColor:a,bottomColor:u,altitude:l,bottomHeight:h,asynchronous:c,top:f}=e;let p;const d=K(t)?nt(t):t.getCenter();if(c){p=Sn();const e=i.Util.GUID();this.getOptions().id=e,this.getOptions().center=d,un.push({data:t,layer:r,id:e,baseObject:this})}else{p=function(t,e,n,r,i){const{position:s,normal:a,uv:u,indices:l}=ke(t,e,n,r,i),h=new Float32Array(s.length);h.fill(1,0,s.length);const c=new o.BufferGeometry;return R(c,"color",new o.BufferAttribute(h,3)),R(c,"normal",new o.BufferAttribute(a,3)),R(c,"position",new o.BufferAttribute(s,3)),R(c,"uv",new o.BufferAttribute(u,2)),c.setIndex(new o.BufferAttribute(l,1)),c}(t,s,f,r);const e=we(p,h,r);if(a){Pe(p,u,a,e+r.altitudeToVector3(s,s).x/2),n.vertexColors=O()}}this._createMesh(p,n);const g=r.altitudeToVector3(l,l).x,y=r.coordinateToVector3(d,g);this.getObject3d().position.copy(y),this.type="ExtrudePolygon"}_workerLoad(t){const e=En(t),{topColor:n,bottomColor:r,bottomHeight:i,height:o}=this.getOptions(),s=this.getObject3d(),a=s.material;if(n){const t=this.getLayer();Pe(e,r,n,t.altitudeToVector3(i,i).x+t.altitudeToVector3(o,o).x/2),a.vertexColors=O()}s.geometry=e,s.material.needsUpdate=!0,this._fire("workerload",{target:this})}}const qn={altitude:0,coordinate:null};class Hn extends W{constructor(t,e={},n){e.coordinate||(console.warn("coordinate is null,it is important to locate the model"),e.coordinate=n.getMap().getCenter()),e=i.Util.extend({},qn,e,{layer:n,model:t}),super(),this._initOptions(e),this._createGroup(),this.getObject3d().add(t);const{altitude:r,coordinate:o}=e,s=n.altitudeToVector3(r,r).x,a=n.coordinateToVector3(o,s);this.getObject3d().position.copy(a),this.type="Model"}getCoordinates(){const t=this.options.coordinate,e=this.options.altitude,n=new i.Coordinate(t);return n.z=e,n}}const Wn=Math.PI/180;function Yn(t){return t*Wn}function Xn(t,e){if(!t||!e)return 0;Array.isArray(t)||(t=t.toArray()),Array.isArray(e)||(e=e.toArray());let n=Yn(t[1]);const r=Yn(e[1]),i=n-r,o=Yn(t[0])-Yn(e[0]);return n=2*Math.asin(Math.sqrt(Math.pow(Math.sin(i/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(o/2),2))),n*=6378137,Math.round(1e5*n)/1e5}function Jn(t,e){const{len:n,c1:r,c2:i}=t,o=i[0]-r[0],s=i[1]-r[1],a=e/n;return[r[0]+a*o,r[1]+a*s]}const Kn=1e3;const Zn={trail:5,chunkLength:50,width:2,height:1,speed:1,altitude:0,interactive:!1,heightEnable:!0,pathUV:!1};class $n extends W{constructor(t,e,n,r){e=i.Util.extend({},Zn,e,{layer:r,lineString:t}),super(),this._initOptions(e);const{width:s,height:a,altitude:u,speed:l,chunkLength:h,trail:c,pathUV:f}=e;let p,d;J(t)?(p=nt(t),d=et(t)):(p=t.getCenter(),d=t);const g=function(t,e=10){e=Math.max(e,.1),Array.isArray(t)||(t=t.getCoordinates().map((t=>t.toArray())));const n=t.length;let r=[],i=0;for(let e=0;e<n-1;e++){const n=Xn(t[e],t[e+1]),o=Math.floor(n);r.push({c1:t[e],len:o,c2:t[e+1]}),i+=o}if(i<=e)return r.map((t=>[t.c1,t.c2]));if(1===r.length&&r[0].len<=e)return[[r[0].c1,r[0].c2]];const o=r.length;let s,a=0,u=0;const l=[];let h=[r[0].c1];for(;a<o;){const{len:t,c2:n}=r[a];if(u+=t,u<e&&(h.push(n),a===o-1&&l.push(h),a++),u===e&&(h.push(n),u=0,l.push(h),h=[n],a++),u>e){const n=t-u+e;s=Jn(r[a],n),h.push(s),l.push(h),u=0,r[a].c1=s,r[a].len=t-n,h=[],h.push(s)}}return l}(d,h),y=r.coordinateToVector3(p),v=new o.BufferGeometry,m=new Float32Array(3e3),A=new Float32Array(3e3),_=new Uint16Array(Kn);R(v,"position",new o.BufferAttribute(m,3)),R(v,"normal",new o.BufferAttribute(A,3)),v.setIndex(new o.BufferAttribute(_,1));const x=r.distanceToVector3(s,s).x,w=r.altitudeToVector3(a,a).x;this._createMesh(v,n);const b=r.altitudeToVector3(u,u).x,E=r.coordinateToVector3(p,b);this.getObject3d().position.copy(E),this._params={index:0,chunkLines:g,geometries:[],layer:r,trail:Math.max(1,c),lineWidth:x,depth:w,speed:Math.min(1,l),idx:0,loaded:!0,center:p,centerPt:y,workerInitCount:0,pathUV:f},this._init(this._params),this.type="ExtrudeLineTrail"}_init(t){const{layer:e,trail:n,lineWidth:r,depth:o,chunkLines:s,positionMap:a,centerPt:u,center:l,pathUV:h}=t,c=s.length,f=[];if(this.options.asynchronous){t.loaded=!1;const r=i.Util.GUID();for(let t=0;t<c;t++){const o={type:"Feature",geometry:{type:"LineString",coordinates:Ge(s.slice(t,t+n))}},a=`${r}-${t}`,u=i.Util.extend({},this.options);u.parentCenter=l,u.id=a,u.center=l,hn.push({id:a,data:[o],layer:e,center:l,lineString:o,baseObject:this,option:u})}}else for(let t=0;t<c;t++){const i=Qe(s.slice(t,t+n),e,0,u).positionsV;f.push(ze(i,r,o,h,e))}}_animation(){const{index:t,geometries:e,speed:n,idx:r,chunkLines:i,trail:o,lineWidth:s,depth:a,loaded:u,layer:l,positionMap:h,centerPt:c,pathUV:f}=this._params;if(!u)return;const p=Math.round(t);if(p>r&&p<=i.length-1){this._params.idx++;let t=e[p];if(!t){t=ze(Qe(i.slice(p,p+o),l,0,c).positionsV,s,a,f,l),e[p]=t}const n=this.getObject3d();!function(t,e,n,r){const i=e.length;t.attributes.normal.count=i,t.attributes.position.count=i;const o=t.attributes.position.array,s=t.attributes.normal.array;for(let t=0;t<i;t++)o[t]=e[t],s[t]=n[t];t.index.count=r.length;for(let e=0,n=r.length;e<n;e++)t.index.array[e]=r[e]}(n.geometry,t.position,t.normal,t.indices),n.geometry.attributes.position.needsUpdate=!0,n.geometry.attributes.normal.needsUpdate=!0,n.geometry.index.needsUpdate=!0}t>=i.length-1&&(this._params.index=-1,this._params.idx=-1),this._params.index+=n}_workerLoad(t){if(!t)return this;const{id:e,indices:n,position:r,normal:o,uv:s}=t;if(!(e&&n&&r&&o&&s))return;let a=e.split("-")[1];if(a=parseInt(a),i.Util.isNumber(a)){this._params.geometries[a]={indices:new Uint32Array(n),position:new Float32Array(r),uv:new Float32Array(s),normal:new Float32Array(o)},this._params.workerInitCount++}this._params.workerInitCount===this._params.chunkLines.length&&(this._params.loaded=!0,this._fire("workerload",{target:this}))}}const tr=["click","mousemove","mousedown","mouseup","dblclick","contextmenu"].join(" ").toString(),er=new o.MeshBasicMaterial;er.vertexColors=O();const nr=t=>class extends t{_initBaseObjectsEvent(t){if(t&&Array.isArray(t)&&t.length)for(let e=0,n=t.length;e<n;e++){const n=t[e];this._proxyEvent(n)}return this}_proxyEvent(t){t.on("add",(t=>{this._showGeometry(t.target,!0)})),t.on("remove",(t=>{this._showGeometry(t.target,!1)})),t.on("mouseout",(t=>{this._mouseover=!1,this.fire("mouseout",Object.assign({},t,{target:this,selectMesh:this.getSelectMesh?this.getSelectMesh():null}))})),t.on(tr,(t=>{this.fire(t.type,Object.assign({},t,{target:this,selectMesh:this.getSelectMesh?this.getSelectMesh():null}))}))}_getHideGeometryIndex(t){const e=[];let n=0;for(let r=0,i=this._geometriesAttributes.length;r<i;r++)!0===this._geometriesAttributes[r].hide&&(e.push(r),n+=this._geometriesAttributes[r][t].count);return{indexs:e,count:n}}_updateAttribute(t,e){const{indexs:n}=this._getHideGeometryIndex(e),r=this._geometryCache.attributes[e].array,i=r.length;for(let e=0;e<i;e++)t.array[e]=r[e];let s=NaN;this.getObject3d()instanceof o.LineSegments&&(s=0);for(let r=0;r<n.length;r++){const i=n[r],{start:o,end:a}=this._geometriesAttributes[i][e];for(let e=o;e<a;e++)t.array[e]=s}return this}_showGeometry(t,e){let n;if(t&&(n=t.getOptions().index),null!=n){const t=this._geometriesAttributes[n],{hide:r}=t;if(r===e)return this;t.hide=e;const i=this.getObject3d().geometry;this._updateAttribute(i.attributes.position,"position"),i.attributes.position.needsUpdate=!0,this.isHide=e}return this}getSelectMesh(){const t=this._getIndex();if(null!=t)return{data:this._datas[t],baseObject:this._baseObjects[t]}}_getIndex(t){return null==t&&(t=this.faceIndex||this.index),t}_init(){const t=this.getLayer().getPick();this.on("add",(()=>{t.add(this.pickObject3d)})),this.on("remove",(()=>{t.remove(this.pickObject3d)}))}_setPickObject3d(){if(!this._colorMap)return;const t=this._geometryCache||this.getObject3d().geometry.clone(),e=this.getLayer().getPick(),{_geometriesAttributes:n}=this,r=n.length,i=be(n);let s=0;for(let t=0;t<r;t++){const r=e.getColor(),o=r.getHex();this._colorMap[o]=t;const{count:a}=n[t].position;this._datas[t].colorIndex=o;for(let t=0;t<a;t++)i[s]=r.r,i[s+1]=r.g,i[s+2]=r.b,s+=3}R(t,"color",new o.BufferAttribute(i,3,!0));const a=e.getColor().getHex(),u=new o.Mesh(t,er);u.position.copy(this.getObject3d().position),u._colorIndex=a,this.setPickObject3d(u)}},rr={altitude:0,height:1,bottomHeight:0,topColor:null,bottomColor:"#2d2f61",top:!0},ir=new i.Coordinate(0,0);class or extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const o=t.length;0===o&&console.error("polygons is empty");let s=1/0,a=1/0,u=-1/0,l=-1/0;for(let e=0;e<o;e++){const n=t[e],r=n.getCenter?n.getCenter():nt(n,ir);let o,h;Array.isArray(r)?(o=r[0],h=r[1]):r instanceof i.Coordinate&&(o=r.x,h=r.y),s=Math.min(s,o),a=Math.min(a,h),u=Math.max(u,o),l=Math.max(l,h)}const h=new i.Coordinate((s+u)/2,(a+l)/2);e=i.Util.extend({},rr,e,{layer:r,polygons:t,coordinate:h});const{topColor:c,bottomColor:f,altitude:p,asynchronous:d,top:g}=e;let y;const v=[],m=[];if(super(),d)y=Sn(),ln.push({id:i.Util.GUID(),layer:r,key:e.key,center:h,data:t,baseObject:this,option:e});else{const s=r.coordinateToVector3(h),a=[];let u=0;const l={};for(let n=0;n<o;n++){const o=t[n],c=i.Util.extend({},e,Se(o)),f=c.height||1,p=c.bottomHeight||0,d=ke(o,f,g,r,h,s,l);a.push(d);const y=we(d,p,r,l),{position:v,normal:A,uv:_,indices:x}=d;x.length;const w=v.length/3;A.length,_.length,m[n]={position:{middleZ:y+l[f]/2,count:w,start:u,end:u+3*w},hide:!1},u+=3*w}y=xn(a),c&&(Pe(y,f,c,m),n.vertexColors=O())}this._initOptions(e),this._createMesh(y,n);const A=r.altitudeToVector3(p,p).x,_=r.coordinateToVector3(h,A);this.getObject3d().position.copy(_),this._baseObjects=v,this._datas=t,this._geometriesAttributes=m,this.faceIndex=null,this._geometryCache=In(y),this.isHide=!1,this._colorMap={},this._initBaseObjectsEvent(v),d||(this._setPickObject3d(),this._init()),this.type="ExtrudePolygons"}getSelectMesh(){const t=this._getIndex();if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],n=Object.assign({},this.options,K(e)?e.properties:e.getProperties(),{index:t});this._baseObjects[t]=new Vn(e,n,this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}identify(t){return this.picked}_workerLoad(t){const{geometriesAttributes:e}=t;this._geometriesAttributes=e;const n=En(t);this._geometryCache=In(n);const{topColor:r,bottomColor:i}=this.getOptions(),o=this.getObject3d(),s=o.material;if(r&&(Pe(n,i,r,e),s.vertexColors=O()),o.geometry=n,o.material.needsUpdate=!0,this._setPickObject3d(),this._init(),this.isAdd){this.getLayer().getPick().add(this.pickObject3d)}this._fire("workerload",{target:this})}}function sr(t,e,n){const r=t.project(n),i=e.width/2,o=e.height/2;return{x:Math.round(r.x*i+i),y:Math.round(-r.y*o+o)}}const ar={altitude:0,height:0,color:null},ur=new o.Vector3;class lr extends W{constructor(t,e,n,r){e=i.Util.extend({},ar,e,{layer:r,coordinate:t}),super();let{height:s,altitude:a,color:u,size:l}=e;const h=[],c=[];u&&(u=u instanceof o.Color?u:new o.Color(u),c.push(u.r,u.g,u.b));const f=r.altitudeToVector3(s,s).x,p=r.coordinateToVector3(t,f);h.push(0,0,p.z);const d=new o.BufferGeometry;R(d,"position",new o.Float32BufferAttribute(h,3,!0)),c.length&&R(d,"color",new o.Float32BufferAttribute(c,3,!0)),void 0!==l&&R(d,"size",new o.Float32BufferAttribute([l],1,!0)),e.positions=p,this._initOptions(e),this._createPoints(d,n);const g=r.altitudeToVector3(a,a).x,y=new o.Vector3(p.x,p.y,g);this.getObject3d().position.copy(y),this.type="Point"}identify(t){const e=this.getLayer(),n=this.getMap().getSize(),r=this.getLayer().getCamera(),i=this.getOptions().positions,o=this.getOptions().altitude;let s=this.getObject3d().material.size;void 0===s&&(s=this.options.size||1);const a=this.getMap().coordToContainerPoint(t),u=e.altitudeToVector3(o,o).x;ur.x=i.x,ur.y=i.y,ur.z=i.z+u;const l=sr(ur,n,r);return Math.sqrt(Math.pow(a.x-l.x,2)+Math.pow(a.y-l.y,2))<=s/2}}function hr(t,e){const{minx:n,miny:r,maxx:i,maxy:o}=t,[s,a]=e;return n<=s&&s<=i&&r<=a&&a<=o}class cr{constructor(t,e,n,r){this.minlng=t,this.minlat=e,this.maxlng=n,this.maxlat=r,this.minx=1/0,this.miny=1/0,this.maxx=-1/0,this.maxy=-1/0,this.coordinates=[],this.positions=[],this.indexs=[],this.key=null}updateBBoxPixel(t){let e=1/0,n=1/0,r=-1/0,o=-1/0;const{minlng:s,minlat:a,maxlng:u,maxlat:l}=this;return[[s,a],[s,l],[u,a],[u,l]].map((t=>new i.Coordinate(t))).map((e=>t.coordToContainerPoint(e))).forEach((t=>{e=Math.min(e,t.x),n=Math.min(n,t.y),r=Math.max(r,t.x),o=Math.max(o,t.y)})),this.minx=e,this.miny=n,this.maxx=r,this.maxy=o,this}containsCoordinate(t){let e,n;Array.isArray(t)?(e=t[0],n=t[1]):t instanceof i.Coordinate&&(e=t.x,n=t.y);const{minlng:r,minlat:o,maxlng:s,maxlat:a}=this;return r<=e&&e<=s&&o<=n&&n<=a}isRecCross(t,e){const{x:n,y:r}=t,i={minx:n-e/2,miny:r-e/2,maxx:n+e/2,maxy:r+e/2},{minx:o,miny:s,maxx:a,maxy:u}=i;return!!(hr(this,[o,s])||hr(this,[o,u])||hr(this,[a,s])||hr(this,[a,u])||hr(i,[this.minx,this.miny])||hr(i,[this.minx,this.maxy])||hr(i,[this.maxx,this.miny])||hr(i,[this.maxx,this.maxy]))}static initGrids(t,e,n,r){const i=[],o=(n-t)/30,s=(r-e)/30;let a=t,u=e;for(let n=0;n<30;n++){a=t+n*o;for(let t=0;t<30;t++){u=e+t*s;const r=new cr(a,u,a+o,u+s);r.key=t+"-"+n,i.push(r)}}return{grids:i,averageX:o,averageY:s,ROWS:30,COLS:30}}}const fr={altitude:0},pr=new o.Vector3;function dr(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}class gr extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]),e=i.Util.extend({},fr,e,{layer:r,points:t});let s=1/0,a=1/0,u=-1/0,l=-1/0;for(let e=0,n=t.length;e<n;e++){const{coordinate:n}=t[e];let r,o;Array.isArray(n)?(r=n[0],o=n[1]):n instanceof i.Coordinate&&(r=n.x,o=n.y),t[e].coords=[r,o],s=Math.min(s,r),a=Math.min(a,o),u=Math.max(u,r),l=Math.max(l,o)}const h=r.coordinateToVector3([(s+u)/2,(a+l)/2]),{grids:c,averageX:f,averageY:p,ROWS:d,COLS:g}=cr.initGrids(s,a,u,l);c.length;const y=new Float32Array(3*t.length),v=[],m=new Float32Array(3*t.length),A=new Float32Array(t.length),_=[],x=[],w={};let b=0,E=!1,I=!1;const C=new o.Vector3(0,0,0);for(let e=0,n=t.length;e<n;e++){let{coordinate:n,height:i,color:u,size:l,coords:g}=t[e];const _=3*e;u&&(E=!0,u=u instanceof o.Color?u:new o.Color(u),m[_]=u.r,m[_+1]=u.g,m[_+2]=u.b),l&&(I=!0,A[e]=l,b=Math.max(b,l));const S=_e(i,r,w),M=r.coordinateToVector3(n,S);C.x=M.x,C.y=M.y,C.z=M.z,C.sub(h),y[_]=C.x,y[_+1]=C.y,y[_+2]=C.z,v.push(M),x[e]={position:{count:1,start:3*e,end:3*e+3},hide:!1};let B=dr((g[1]-a)/p,4),T=dr((g[0]-s)/f,4);B-=1,T-=1,B=Math.max(0,B),T=Math.max(0,T),B=Math.ceil(B),T=Math.ceil(T);const k=T*d+B;c[k]&&(c[k].positions.push(M),c[k].indexs.push(e))}const S=new o.BufferGeometry;R(S,"position",new o.BufferAttribute(y,3,!0)),E&&R(S,"color",new o.BufferAttribute(m,3,!0)),I&&R(S,"size",new o.BufferAttribute(A,1,!0)),e.positions=v,super(),this._initOptions(e),this._createPoints(S,n);const M=e.altitude,B=r.altitudeToVector3(M,M).x,T=h.clone();T.z=B,this.getObject3d().position.copy(T),this._baseObjects=_,this._datas=t,this.faceIndex=null,this._geometriesAttributes=x,this._geometryCache=S.clone(),this.isHide=!1,this._initBaseObjectsEvent(_),this._grids=c,this._bindMapEvents(),this.type="Points",this.maxSize=b}_bindMapEvents(){const t=this.getMap(),e="zoomstart zooming zoomend movestart moving moveend pitch rotate";this.on("add",(()=>{this._updateGrids(),t.on(e,this._updateGrids,this)})),this.on("remove",(()=>{t.off(e,this._updateGrids,this)}))}_updateGrids(){const t=this.getMap();this._grids.forEach((e=>{e.indexs.length&&e.updateBBoxPixel(t)}))}getSelectMesh(){const t=this.faceIndex;if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],{coordinate:n,height:r,color:i,size:o}=e;this._baseObjects[t]=new lr(n,{height:r,index:t,color:i,size:o},this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}identify(t){const e=this.getLayer(),n=this.getMap().getSize(),r=this.getLayer().getCamera(),i=this.getOptions().altitude,o=this.getMap(),s=e.altitudeToVector3(i,i).x;let a=this.getObject3d().material.size;const u=void 0===a,l=o.coordToContainerPoint(t),h=[];if(this._grids.forEach((t=>{t.indexs.length&&t.isRecCross(l,u?this.maxSize:a)&&h.push(t)})),h.length<1)return!1;for(let t=0,e=h.length;t<e;t++)for(let e=h[t].positions.length-1;e>=0;e--){u&&(a=this._datas[h[t].indexs[e]].size||1);const i=h[t].positions[e];pr.x=i.x,pr.y=i.y,pr.z=i.z+s;const o=sr(pr,n,r);if(Math.sqrt(Math.pow(l.x-o.x,2)+Math.pow(l.y-o.y,2))<=a/2)return this.faceIndex=h[t].indexs[e],!0}return!1}}const yr={coordinate:"",radius:10,height:100,radialSegments:6,altitude:0,topColor:"",bottomColor:"#2d2f61"};class vr extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const s=t.length,a=xe(t),u=r.coordinateToVector3(a),l=[],h=[],c=[];let f=0;const p={},d={};let g;super(),e=i.Util.extend({},{altitude:0,layer:r,points:t},yr,e),this._initOptions(e);const y=new o.Vector3;if(e.asynchronous){g=Sn();const n=i.Util.GUID();this.getOptions().id=n;const o=[];for(let n=0;n<s;n++){const s=i.Util.extend({index:n},e,t[n]),{radius:a,radialSegments:l,altitude:h,height:c,coordinate:f}=s,g=Ae(a,r,p);t[n]._radius=g;const v=_e(c,r,d),m=_e(h,r,d),A=r.coordinateToVector3(f,0,y).sub(u);o.push({radialSegments:l,radius:g,height:v,center:[A.x,A.y],altitude:m})}vn.push({id:n,data:o,layer:r,baseObject:this})}else{for(let o=0;o<s;o++){const s=i.Util.extend({index:o},e,t[o]),{radius:a,radialSegments:g,altitude:v,topColor:m,bottomColor:A,height:_,coordinate:x}=s,w=Ae(a,r,p),b=_e(_,r,d),E=_e(v,r,d),I=r.coordinateToVector3(x,0,y).sub(u),C=Pn({radius:w,height:b,radialSegments:g,center:[I.x,I.y]});m&&(Ln(C,A,m,"z",b/2),n.vertexColors=O());const S=C.attributes.position.array;for(let t=0,e=S.length;t<e;t+=3)S[t+2]+=E;l.push(C);const M=new Nn(x,s,n,r);h.push(M),C.index.count;const B=C.attributes.position.count;C.attributes.normal.count,C.attributes.uv.count,c[o]={position:{count:B,start:f,end:f+3*B},hide:!1},f+=3*B}g=Rn(l)}this._createMesh(g,n);const v=e.altitude,m=r.altitudeToVector3(v,v).x,A=u.clone();A.z=m,this.getObject3d().position.copy(A),this._baseObjects=h,this._datas=t,this._geometriesAttributes=c,this.faceIndex=null,this._geometryCache=In(g),this.isHide=!1,this._colorMap={},this._initBaseObjectsEvent(h),e.asynchronous||(this._setPickObject3d(),this._init()),this.type="Bars"}identify(){return this.picked}getSelectMesh(){const t=this._getIndex();if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],n=Object.assign({},this.options,e,{index:t,asynchronous:!1});this._baseObjects[t]=new Nn(e.coordinate,n,this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}_workerLoad(t){const{geometriesAttributes:e}=t;this._geometriesAttributes=e;const n=En(t);this._geometryCache=In(n);const{topColor:r,bottomColor:i}=this.getOptions(),o=this.getObject3d(),s=o.material;if(r&&(Ln(n,i,r,"z",e),s.vertexColors=O()),o.geometry=n,o.material.needsUpdate=!0,this._setPickObject3d(),this._init(),this.isAdd){this.getLayer().getPick().add(this.pickObject3d)}this._fire("workerload",{target:this})}}const mr={width:3,height:1,altitude:0,topColor:null,bottomColor:"#2d2f61",pathUV:!1};class Ar extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const o=[],s=[],a=t.length;for(let e=0;e<a;e++){const n=Ve(t[e]);o.push(n.center),s.push(n.lineStrings)}const u=xe(o);e=i.Util.extend({},mr,e,{layer:r,lineStrings:t,coordinate:u});const{altitude:l,topColor:h,bottomColor:c,asynchronous:f,pathUV:p}=e;let d;const g=[],y=[];if(super(),f)d=Sn(),cn.push({id:i.Util.GUID(),layer:r,key:e.key,center:u,data:s,lineStrings:t,baseObject:this,option:e});else{const o=[];let l=0;const f={},g={};for(let n=0;n<a;n++){const a=t[n],h=i.Util.extend({},e,Me(a),{index:n}),{height:c,width:d,bottomHeight:v}=h,m=Ae(d,r,f),A=_e(c,r,g),_=s[n],x=[];let w=0;for(let t=0,e=_.length;t<e;t++){const e=ze(_[t],m,A,p,r,u);w=we(e,v,r,f),x.push(e)}const b=wn(x);o.push(b);const{position:E,normal:I,indices:C}=b;C.length;const S=E.length/3;I.length,y[n]={position:{middleZ:w+A/2,count:S,start:l,end:l+3*S},hide:!1},l+=3*S}d=xn(o),h&&(Pe(d,c,h,y),n.vertexColors=O())}this._initOptions(e),this._createMesh(d,n);const v=r.altitudeToVector3(l,l).x,m=r.coordinateToVector3(u,v);this.getObject3d().position.copy(m),this._baseObjects=g,this._datas=t,this._geometriesAttributes=y,this.faceIndex=null,this._geometryCache=In(d),this.isHide=!1,this._colorMap={},this._initBaseObjectsEvent(g),f||(this._setPickObject3d(),this._init()),this.type="ExtrudeLines"}getSelectMesh(){const t=this._getIndex();if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],n=Object.assign({},this.options,Z(e)?e.properties:e.getProperties(),{index:t});this._baseObjects[t]=new zn(e,n,this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}identify(t){return this.picked}_workerLoad(t){const{geometriesAttributes:e}=t;this._geometriesAttributes=e;const n=En(t);this._geometryCache=In(n);const{topColor:r,bottomColor:i,bottomHeight:o,height:s}=this.getOptions(),a=this.getObject3d().material;if(r&&(Pe(n,i,r,e),a.vertexColors=O()),this.getObject3d().geometry=n,this.getObject3d().material.needsUpdate=!0,this._setPickObject3d(),this._init(),this.isAdd){this.getLayer().getPick().add(this.pickObject3d)}this._fire("workerload",{target:this})}}const _r={altitude:0,colors:null};class xr extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const s=[],a=[],u=t.length;for(let e=0;e<u;e++){const n=Ve(t[e]);s.push(n.center),a.push(n.lineStrings)}const l=xe(s);e=i.Util.extend({},_r,e,{layer:r,lineStrings:t,coordinate:l}),super(),this._initOptions(e);const{asynchronous:h}=e;let c;const f=[],p={};let d=[],g=0,y=[];if(h)c=Xe(),pn.push({id:i.Util.GUID(),layer:r,key:e.key,center:l,data:a,lineStrings:t,baseObject:this,option:e});else{for(let t=0;t<u;t++){const n=a[t];let o=0;for(let t=0,s=n.length;t<s;t++){const s=Me(n[t]),a=i.Util.extend({},e,s),{positions:u}=Ue(n[t],r,l,!1);we(u,a.bottomHeight,r,p),o+=u.length/3*2-2,y.push(qe(u))}d[t]={position:{count:o,start:g,end:g+3*o},hide:!1},g+=3*o}const t=He(y);c=new o.BufferGeometry,R(c,"position",new o.BufferAttribute(t,3))}this._createLineSegments(c,n);const{altitude:v}=e,m=r.altitudeToVector3(v,v).x,A=r.coordinateToVector3(l,m);this.getObject3d().position.copy(A),this._baseObjects=f,this._datas=t,this._geometriesAttributes=d,this.faceIndex=null,this.index=null,this._geometryCache=c.clone(),this.isHide=!1,this._colorMap={},this._initBaseObjectsEvent(f),h||(this._setPickObject3d(),this._init()),this.type="Lines"}getSelectMesh(){const t=this._getIndex();if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],n=i.Util.extend({},this.getOptions(),{index:t},Z(e)?e.properties:e.getProperties());this._baseObjects[t]=new Qn(e,n,this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}_setPickObject3d(){if(!this._colorMap)return;const t=this._geometryCache||this.getObject3d().geometry.clone(),e=this.getLayer().getPick(),{_geometriesAttributes:n}=this,r=n.length,i=be(n);let s=0;for(let t=0;t<r;t++){const r=e.getColor(),o=r.getHex();this._colorMap[o]=t;const{count:a}=n[t].position;this._datas[t].colorIndex=o;for(let t=0;t<a;t++)i[s]=r.r,i[s+1]=r.g,i[s+2]=r.b,s+=3}R(t,"color",new o.BufferAttribute(i,3,!0));const a=this.getObject3d().material.clone();a.color.set("#fff"),a.vertexColors=O();const u=e.getColor().getHex(),l=new o.LineSegments(t,a);l.position.copy(this.getObject3d().position),l._colorIndex=u,this.setPickObject3d(l)}identify(t){return this.picked}_workerLoad(t){const{position:e,geometriesAttributes:n}=t;this._geometriesAttributes=n;const r=new o.BufferGeometry;if(R(r,"position",new o.BufferAttribute(new Float32Array(e),3)),this._computeLineDistances(r),this._geometryCache=r.clone(),this.getObject3d().geometry=r,this.getObject3d().material.needsUpdate=!0,this._setPickObject3d(),this._init(),this.isAdd){this.getLayer().getPick().add(this.pickObject3d)}this._fire("workerload",{target:this})}}const wr=[],br=[];function Er(){return{waitingQueue:wr,currentQueue:br}}function Ir(t,e){for(let n=0,r=t.length;n<r;n++){const r=t[n];if(r){const{key:i,callback:o}=r;if(e===i)return t.splice(n,1),o}}return null}const Cr=document.createElement("canvas");let Sr;function Mr(t,e=!1){if(Sr)return Sr;const n=Cr.getContext("2d");return n.clearRect(0,0,256,256),n.save(),Sr=Cr.toDataURL(),Sr}function Br(t=1,e=1){let n;return"undefined"==typeof document||(n=document.createElement("canvas"),t&&(n.width=t),e&&(n.height=e)),n}Cr.width=Cr.height=256;class Tr extends i.TileLayer{constructor(t,e={}){super(i.Util.GUID(),i.Util.extend({urlTemplate:t},e)),this._opts=null,this._layer=null,this.material=null,this.getMaterial=null,this._baseObjectKeys={},this._loadTiles={},this._add=null,this._layerLaodTime=(new Date).getTime()}isAsynchronous(){return this._opts.worker}getBaseObjects(){const t=this._loadTiles,e=[];for(let n in t){const t=this._baseObjectKeys[n];if(t&&Array.isArray(t)&&t.length)for(let n=0,r=t.length;n<r;n++)e.push(t[n])}return e}onSelectMesh(t,e){}formatBaseObjects(t,e){return[]}loopMessage(t){}getTileData(t){const{key:e,url:n,callback:r,img:o}=t;i.Ajax.getJSON(n,{},(function(t,n){t?(console.error(t),r(e,null,o)):r(e,n,o)}))}_getCurentTileKeys(){const t=this.getTiles().tileGrids||[],e=[],n={};for(let r=0,i=t.length;r<i;r++){const i=t[r].tiles||[];for(let t=0,r=i.length;t<r;t++){const{id:r}=i[t];e.push(r),n[r]=!0}}return{keys:e,keysMap:n}}_isLoad(){const{keys:t}=this._getCurentTileKeys(),e=Object.keys(this._renderer.tilesInView);return t.length===e.length}_layerOnLoad(){const t=(new Date).getTime();if(t-this._layerLaodTime<20)return;this._layerLaodTime=t;const e=this._renderer.tilesInView,n=this._loadTiles,r=this._layer,i=this._baseObjectKeys,o=Object.keys(e).length,s=Object.keys(n).length,a=[];if(o&&s)for(let t in n)e[t]||i[t]&&(i[t]||[]).forEach((t=>{a.push(t)}));if(a.length&&r.removeMesh(a,!1),o&&s)for(let t in e)if(!n[t])if(i[t]){const e=i[t];r.addMesh(e)}else{const{x:e,y:n,z:r}=this._getXYZOfIndex(t);this.getTileUrl(e,n,r)}this._loadTiles=Object.assign({},e),this._diffCache()}_init(){}_workerLoad(t){const e=t.target._img;e.currentCount++,e.currentCount===e.needCount&&(e.src=Mr(e._key,this._opts.debug))}_generateBaseObjects(t,e,n){if(e&&n){const{keysMap:r}=this._getCurentTileKeys();if(!r[t])return void(n.src=Mr(0,this._opts.debug));const i=this.formatBaseObjects(t,e);if(i.length){n.needCount=i.length,n.currentCount=0;for(let e=0,r=i.length;e<r;e++){const r=i[e];r._img=n,r._vt=this,this.isVisible()||r.hide(),this._cachetile(t,r),r.isAsynchronous()||n.currentCount++}this._layer.addMesh(i,!1),n.needCount===n.currentCount&&(n.src=Mr(0,this._opts.debug)),this.isAsynchronous()?i.filter((t=>t.isAsynchronous())).forEach((t=>{t.on("workerload",this._workerLoad,this)})):n.src=Mr(0,this._opts.debug)}else n.src=Mr(0,this._opts.debug);this._loadTiles[t]=!0}else n&&(n.src=Mr(0,this._opts.debug))}_diffCache(){if(Object.keys(this._baseObjectKeys).length>this._renderer.tileCache.max){const t=this._renderer.tileCache.data,e=this._renderer.tilesInView,n=[];for(let r in this._baseObjectKeys)t[r]||e[r]||((this._baseObjectKeys[r]||[]).forEach((t=>{t.isAdd&&n.push(t)})),this._diposeBaseObject(r),delete this._baseObjectKeys[r]);n.length&&this._layer.removeMesh(n,!1)}}_diposeBaseObject(t){const e=this._baseObjectKeys[t];e&&e.length&&e.forEach((t=>{t.getObject3d().geometry.dispose(),t._geometryCache&&t._geometryCache.dispose();const e=t._baseObjects;e&&e.length&&e.forEach((t=>{t.getObject3d().geometry.dispose(),t=null})),t._datas=null,t._geometriesAttributes=null,t._faceMap=null,t._colorMap=null,t.pickObject3d&&t.pickObject3d.geometry.dispose(),t=null}))}_cachetile(t,e){this._baseObjectKeys[t]||(this._baseObjectKeys[t]=[]),this._baseObjectKeys[t].push(e)}_getXYZOfIndex(t){const e=t.indexOf("_")>-1?"_":"-";let[n,r,i]=t.split(e).slice(1,4);return{x:parseInt(r),y:parseInt(n),z:parseInt(i)}}_getTileExtent(t,e,n){const r=this.getMap()._getResolution(n);return this._getTileConfig().getTilePrjExtent(t,e,r)}_getTileLngLatExtent(t,e,n){const r=this._getTileExtent(t,e,n);let o=r.getMax(),s=r.getMin();const a=this.getMap().getProjection();return s=a.unproject(s),o=a.unproject(o),new i.Extent(s,o)}}const kr={worker:!1};class Pr extends Tr{constructor(t,e={},n,r){super(i.Util.GUID(),i.Util.extend({urlTemplate:t},kr,e)),this._opts=e,this._layer=r,this.getMaterial=n,this._baseObjectKeys={},this._loadTiles={},this._add=null,this._layerLaodTime=(new Date).getTime(),this._init()}formatBaseObjects(t,e){const n=this._opts,r=[],s=this.isAsynchronous();for(let a in e){const u=e[a]||{};let l;if(Array.isArray(u)?l=u:"FeatureCollection"===u.type&&(l=u.features),l&&l.length){const e=[],h=[],c=[];for(let t=0,n=l.length;t<n;t++){const n=l[t];if(K(n))e.push(n);else if(Z(n)){const t=rt(n);for(let e=0,n=t.length;e<n;e++)h.push(t[e])}else if($(n)){const t=rt(n);for(let e=0,n=t.length;e<n;e++)c.push(i.Util.extend({},t[e].properties,t[e],{coordinate:et(t[e])}))}}if(e.length){const o=this._getMaterial(a,e,t,u);if(o){const u=this._layer.toExtrudePolygons(e,i.Util.extend({},{topColor:"#fff",layerName:a,asynchronous:s,key:t},n),o);r.push(u)}}if(h.length){const e=this._getMaterial(a,h,t,u);if(e&&(e instanceof o.LineBasicMaterial||e instanceof o.LineDashedMaterial)){const t=this._layer.toLines(h,i.Util.extend({},{layerName:a,asynchronous:s},n),e);r.push(t)}}if(c.length){const e=this._getMaterial(a,c,t,u);if(e&&e instanceof o.PointsMaterial){const t=this._layer.toPoints(c,i.Util.extend({},{layerName:a,asynchronous:s},n),e);r.push(t)}}}}return r}loopMessage(t){const{currentQueue:e}=Er();e.length>0&&this.getTileData(t)}_init(){this.on("layerload",this._layerOnLoad),this.on("add",(()=>{if(!1===this._add){const t=this.getBaseObjects();this._layer.addMesh(t)}this._add=!0,this.intervalId=setInterval((()=>{this._isLoad()&&!this._layer.getMap().isInteracting()&&this.fire("layerload")}),1e3)})),this.on("remove",(()=>{this._add=!1;const t=this.getBaseObjects();this._layer.removeMesh(t),clearInterval(this.intervalId)})),this.on("show",(()=>{this.getBaseObjects().forEach((t=>{t.show()}));for(let t in this._baseObjectKeys){(this._baseObjectKeys[t]||[]).forEach((t=>{t.show()}))}})),this.on("hide",(()=>{this.getBaseObjects().forEach((t=>{t.hide()}));for(let t in this._baseObjectKeys){(this._baseObjectKeys[t]||[]).forEach((t=>{t.hide()}))}})),this.on("renderercreate",(t=>{t.renderer.loadTile=function(t){var e=this.layer.getTileSize(),n=new Image;return n.width=e.width,n.height=e.height,n.onload=this.onTileLoad.bind(this,n,t),n.onerror=this.onTileError.bind(this,n,t),this.loadTileImage(n,t.url,t.id),n},t.renderer.deleteTile=function(t){if(!t||!t.image)return;t.image.onload=null,t.image.onerror=null;!function(t){const e=Ir(wr,t);e&&e(t)}((t.info||{}).id)},t.renderer.loadTileImage=(t,e,n)=>{t._key=n,function(t,e,n,r,i){const o={key:t,url:e,callback:n,img:r,vt:i};br.length<10?(br.push(o),i.loopMessage(o)):wr.push(o)}(n,e,((t,e,n)=>{this._generateBaseObjects(t,e,n),function(t,e){if(Ir(br,t),wr.length){br.push(wr[0]),wr.splice(0,1);const t=br[br.length-1];e.loopMessage(t)}}(t,this)}),t,this)}}))}_getMaterial(t,e,n,r){return this.getMaterial&&i.Util.isFunction(this.getMaterial)?this.getMaterial(t,e,n,r):null}}function Lr(t,e,n,r){const{position:i,uv:s,normal:a,indexs:u}=function(t,e,n,r){const i=t/n,o=e/r,s=-t/2,a=e/2,u=-e/2,l=(n+1)*(r+1),h=new Float32Array(3*l),c=new Float32Array(2*l),f=new Float32Array(3*l),p=new Uint32Array(10*l);let d=0,g=0,y=0;for(let l=0;l<=r;l++)for(let v=0;v<=n;v++){const m=s+i*v,A=a-o*l;h[d]=m,h[d+1]=A,h[d+2]=0,f[d]=0,f[d+1]=0,f[d+2]=1;const _=(m-s)/t,x=(A-u)/e;if(c[g]=_,c[g+1]=x,d+=3,g+=2,v<n&&l<r){const t=l*(n+1)+v,e=t+1,r=(n+1)*(l+1)+v,i=r+1;p[y]=t,p[y+1]=r,p[y+2]=e,p[y+3]=r,p[y+4]=i,p[y+5]=e,y+=6}}const v=new Uint32Array(y);for(let t=0,e=v.length;t<e;t++)v[t]=p[t];return{position:h,uv:c,normal:f,indexs:v}}(t,e,n,r),l=new o.BufferGeometry;return R(l,"position",new o.BufferAttribute(i,3)),R(l,"normal",new o.BufferAttribute(a,3)),R(l,"uv",new o.BufferAttribute(s,2)),l.setIndex(new o.BufferAttribute(u,1)),l}const Rr=new o.TextureLoader,Dr=document.createElement("canvas");function Or(t){if(!t)return null;let e;return"string"==typeof t?(e=new Image,e.src=t):t instanceof HTMLCanvasElement?(e=new Image,e.src=t.toDataURL()):t instanceof Image&&(e=new Image,e.src=t.src,e.crossOrigin=t.crossOrigin),e&&!e.crossOrigin&&(e.crossOrigin="Anonymous"),e}const Nr=new Map;function Fr(t,e,n,r){if(!e||!n)return;const{imageWidth:i,imageHeight:s,flaserBoundary:a}=r;let u;if(u=t instanceof Uint32Array||t instanceof Uint8ClampedArray?t:function(t,e=256,n=256){Dr.width=e,Dr.height=n;const r=Dr.getContext("2d");return r.drawImage(t,0,0,e,n),r.getImageData(0,0,e,n).data}(t,i,s),!u)return void console.error("image is error type data",t);let l=0,h=0,c=0;const f=new o.Vector3,p=Nr;for(let t=0,r=u.length;t<r;t+=4){const r=.1*(256*u[t]*256+256*u[t+1]+u[t+2])-1e4;let o=0;if(0!==h&&h+1!==s&&0!==c&&c+1!==i||!a){const t=p.get(r);void 0!==t?o=t:(o=n.altitudeToVector3(r,r,null,f).x,p.set(r,o))}e.attributes.position.array[3*l+2]=o,l++,c++,c===i&&(h++,c=0)}e.attributes.position.needsUpdate=!0}const Ur={interactive:!1,altitude:0,image:null,imageWidth:256,imageHeight:256,texture:null,flaserBoundary:!0,bufferPixel:1};class Qr extends W{constructor(t,e,n,r){e=i.Util.extend({},Ur,e,{layer:r,extent:t});const{texture:o,image:s,altitude:a,imageHeight:u,imageWidth:l,flaserBoundary:h,bufferPixel:c}=e;t instanceof i.Extent||(t=new i.Extent(t));const{xmin:f,ymin:p,xmax:d,ymax:g}=t;let y=1/0,v=1/0,m=-1/0,A=-1/0;[[f,p],[f,g],[d,g],[d,p]].forEach((t=>{const e=r.coordinateToVector3(t),{x:n,y:i}=e;y=Math.min(n,y),v=Math.min(i,v),m=Math.max(n,m),A=Math.max(i,A)}));const _=(m-y)/l,x=(A-v)/u;y-=_*c,m+=_*c,v-=x*c,A+=x*c;const w=Math.abs(m-y),b=Math.abs(A-v),E=Or(s),I=Or(o),C=Lr(w,b,l-1,u-1);super(),this._initOptions(e),this._createMesh(C,n);const S=r.altitudeToVector3(a,a).x,M=r.coordinateToVector3(t.getCenter(),S);this.getObject3d().position.copy(M),n.transparent=!0,E&&(E.onload=()=>{Fr(E,C,r,{imageWidth:l,imageHeight:u,flaserBoundary:h}),this.fire("dataload",{})},E.onerror=function(){console.error(`not load ${E.src}`),this.fire("dataerror",{})}),I?(n.opacity=0,Rr.load(I.src,(t=>{n.map=t,n.opacity=1,n.needsUpdate=!0,this.fire("textureload",{})}))):n.opacity=1,this.type="Terrain"}updateData(t){return Fr(t,this.getObject3d().geometry,this.getLayer(),this.getOptions()),this.fire("updatedata",{}),this}}const Gr={scale:1,tileDivisor:4};class zr extends Tr{constructor(t,e={},n,r){super(i.Util.GUID(),i.Util.extend({urlTemplate:t},Gr,e)),this._opts=e,this._layer=r,this.material=n,this._baseObjectKeys={},this._loadTiles={},this._add=null,this._imgQueue={},this._layerLaodTime=(new Date).getTime(),this._init()}isAsynchronous(){return!1}formatBaseObjects(t,e){const n=this.options,r=[],{scale:i,tileDivisor:o}=n,{x:s,y:a,z:u}=this._getXYZOfIndex(t),l=this.getMap().getZoom(),h=this.getTileUrl(s,a,u),[c,f]=this.options.tileSize,p=this._getTileLngLatExtent(s,a,u),d=this.material.clone();if(u+1>=Math.round(l)){const t=new Qr(p,{image:e,imageWidth:c/o,imageHeight:f/o,texture:h},d,this._layer);t.getObject3d().scale.set(i,i,1),r.push(t)}return r}loopMessage(t){this.getTileData(t)}_init(){this.on("layerload",this._layerOnLoad),this.on("add",(()=>{if(!1===this._add){const t=this.getBaseObjects();this._layer.addMesh(t)}this._add=!0,this.intervalId=setInterval((()=>{this._isLoad()&&!this._layer.getMap().isInteracting()&&this.fire("layerload")}),1e3)})),this.on("remove",(()=>{this._add=!1;const t=this.getBaseObjects();this._layer.removeMesh(t),clearInterval(this.intervalId)})),this.on("show",(()=>{this.getBaseObjects().forEach((t=>{t.show()}));for(let t in this._baseObjectKeys){(this._baseObjectKeys[t]||[]).forEach((t=>{t.show()}))}})),this.on("hide",(()=>{this.getBaseObjects().forEach((t=>{t.hide()}));for(let t in this._baseObjectKeys){(this._baseObjectKeys[t]||[]).forEach((t=>{t.hide()}))}})),this.on("renderercreate",(t=>{t.renderer.loadTile=function(t){var e=this.layer.getTileSize(),n=new Image;return n.width=e.width,n.height=e.height,n.onload=this.onTileLoad.bind(this,n,t),n.onerror=this.onTileError.bind(this,n,t),this.loadTileImage(n,t.url,t.id),n},t.renderer.deleteTile=t=>{if(!t||!t.image)return;t.image.onload=null,t.image.onerror=null;const e=t.info||{},n=this._imgQueue[e.id];n&&(n.src="",n.onload=null,n.onerror=null,delete this._imgQueue[e.id])},t.renderer.loadTileImage=(t,e,n)=>{t._key=n;const r=new Image;this._imgQueue[n]=r;const i={key:n,url:e,rgbImage:r,callback:(t,e,n)=>{this._generateBaseObjects(t,e,n)},img:t,vt:this};this.loopMessage(i)}}))}}
|
|
5
5
|
/*!
|
|
6
6
|
* Code from baidu mapv
|
|
7
7
|
* License: BSD-3
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* https://github.com/huiyan-fe/mapv
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
|
-
function(t){var e=t/2,n=t+e,r=1e4,i=Br(2*n,2*n),o=i.getContext("2d");return o.shadowBlur=e,o.shadowColor="black",o.shadowOffsetX=o.shadowOffsetY=r,o.beginPath(),o.arc(n-r,n-r,t,0,2*Math.PI,!0),o.closePath(),o.fill(),i}(n._size||n.size||13),o=i.width/2,s=i.height/2,a=e,u={};for(var l in a.forEach((function(t){var e=void 0===t.count?1:t.count,n=Math.min(1,e/r).toFixed(2);u[n]=u[n]||[],u[n].push(t)})),u)if(!isNaN(l)){var h=u[l];t.beginPath(),n.withoutAlpha||(t.globalAlpha=l),h.forEach((function(e){var n=e.coordinate,a=void 0===e.count?1:e.count;t.globalAlpha=a/r,t.drawImage(i,n[0]-o,n[1]-s)}))}}jr.prototype.setMax=function(t){this.max=t||100},jr.prototype.setMin=function(t){this.min=t||0},jr.prototype.setMaxSize=function(t){this.maxSize=t||35},jr.prototype.setMinSize=function(t){this.minSize=t||0},jr.prototype.initPalette=function(){var t=this.gradient,e=Br(256,1),n=this.paletteCtx=e.getContext("2d"),r=n.createLinearGradient(0,0,256,1);for(var i in t)r.addColorStop(parseFloat(i),t[i]);n.fillStyle=r,n.fillRect(0,0,256,1)},jr.prototype.getColor=function(t){var e=this.getImageData(t);return"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]/256+")"},jr.prototype.getImageData=function(t){var e=this.paletteCtx.getImageData(0,0,256,1).data;if(void 0===t)return e;var n=this.max,r=this.min;t>n&&(t=n),t<r&&(t=r);var i=4*Math.floor((t-r)/(n-r)*255);return[e[i],e[i+1],e[i+2],e[i+3]]},jr.prototype.getSize=function(t){var e=this.max,n=this.min,r=this.maxSize,i=this.minSize;return t>e&&(t=e),t<n&&(t=n),e>n?i+(t-n)/(e-n)*(r-i):r},jr.prototype.getLegend=function(t){var e=this.gradient,n=t.width||20,r=t.height||180,i=Br(n,r),o=i.getContext("2d"),s=o.createLinearGradient(0,r,0,0);for(var a in e)s.addColorStop(parseFloat(a),e[a]);return o.fillStyle=s,o.fillRect(0,0,n,r),i};var Wr={draw:function(t,e,n){if(!(t.canvas.width<=0||t.canvas.height<=0)){var r=n.strength||.3;t.strokeStyle="rgba(0,0,0,"+r+")";var i=Br(t.canvas.width,t.canvas.height),o=i.getContext("2d");o.scale(devicePixelRatio,devicePixelRatio),n=n||{},t.save();var s=new jr({gradient:n.gradient});if(Hr(o,e,n),!n.absolute){var a=o.getImageData(0,0,t.canvas.width,t.canvas.height);Vr(a.data,s.getImageData(),n),t.putImageData(a,0,0),t.restore()}s=null,i=null}},drawGray:Hr,colorize:Vr};const Yr={altitude:0,interactive:!1,min:0,max:100,size:13,gradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},gridScale:.5},Xr=2048;class Jr extends W{constructor(t,e,n,r){Array.isArray(t)||(t=[t]);let s=1/0,a=1/0,u=-1/0,l=-1/0;const h=[];for(let e=0,n=t.length;e<n;e++){const{coordinate:n,lnglat:i,xy:o}=t[e],c=n||i||o;if(!c){console.warn("not find coordinate");continue}const f=r.coordinateToVector3(c);h.push(f);const{x:p,y:d}=f;s=Math.min(s,p),a=Math.min(a,d),u=Math.max(u,p),l=Math.max(l,d)}e=i.Util.extend({},Yr,e,{layer:r,points:t});let{gridScale:c,altitude:f,size:p}=e;const d=Math.abs(u-s),g=Math.abs(l-a),y=Math.max(d*c,g*c);if(y>Xr){console.warn(`gridScale: ${c} it's too big. I hope it's a smaller value,canvas max size is 2048* 2048`);c=Xr/(y/c)}let v=Math.ceil(d*c),m=Math.ceil(g*c);const A=v/d,_=m/g,x=[],w=Math.ceil(2*p);for(let e=0,n=h.length;e<n;e++){const n=h[e];n.x-=s,n.y-=a,n.x*=A,n.y*=_,n.y=m-n.y,n.x+=w,n.y+=w,x.push({coordinate:[n.x,n.y],count:t[e].count})}v+=2*w,m+=2*w;let b=Br(v,m),E=b.getContext("2d");Wr.drawGray(E,x,e);const I=E.getImageData(0,0,E.canvas.width,E.canvas.height);let C=-1/0;const S=new Float32Array(I.data.length/4),M=new Float32Array(I.data.length/4);for(let t=3,e=I.data.length,n=0;t<e;t+=4){const e=I.data[t];C=Math.max(C,e),M[n]=e,e<=0&&(S[n]=1),n++}const B=new jr({gradient:e.gradient});Wr.colorize(I.data,B.getImageData(),e),b=null,E=null;const T=Lr(d,g,v-1,m-1),k=T.getIndex().array,P=T.attributes.position.array,L=new Float32Array(P.length),D=new Uint32Array(6*P.length),N=new o.Color;let F=0;for(let t=0,e=P.length,n=0,r=k.length,i=0,o=I.data.length,s=0;t<Math.max(e,r,o);t+=3){if(t<e){const e=M[s];e>0&&(P[t+2]=e/C)}if(n<r){const t=k[n],e=k[n+1],r=k[n+2];S[t]&&S[e]&&S[r]||(D[F]=t,D[F+1]=e,D[F+2]=r,F+=3)}if(i<o){const t=`rgb(${I.data[i]},${I.data[i+1]},${I.data[i+2]})`;N.setStyle(t),L[n]=N.r,L[n+1]=N.g,L[n+2]=N.b}n+=3,i+=4,s++}const U=new Uint32Array(F);for(let t=0;t<F;t++)U[t]=D[t];T.setIndex(new o.BufferAttribute(U,1)),R(T,"color",new o.BufferAttribute(L,3,!0)),n.vertexColors=O(),super(),this._initOptions(e),this._createMesh(T,n);const Q=r.altitudeToVector3(f,f).x;this.getObject3d().position.copy(new o.Vector3((s+u)/2,(a+l)/2,Q)),this.type="HeatMap"}}const Kr=new o.Color;let Zr=1;class $r{constructor(t){this.object3ds=[],this.layer=t,this.camera=t.getCamera(),this.renderer=t.getThreeRenderer(),this.pickingTexture=L>=152?new o.WebGLRenderTarget(1,1,{format:o.RGBAFormat,colorSpace:o.SRGBColorSpace}):new o.WebGLRenderTarget(1,1,{}),this.pickingScene=new o.Scene}getColor(){return Kr.setHex(Zr),Zr++,Kr}add(t){if(t){const e=t._colorIndex;e&&(this.object3ds[e]=t,this.pickingScene.add(t))}return this}remove(t){if(t){const e=t._colorIndex;e&&(this.object3ds[e]=null,this.pickingScene.remove(t))}return this}isEmpty(){if(0===this.pickingScene.children.length)return!0;for(let t=0,e=this.pickingScene.children.length;t<e;t++){const e=this.pickingScene.children[t];if(e){const t=e.__parent;if(t&&!0===t.getOptions().interactive)return!1}}return!0}pick(t){if(!t)return;if(this.isEmpty())return;const{camera:e,renderer:n,pickingTexture:r,pickingScene:i,object3ds:o,layer:s}=this,a=this.pickingScene.children.length;for(let t=0;t<a;t++){const e=this.pickingScene.children[t];e&&e.__parent&&(e.__parent.picked=!1)}const{width:u,height:l}=s._getRenderer().canvas,h=r.width,c=r.height;u===h&&l===c||r.setSize(u,l),n.setRenderTarget(r),n.clear(),e&&e.layers&&this.camera.layers.set(0),n.render(i,e);const f=new Uint8Array(4),{x:p,y:d}=t;let g=window.devicePixelRatio;const y=s.getMap();y&&(g=y.getDevicePixelRatio?y.getDevicePixelRatio():y.options.devicePixelRatio);const v=p*g,m=r.height-d*g;n.readRenderTargetPixels(r,Math.round(v),Math.round(m),1,1,f);const A=f[0]<<16|f[1]<<8|f[2],_=o[A];if(_)_.__parent&&(o[A].__parent.picked=!0);else for(let t=0;t<a;t++){const e=this.pickingScene.children[t];if(e&&e.__parent){const t=e.__parent;if(t._colorMap&&null!=t._colorMap[A]){t.picked=!0,t.index=t._colorMap[A];break}}}n.setRenderTarget(null)}}const ti={bottomHeight:0,altitude:0};class ei extends W{constructor(t,e,n,r){e=i.Util.extend({},ti,e,{layer:r,lineString:t}),super(),this._initOptions(e);const{asynchronous:o}=e,{lineStrings:s,center:a}=Ve(t),u=new j;let l;if(o){const e=i.Util.GUID();this.getOptions().id=e,this.getOptions().center=a,dn.push({id:e,data:s,lineString:t,center:a,layer:r,baseObject:this})}else{const t=[],n={};for(let i=0,o=s.length;i<o;i++){const o=Ue(s[i],r,a,!1).positions;we(o,e.bottomHeight,r,n),t.push(qe(o))}l=He(t),u.setPositions(l)}this._setMaterialRes(r,n),this._createLine2(u,n);const{altitude:h}=e,c=r.altitudeToVector3(h,h).x,f=r.coordinateToVector3(a,c);this.getObject3d().position.copy(f),o||(this._setPickObject3d(l,n.linewidth),this._init()),this.type="FatLine"}_init(){const t=this.getLayer().getPick();this.on("add",(()=>{t.add(this.pickObject3d)})),this.on("remove",(()=>{t.remove(this.pickObject3d)}))}_setMaterialRes(t,e){const n=t.getMap();if(!n)return this;const r=n.getSize(),i=r.width,o=r.height;e.resolution.set(i,o)}_setPickObject3d(t,e){const n=new j;n.setPositions(t);const r=this.getLayer().getPick().getColor(),i=[];for(let e=0,n=t.length/3;e<n;e++)i.push(r.r,r.g,r.b);n.setColors(i);const o=new G({color:"#fff",linewidth:e,vertexColors:O()});this._setMaterialRes(this.getLayer(),o);const s=r.getHex(),a=new V(n,o);a.position.copy(this.getObject3d().position),a._colorIndex=s,this.setPickObject3d(a)}identify(t){return this.picked}setSymbol(t){if(t&&t instanceof o.Material){t.needsUpdate=!0;const e=this.getMap().getSize(),n=e.width,r=e.height;t.resolution.set(n,r),this.getObject3d().material=t}return this}_workerLoad(t){const e=new Float32Array(t.position),n=this.getObject3d();if(n.geometry.setPositions(e),n.computeLineDistances(),this._setPickObject3d(e,n.material.linewidth),this._init(),this.isAdd){this.getLayer().getPick().add(this.pickObject3d)}this._fire("workerload",{target:this})}_animation(){const t=this.getLayer();if(!t)return this;[this.getObject3d(),this.getPickObject3d()].forEach((e=>{e&&this._setMaterialRes(t,e.material)}))}}const ni={altitude:0,colors:null};class ri extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const o=[],s=[],a=t.length;for(let e=0;e<a;e++){const n=Ve(t[e]);o.push(n.center),s.push(n.lineStrings)}const u=xe(o);e=i.Util.extend({},ni,e,{layer:r,lineStrings:t,coordinate:u}),super(),this._initOptions(e);const{asynchronous:l}=e,h=new j,c=[],f={};let p,d,g=[],y=0,v=[];if(l)gn.push({id:i.Util.GUID(),data:s,key:e.key,center:u,layer:r,baseObject:this,lineStrings:t,option:e});else{for(let t=0;t<a;t++){const n=s[t];let o=0;for(let t=0,s=n.length;t<s;t++){const s=Me(n[t]),a=i.Util.extend({},e,s),{positions:l}=Ue(n[t],r,u,!1);we(l,a.bottomHeight,r,f),o+=l.length/3*2-2,v.push(qe(l))}g[t]={position:{count:o,start:y,end:y+3*o},instanceStart:{count:o,start:y,end:y+3*o},instanceEnd:{count:o,start:y,end:y+3*o},hide:!1},y+=3*o}p=He(v),h.setPositions(p)}this._setMaterialRes(r,n),this._createLine2(h,n);const{altitude:m}=e,A=r.altitudeToVector3(m,m).x,_=r.coordinateToVector3(u,A);this.getObject3d().position.copy(_),this._baseObjects=c,this._datas=t,this._geometriesAttributes=g,this.faceIndex=null,this.index=null,this._geometryCache=new j,l||(d=new Float32Array(p),this._geometryCache.setPositions(d)),this._colorMap={},this.isHide=!1,this._initBaseObjectsEvent(c),l||(this._setPickObject3d(d,n.linewidth),this._init()),this.type="FatLines"}_setMaterialRes(t,e){const n=t.getMap();if(!n)return this;const r=n.getSize(),i=r.width,o=r.height;e.resolution.set(i,o)}_setPickObject3d(t,e){if(!this._colorMap)return;const n=this._geometryCache||new j;n.setPositions(t);const r=this.getLayer().getPick(),{_geometriesAttributes:i}=this,o=be(i);let s=0;for(let t=0,e=i.length;t<e;t++){const e=r.getColor(),n=e.getHex();this._colorMap[n]=t;const{count:a}=i[t].position;this._datas[t].colorIndex=n;for(let t=0;t<a;t++)o[s]=e.r,o[s+1]=e.g,o[s+2]=e.b,s+=3}n.setColors(o);const a=new G({color:"#fff",linewidth:e,vertexColors:O()});this._setMaterialRes(this.getLayer(),a);const u=r.getColor().getHex(),l=new V(n,a);l.position.copy(this.getObject3d().position),l._colorIndex=u,this.setPickObject3d(l)}identify(t){return this.picked}setSymbol(t){if(t&&t instanceof o.Material){t.needsUpdate=!0;const e=this.getMap().getSize(),n=e.width,r=e.height;t.resolution.set(n,r),this.getObject3d().material=t}return this}getSelectMesh(){const t=this._getIndex();if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],n=i.Util.extend({},this.getOptions(),{index:t},Z(e)?e.properties:e.getProperties());this._baseObjects[t]=new ei(e,n,this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}_updateAttribute(t,e){const{indexs:n}=this._getHideGeometryIndex(e),r=this._geometryCache.attributes[e].array,i=r.length;for(let e=0;e<i;e++)t.array[e]=r[e];for(let r=0;r<n.length;r++){const i=n[r],{start:o,end:s}=this._geometriesAttributes[i][e];for(let e=o;e<s;e++)t.array[e]=-1e5}return this}_showGeometry(t,e){let n;if(t&&(n=t.getOptions().index),null!=n){const t=this._geometriesAttributes[n],{hide:r}=t;if(r===e)return this;t.hide=e;const i=this.getObject3d().geometry;this._updateAttribute(i.attributes.instanceStart,"instanceStart"),this._updateAttribute(i.attributes.instanceEnd,"instanceEnd"),i.attributes.instanceStart.data.needsUpdate=!0,i.attributes.instanceEnd.data.needsUpdate=!0,this.isHide=e}return this}_workerLoad(t){const{geometriesAttributes:e}=t;this._geometriesAttributes=e;const n=this.getObject3d(),r=new Float32Array(t.position),i=new Float32Array(r);if(n.geometry.setPositions(new Float32Array(r)),this._geometryCache.setPositions(i),this._setPickObject3d(i,n.material.linewidth),this._init(),this.isAdd){this.getLayer().getPick().add(this.pickObject3d)}this._fire("workerload",{target:this})}_animation(){const t=this.getLayer();if(!t)return this;[this.getObject3d(),this.getPickObject3d()].forEach((e=>{e&&this._setMaterialRes(t,e.material)}))}}const ii={radius:10,height:100,altitude:0,topColor:"",bottomColor:"#2d2f61",heightEnable:!0};class oi extends W{constructor(t,e,n,r){e=i.Util.extend({},ii,e,{layer:r,coordinate:t}),super(),this._initOptions(e);const{height:o,radius:s,topColor:a,bottomColor:u,altitude:l}=e,h=r.altitudeToVector3(o,o).x,c=r.distanceToVector3(s,s).x,f=Dn().clone();f.scale(2*c,2*c,h),a&&(Ln(f,u,a,"z",h/2),n.vertexColors=O()),this._createMesh(f,n);const p=r.altitudeToVector3(l,l).x,d=r.coordinateToVector3(t,p);this.getObject3d().position.copy(d),this.type="Box"}}const si={radius:10,height:100,altitude:0,topColor:null,bottomColor:"#2d2f61"};class ai extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const o=t.length,s=xe(t),a=r.coordinateToVector3(s),u=[],l=[],h=[];let c=0;e=i.Util.extend({},{altitude:0,layer:r,points:t},si,e);const f={},p={};for(let s=0;s<o;s++){const o=i.Util.extend({index:s},e,t[s]),{radius:d,altitude:g,topColor:y,bottomColor:v,height:m,coordinate:A}=o,_=Ae(d,r,f),x=_e(m,r,p),w=_e(g,r,p),b=Dn().clone();b.scale(2*_,2*_,x),y&&(Ln(b,v,y,"z",x/2),n.vertexColors=O());const E=r.coordinateToVector3(A).sub(a),I=b.attributes.position.array;for(let t=0,e=I.length;t<e;t+=3)I[t+2]+=w,I[t]+=E.x,I[t+1]+=E.y,I[t+2]+=E.z;u.push(b);const C=new oi(A,o,n,r);l.push(C),b.index.count;const S=b.attributes.position.count;b.attributes.normal.count,b.attributes.uv.count,h[s]={position:{count:S,start:c,end:c+3*S},hide:!1},c+=3*S}super(),this._initOptions(e);const d=Rn(u);this._createMesh(d,n);const g=e.altitude,y=r.altitudeToVector3(g,g).x,v=a.clone();v.z=y,this.getObject3d().position.copy(v),this._baseObjects=l,this._datas=t,this._geometriesAttributes=h,this.faceIndex=null,this._geometryCache=In(d),this.isHide=!1,this._colorMap={},this._initBaseObjectsEvent(l),this._setPickObject3d(),this._init(),this.type="Boxs"}identify(t){return this.picked}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function ui(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})})),e}var li={exports:{}};function hi(t,e,n){n=n||2;var r,i,o,s,a,u,l,h=e&&e.length,c=h?e[0]*n:t.length,f=ci(t,0,c,n,!0),p=[];if(!f||f.next===f.prev)return p;if(h&&(f=function(t,e,n,r){var i,o,s,a=[];for(i=0,o=e.length;i<o;i++)(s=ci(t,e[i]*r,i<o-1?e[i+1]*r:t.length,r,!1))===s.next&&(s.steiner=!0),a.push(wi(s));for(a.sort(mi),i=0;i<a.length;i++)n=Ai(a[i],n);return n}(t,e,f,n)),t.length>80*n){r=o=t[0],i=s=t[1];for(var d=n;d<c;d+=n)(a=t[d])<r&&(r=a),(u=t[d+1])<i&&(i=u),a>o&&(o=a),u>s&&(s=u);l=0!==(l=Math.max(o-r,s-i))?32767/l:0}return pi(f,p,n,r,i,l,0),p}function ci(t,e,n,r,i){var o,s;if(i===Di(t,e,n,r)>0)for(o=e;o<n;o+=r)s=Pi(o,t[o],t[o+1],s);else for(o=n-r;o>=e;o-=r)s=Pi(o,t[o],t[o+1],s);return s&&Ci(s,s.next)&&(Li(s),s=s.next),s}function fi(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!Ci(r,r.next)&&0!==Ii(r.prev,r,r.next))r=r.next;else{if(Li(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function pi(t,e,n,r,i,o,s){if(t){!s&&o&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=xi(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,s,a,u,l=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e<l&&(a++,r=r.nextZ);e++);for(u=l;a>0||u>0&&r;)0!==a&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(s>1)}(i)}(t,r,i,o);for(var a,u,l=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?gi(t,r,i,o):di(t))e.push(a.i/n|0),e.push(t.i/n|0),e.push(u.i/n|0),Li(t),t=u.next,l=u.next;else if((t=u)===l){s?1===s?pi(t=yi(fi(t),e,n),e,n,r,i,o,2):2===s&&vi(t,e,n,r,i,o):pi(fi(t),e,n,r,i,o,1);break}}}function di(t){var e=t.prev,n=t,r=t.next;if(Ii(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,s=r.x,a=e.y,u=n.y,l=r.y,h=i<o?i<s?i:s:o<s?o:s,c=a<u?a<l?a:l:u<l?u:l,f=i>o?i>s?i:s:o>s?o:s,p=a>u?a>l?a:l:u>l?u:l,d=r.next;d!==e;){if(d.x>=h&&d.x<=f&&d.y>=c&&d.y<=p&&bi(i,a,o,u,s,l,d.x,d.y)&&Ii(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function gi(t,e,n,r){var i=t.prev,o=t,s=t.next;if(Ii(i,o,s)>=0)return!1;for(var a=i.x,u=o.x,l=s.x,h=i.y,c=o.y,f=s.y,p=a<u?a<l?a:l:u<l?u:l,d=h<c?h<f?h:f:c<f?c:f,g=a>u?a>l?a:l:u>l?u:l,y=h>c?h>f?h:f:c>f?c:f,v=xi(p,d,e,n,r),m=xi(g,y,e,n,r),A=t.prevZ,_=t.nextZ;A&&A.z>=v&&_&&_.z<=m;){if(A.x>=p&&A.x<=g&&A.y>=d&&A.y<=y&&A!==i&&A!==s&&bi(a,h,u,c,l,f,A.x,A.y)&&Ii(A.prev,A,A.next)>=0)return!1;if(A=A.prevZ,_.x>=p&&_.x<=g&&_.y>=d&&_.y<=y&&_!==i&&_!==s&&bi(a,h,u,c,l,f,_.x,_.y)&&Ii(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;A&&A.z>=v;){if(A.x>=p&&A.x<=g&&A.y>=d&&A.y<=y&&A!==i&&A!==s&&bi(a,h,u,c,l,f,A.x,A.y)&&Ii(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;_&&_.z<=m;){if(_.x>=p&&_.x<=g&&_.y>=d&&_.y<=y&&_!==i&&_!==s&&bi(a,h,u,c,l,f,_.x,_.y)&&Ii(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function yi(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!Ci(i,o)&&Si(i,r,r.next,o)&&Ti(i,o)&&Ti(o,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(o.i/n|0),Li(r),Li(r.next),r=t=o),r=r.next}while(r!==t);return fi(r)}function vi(t,e,n,r,i,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&Ei(s,a)){var u=ki(s,a);return s=fi(s,s.next),u=fi(u,u.next),pi(s,e,n,r,i,o,0),void pi(u,e,n,r,i,o,0)}a=a.next}s=s.next}while(s!==t)}function mi(t,e){return t.x-e.x}function Ai(t,e){var n=function(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s&&(s=a,n=r.x<r.next.x?r:r.next,a===i))return n}r=r.next}while(r!==e);if(!n)return null;var u,l=n,h=n.x,c=n.y,f=1/0;r=n;do{i>=r.x&&r.x>=h&&i!==r.x&&bi(o<c?i:s,o,h,c,o<c?s:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),Ti(r,t)&&(u<f||u===f&&(r.x>n.x||r.x===n.x&&_i(n,r)))&&(n=r,f=u)),r=r.next}while(r!==l);return n}(t,e);if(!n)return e;var r=ki(n,t);return fi(r,r.next),fi(n,n.next)}function _i(t,e){return Ii(t.prev,t,e.prev)<0&&Ii(e.next,t,t.next)<0}function xi(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function wi(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function bi(t,e,n,r,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function Ei(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Si(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Ti(t,e)&&Ti(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.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!==t);return r}(t,e)&&(Ii(t.prev,t,e.prev)||Ii(t,e.prev,e))||Ci(t,e)&&Ii(t.prev,t,t.next)>0&&Ii(e.prev,e,e.next)>0)}function Ii(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Ci(t,e){return t.x===e.x&&t.y===e.y}function Si(t,e,n,r){var i=Bi(Ii(t,e,n)),o=Bi(Ii(t,e,r)),s=Bi(Ii(n,r,t)),a=Bi(Ii(n,r,e));return i!==o&&s!==a||(!(0!==i||!Mi(t,n,e))||(!(0!==o||!Mi(t,r,e))||(!(0!==s||!Mi(n,t,r))||!(0!==a||!Mi(n,e,r)))))}function Mi(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Bi(t){return t>0?1:t<0?-1:0}function Ti(t,e){return Ii(t.prev,t,t.next)<0?Ii(t,e,t.next)>=0&&Ii(t,t.prev,e)>=0:Ii(t,e,t.prev)<0||Ii(t,t.next,e)<0}function ki(t,e){var n=new Ri(t.i,t.x,t.y),r=new Ri(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Pi(t,e,n,r){var i=new Ri(t,e,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 Li(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ri(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Di(t,e,n,r){for(var i=0,o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}li.exports=hi,li.exports.default=hi,hi.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(Di(t,0,o,n));if(i)for(var a=0,u=e.length;a<u;a++){var l=e[a]*n,h=a<u-1?e[a+1]*n:t.length;s-=Math.abs(Di(t,l,h,n))}var c=0;for(a=0;a<r.length;a+=3){var f=r[a]*n,p=r[a+1]*n,d=r[a+2]*n;c+=Math.abs((t[f]-t[d])*(t[p+1]-t[f+1])-(t[f]-t[p])*(t[d+1]-t[f+1]))}return 0===s&&0===c?0:Math.abs((c-s)/s)},hi.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[i][o][s]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n};var Oi=li.exports;function Ni(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function Fi(t,e,n,r,i){for(var o,s=r,a=e+1;a<n;a++){var u=Ni(t[a],t[e],t[n]);u>s&&(o=a,s=u)}s>r&&(o-e>1&&Fi(t,e,o,r,i),i.push(t[o]),n-o>1&&Fi(t,o,n,r,i))}function Ui(t,e){var n=t.length-1,r=[t[0]];return Fi(t,0,n,e,r),r.push(t[n]),r}function Qi(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return t=n?t:function(t,e){for(var n,r,i,o,s,a=t[0],u=[a],l=1,h=t.length;l<h;l++)n=t[l],i=a,o=void 0,s=void 0,o=(r=n)[0]-i[0],s=r[1]-i[1],o*o+s*s>e&&(u.push(n),a=n);return a!==n&&u.push(n),u}(t,r),t=Ui(t,r)}function Gi(t,e){return t[0]*e[0]+t[1]*e[1]}function zi(t,e){const n=e[0],r=e[1],i=Math.sqrt(n*n+r*r);return t[0]=n/i,t[1]=r/i,t}function ji(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function Vi(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function qi(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Hi(t,e){const n=e[0],r=e[1],i=e[2],o=Math.sqrt(n*n+r*r+i*i);return t[0]=n/o,t[1]=r/o,t[2]=i/o,t}function Wi(t,e,n){var r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],u=n[2];return t[0]=i*u-o*a,t[1]=o*s-r*u,t[2]=r*a-i*s,t}const Yi=[];function Xi(t,e,n,r){const i=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}(e,n),o=Math.acos(i)*r;return ji(Yi,n,e,-i),function(t,e){const n=e[0],r=e[1],i=e[2],o=Math.sqrt(n*n+r*r+i*i);t[0]=n/o,t[1]=r/o,t[2]=i/o}(Yi,Yi),function(t,e,n){t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}(t,e,Math.cos(o)),ji(t,t,Yi,Math.sin(o)),t}function Ji(t,e,n,r,i,o,s,a,u,l){const h=s-i,c=a-o,f=(h*(e-o)-c*(t-i))/(c*(n-t)-h*(r-e));return u&&(u[l=l||0]=t+f*(n-t),u[l+1]=e+f*(r-e)),f}function Ki(t,e,n){if(n-e<3)return 0;let r=0;for(let i=2*(n-1),o=2*e;o<2*n;){const e=t[i],n=t[i+1],s=t[o],a=t[o+1];i=o,o+=2,r+=e*a-s*n}return r}function Zi(t,e,n=2){return Oi(t,e,n)}const $i=[],to=[],eo=[];function no(t,e,n,r,i,o,s,a,u){const l=null!=s;let h,c,f,p=i,d=null;l&&(d=new Uint32Array(r-n));let g=[];for(let i=n;i<r;i++){const y=i===r-1?n:i+1,v=i===n?r-1:i-1,m=t[2*v],A=t[2*v+1],_=t[2*i],x=t[2*i+1],w=t[2*y],b=t[2*y+1];$i[0]=_-m,$i[1]=x-A,to[0]=w-_,to[1]=b-x,zi($i,$i),zi(to,to),l&&(d[i]=p);let E,I,C=!1;if(a||i!==n)if(a||i!==r-1){Vi(eo,to,$i);const t=eo[1];eo[1]=-eo[0],eo[0]=t,zi(eo,eo);const n=Gi(eo,to),r=Math.sqrt(1-n*n),i=o*Math.min(10,1/r);if(l&&1/r>s&&o*n<0){const t=_+eo[0]*o,n=x+eo[1]*o,i=Math.acos(r)/2,s=Math.tan(i)*Math.abs(o);e[2*p]=t+eo[1]*s,e[2*p+1]=n-eo[0]*s,p++,e[2*p]=t-eo[1]*s,e[2*p+1]=n+eo[0]*s,p++}else E=_+eo[0]*i,I=x+eo[1]*i,C=!0;if(C){if(u&&null!=h){const t=Ji(m,A,h,c,_,x,E,I,g,0);t>=-.01&&t<=1.01&&(e[2*f]=E=g[0],e[2*f+1]=I=g[1])}h=e[2*p]=E,c=e[2*p+1]=I,f=p,p++}}else eo[0]=$i[1],eo[1]=-$i[0],zi(eo,eo),E=_+eo[0]*o,I=x+eo[1]*o,C=!0;else eo[0]=to[1],eo[1]=-to[0],zi(eo,eo),h=e[2*p]=_+eo[0]*o,c=e[2*p+1]=x+eo[1]*o,f=p,p++}return d}function ro(t,e,n,r,i){const o=null!=r?[]:new Float32Array(t.length);if(no(t,o,0,e&&e.length?e[0]:t.length/2,0,n,r,i,!0),e)for(let s=0;s<e.length;s++){const a=e[s];no(t,o,a,e[s+1]||t.length/2,null!=r?o.length/2:a,n,r,i,!1)}return o}function io(t,e,n,r){for(let i=0;i<Math.floor((r-n)/2);i++)for(let o=0;o<e;o++){const s=(i+n)*e+o,a=(r-i-1)*e+o,u=t[s];t[s]=t[a],t[a]=u}return t}function oo(t,e){let n=t.length/2,r=0,i=e&&e.length?e[0]:n;Ki(t,r,i)>0&&io(t,2,r,i);for(let o=1;o<(e?e.length:0)+1;o++)r=e[o-1],i=e[o]||n,Ki(t,r,i)<0&&io(t,2,r,i)}const so=[[0,0],[1,0],[1,1],[0,0],[1,1],[0,1]];function ao(t,e,n){let r=0,i=t[e],o=t[e+1];const s=i,a=o;for(let s=e+2;s<n;s+=2){const e=t[s],n=t[s+1];r+=Math.sqrt((e-i)*(e-i)+(n-o)*(n-o)),i=e,o=n}return r+=Math.sqrt((i-s)*(i-s)+(o-a)*(o-a)),r}function uo(t,{vertices:e,topVertices:n,splittedMap:r,depth:i,rect:o},s,a,u,l){const h=a-s,c=l.smoothBevel?1:2,f=Math.min(i/2,l.bevelSize),p=l.bevelSegments,d=u.vertex,g=u.ringPerimeter,y=Math.max(o.width,o.height,i,g);function v(t){const n=(t+1)%h,r=e[2*t],i=e[2*t+1],o=e[2*n],s=e[2*n+1];return r===o&&i===s}if(f>0){const o=[0,0,1],a=[],l=[0,0,-1],g=[];let m=0,A=new Float32Array(h);for(let _=0;_<2;_++){const x=0===_?i-f:f;for(let i=0;i<=p*c;i++){let w,b,E=0;for(let I=0;I<h;I++){const C=2*(I%h+s),S=r?2*r[C/2]:C;a[0]=e[C]-n[S],a[1]=e[C+1]-n[S+1],a[2]=0;const M=Math.sqrt(a[0]*a[0]+a[1]*a[1]);a[0]/=M,a[1]/=M;const B=(Math.floor(i/c)+i%c)/p;0===_?Xi(g,o,a,B):Xi(g,a,l,B);const T=0===_?B:1-B,k=f*Math.sin(T*Math.PI/2),P=M*Math.cos(T*Math.PI/2),L=f*M/Math.sqrt(k*k+P*P),R=g[0]*L+n[S],D=g[1]*L+n[S+1],O=g[2]*L+x;if(t.position[3*u.vertex]=R,t.position[3*u.vertex+1]=D,t.position[3*u.vertex+2]=O,I>0&&(E+=Math.sqrt((w-R)*(w-R)+(b-D)*(b-D))),i>0||_>0){let e=3*(u.vertex-h),n=t.position[e],r=t.position[e+1],i=t.position[e+2];A[I]+=Math.sqrt((n-R)*(n-R)+(r-D)*(r-D)+(i-O)*(i-O))}if(t.uv[2*u.vertex]=E/y,t.uv[2*u.vertex+1]=A[I]/y,w=R,b=D,u.vertex++,!v(I)&&(c>1&&i%c||1===c&&i>=1))for(let e=0;e<6;e++){const n=(so[e][0]+I)%h,r=so[e][1]+m;t.indices[u.index++]=(r-1)*h+n+d}}m++}}}else for(let n=0;n<2;n++){const r=0===n?i-f:f;let o,a,l=0;for(let n=0;n<h;n++){const i=2*(n%h+s),c=e[i],f=e[i+1];t.position[3*u.vertex]=c,t.position[3*u.vertex+1]=f,t.position[3*u.vertex+2]=r,n>0&&(l+=Math.sqrt((o-c)*(o-c)+(a-f)*(a-f))),t.uv[2*u.vertex]=l/y,t.uv[2*u.vertex+1]=r/y,o=c,a=f,u.vertex++}}const m=f>0?p*c+1:1;for(let e=0;e<h;e++)if(!v(e))for(let n=0;n<6;n++){const r=(so[n][0]+e)%h,i=so[n][1]+m;t.indices[u.index++]=(i-1)*h+r+d}}function lo({indices:t,topVertices:e,rect:n,depth:r},i,o,s){if(e.length<=4)return;const a=o.vertex,u=t.length;for(let e=0;e<u;e++)i.indices[o.index++]=a+t[e];const l=Math.max(n.width,n.height);for(let t=0;t<(s.excludeBottom?1:2);t++)for(let s=0;s<e.length;s+=2){const a=e[s],u=e[s+1];i.position[3*o.vertex]=a,i.position[3*o.vertex+1]=u,i.position[3*o.vertex+2]=(1-t)*r,i.uv[2*o.vertex]=(a-n.x)/l,i.uv[2*o.vertex+1]=(u-n.y)/l,o.vertex++}if(!s.excludeBottom){const n=e.length/2;for(let e=0;e<u;e+=3)for(let r=0;r<3;r++)i.indices[o.index++]=a+n+t[e+2-r]}}function ho(t,e,n,r){const i=null==n||"auto"===n;if(!0===n)return{vertices:t,holes:e};const o=[],s=e&&[],a=t.length/2,u=[],l=[],h=[];let c=0,f=0;const p=(e?e.length:0)+1;for(let n=0;n<p;n++){0===n?f=e&&e.length?e[0]:a:(c=e[n-1],f=e[n]||a);for(let e=c;e<f;e++){const n=t[2*e],s=t[2*e+1],a=e===f-1?c:e+1,p=t[2*a],d=t[2*a+1];if(i){const i=e===c?f-1:e-1,a=t[2*i],g=t[2*i+1];u[0]=a-n,u[1]=g-s,l[0]=p-n,l[1]=d-s,zi(u,u),zi(l,l);1-(.5*Gi(u,l)+.5)>r?(o.push(n,s),h.push(e)):(o.push(n,s,n,s),h.push(e,e))}else o.push(n,s,n,s),h.push(e,e)}n<p-1&&s&&s.push(o.length/2)}return{vertices:new Float32Array(o),splittedMap:h,holes:s}}function co(t,e){let n=0,r=0;for(let i=0;i<t.length;i++){const{indices:o,vertices:s,splittedMap:a,topVertices:u,depth:l}=t[i],h=Math.min(l/2,e.bevelSize)>0?e.bevelSegments:0,c=t[i].holes||[];n+=o.length*(e.excludeBottom?1:2),r+=u.length/2*(e.excludeBottom?1:2);const f=2+2*h;let p=0,d=0;for(let t=0;t<c.length+1;t++){0===t?d=c.length?c[0]:s.length/2:(p=c[t-1],d=c[t]||s.length/2);n+=6*((a?a[d-1]+1:d)-(a?a[p]:p))*(f-1);const i=d-p;r+=i*f+(e.smoothBevel?0:h*i*2)}}const i={position:new Float32Array(3*r),indices:new(r>65535?Uint32Array:Uint16Array)(n),uv:new Float32Array(2*r)},o={vertex:0,index:0,ringPerimeter:0};for(let n=0;n<t.length;n++)lo(t[n],i,o,e);for(let n=0;n<t.length;n++){const{holes:r,vertices:s}=t[n],a=s.length/2;let u=0,l=r&&r.length?r[0]:a;if(o.ringPerimeter=ao(t[n].topVertices,u,l),uo(i,t[n],u,l,o,e),r)for(let s=0;s<r.length;s++)u=r[s],l=r[s+1]||a,o.ringPerimeter=ao(t[n].topVertices,u,l),uo(i,t[n],u,l,o,e)}for(let t=0;t<i.uv.length;t++){const e=i.uv[t];e>0&&Math.round(e)===e?i.uv[t]=1:i.uv[t]=e%1}return i.normal=function(t,e){function n(t,e,n,r){t[0]=e,t[1]=n,t[2]=r}const r=[],i=[],o=[],s=[],a=[],u=[],l=t.length,h=new Float32Array(e.length);for(let c=0;c<l;){const l=3*t[c++],f=3*t[c++],p=3*t[c++];n(r,e[l],e[l+1],e[l+2]),n(i,e[f],e[f+1],e[f+2]),n(o,e[p],e[p+1],e[p+2]),qi(s,r,i),qi(a,i,o),Wi(u,s,a);for(let t=0;t<3;t++)h[l+t]=h[l+t]+u[t],h[f+t]=h[f+t]+u[t],h[p+t]=h[p+t]+u[t]}for(var c=0;c<h.length;)n(u,h[c],h[c+1],h[c+2]),Hi(u,u),h[c++]=u[0],h[c++]=u[1],h[c++]=u[2];return h}(i.indices,i.position),i.boundingRect=t[0]&&t[0].rect,i}function fo(t,e){const n=[];for(let r=0;r<t.length;r++){const i=t[r],o=[],s=i.length;let a=i[s-1][0],u=i[s-1][1],l=0;for(let t=0;t<s;t++){let n=i[t][0],r=i[t][1];const s=n-a,h=r-u;l+=Math.sqrt(s*s+h*h),l>e&&(o.push(i[t]),l=0),a=n,u=r}o.length>=3&&n.push(o)}return n.length>0?n:null}function po(t,e){const n=[];for(let r=0;r<t.length;r++){let i=t[r];i=Qi(i,e,!0),i.length>=3&&n.push(i)}return n.length>0?n:null}function go(t,e){e=Object.assign({},e);const n=[1/0,1/0],r=[-1/0,-1/0];for(let e=0;e<t.length;e++)yo(t[e][0],n,r);e.boundingRect=e.boundingRect||{x:n[0],y:n[1],width:r[0]-n[0],height:r[1]-n[1]},function(t){t.depth=t.depth||1,t.bevelSize=t.bevelSize||0,t.bevelSegments=null==t.bevelSegments?2:t.bevelSegments,t.smoothBevel=t.smoothBevel||!1,t.simplify=t.simplify||0,null==t.smoothSide&&(t.smoothSide="auto"),null==t.smoothSideThreshold&&(t.smoothSideThreshold=.9),"number"==typeof t.depth&&(t.bevelSize=Math.min(t.bevelSegments>0?t.bevelSize:0,t.depth/2)),t.bevelSize>0||(t.bevelSegments=0),t.bevelSegments=Math.round(t.bevelSegments);const e=t.boundingRect;if(t.translate=t.translate||[0,0],t.scale=t.scale||[1,1],t.fitRect){let n=null==t.fitRect.x?e.x||0:t.fitRect.x,r=null==t.fitRect.y?e.y||0:t.fitRect.y,i=t.fitRect.width,o=t.fitRect.height;null==i?null!=o?i=o/e.height*e.width:(i=e.width,o=e.height):null==o&&(o=i/e.width*e.height),t.scale=[i/e.width,o/e.height],t.translate=[(n-e.x)*t.scale[0],(r-e.y)*t.scale[1]]}}(e);const i=[],o=e.translate||[0,0],s=e.scale||[1,1],a=e.boundingRect,u={x:a.x*s[0]+o[0],y:a.y*s[1]+o[1],width:a.width*s[0],height:a.height*s[1]},l=Math.min(a.width,a.height)/1e5;for(let n=0;n<t.length;n++){let r=fo(t[n],l);if(!r)continue;const a=e.simplify/Math.max(s[0],s[1]);if(a>0&&(r=po(r,a)),!r)continue;const{vertices:h,holes:c,dimensions:f}=Oi.flatten(r);for(let t=0;t<h.length;)h[t]=h[t++]*s[0]+o[0],h[t]=h[t++]*s[1]+o[1];if(oo(h,c),2!==f)throw new Error("Only 2D polygon points are supported");const p=e.bevelSize>0?ro(h,c,e.bevelSize,null,!0):h,d=Zi(p,c,f),g=ho(h,c,e.smoothSide,e.smoothSideThreshold);i.push({indices:d,vertices:g.vertices,rawVertices:h,topVertices:p,holes:g.holes,splittedMap:g.splittedMap,rect:u,depth:"function"==typeof e.depth?e.depth(n):e.depth})}return co(i,e)}function yo(t,e,n){for(let r=0;r<t.length;r++)e[0]=Math.min(t[r][0],e[0]),e[1]=Math.min(t[r][1],e[1]),n[0]=Math.max(t[r][0],n[0]),n[1]=Math.max(t[r][1],n[1])}const vo={bottomHeight:0,width:3,cornerRadius:0,altitude:0,topColor:null,bottomColor:"#2d2f61",heightEnable:!0};class mo extends W{constructor(t,e,n,r){e=i.Util.extend({},vo,e,{layer:r,lineString:t}),super(),this._initOptions(e);const{width:o,cornerRadius:s,bottomHeight:a,altitude:u,asynchronous:l}=e,h=r.distanceToVector3(s,s).x,c=r.distanceToVector3(o,o).x,{lineStrings:f,center:p}=Ve(t);let d;if(l){d=Sn();const e=i.Util.GUID();this.getOptions().id=e,this.getOptions().center=p,mn.push({id:e,data:f,layer:r,center:p,lineString:t,baseObject:this})}else{const t=[],e={};for(let n=0,i=f.length;n<i;n++){const i=je(f[n],c,h,r,p);we(i,a,r,e),t.push(i)}d=xn(t)}this._createMesh(d,n);const g=r.altitudeToVector3(u,u).x,y=r.coordinateToVector3(p,g);this.getObject3d().position.copy(y),this.type="Path"}_workerLoad(t){const e=En(t);this.getObject3d().geometry=e,this._fire("workerload",{target:this})}}const Ao={width:3,cornerRadius:0,altitude:0,topColor:null,bottomColor:"#2d2f61"};class _o extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const o=[],s=[],a=t.length;for(let e=0;e<a;e++){const n=Ve(t[e]);o.push(n.center),s.push(n.lineStrings)}const u=xe(o);e=i.Util.extend({},Ao,e,{layer:r,lineStrings:t,coordinate:u});const{altitude:l,asynchronous:h}=e;let c;const f=[],p=[];if(super(),h)c=Sn(),An.push({id:i.Util.GUID(),layer:r,key:e.key,center:u,data:s,lineStrings:t,baseObject:this,option:e});else{const n=[];let o=0;const l={},h={};for(let c=0;c<a;c++){const a=t[c],f=i.Util.extend({},e,Me(a),{index:c}),{cornerRadius:d,width:g,bottomHeight:y}=f,v=Ae(g,r,l),m=Ae(d,r,h),A=s[c],_=[];let x=0;for(let t=0,e=A.length;t<e;t++){const e=je(A[t],v,m,r,u);x=we(e,y,r,l),_.push(e)}const w=wn(_);n.push(w);const{position:b,normal:E,indices:I}=w;I.length;const C=b.length/3;E.length,p[c]={position:{middleZ:x,count:C,start:o,end:o+3*C},hide:!1},o+=3*C}c=xn(n)}this._initOptions(e),this._createMesh(c,n);const d=r.altitudeToVector3(l,l).x,g=r.coordinateToVector3(u,d);this.getObject3d().position.copy(g),this._baseObjects=f,this._datas=t,this._geometriesAttributes=p,this.faceIndex=null,this._geometryCache=In(c),this.isHide=!1,this._colorMap={},this._initBaseObjectsEvent(f),h||(this._setPickObject3d(),this._init()),this.type="Paths"}getSelectMesh(){const t=this._getIndex();if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],n=Object.assign({},this.options,Z(e)?e.properties:e.getProperties(),{index:t});this._baseObjects[t]=new mo(e,n,this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}identify(t){return this.picked}_workerLoad(t){const{geometriesAttributes:e}=t;this._geometriesAttributes=e;const n=En(t);if(this._geometryCache=In(n),this.getObject3d().geometry=n,this._setPickObject3d(),this._init(),this.isAdd){this.getLayer().getPick().add(this.pickObject3d)}this._fire("workerload",{target:this})}}const xo=Math.PI/180,wo=[[4e3,220],[2e3,100],[1e3,30],[500,15],[100,5],[50,2],[10,1],[5,.7],[2,.1],[1,.05],[.5,.02],[.4,.01],[.1,.005],[.05,.002],[.01,.001]],bo=["mouseout","mousemove","click","mousedown","mouseup","dblclick","contextmenu","touchstart","touchmove","touchend"],Eo=new i.Coordinate(0,0),Io=new i.Point(0,0),Co=new o.Vector3,So=new Map,Mo="__webglFramebuffer",Bo=new o.Vector4;class To extends i.CanvasLayer{constructor(t,e){super(t,e),this._animationBaseObjectMap={},this._needsUpdate=!0,this._mousemoveTimeOut=0,this._mousedownTime=0,this._baseObjects=[],this._delayMeshes=[],this._meshes=[],this.type="ThreeLayer"}isMercator(){const t=this.getMap();if(!t)return!1;const e=t.getSpatialReference(),n=e._projection,r=e._resolutions;return!!(n&&"EPSG:3857"===n.code&&r&&r.length&&156543===Math.floor(r[0])&&t.getGLRes)}isRendering(){const t=this.getMap();return!!t&&(t.isInteracting()||t.isAnimating())}prepareToDraw(...t){}draw(t,e,n,r,i,o){this.renderScene(o,this)}drawOnInteracting(t,e,n,r,i,o,s){this.renderScene(s,this)}_transformHeight(t,e){if(!t)return 0;if(0===(e=e||0))return 0;return this.altitudeToVector3(e,e,null,Co).x}coordinateToVector3(t,e=0,n){const r=this.getMap();if(!r)return null;const s=Array.isArray(t);s?(Eo.x=t[0],Eo.y=t[1]):t instanceof i.Coordinate||(t=new i.Coordinate(t));const a=Ro(r),u=Do(r,s?Eo:t,a,Io);return n&&(n.x=u.x,n.y=u.y,n.z=e),new o.Vector3(u.x,u.y,e)}coordinatiesToGLFloatArray(t,e,n){const r=this.getMap();if(!r)return null;const o=Ro(r),s=t.length,a=new Float32Array(2*s),u=new Float32Array(3*s);So.clear();for(let l=0;l<s;l++){let s=t[l];const h=Array.isArray(s);h?(Eo.x=s[0],Eo.y=s[1]):s instanceof i.Coordinate||(s=new i.Coordinate(s));const c=Do(r,h?Eo:s,o,Io);c.x-=e.x,c.y-=e.y;const f=2*l;a[f]=c.x,a[f+1]=c.y;const p=s;let d=p.z||p[2]||0;if(n&&!So.has(d)){const t=this._transformHeight(n,d);So.set(d,t)}let g=0;n&&(g=So.get(d)||0);const y=3*l;u[y]=c.x,u[y+1]=c.y,u[y+2]=g}return{positions:u,positons2d:a}}coordinatiesToGLArray(t,e){const n=this.getMap();if(!n)return null;const r=Ro(n),o=t.length,s=new Array(o);for(let a=0;a<o;a++){let o=t[a];const u=Array.isArray(o);u?(Eo.x=o[0],Eo.y=o[1]):o instanceof i.Coordinate||(o=new i.Coordinate(o));const l=Do(n,u?Eo:o,r,Io);l.x-=e.x,l.y-=e.y,s[a]=[l.x,l.y]}return s}distanceToVector3(t,e,n){if(0===t&&0===e||!i.Util.isNumber(t)||!i.Util.isNumber(e))return new o.Vector3(0,0,0);const r=this.getMap(),s=Ro(r);let a=n||r.getCenter();a instanceof i.Coordinate||(a=new i.Coordinate(a));const u=r.locate(a,t,e),l=Do(r,a,s),h=Do(r,u,s),c=Math.abs(h.x-l.x)*i.Util.sign(t),f=Math.abs(h.y-l.y)*i.Util.sign(e);return new o.Vector3(c,f,0)}altitudeToVector3(t,e,n,r){if(0===t||!i.Util.isNumber(t))return new o.Vector3(0,0,0);const s=this.getMap();if(s.altitudeToPoint){const e=Ro(s);let n=s.altitudeToPoint(t,e);return t<0&&n>0&&(n=-n),r?(r.x=n,r.y=n,r.z=0,r):new o.Vector3(n,n,0)}return this.distanceToVector3(t,t,n)}toShape(t){if(!t)return null;if(t instanceof i.MultiPolygon)return t.getGeometries().map((t=>this.toShape(t)));const e=t.getCenter(),n=this.coordinateToVector3(e),r=t.getShell().map((t=>{const e=this.coordinateToVector3(t).sub(n);return new o.Vector2(e.x,e.y)})),s=new o.Shape(r),a=t.getHoles();return a&&a.length>0&&(s.holes=a.map((t=>{const e=t.map((t=>{const e=this.coordinateToVector3(t).sub(n);return new o.Vector2(e.x,e.y)}));return new o.Shape(e)}))),s}toExtrudeMesh(t,e,n,r){if(!t)return null;if(t instanceof i.MultiPolygon)return t.getGeometries().map((t=>this.toExtrudeMesh(t,e,n,r)));const s=t.getCoordinates();s.forEach((t=>{for(let e=t.length-1;e>=1;e--)t[e].equals(t[e-1])&&t.splice(e,1)})),t.setCoordinates(s);const a=this.toShape(t),u=this.coordinateToVector3(t.getCenter());r=i.Util.isNumber(r)?r:e,r=this.altitudeToVector3(r,r).x;const l=this.altitudeToVector3(e,e).x,h={bevelEnabled:!1,bevelSize:1};h[parseInt(o.REVISION)>=93?"depth":"amount"]=r;const c=new o.ExtrudeGeometry(a,h);let f=c;o.BufferGeometry.prototype.fromGeometry&&(f=new o.BufferGeometry,f.fromGeometry(c));const p=new o.Mesh(f,n);return p.position.set(u.x,u.y,l-r),p}toExtrudePolygon(t,e,n){return new Vn(t,e,n,this)}toBar(t,e,n){return new Nn(t,e,n,this)}toLine(t,e,n){return new Qn(t,e,n,this)}toExtrudeLine(t,e,n){return new zn(t,e,n,this)}toModel(t,e){return new Hn(t,e,this)}toExtrudeLineTrail(t,e,n){return new $n(t,e,n,this)}toExtrudePolygons(t,e,n){return new or(t,e,n,this)}toPoint(t,e,n){return new lr(t,e,n,this)}toPoints(t,e,n){return new gr(t,e,n,this)}toBars(t,e,n){return new vr(t,e,n,this)}toExtrudeLines(t,e,n){return new Ar(t,e,n,this)}toLines(t,e,n){return new xr(t,e,n,this)}toThreeVectorTileLayer(t,e,n){return new Pr(t,e,n,this)}toTerrain(t,e,n){return new Qr(t,e,n,this)}toTerrainVectorTileLayer(t,e,n){return new zr(t,e,n,this)}toHeatMap(t,e,n){return new Jr(t,e,n,this)}toFatLine(t,e,n){return new ei(t,e,n,this)}toFatLines(t,e,n){return new ri(t,e,n,this)}toBox(t,e,n){return new oi(t,e,n,this)}toBoxs(t,e,n){return new ai(t,e,n,this)}toPath(t,e,n){return new mo(t,e,n,this)}toPaths(t,e,n){return new _o(t,e,n,this)}getBaseObjects(){return this.getMeshes().filter((t=>t instanceof W))}getMeshes(){const t=this.getScene();if(!t)return[];const e=[];for(let n=0,r=t.children.length;n<r;n++){const r=t.children[n];r instanceof o.Object3D&&!(r instanceof o.Camera)&&e.push(r.__parent||r)}return e}clear(){return this.clearMesh()}clearBaseObjects(){return this.removeMesh(this.getBaseObjects())}clearMesh(){const t=this.getScene();if(!t)return this;for(let e=t.children.length-1;e>=0;e--){const n=t.children[e];if(n instanceof o.Object3D&&!(n instanceof o.Camera)){t.remove(n);const e=n.__parent;e&&e instanceof W&&(e.isAdd=!1,e.options.layer=null,e._fire("remove",{target:e}),delete this._animationBaseObjectMap[n.uuid],e._hideUI())}}return this._meshes=[],this}lookAt(t){const e=this._getRenderer();return e&&e.context.lookAt(t),this}getCamera(){const t=this._getRenderer();return t?t.camera:null}getScene(){const t=this._getRenderer();return t?t.scene:null}renderScene(t,e){const n=this._getRenderer();return n&&(n.clearCanvas(),n.renderScene(t),e||n.setToRedraw()),this}loop(t=!1){const e=this._delayMeshes;if(!e.length)return;const n=this.getMap();if(!n||n.isAnimating()||n.isInteracting())return;const r=this.options.loopRenderCount||50,i=e.slice(0,r);i&&this.addMesh(i,t),e.splice(0,r)}renderPickScene(){const t=this._getRenderer();if(t){const e=t.pick;e&&e.pick(this._containerPoint)}return this}getThreeRenderer(){const t=this._getRenderer();return t?t.context:null}getPick(){const t=this._getRenderer();return t?t.pick:null}delayAddMesh(t){if(!t)return this;Array.isArray(t)||(t=[t]);for(let e=0,n=t.length;e<n;e++)this._delayMeshes.push(t[e]);return this}addMesh(t,e=!0){if(!t)return this;Array.isArray(t)||(t=[t]);const n=this.getScene();if(t.forEach((t=>{t instanceof W?(n.add(t.getObject3d()),t.isAdd||(t.isAdd=!0,t.options.layer=this,t._fire("add",{target:t})),t._animation&&i.Util.isFunction(t._animation)&&(this._animationBaseObjectMap[t.getObject3d().uuid]=t)):t instanceof o.Object3D&&n.add(t);-1===this._meshes.indexOf(t)&&this._meshes.push(t)})),this._zoomend(),e){const t=this._getRenderer();t&&t.setToRedraw()}return this}removeMesh(t,e=!0){if(!t)return this;Array.isArray(t)||(t=[t]);const n=this.getScene();if(t.forEach((t=>{if(t instanceof W){n.remove(t.getObject3d()),t.isAdd&&(t.isAdd=!1,t.options.layer=null,t._fire("remove",{target:t}),t._hideUI()),t._animation&&i.Util.isFunction(t._animation)&&delete this._animationBaseObjectMap[t.getObject3d().uuid];const e=this._delayMeshes;if(e.length)for(let n=0,r=e.length;n<r;n++)if(e[n]===t){e.splice(n,1);break}}else t instanceof o.Object3D&&n.remove(t);for(let e=0,n=this._meshes.length;e<n;e++){const n=this._meshes[e];n&&(n===t&&this._meshes.splice(e,1))}})),e){const t=this._getRenderer();t&&t.setToRedraw()}return this}_initRaycaster(){return this._raycaster||(this._raycaster=new o.Raycaster,this._mouse=new o.Vector2),this}getRaycaster(){return this._raycaster}identify(t,e){if(!t)return console.error("coordinate is null,it should be Coordinate"),[];if(Array.isArray(t)&&(t=new i.Coordinate(t)),!(t instanceof i.Coordinate))return console.error("coordinate type is error,it should be Coordinate"),[];const n=this.getMap().coordToContainerPoint(t);this._containerPoint=n;const{x:r,y:s}=n;this._initRaycaster(),this.fire("identify",{coordinate:t,options:e});const a=this._raycaster,u=this._mouse,l=this.getCamera(),h=this.getScene(),c=this.getMap().getSize();if(!h)return[];const f=c.width,p=c.height;u.x=r/f*2-1,u.y=-s/p*2+1,a.setFromCamera(u,l),a.layers&&a.layers.enableAll&&a.layers.enableAll(),function(t,e){L>113?t.params.Line.threshold=e:t.linePrecision=e}(a,this._getLinePrecision(this.getMap().getResolution()));const d=[],g=[];h.children.forEach((t=>{const e=t.__parent;if(e&&e.getOptions){const n=e;n.getOptions().interactive&&n.isVisible()&&(n.identify&&i.Util.isFunction(n.identify)?g.push(n):d.push(t))}else(t instanceof o.Mesh||t instanceof o.Group)&&d.push(t)}));let y=[];const v=a.intersectObjects(d,!0);v&&Array.isArray(v)&&v.length&&(y=v.map((t=>{let e=t.object;const n=t.instanceId;e=this._recursionMesh(e)||{};const r=e.__parent||e;return r.faceIndex=t.faceIndex,r.index=t.index,r.intersect=t,i.Util.isNumber(n)&&(r.instanceId=n),r}))),this.renderPickScene(),g.length&&g.forEach((e=>{e.identify(t)&&y.push(e)}));const m=y.length;for(let t=0;t<m;t++)if(y[t])for(let e=t+1;e<m;e++)y[t]===y[e]&&y.splice(e,1);let A=y.filter((t=>t instanceof W));A=A.sort(((t,e)=>t.options.pickWeight-e.options.pickWeight)),y.forEach((t=>{t instanceof W||A.push(t)}));const _=(e=i.Util.extend({},e)).count;return i.Util.isNumber(_)&&_>0?A.slice(0,_):y}identifyAtPoint(t,e={}){const n=this.getMap();if(!n)return[];const r=n.containerPointToCoordinate(t);return this.identify(r,e)}_recursionMesh(t){for(;t&&t.parent!==this.getScene();)t=t.parent;return t}_getLinePrecision(t=10){for(let e=0,n=wo.length;e<n;e++){const[n,r]=wo[e];if(t>n)return r}return.01}fireGeoEvent(t,e,n){if(!(t instanceof W))return this;n=n||e.type;const r=this._getEventParams(e),{coordinate:i}=r,o=this.getMap();function s(t,e){e=e||n;const r=t.getInfoWindow();r&&!r._owner&&r.addTo(t);((r?r.options:{}).autoOpenOn||"click")===e&&(o.options.supportPluginEvent||t.openInfoWindow(i),t.fire("showinfowindow",{infoWindow:r}))}if("mousemove"===n){t.fire(n,Object.assign({},r,{target:t,selectMesh:t.getSelectMesh?t.getSelectMesh():null}));const e=t.getToolTip();e&&!e._owner&&e.addTo(t),t.openToolTip(i),s(t)}else"mouseover"===n?t._mouseover||(t.fire("mouseover",Object.assign({},r,{target:t,type:"mouseover",selectMesh:t.getSelectMesh?t.getSelectMesh():null})),t._mouseover=!0,s(t,"mouseover")):"mouseout"===n?t.getSelectMesh?t.isHide||(t._mouseover=!1,t.fire("mouseout",Object.assign({},r,{target:t,type:"mouseout",selectMesh:null})),t.closeToolTip()):(t._mouseover=!1,t.fire("mouseout",Object.assign({},r,{target:t,type:"mouseout"})),t.closeToolTip()):(t.fire(n,Object.assign({},r,{target:t,selectMesh:t.getSelectMesh?t.getSelectMesh():null})),s(t))}_emptyIdentify(t={}){const e=t.domEvent,n=this.getScene();if(!n)return this;const r=this.map||this.getMap();if(!r)return this;const i=r._getEventParams?r._getEventParams(e):this._getEventParams(e);for(let t=0,e=n.children.length;t<e;t++){const e=(n.children[t]||{}).__parent;e&&e.fire("empty",Object.assign({},i,{target:e}))}}_identifyBaseObjectEvents(t){if(!this.options.geometryEvents)return this;const e=this.map||this.getMap();if(e.isInteracting()||!e.options.geometryEvents||e._ignoreEvent(t))return this;const n=t.type,r=e._getEventParams?e._getEventParams(t):this._getEventParams(t);r.type=n;const{type:o,coordinate:s}=r,a=i.Util.now();if(this._mousemoveTimeOut&&"mousemove"===o&&a-this._mousemoveTimeOut<64)return this;this._mousemoveTimeOut=a,"mousedown"!==o&&"touchstart"!==o||(this._mousedownTime=i.Util.now());let u=!1;if("click"===o||"touchend"===o){const t=e.options.clickTimeThreshold||280;u=i.Util.now()-this._mousedownTime<t}if("click"===o&&!u)return this;const l=this.options.identifyCountOnEvent;let h=Math.max(0,i.Util.isNumber(l)?l:0);0===h&&(h=1/0);const c=t=>{const e=[];this._baseObjects&&this._baseObjects.forEach((n=>{let r=!0;t.forEach((t=>{n===t&&(r=!1)})),r&&e.push(n)})),e.forEach((t=>{t&&t instanceof W&&(t.getSelectMesh?t.isHide||(t._mouseover=!1,t.fire("mouseout",Object.assign({},r,{target:t,type:"mouseout",selectMesh:null})),t.closeToolTip()):(t._mouseover=!1,t.fire("mouseout",Object.assign({},r,{target:t,type:"mouseout"})),t.closeToolTip()))}))};if("mouseout"===o)return c([]),this._baseObjects=[],this;const f=this.identify(s,{count:h}),p=this.getScene();if(0===f.length&&p)for(let t=0,e=p.children.length;t<e;t++){const e=(p.children[t]||{}).__parent;e&&e.fire("empty",Object.assign({},r,{target:e}))}function d(t,e){e=e||o;const n=t.getInfoWindow();n&&!n._owner&&n.addTo(t);((n?n.options:{}).autoOpenOn||"click")===e&&(t.openInfoWindow(s),t.fire("showinfowindow",{infoWindow:n}))}if("mousemove"===o?(c(f),f.forEach((t=>{if(t instanceof W){t._mouseover||(t.fire("mouseover",Object.assign({},r,{target:t,type:"mouseover",selectMesh:t.getSelectMesh?t.getSelectMesh():null})),t._mouseover=!0,d(t,"mouseover")),t.fire(o,Object.assign({},r,{target:t,selectMesh:t.getSelectMesh?t.getSelectMesh():null}));const e=t.getToolTip();e&&!e._owner&&e.addTo(t),t.openToolTip(s),d(t)}})),this._baseObjects=f):f.forEach((t=>{t instanceof W&&(t.fire(o,Object.assign({},r,{target:t,selectMesh:t.getSelectMesh?t.getSelectMesh():null})),d(t))})),"touchend"===o&&u){const e=i.Util.extend({},r,{domEvent:t});f.forEach((t=>{t instanceof W&&(t.fire("click",Object.assign({},e,{target:t,selectMesh:t.getSelectMesh?t.getSelectMesh():null})),d(t,"click"))}))}return this}_getEventParams(t){const e=this.getMap(),n={domEvent:t};if(!e)return n;const r=t.touches&&t.touches.length>0?t.touches[0]:t.changedTouches&&t.changedTouches.length>0?t.changedTouches[0]:t;if(r){const t=(0,i.DomUtil.getEventContainerPoint)(r,e._containerDOM);n.coordinate=e.containerPointToCoordinate(t),n.containerPoint=t,n.viewPoint=e.containerPointToViewPoint(t),n.pont2d=e._containerPointToPoint(t)}return n}_zoomend(){const t=this.getScene();if(!t)return;const e=this.getMap().getZoom();t.children.forEach((t=>{const n=t.__parent;if(n&&n.getOptions){const t=n;t.zoomChange&&i.Util.isFunction(t.zoomChange)&&t.zoomChange(e);const r=t.getMinZoom(),o=t.getMaxZoom();e<r||e>o?(t.isVisible()&&(t.getObject3d().visible=!1),t._zoomVisible=!1):r<=e&&e<=o&&(t._visible&&(t.getObject3d().visible=!0),t._zoomVisible=!0)}}))}_getGeometryEventMapPanel(){const t=this.map||this.getMap();return t._panels.allLayers||t._containerDOM}onAdd(){super.onAdd();const t=this.map||this.getMap();if(!t)return this;const e=this._getGeometryEventMapPanel();return this._identifyBaseObjectEventsThis||(this._identifyBaseObjectEventsThis=this._identifyBaseObjectEvents.bind(this)),this._zoomendThis||(this._zoomendThis=this._zoomend.bind(this)),this._emptyIdentifyThis||(this._emptyIdentifyThis=this._emptyIdentify.bind(this)),t.options.supportPluginEvent?this.on("identifyempty",this._emptyIdentifyThis):i.DomUtil.on(e,bo.join(" "),this._identifyBaseObjectEventsThis,this),this._needsUpdate=!0,this._animationBaseObjectMap||(this._animationBaseObjectMap={}),t.on("zooming zoomend",this._zoomendThis,this),this}onRemove(){super.onRemove();const t=this.map||this.getMap();if(!t)return this;const e=this._getGeometryEventMapPanel();return t.options.supportPluginEvent?this.off("identifyempty",this._emptyIdentifyThis):i.DomUtil.off(e,bo.join(" "),this._identifyBaseObjectEventsThis,this),t.off("zooming zoomend",this._zoomendThis,this),this}_addBaseObjectsWhenInit(){return this.addMesh(this._meshes),this}_callbackBaseObjectAnimation(){const t=this;if(t._animationBaseObjectMap)for(const e in t._animationBaseObjectMap){t._animationBaseObjectMap[e]._animation()}return this}_getFovRatio(){const t=this.getMap().getFov();return Math.tan(t/2*xo)}}To.mergeOptions({renderer:"gl",doubleBuffer:!1,glOptions:null,geometryEvents:!0,identifyCountOnEvent:0,forceRenderOnZooming:!0,loopRenderCount:50});const ko={bloom:!0};class Po extends i.renderer.CanvasLayerRenderer{constructor(){super(...arguments),this._renderTime=0,this._renderTarget=null}getPrepareParams(){return[this.scene,this.camera]}getDrawParams(){return[this.scene,this.camera]}_drawLayer(){super._drawLayer.apply(this,arguments)}hitDetect(){return!1}createCanvas(){super.createCanvas(),this.createContext()}createContext(){if(this.canvas.gl&&this.canvas.gl.wrap)this.gl=this.canvas.gl.wrap();else{const t=this.layer.options.glOptions||{alpha:!0,depth:!0,antialias:!0,stencil:!0,preserveDrawingBuffer:!1};t.preserveDrawingBuffer=!0,this.gl=this.gl||this._createGLContext(this.canvas,t)}this._initThreeRenderer(),this.layer.onCanvasCreate(this.context,this.scene,this.camera)}_initThreeRenderer(){this.matrix4=new o.Matrix4;const t=new o.WebGLRenderer({context:this.gl,alpha:!0});t.autoClear=!1,t.setClearColor(new o.Color(1,1,1),0),t.setSize(this.canvas.width,this.canvas.height),t.clear(),this.context=t;const e=this.scene=new o.Scene,n=this.layer.getMap(),r=n.getFov()*Math.PI/180,i=this.camera=new o.PerspectiveCamera(r,n.width/n.height,n.cameraNear,n.cameraFar);i.matrixAutoUpdate=!1,this._syncCamera(),e.add(i),this.pick=new $r(this.layer),_n.star(),this.layer._addBaseObjectsWhenInit()}onCanvasCreate(){super.onCanvasCreate()}resizeCanvas(t){if(!this.canvas)return;let e,n=this.getMap();e=t||n.getSize();const r=n.getDevicePixelRatio?n.getDevicePixelRatio():i.Browser.retina?2:1,o=this.canvas,{width:s,height:a,cssWidth:u,cssHeight:l}=i.Util.calCanvasSize(e,r);if(!this.layer._canvas||o.style.width===u&&o.style.height===l||(o.style.width=u,o.style.height=l),o.width===s&&o.height===a)return this;o.width=s,o.height=a,this.context.setSize(o.width,o.height)}clearCanvas(){this.canvas&&this.context.clear()}prepareCanvas(){return this.canvas?this.clearCanvas():this.createCanvas(),this.layer.fire("renderstart",{context:this.context}),null}renderScene(t){if(this.layer._callbackBaseObjectAnimation(),this._syncCamera(),t&&t.renderTarget){const{width:e,height:n}=t.renderTarget.fbo;this._renderTarget?(this._renderTarget.viewport.set(0,0,e,n),this._renderTarget.scissor.set(0,0,e,n)):(this._renderTarget=new o.WebGLRenderTarget(e,n,{depthBuffer:!1}),this.context.setRenderTarget(this._renderTarget),this.context.render(this.scene,this.camera));const r=this.context.properties.get(this._renderTarget),i=r[Mo];r[Mo]=t.renderTarget.getFramebuffer(t.renderTarget.fbo),this.context.setRenderTarget(this._renderTarget);const s=1===t.bloom&&t.sceneFilter,a=this.scene.children||[];let u=!1;if(s){const e=t.sceneFilter;u=e(ko);for(let t=0,n=a.length;t<n;t++){if(!a[t]||!a[t].layers)continue;const n=a[t].__parent;a[t].bloom=!1,n&&(a[t].bloom=n.bloom);let r=0;(a[t]&&e(a[t])||!n)&&u&&(r=1),a[t].__layer!==r&&(Lo(a[t],r),a[t].__layer=r)}}else for(let t=0,e=a.length;t<e;t++)a[t]&&a[t].layers&&0!==a[t].__layer&&(Lo(a[t],0),a[t].__layer=0);this.camera.layers.set(u?1:0),this.context.render(this.scene,this.camera),r[Mo]=i}else{const{width:t,height:e}=this.canvas,n=this.context.getViewport(Bo);n.width===t&&n.height===e||this.context.setViewport(0,0,t,e),this.context.render(this.scene,this.camera)}this.context.setRenderTarget(null),this.completeRender()}remove(){delete this._drawContext,this._renderTarget&&(this._renderTarget.dispose(),delete this._renderTarget),super.remove()}_syncCamera(){const t=this.getMap(),e=this.camera;e.matrix.elements=t.cameraWorldMatrix,e.projectionMatrix.elements=t.projMatrix,this.matrix4.invert?e.projectionMatrixInverse.elements=this.matrix4.copy(e.projectionMatrix).invert().elements:e.projectionMatrixInverse&&(e.projectionMatrixInverse.elements=this.matrix4.getInverse(e.projectionMatrix).elements)}_createGLContext(t,e){const n=["webgl2","webgl","experimental-webgl"];let r=null;for(let i=0;i<n.length;++i){try{r=t.getContext(n[i],e)}catch(t){}if(r)break}return r}}function Lo(t,e){if(!t)return;t.layers&&t.layers.set(e);const n=t.children;if(n&&n.length)for(let t=0,r=n.length;t<r;t++)Lo(n[t],e)}function Ro(t){return t.getGLRes?t.getGLRes():t.getGLZoom()}function Do(t,e,n,r){return t.coordToPointAtRes?t.coordToPointAtRes(e,n,r):t.coordinateToPoint(e,n,r)}To.registerRenderer("gl",Po),i.registerWorkerAdapter&&(i.registerWorkerAdapter("__maptalks.three__",'(function(t){"use strict";\n/*!\n * poly-extrude v0.16.0\n */function n(t,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function i(t,n){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},i(t,n)}function e(t,n,i){void 0===i&&(i=2);var e,s,h,a=n&&n.length,u=a?n[0]*i:t.length,c=r(t,0,u,i,!0),x=[];if(!c||c.next===c.prev)return x;if(a&&(c=function(t,n,i,e){for(var s=[],o=0,h=n.length;o<h;o++){var a=r(t,n[o]*e,o<h-1?n[o+1]*e:t.length,e,!1);a===a.next&&(a.steiner=!0),s.push(d(a))}s.sort(l);for(var u=0;u<s.length;u++)i=f(s[u],i);return i}(t,n,c,i)),t.length>80*i){e=1/0,s=1/0;for(var y=-1/0,p=-1/0,v=i;v<u;v+=i){var g=t[v],_=t[v+1];g<e&&(e=g),_<s&&(s=_),g>y&&(y=g),_>p&&(p=_)}h=0!==(h=Math.max(y-e,p-s))?32767/h:0}return o(c,x,i,e,s,h,0),x}function r(t,n,i,e,r){var s;if(r===function(t,n,i,e){for(var r=0,s=n,o=i-e;s<i;s+=e)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}(t,n,i,e)>0)for(var o=n;o<i;o+=e)s=P(o/e|0,t[o],t[o+1],s);else for(var h=i-e;h>=n;h-=e)s=P(h/e|0,t[h],t[h+1],s);return s&&m(s,s.next)&&(S(s),s=s.next),s}function s(t,n){if(!t)return t;n||(n=t);var i,e=t;do{if(i=!1,e.steiner||!m(e,e.next)&&0!==_(e.prev,e,e.next))e=e.next;else{if(S(e),(e=n=e.prev)===e.next)break;i=!0}}while(i||e!==n);return n}function o(t,n,i,e,r,l,f){if(t){!f&&l&&function(t,n,i,e){var r=t;do{0===r.z&&(r.z=y(r.x,r.y,n,i,e)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var n,i=1;do{var e=t,r=void 0;t=null;var s=null;for(n=0;e;){n++;for(var o=e,h=0,a=0;a<i&&(h++,o=o.nextZ);a++);for(var u=i;h>0||u>0&&o;)0!==h&&(0===u||!o||e.z<=o.z)?(r=e,e=e.nextZ,h--):(r=o,o=o.nextZ,u--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;e=o}s.nextZ=null,i*=2}while(n>1)}(r)}(t,e,r,l);for(var x=t;t.prev!==t.next;){var d=t.prev,p=t.next;if(l?a(t,e,r,l):h(t))n.push(d.i,t.i,p.i),S(t),t=p.next,x=p.next;else if((t=p)===x){f?1===f?o(t=u(s(t),n),n,i,e,r,l,2):2===f&&c(t,n,i,e,r,l):o(s(t),n,i,e,r,l,1);break}}}}function h(t){var n=t.prev,i=t,e=t.next;if(_(n,i,e)>=0)return!1;for(var r=n.x,s=i.x,o=e.x,h=n.y,a=i.y,u=e.y,c=Math.min(r,s,o),l=Math.min(h,a,u),f=Math.max(r,s,o),x=Math.max(h,a,u),y=e.next;y!==n;){if(y.x>=c&&y.x<=f&&y.y>=l&&y.y<=x&&v(r,h,s,a,o,u,y.x,y.y)&&_(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function a(t,n,i,e){var r=t.prev,s=t,o=t.next;if(_(r,s,o)>=0)return!1;for(var h=r.x,a=s.x,u=o.x,c=r.y,l=s.y,f=o.y,x=Math.min(h,a,u),d=Math.min(c,l,f),p=Math.max(h,a,u),g=Math.max(c,l,f),m=y(x,d,n,i,e),z=y(p,g,n,i,e),w=t.prevZ,M=t.nextZ;w&&w.z>=m&&M&&M.z<=z;){if(w.x>=x&&w.x<=p&&w.y>=d&&w.y<=g&&w!==r&&w!==o&&v(h,c,a,l,u,f,w.x,w.y)&&_(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,M.x>=x&&M.x<=p&&M.y>=d&&M.y<=g&&M!==r&&M!==o&&v(h,c,a,l,u,f,M.x,M.y)&&_(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;w&&w.z>=m;){if(w.x>=x&&w.x<=p&&w.y>=d&&w.y<=g&&w!==r&&w!==o&&v(h,c,a,l,u,f,w.x,w.y)&&_(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;M&&M.z<=z;){if(M.x>=x&&M.x<=p&&M.y>=d&&M.y<=g&&M!==r&&M!==o&&v(h,c,a,l,u,f,M.x,M.y)&&_(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function u(t,n){var i=t;do{var e=i.prev,r=i.next.next;!m(e,r)&&z(e,i,i.next,r)&&b(e,r)&&b(r,e)&&(n.push(e.i,i.i,r.i),S(i),S(i.next),i=t=r),i=i.next}while(i!==t);return s(i)}function c(t,n,i,e,r,h){var a=t;do{for(var u=a.next.next;u!==a.prev;){if(a.i!==u.i&&g(a,u)){var c=A(a,u);return a=s(a,a.next),c=s(c,c.next),o(a,n,i,e,r,h,0),void o(c,n,i,e,r,h,0)}u=u.next}a=a.next}while(a!==t)}function l(t,n){var i=t.x-n.x;0===i&&(0===(i=t.y-n.y)&&(i=(t.next.y-t.y)/(t.next.x-t.x)-(n.next.y-n.y)/(n.next.x-n.x)));return i}function f(t,n){var i=function(t,n){var i,e=n,r=t.x,s=t.y,o=-1/0;if(m(t,e))return e;do{if(m(t,e.next))return e.next;if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var h=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=r&&h>o&&(o=h,i=e.x<e.next.x?e:e.next,h===r))return i}e=e.next}while(e!==n);if(!i)return null;var a=i,u=i.x,c=i.y,l=1/0;e=i;do{if(r>=e.x&&e.x>=u&&r!==e.x&&p(s<c?r:o,s,u,c,s<c?o:r,s,e.x,e.y)){var f=Math.abs(s-e.y)/(r-e.x);b(e,t)&&(f<l||f===l&&(e.x>i.x||e.x===i.x&&x(i,e)))&&(i=e,l=f)}e=e.next}while(e!==a);return i}(t,n);if(!i)return n;var e=A(i,t);return s(e,e.next),s(i,i.next)}function x(t,n){return _(t.prev,t,n.prev)<0&&_(n.next,t,t.next)<0}function y(t,n,i,e,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-e)*r|0)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function d(t){var n=t,i=t;do{(n.x<i.x||n.x===i.x&&n.y<i.y)&&(i=n),n=n.next}while(n!==t);return i}function p(t,n,i,e,r,s,o,h){return(r-o)*(n-h)>=(t-o)*(s-h)&&(t-o)*(e-h)>=(i-o)*(n-h)&&(i-o)*(s-h)>=(r-o)*(e-h)}function v(t,n,i,e,r,s,o,h){return!(t===o&&n===h)&&p(t,n,i,e,r,s,o,h)}function g(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==n.i&&i.next.i!==n.i&&z(i,i.next,t,n))return!0;i=i.next}while(i!==t);return!1}(t,n)&&(b(t,n)&&b(n,t)&&function(t,n){var i=t,e=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(e=!e),i=i.next}while(i!==t);return e}(t,n)&&(_(t.prev,t,n.prev)||_(t,n.prev,n))||m(t,n)&&_(t.prev,t,t.next)>0&&_(n.prev,n,n.next)>0)}function _(t,n,i){return(n.y-t.y)*(i.x-n.x)-(n.x-t.x)*(i.y-n.y)}function m(t,n){return t.x===n.x&&t.y===n.y}function z(t,n,i,e){var r=M(_(t,n,i)),s=M(_(t,n,e)),o=M(_(i,e,t)),h=M(_(i,e,n));return r!==s&&o!==h||(!(0!==r||!w(t,i,n))||(!(0!==s||!w(t,e,n))||(!(0!==o||!w(i,t,e))||!(0!==h||!w(i,n,e)))))}function w(t,n,i){return n.x<=Math.max(t.x,i.x)&&n.x>=Math.min(t.x,i.x)&&n.y<=Math.max(t.y,i.y)&&n.y>=Math.min(t.y,i.y)}function M(t){return t>0?1:t<0?-1:0}function b(t,n){return _(t.prev,t,t.next)<0?_(t,n,t.next)>=0&&_(t,t.prev,n)>=0:_(t,n,t.prev)<0||_(t,t.next,n)<0}function A(t,n){var i=C(t.i,t.x,t.y),e=C(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,i.next=r,r.prev=i,e.next=i,i.prev=e,s.next=e,e.prev=s,e}function P(t,n,i,e){var r=C(t,n,i);return e?(r.next=e.next,r.prev=e,e.next.prev=r,e.next=r):(r.prev=r,r.next=r),r}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function C(t,n,i){return{i:t,x:n,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}var k=new(function(){function t(t,n,i,e){void 0===t&&(t=0),void 0===n&&(n=0),void 0===i&&(i=0),void 0===e&&(e=1),this.isQuaternion=!0,this._x=t,this._y=n,this._z=i,this._w=e}t.slerpFlat=function(t,n,i,e,r,s,o){var h=i[e+0],a=i[e+1],u=i[e+2],c=i[e+3],l=r[s+0],f=r[s+1],x=r[s+2],y=r[s+3];if(0===o)return t[n+0]=h,t[n+1]=a,t[n+2]=u,void(t[n+3]=c);if(1===o)return t[n+0]=l,t[n+1]=f,t[n+2]=x,void(t[n+3]=y);if(c!==y||h!==l||a!==f||u!==x){var d=1-o,p=h*l+a*f+u*x+c*y,v=p>=0?1:-1,g=1-p*p;if(g>Number.EPSILON){var _=Math.sqrt(g),m=Math.atan2(_,p*v);d=Math.sin(d*m)/_,o=Math.sin(o*m)/_}var z=o*v;if(h=h*d+l*z,a=a*d+f*z,u=u*d+x*z,c=c*d+y*z,d===1-o){var w=1/Math.sqrt(h*h+a*a+u*u+c*c);h*=w,a*=w,u*=w,c*=w}}t[n]=h,t[n+1]=a,t[n+2]=u,t[n+3]=c},t.multiplyQuaternionsFlat=function(t,n,i,e,r,s){var o=i[e],h=i[e+1],a=i[e+2],u=i[e+3],c=r[s],l=r[s+1],f=r[s+2],x=r[s+3];return t[n]=o*x+u*c+h*f-a*l,t[n+1]=h*x+u*l+a*c-o*f,t[n+2]=a*x+u*f+o*l-h*c,t[n+3]=u*x-o*c-h*l-a*f,t};var i,e,r,s=t.prototype;return s.set=function(t,n,i,e){return this._x=t,this._y=n,this._z=i,this._w=e,this._onChangeCallback(),this},s.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)},s.copy=function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},s.setFromEuler=function(t,n){void 0===n&&(n=!0);var i=t._x,e=t._y,r=t._z,s=t._order,o=Math.cos,h=Math.sin,a=o(i/2),u=o(e/2),c=o(r/2),l=h(i/2),f=h(e/2),x=h(r/2);switch(s){case"XYZ":this._x=l*u*c+a*f*x,this._y=a*f*c-l*u*x,this._z=a*u*x+l*f*c,this._w=a*u*c-l*f*x;break;case"YXZ":this._x=l*u*c+a*f*x,this._y=a*f*c-l*u*x,this._z=a*u*x-l*f*c,this._w=a*u*c+l*f*x;break;case"ZXY":this._x=l*u*c-a*f*x,this._y=a*f*c+l*u*x,this._z=a*u*x+l*f*c,this._w=a*u*c-l*f*x;break;case"ZYX":this._x=l*u*c-a*f*x,this._y=a*f*c+l*u*x,this._z=a*u*x-l*f*c,this._w=a*u*c+l*f*x;break;case"YZX":this._x=l*u*c+a*f*x,this._y=a*f*c+l*u*x,this._z=a*u*x-l*f*c,this._w=a*u*c-l*f*x;break;case"XZY":this._x=l*u*c-a*f*x,this._y=a*f*c-l*u*x,this._z=a*u*x+l*f*c,this._w=a*u*c+l*f*x;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===n&&this._onChangeCallback(),this},s.setFromAxisAngle=function(t,n){var i=n/2,e=Math.sin(i);return this._x=t.x*e,this._y=t.y*e,this._z=t.z*e,this._w=Math.cos(i),this._onChangeCallback(),this},s.setFromRotationMatrix=function(t){var n=t.elements,i=n[0],e=n[4],r=n[8],s=n[1],o=n[5],h=n[9],a=n[2],u=n[6],c=n[10],l=i+o+c;if(l>0){var f=.5/Math.sqrt(l+1);this._w=.25/f,this._x=(u-h)*f,this._y=(r-a)*f,this._z=(s-e)*f}else if(i>o&&i>c){var x=2*Math.sqrt(1+i-o-c);this._w=(u-h)/x,this._x=.25*x,this._y=(e+s)/x,this._z=(r+a)/x}else if(o>c){var y=2*Math.sqrt(1+o-i-c);this._w=(r-a)/y,this._x=(e+s)/y,this._y=.25*y,this._z=(h+u)/y}else{var d=2*Math.sqrt(1+c-i-o);this._w=(s-e)/d,this._x=(r+a)/d,this._y=(h+u)/d,this._z=.25*d}return this._onChangeCallback(),this},s.setFromUnitVectors=function(t,n){var i=t.dot(n)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this._w=i),this.normalize()},s.rotateTowards=function(t,n){var i=this.angleTo(t);if(0===i)return this;var e=Math.min(1,n/i);return this.slerp(t,e),this},s.identity=function(){return this.set(0,0,0,1)},s.invert=function(){return this.conjugate()},s.conjugate=function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},s.dot=function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},s.lengthSq=function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},s.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},s.normalize=function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},s.multiply=function(t){return this.multiplyQuaternions(this,t)},s.premultiply=function(t){return this.multiplyQuaternions(t,this)},s.multiplyQuaternions=function(t,n){var i=t._x,e=t._y,r=t._z,s=t._w,o=n._x,h=n._y,a=n._z,u=n._w;return this._x=i*u+s*o+e*a-r*h,this._y=e*u+s*h+r*o-i*a,this._z=r*u+s*a+i*h-e*o,this._w=s*u-i*o-e*h-r*a,this._onChangeCallback(),this},s.slerp=function(t,n){if(0===n)return this;if(1===n)return this.copy(t);var i=this._x,e=this._y,r=this._z,s=this._w,o=s*t._w+i*t._x+e*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=s,this._x=i,this._y=e,this._z=r,this;var h=1-o*o;if(h<=Number.EPSILON){var a=1-n;return this._w=a*s+n*this._w,this._x=a*i+n*this._x,this._y=a*e+n*this._y,this._z=a*r+n*this._z,this.normalize(),this}var u=Math.sqrt(h),c=Math.atan2(u,o),l=Math.sin((1-n)*c)/u,f=Math.sin(n*c)/u;return this._w=s*l+this._w*f,this._x=i*l+this._x*f,this._y=e*l+this._y*f,this._z=r*l+this._z*f,this._onChangeCallback(),this},s.slerpQuaternions=function(t,n,i){return this.copy(t).slerp(n,i)},s.random=function(){var t=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),e=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(e*Math.sin(t),e*Math.cos(t),r*Math.sin(n),r*Math.cos(n))},s.equals=function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},s.fromArray=function(t,n){return void 0===n&&(n=0),this._x=t[n],this._y=t[n+1],this._z=t[n+2],this._w=t[n+3],this._onChangeCallback(),this},s.toArray=function(t,n){return void 0===t&&(t=[]),void 0===n&&(n=0),t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._w,t},s.fromBufferAttribute=function(t,n){return this._x=t.getX(n),this._y=t.getY(n),this._z=t.getZ(n),this._w=t.getW(n),this._onChangeCallback(),this},s.toJSON=function(){return this.toArray()},s._onChange=function(t){return this._onChangeCallback=t,this},s._onChangeCallback=function(){},i=t,(e=[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}])&&n(i.prototype,e),r&&n(i,r),Object.defineProperty(i,"prototype",{writable:!1}),t}()),Z=function(){function t(t,n,i){void 0===t&&(t=0),void 0===n&&(n=0),void 0===i&&(i=0),this.x=t,this.y=n,this.z=i}var n=t.prototype;return n.set=function(t,n,i){return void 0===i&&(i=this.z),this.x=t,this.y=n,this.z=i,this},n.clone=function(){return new this.constructor(this.x,this.y,this.z)},n.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this},n.addVectors=function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this},n.addScaledVector=function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this},n.sub=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},n.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this},n.subVectors=function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this},n.multiply=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this},n.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.multiplyVectors=function(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this},n.applyAxisAngle=function(t,n){return this.applyQuaternion(k.setFromAxisAngle(t,n))},n.applyMatrix4=function(t){var n=this.x,i=this.y,e=this.z,r=t.elements,s=1/(r[3]*n+r[7]*i+r[11]*e+r[15]);return this.x=(r[0]*n+r[4]*i+r[8]*e+r[12])*s,this.y=(r[1]*n+r[5]*i+r[9]*e+r[13])*s,this.z=(r[2]*n+r[6]*i+r[10]*e+r[14])*s,this},n.applyQuaternion=function(t){var n=this.x,i=this.y,e=this.z,r=t.x,s=t.y,o=t.z,h=t.w,a=h*n+s*e-o*i,u=h*i+o*n-r*e,c=h*e+r*i-s*n,l=-r*n-s*i-o*e;return this.x=a*h+l*-r+u*-o-c*-s,this.y=u*h+l*-s+c*-r-a*-o,this.z=c*h+l*-o+a*-s-u*-r,this},n.divide=function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},n.divideScalar=function(t){return this.multiplyScalar(1/t)},n.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},n.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},n.clamp=function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this},n.clampScalar=function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this},n.clampLength=function(t,n){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(n,i)))},n.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z},n.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},n.normalize=function(){return this.divideScalar(this.length()||1)},n.setLength=function(t){return this.normalize().multiplyScalar(t)},n.lerp=function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this},n.lerpVectors=function(t,n,i){return this.x=t.x+(n.x-t.x)*i,this.y=t.y+(n.y-t.y)*i,this.z=t.z+(n.z-t.z)*i,this},n.cross=function(t){return this.crossVectors(this,t)},n.crossVectors=function(t,n){var i=t.x,e=t.y,r=t.z,s=n.x,o=n.y,h=n.z;return this.x=e*h-r*o,this.y=r*s-i*h,this.z=i*o-e*s,this},n.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},n.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},n.fromArray=function(t,n){return void 0===n&&(n=0),this.x=t[n],this.y=t[n+1],this.z=t[n+2],this},n.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this},t}();function F(t){let n,i,e=0,r=1;const s=t.length;for(;r<s;)n=i||t[0],i=t[r],e+=(i[0]-n[0])*(i[1]+n[1]),r++;return e>0}function V(t,n,i){return t[0]=n[0]-i[0],t[1]=n[1]-i[1],t[2]=n[2]-i[2],t}function L(t,n){const i=n[0],e=n[1],r=n[2],s=Math.sqrt(i*i+e*e+r*r)||1;return t[0]=i/s,t[1]=e/s,t[2]=r/s,t}function q(t,n,i){const e=n[0],r=n[1],s=n[2],o=i[0],h=i[1],a=i[2];return t[0]=r*a-s*h,t[1]=s*o-e*a,t[2]=e*h-r*o,t}function E(t,n){function i(t,n,i,e){t[0]=n,t[1]=i,t[2]=e}const e=[],r=[],s=[],o=[],h=[],a=[],u=t.length,c=new Float32Array(n.length);let l=0;for(;l<u;){const u=3*t[l],f=3*t[l+1],x=3*t[l+2];i(e,n[u],n[u+1],n[u+2]),i(r,n[f],n[f+1],n[f+2]),i(s,n[x],n[x+1],n[x+2]),V(h,s,r),V(o,e,r),q(a,h,o);for(let t=0;t<3;t++)c[u+t]+=a[t],c[f+t]+=a[t],c[x+t]+=a[t];l+=3}let f=0;const x=c.length;for(;f<x;)i(a,c[f],c[f+1],c[f+2]),L(a,a),c[f]=a[0]||0,c[f+1]=a[1]||0,c[f+2]=a[2]||0,f+=3;return c}function I(t){if(1===t.length){return{position:t[0].position,normal:t[0].normal,uv:t[0].uv,indices:t[0].indices,results:t}}let n=0,i=0;for(let e=0,r=t.length;e<r;e++){const{position:r,indices:s}=t[e];n+=r.length,i+=s.length}const e={position:new Float32Array(n),normal:new Float32Array(n),uv:new Float32Array(n/3*2),indices:new Uint32Array(i),results:t};let r=0,s=0,o=0,h=0;for(let n=0,i=t.length;n<i;n++){const{position:i,indices:a,normal:u,uv:c}=t[n];e.position.set(i,r),e.normal.set(u,r),e.uv.set(c,h);let l=0;const f=a.length;for(;l<f;){const t=a[l]+s;e.indices[o]=t,o++,l++}h+=c.length,r+=i.length,s+=i.length/3}return e}function O(t){return 180*t/Math.PI}function U(t){return t/180*Math.PI}function N(t,n,i,e,r,s){const o=3*i,h=3*e,a=3*r,u=3*s,c=n[o],l=n[o+1],f=n[o+2],x=n[h],y=n[h+1],d=n[h+2],p=n[a],v=n[a+1],g=n[a+2],_=n[u],m=n[u+1],z=n[u+2];let w=t.length-1;Math.abs(l-y)<Math.abs(c-x)?(t[++w]=c,t[++w]=1-f,t[++w]=x,t[++w]=1-d,t[++w]=p,t[++w]=1-g,t[++w]=_,t[++w]=1-z):(t[++w]=l,t[++w]=1-f,t[++w]=y,t[++w]=1-d,t[++w]=v,t[++w]=1-g,t[++w]=m,t[++w]=1-z)}function j(t,n){n=Object.assign({},{depth:2,top:!0},n);const i=t.map((t=>{for(let n=0,i=t.length;n<i;n++){const i=t[n];Q(i),0===n?F(i)||(t[n]=i.reverse()):F(i)&&(t[n]=i.reverse()),R(i)&&i.splice(i.length-1,1)}const i=function(t,n){const i=function(t){let n=0,i=0;const e=t.length;for(;i<e;)n+=t[i].length,i++;return n}(t),e=t.length,r=[],s=new Float32Array(2*i),o=[],h=[],a=3*i,u=2*i,c=n.depth;let l=0,f=0,x=0;for(let n=0;n<e;n++){const i=t[n];n>0&&r.push(l/2);let e=0;const y=i.length;for(;e<y;){const t=i[e],n=t[0],r=t[1],y=t[2]||0;s[l++]=n,s[l++]=r,o[f]=n,o[f+1]=r,o[f+2]=c+y,o[a+f]=n,o[a+f+1]=r,o[a+f+2]=y,h[x]=n,h[x+1]=r,h[u+x]=n,h[u+x+1]=r,f+=3,x+=2,e++}}return{flatVertices:s,holes:r,points:o,count:i,uv:h}}(t,n);i.polygon=t;return function(t,n,i){const e=[],{count:r}=t,s=i.top;for(let t=0,i=n.length;t<i;t+=3){const o=n[t],h=n[t+1],a=n[t+2];s&&(e[t]=o,e[t+1]=h,e[t+2]=a);let u=i+t;const c=r+o,l=r+h,f=r+a;s||(u=t),e[u]=c,e[u+1]=l,e[u+2]=f}t.indices=e}(i,e(i.flatVertices,i.holes,2),n),function(t,n){const{points:i,indices:e,polygon:r,uv:s}=t,o=n.depth;let h=i.length-1,a=e.length-1;for(let t=0,n=r.length;t<n;t++){const n=r[t];let u=0;const c=n.length;for(;u<c;){const t=n[u];let r=n[u+1];u===c-1&&(r=n[0]);const l=i.length/3,f=t[0],x=t[1],y=t[2]||0,d=r[0],p=r[1],v=r[2]||0;i[++h]=f,i[++h]=x,i[++h]=y+o,i[++h]=d,i[++h]=p,i[++h]=v+o,i[++h]=f,i[++h]=x,i[++h]=y,i[++h]=d,i[++h]=p,i[++h]=v;const g=l+2,_=l+3,m=l,z=l+1;e[++a]=g,e[++a]=m,e[++a]=_,e[++a]=m,e[++a]=z,e[++a]=_,N(s,i,g,_,m,z),u++}}}(i,n),i.position=new Float32Array(i.points),i.indices=new Uint32Array(i.indices),i.uv=new Float32Array(i.uv),i.normal=E(i.indices,i.position),i})),r=I(i);return r.polygons=t,r}function Q(t){R(t)||t.push(t[0])}function R(t){const n=t.length,[i,e]=t[0],[r,s]=t[n-1];return i===r&&e===s}function W(t,n){!function(t){t.lineWidth=Math.max(0,t.lineWidth),t.depth=Math.max(0,t.depth),t.sideDepth=Math.max(0,t.sideDepth)}(n=Object.assign({},{depth:2,lineWidth:1,bottomStickGround:!1,pathUV:!1},n));const i=t.map((t=>{const i=function(t,n){let i=n.lineWidth/2;n.isSlope&&(i*=2);const e=[],r=[],s=[],o=t.length;let h=0;for(;h<o;){let n=t[h],a=t[h+1];const u=t[h];h===o-1&&(n=t[o-2],a=t[o-1]);const c=a[1]-n[1],l=a[0]-n[0];let f=0;const x=O(Math.atan(c/l));if(0===h||h===o-1)f=x,f-=90;else{const i=t[h-1];B.x=i[0]-n[0],B.y=i[1]-n[1],T.x=a[0]-n[0],T.y=a[1]-n[1];f=x-H(B,T)/2}const y=U(f),d=u,p=[Math.cos(y)+d[0],Math.sin(y)+d[1]],[v,g]=Y(n,a,i);let _=D(v[0],v[1],d,p),m=D(g[0],g[1],d,p);if(!_||!m){const t=e.length,n=e[t-2],i=e[t-1];if(!n||!i)continue;_=[n[0],n[1]],m=[i[0],i[1]]}_[2]=u[2]||0,m[2]=u[2]||0,e.push(_,m),X(_,n,a)?(r.push(_),s.push(m)):(r.push(m),s.push(_)),h++}return{offsetPoints:e,leftPoints:r,rightPoints:s,line:t}}(t,n);return i.line=t,function(t,n){const i=n.bottomStickGround,e=n.depth,r=t.depths;let s=e,o=e;r&&(s=r[0],o=r[1]);const{leftPoints:h,rightPoints:a}=t,u=t.line,c=n.pathUV;if(c){!function(t){let n=0;for(let i=0,e=t.length;i<e;i++){const e=t[i],r=t[i+1];if(0===i&&(e.distance=0),e&&r){const[t,i,s]=e,[o,h,a]=r,u=t-o,c=i-h,l=(s||0)-(a||0);n+=Math.sqrt(u*u+c*c+l*l),r.distance=n}}}(u);for(let t=0,n=u.length;t<n;t++)h[t].distance=a[t].distance=u[t].distance}let l=0,f=h.length;const x=[],y=[],d=[];for(;l<f;){const t=3*l,[n,e,r]=h[l];x[t]=n,x[t+1]=e,x[t+2]=s+r;const[y,p,v]=a[l],g=3*f+t;x[g]=y,x[g+1]=p,x[g+2]=o+v;const _=2*f*3+t;x[_]=n,x[_+1]=e,x[_+2]=r,i&&(x[_+2]=0);const m=2*f*3+3*f+t;if(x[m]=y,x[m+1]=p,x[m+2]=v,i&&(x[m+2]=0),c){const t=u[l].distance,n=2*l;d[n]=t,d[n+1]=1;const i=2*f+n;d[i]=t,d[i+1]=0;const e=2*f*2+n;d[e]=t,d[e+1]=1;const r=2*f*2+2*f+n;d[r]=t,d[r+1]=0}l++}if(!c){l=0,f=x.length;let t=d.length-1;for(;l<f;){const n=x[l],i=x[l+1];d[++t]=n,d[++t]=i,l+=3}}l=0,f=h.length;let p=y.length-1;for(;l<f-1;){const t=l,n=l+1,i=t+f,e=n+f;y[++p]=t,y[++p]=i,y[++p]=n,y[++p]=i,y[++p]=e,y[++p]=n;const r=l+2*f,s=r+1,o=r+f,h=s+f;y[++p]=r,y[++p]=o,y[++p]=s,y[++p]=o,y[++p]=h,y[++p]=s,l++}if(t.indices=y,t.points=x,t.uv=d,r)for(f=h.length,l=0;l<f;)h[l].depth=s,a[l].depth=o,l++}(i,n),function(t,n){const{points:i,indices:e,leftPoints:r,rightPoints:s,uv:o}=t,h=n.depth,a=n.bottomStickGround,u=[r,s],c=t.depths,l=n.pathUV,f=n.lineWidth;let x=i.length-1,y=e.length-1,d=o.length-1;function p(t,n){const r=i.length/3,s=c?t.depth:h,u=c?n.depth:h;i[++x]=t[0],i[++x]=t[1],i[++x]=s+t[2],i[++x]=n[0],i[++x]=n[1],i[++x]=u+n[2],i[++x]=t[0],i[++x]=t[1],i[++x]=a?0:t[2],i[++x]=n[0],i[++x]=n[1],i[++x]=a?0:n[2];const p=r+2,v=r+3,g=r,_=r+1;e[++y]=p,e[++y]=g,e[++y]=v,e[++y]=g,e[++y]=_,e[++y]=v,l?(o[++d]=t.distance,o[++d]=s/f,o[++d]=n.distance,o[++d]=u/f,o[++d]=t.distance,o[++d]=0,o[++d]=n.distance,o[++d]=0):N(o,i,p,v,g,_)}for(let t=0,n=u.length;t<n;t++){let n=u[t];t>0&&(n=n.map((t=>t)),n=n.reverse());let i=0;const e=n.length-1;for(;i<e;){p(n[i],n[i+1]),i++}}const v=r.length,g=[s[0],r[0],r[v-1],s[v-1]];for(let t=0;t<g.length;t+=2){p(g[t],g[t+1])}}(i,n),i.position=new Float32Array(i.points),i.indices=new Uint32Array(i.indices),i.uv=new Float32Array(i.uv),i.normal=E(i.indices,i.position),i})),e=I(i);return e.lines=t,e}const B={x:0,y:0},T={x:0,y:0};const H=({x:t,y:n},{x:i,y:e})=>{const r=t*i+n*e,s=t*e-n*i;return(Math.atan2(s,r)/Math.PI*180+360)%360};function X(t,n,i){const[e,r]=n,[s,o]=i,[h,a]=t;return(r-o)*h+(s-e)*a+e*o-s*r>0}function Y(t,n,i){const e=n[1]-t[1],r=n[0]-t[0],s=Math.atan2(e,r),o=s+Math.PI/2;let h=Math.cos(o)*i,a=Math.sin(o)*i;const u=[t[0]+h,t[1]+a],c=[n[0]+h,n[1]+a],l=s-Math.PI/2;h=Math.cos(l)*i,a=Math.sin(l)*i;return[[u,c],[[t[0]+h,t[1]+a],[n[0]+h,n[1]+a]]]}function D(t,n,i,e){const r=n[0]-t[0],s=n[1]-t[1],o=e[0]-i[0],h=e[1]-i[1];if(0===r&&0===o)return null;if(0===s&&0===h)return null;const a=s/r,u=h/o,c=t[1]-a*t[0],l=i[1]-u*i[0];let f,x;return 0===r?(f=t[0],x=u*f+l):0===o?(f=i[0],x=a*f+c):0===s?(x=t[1],f=(x-l)/u):0===h?(x=i[1],f=(x-c)/a):(f=(l-c)/(a-u),x=a*f+c),[f,x]}function G(t,n){n=Object.assign({},{radius:1,height:2,radialSegments:6},n);const i=Math.round(Math.max(4,n.radialSegments));let{radius:e,height:r}=n;e=e,r=r;const s=360/i/360*Math.PI*2,o=i+1,h=new Float32Array(3*o*2),[a,u]=t;let c=0,l=0;const f=3*o,x=2*o,y=[],d=[];let p=y.length-1;for(let t=-1;t<i;t++){const n=s*t,i=Math.cos(n)*e+a,o=Math.sin(n)*e+u;h[c]=i,h[c+1]=o,h[c+2]=0,h[c+f]=i,h[c+1+f]=o,h[c+2+f]=r;let v=0,g=0;v=.5+i/e/2,g=.5+o/e/2,d[l]=v,d[l+1]=g,d[l+x]=v,d[l+1+x]=g,c+=3,l+=2,t>1&&(y[++p]=0,y[++p]=t-1,y[++p]=t)}c-=3,h[c]=h[0],h[c+1]=h[1],h[c+2]=h[2];const v=h.length;h[v-3]=h[0],h[v-2]=h[1],h[v-1]=r;const g=y.length;p=y.length-1;for(let t=0;t<g;t++){const n=y[t];y[++p]=n+o}const _=new Float32Array(2*(3*o*2-6));let m=-1;c=2*o,l=0,p=y.length-1;let z=d.length-1;for(let t=0,n=h.length/2;t<n-3;t+=3){const n=h[t],i=h[t+1],s=h[t+3],a=h[t+4];_[++m]=n,_[++m]=i,_[++m]=r,_[++m]=s,_[++m]=a,_[++m]=r,_[++m]=n,_[++m]=i,_[++m]=0,_[++m]=s,_[++m]=a,_[++m]=0;const u=c+2,f=c+3,x=c,v=c+1;y[++p]=x,y[++p]=u,y[++p]=v,y[++p]=u,y[++p]=f,y[++p]=v,c+=4;const g=l/o,w=(l+1)/o;d[++z]=g,d[++z]=r/e/2,d[++z]=w,d[++z]=r/e/2,d[++z]=g,d[++z]=0,d[++z]=w,d[++z]=0,l++}const w=new Float32Array(h.length+_.length);w.set(h,0),w.set(_,h.length);const M=E(y,w);return{points:h,indices:new Uint32Array(y),position:w,normal:M,uv:new Float32Array(d)}}var J=function(){function t(){this.pos=new Z,this.dir=new Z,this.right=new Z,this.up=new Z,this.dist=0,this.widthScale=1,this.sharp=!1}var n=t.prototype;return n.lerpPathPoints=function(t,n,i){this.pos.lerpVectors(t.pos,n.pos,i),this.dir.lerpVectors(t.dir,n.dir,i),this.up.lerpVectors(t.up,n.up,i),this.right.lerpVectors(t.right,n.right,i),this.dist=(n.dist-t.dist)*i+t.dist,this.widthScale=(n.widthScale-t.widthScale)*i+t.widthScale},n.copy=function(t){this.pos.copy(t.pos),this.dir.copy(t.dir),this.up.copy(t.up),this.right.copy(t.right),this.dist=t.dist,this.widthScale=t.widthScale},t}(),K=function(){function t(t,n,i,e,r,s,o,h,a,u,c,l,f,x,y,d){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,n,i,e,r,s,o,h,a,u,c,l,f,x,y,d)}var n=t.prototype;return n.set=function(t,n,i,e,r,s,o,h,a,u,c,l,f,x,y,d){var p=this.elements;return p[0]=t,p[4]=n,p[8]=i,p[12]=e,p[1]=r,p[5]=s,p[9]=o,p[13]=h,p[2]=a,p[6]=u,p[10]=c,p[14]=l,p[3]=f,p[7]=x,p[11]=y,p[15]=d,this},n.multiply=function(t){return this.multiplyMatrices(this,t)},n.makeRotationAxis=function(t,n){var i=Math.cos(n),e=Math.sin(n),r=1-i,s=t.x,o=t.y,h=t.z,a=r*s,u=r*o;return this.set(a*s+i,a*o-e*h,a*h+e*o,0,a*o+e*h,u*o+i,u*h-e*s,0,a*h-e*o,u*h+e*s,r*h*h+i,0,0,0,0,1),this},n.equals=function(t){for(var n=this.elements,i=t.elements,e=0;e<16;e++)if(n[e]!==i[e])return!1;return!0},t}();function $(t,n,i,e){return function(t,n){var i=1-t;return i*i*n}(t,n)+function(t,n){return 2*(1-t)*t*n}(t,i)+function(t,n){return t*t*n}(t,e)}var tt=function(t){var n,e;function r(n,i,e){var r;return void 0===n&&(n=new Z),void 0===i&&(i=new Z),void 0===e&&(e=new Z),(r=t.call(this)||this).isQuadraticBezierCurve3=!0,r.type="QuadraticBezierCurve3",r.v0=n,r.v1=i,r.v2=e,r}return e=t,(n=r).prototype=Object.create(e.prototype),n.prototype.constructor=n,i(n,e),r.prototype.getPoint=function(t,n){void 0===n&&(n=new Z);var i=n,e=this.v0,r=this.v1,s=this.v2;return i.set($(t,e.x,r.x,s.x),$(t,e.y,r.y,s.y),$(t,e.z,r.z,s.z)),i},r}(function(){function t(){this.type="Curve",this.arcLengthDivisions=200}var n=t.prototype;return n.getPoint=function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},n.getPointAt=function(t,n){var i=this.getUtoTmapping(t);return this.getPoint(i,n)},n.getPoints=function(t){void 0===t&&(t=5);for(var n=[],i=0;i<=t;i++)n.push(this.getPoint(i/t));return n},n.getLength=function(){var t=this.getLengths();return t[t.length-1]},n.getLengths=function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var n,i=[],e=this.getPoint(0),r=0;i.push(0);for(var s=1;s<=t;s++)r+=(n=this.getPoint(s/t)).distanceTo(e),i.push(r),e=n;return this.cacheArcLengths=i,i},n.getUtoTmapping=function(t,n){var i,e=this.getLengths(),r=0,s=e.length;i=n||t*e[s-1];for(var o,h=0,a=s-1;h<=a;)if((o=e[r=Math.floor(h+(a-h)/2)]-i)<0)h=r+1;else{if(!(o>0)){a=r;break}a=r-1}if(e[r=a]===i)return r/(s-1);var u=e[r];return(r+(i-u)/(e[r+1]-u))/(s-1)},t}()),nt=new Z,it=new Z,et=new Z,rt=new K,st=new tt;var ot=function(){function t(){this.array=[],this.count=0}var n=t.prototype;return n.set=function(t,n,i,e,r){if(void 0===n&&(n=.1),void 0===i&&(i=10),void 0===e&&(e=null),void 0===r&&(r=!1),(t=t.slice(0)).length<2)return console.warn("PathPointList: points length less than 2."),void(this.count=0);r&&!t[0].equals(t[t.length-1])&&t.push((new Z).copy(t[0]));for(var s=0,o=t.length;s<o;s++)if(0===s)this._start(t[s],t[s+1],e);else if(s===o-1)if(r){this._corner(t[s],t[1],n,i,e);var h=this.array[0].dist;this.array[0].copy(this.array[this.count-1]),this.array[0].dist=h}else this._end(t[s]);else this._corner(t[s],t[s+1],n,i,e)},n.distance=function(){return this.count>0?this.array[this.count-1].dist:0},n._getByIndex=function(t){return this.array[t]||(this.array[t]=new J),this.array[t]},n._start=function(t,n,i){this.count=0;var e=this._getByIndex(this.count);if(e.pos.copy(t),e.dir.subVectors(n,t),i)e.up.copy(i);else{var r=Number.MAX_VALUE,s=Math.abs(e.dir.x),o=Math.abs(e.dir.y),h=Math.abs(e.dir.z);s<r&&(r=s,e.up.set(1,0,0)),o<r&&(r=o,e.up.set(0,1,0)),h<r&&e.up.set(0,0,1)}e.right.crossVectors(e.dir,e.up).normalize(),e.up.crossVectors(e.right,e.dir).normalize(),e.dist=0,e.widthScale=1,e.sharp=!1,e.dir.normalize(),this.count++},n._end=function(t){var n=this.array[this.count-1],i=this._getByIndex(this.count);i.pos.copy(t),i.dir.subVectors(t,n.pos);var e=i.dir.length();i.dir.normalize(),i.up.copy(n.up);var r=nt.crossVectors(n.dir,i.dir);if(r.length()>Number.EPSILON){r.normalize();var s=Math.acos(Math.min(Math.max(n.dir.dot(i.dir),-1),1));i.up.applyMatrix4(rt.makeRotationAxis(r,s))}i.right.crossVectors(i.dir,i.up).normalize(),i.dist=n.dist+e,i.widthScale=1,i.sharp=!1,this.count++},n._corner=function(t,n,i,e,r){if(i>0&&e>0){for(var s=function(t,n,i,e,r,s){var o=nt.subVectors(n,t),h=it.subVectors(i,n),a=o.length(),u=h.length();o.normalize(),h.normalize();var c=Math.min(.999999*(r?a/2:a),e);s.v0.copy(n).sub(o.multiplyScalar(c)),s.v1.copy(n);var l=Math.min(u/2*.999999,e);return s.v2.copy(n).add(h.multiplyScalar(l)),s}(this.array[this.count-1].pos,t,n,i,this.count-1==0,st),o=s.getPoints(e),h=0;h<e;h++)this._sharpCorner(o[h],o[h+1],r,0===h?1:0);o[e].equals(n)||this._sharpCorner(o[e],n,r,2)}else this._sharpCorner(t,n,r,0,!0)},n._sharpCorner=function(t,n,i,e,r){void 0===e&&(e=0),void 0===r&&(r=!1);var s=this.array[this.count-1],o=this._getByIndex(this.count),h=nt.subVectors(t,s.pos),a=it.subVectors(n,t),u=h.length();if(h.normalize(),a.normalize(),o.pos.copy(t),1===e?o.dir.copy(h):2===e?o.dir.copy(a):(o.dir.addVectors(h,a),o.dir.normalize()),i)1===o.dir.dot(i)?o.right.crossVectors(a,i).normalize():o.right.crossVectors(o.dir,i).normalize(),o.up.crossVectors(o.right,o.dir).normalize();else{o.up.copy(s.up);var c=et.crossVectors(s.dir,o.dir);if(c.length()>Number.EPSILON){c.normalize();var l=Math.acos(Math.min(Math.max(s.dir.dot(o.dir),-1),1));o.up.applyMatrix4(rt.makeRotationAxis(c,l))}o.right.crossVectors(o.dir,o.up).normalize()}o.dist=s.dist+u;var f=h.dot(a);o.widthScale=Math.min(1/Math.sqrt((1+f)/2),1.415)||1,o.sharp=Math.abs(f-1)>.05&&r,this.count++},t}();const ht=new Z(0,0,1),at=new Z,ut=new Z,ct=new Z,lt=new Z,ft=new Z,xt=new Z;function yt(t,n){n=Object.assign({},{lineWidth:1,cornerRadius:0,cornerSplit:10},n);const i=t.map((t=>{const i=function(t){const n=[];for(let i=0,e=t.length;i<e;i++){const e=t[i],[r,s,o]=e,h=new Z(r,s,o||0);n[i]=h}return n}(t),e=new ot;e.set(i,n.cornerRadius,n.cornerSplit,ht);const r=function(t,n){const i=n.lineWidth||.1,e=1,r=i/2,s=i,o=t.distance(),h=e*o;let a=0;const u=[],c=[],l=[],f=[];let x=0;if(0===o)return{position:u,normal:c,uv:l,indices:f,count:a};const y=r/s;let d,p=u.length-1,v=c.length-1,g=l.length-1,_=f.length-1;function m(t){const n=0===u.length,i=t.sharp&&!n,e=t.dist/s,o=t.dir,h=t.up,d=t.right;if(at.copy(d).multiplyScalar(r*t.widthScale),ut.copy(d).multiplyScalar(-r*t.widthScale),at.add(t.pos),ut.add(t.pos),i){ct.fromArray(u,u.length-6).sub(ut),lt.fromArray(u,u.length-3).sub(at);const t=ct.length()-lt.length();let n,i;t>0?(n=ct,i=ut):(n=lt,i=at),ft.copy(n).setLength(Math.abs(t)).add(i);let r=xt.copy(i).sub(ft).normalize().dot(o)*xt.copy(i).sub(ft).length()*2;xt.copy(o).setLength(r).add(ft),t>0?(u[++p]=ft.x,u[++p]=ft.y,u[++p]=ft.z,u[++p]=at.x,u[++p]=at.y,u[++p]=at.z,u[++p]=ut.x,u[++p]=ut.y,u[++p]=ut.z,u[++p]=at.x,u[++p]=at.y,u[++p]=at.z,u[++p]=xt.x,u[++p]=xt.y,u[++p]=xt.z,u[++p]=at.x,u[++p]=at.y,u[++p]=at.z,x+=6,f[++_]=x-6,f[++_]=x-8,f[++_]=x-7,f[++_]=x-6,f[++_]=x-7,f[++_]=x-5,f[++_]=x-4,f[++_]=x-6,f[++_]=x-5,f[++_]=x-2,f[++_]=x-4,f[++_]=x-1,a+=12):(u[++p]=ut.x,u[++p]=ut.y,u[++p]=ut.z,u[++p]=ft.x,u[++p]=ft.y,u[++p]=ft.z,u[++p]=ut.x,u[++p]=ut.y,u[++p]=ut.z,u[++p]=at.x,u[++p]=at.y,u[++p]=at.z,u[++p]=ut.x,u[++p]=ut.y,u[++p]=ut.z,u[++p]=xt.x,u[++p]=xt.y,u[++p]=xt.z,x+=6,f[++_]=x-6,f[++_]=x-8,f[++_]=x-7,f[++_]=x-6,f[++_]=x-7,f[++_]=x-5,f[++_]=x-6,f[++_]=x-5,f[++_]=x-3,f[++_]=x-2,f[++_]=x-3,f[++_]=x-1,a+=12);for(let t=0;t<6;t++)c[++v]=h.x,c[++v]=h.y,c[++v]=h.z;l[++g]=e-y,l[++g]=0,l[++g]=e-y,l[++g]=1,l[++g]=e,l[++g]=0,l[++g]=e,l[++g]=1,l[++g]=e+y,l[++g]=0,l[++g]=e+y,l[++g]=1}else u[++p]=ut.x,u[++p]=ut.y,u[++p]=ut.z,u[++p]=at.x,u[++p]=at.y,u[++p]=at.z,c[++v]=h.x,c[++v]=h.y,c[++v]=h.z,c[++v]=h.x,c[++v]=h.y,c[++v]=h.z,l[++g]=e,l[++g]=0,l[++g]=e,l[++g]=1,x+=2,n||(f[++_]=x-2,f[++_]=x-4,f[++_]=x-3,f[++_]=x-2,f[++_]=x-3,f[++_]=x-1,a+=6)}if(h>0)for(let n=0;n<t.count;n++){const i=t.array[n];if(i.dist>h){const e=t.array[n-1];d=new J;const r=(h-e.dist)/(i.dist-e.dist);d.lerpPathPoints(e,i,r),m(d);break}m(i)}else d=t.array[0];return{position:u,normal:c,uv:l,indices:f,count:a}}(e,n);return{position:new Float32Array(r.position),indices:new Uint32Array(r.indices),uv:new Float32Array(r.uv),normal:new Float32Array(r.normal),line:t,count:r.count}})),e=I(i);return e.lines=t,e}new Z(0,0,1),new Z;var dt={x:0,y:0},pt={x:0,y:0};function vt(t,n,i,e){for(var r=t.length,s=0;s<r;s++){var o=t[s].data;n=t[s].center||n;for(var h=0,a=o.length;h<a;h++)for(var u=o[h],c=0,l=u.length;c<l;c++)t[s].data[h][c]=gt(u[c],n,i,e)}}function gt(t,n,i,e,r){for(var s,o=[],h=r?3:2,a=0,u=(s=i?new Float64Array(t):new Float32Array(t)).length;a<u;a+=h){var c=s[a],l=s[a+1],f=s[a+2];if(n&&i&&e){dt.x=c,dt.y=l;var x=kt(dt,pt);dt.x=x.x,dt.y=x.y,c=(x=Zt(e,dt,i,pt)).x,l=x.y,c-=n[0],l-=n[1]}r?o.push([c,l,f]):o.push([c,l])}return o}function _t(t,n){void 0===n&&(n=1);for(var i=t.length,e=[],r=[],s=0,o=0;o<i;o++){var h=void 0;1===n?h=mt(t[o]):2===n?h=zt(t[o]):3===n&&(h=wt(t[o]));var a=t[o].bottomHeight||0,u=h.position;r.push(h);var c=u.length/3;e[o]={position:{middleZ:a+(t[o].height||0)/2,count:c,start:s,end:s+3*c},hide:!1},s+=3*c}var l=bt(r),f=l.position,x=l.normal,y=l.uv,d=l.indices;return{position:f.buffer,normal:x.buffer,uv:y.buffer,indices:d.buffer,geometriesAttributes:e}}function mt(t){var n=t.data,i=t.height,e=t.bottomHeight,r=j(n,{depth:i}),s=r.position,o=r.normal,h=r.uv,a=r.indices;return At(s,e),{position:s,normal:o,uv:h,indices:a}}function zt(t){var n=t.data,i=t.height,e=t.width,r=t.bottomHeight,s=W(n,{lineWidth:e,depth:i}),o=s.position,h=s.normal,a=s.uv,u=s.indices;return At(o,r),{position:o,normal:h,uv:a,indices:u}}function wt(t){var n=t.data,i=t.cornerRadius,e=t.width,r=t.bottomHeight,s=yt(n,{lineWidth:e,cornerRadius:i}),o=s.position,h=s.normal,a=s.uv,u=s.indices;return At(o,r),{position:o,normal:h,uv:a,indices:u}}function Mt(t,n){for(var i=new Float32Array(n),e=0,r=0;r<t.length;++r)i.set(t[r],e),e+=t[r].length;return i}function bt(t){for(var n={},i={},e=0;e<t.length;++e){var r=t[e];for(var s in r)void 0===n[s]&&(n[s]=[],i[s]=0),n[s].push(r[s]),i[s]+=r[s].length}var o={},h=0,a=[];for(var u in n)if("indices"===u)for(var c=n[u],l=0,f=c.length;l<f;l++){for(var x=c[l],y=0,d=x.length;y<d;y++)a.push(x[y]+h);h+=n.position[l].length/3}else{var p=Mt(n[u],i[u]);if(!p)return null;o[u]=p}return o.indices=new Uint32Array(a),o}function At(t,n){if(void 0!==n&&"number"==typeof n&&0!==n)for(var i=0,e=t.length;i<e;i+=3)t[i+2]+=n}function Pt(t){for(var n=[],i=0,e=t.length;i<e;i+=7){var r=t[i],s=t[i+1],o=t[i+2],h=t[i+3],a=t[i+4],u=t[i+5];n.push({radialSegments:o,radius:h,height:a,altitude:u,center:[r,s]})}for(var c=n.length,l=[],f=[],x=0,y=0;y<c;y++){var d=G(n[y].center||[0,0],n[y]),p=d.position;if(n[y].altitude)for(var v=n[y].altitude,g=0,_=p.length;g<_;g+=3)d[g+2]+=v;f.push(d);var m=p.length/3;l[y]={position:{middleZ:n[y].height/2,count:m,start:x,end:x+3*m},hide:!1},x+=3*m}var z=bt(f),w=z.position,M=z.normal,b=z.uv,A=z.indices;return{position:w.buffer,normal:M.buffer,uv:b.buffer,indices:A.buffer,geometriesAttributes:l}}var St=Math.PI/180,Ct=6378137*Math.PI/180;function kt(t,n){var i,e=85.0511287798,r=t.x,s=Math.max(Math.min(e,t.y),-e);i=0===s?0:Math.log(Math.tan((90+s)*St/2))/St;var o=r*Ct,h=i*Ct;return n?(n.x=o,n.y=h,n):{x:o,y:h}}function Zt(t,n,i,e){var r=t[0]*(n.x-t[2])/i,s=-t[1]*(n.y-t[3])/i;return e?(e.x=r,e.y=s,e):{x:r,y:s}}function Ft(t){void 0===t&&(t=[]);for(var n=t.length,i=new Float32Array(3*n),e=0;e<n;e++){var r=t[e],s=3*e;i[s]=r[0],i[s+1]=r[1],i[s+2]=r[2]||0}return i}function Vt(t){for(var n=new Float32Array(2*t.length-6),i=0,e=0,r=t.length/3;e<r;e++){var s=t[3*e],o=t[3*e+1],h=t[3*e+2];if(e>0&&e<r-1){var a=3*i;n[a]=s,n[a+1]=o,n[a+2]=h,i++}var u=3*i;n[u]=s,n[u+1]=o,n[u+2]=h,i++}return n}function Lt(t){var n=0,i=t.length;if(1===i)return t[0];for(var e=0;e<i;e++)n+=t[e].length;for(var r=new Float32Array(n),s=0,o=0;o<i;o++)r.set(t[o],s),s+=t[o].length;return r}t.initialize=function(){},t.onmessage=function(t,n){var i=t.data,e=i.type,r=i.datas,s=i.glRes,o=i.matrix,h=i.center;if("ExtrudePolygons"===e){vt(r,h,s,o);var a=_t(r);n(null,a,[a.position,a.normal,a.uv,a.indices])}else if("ExtrudeLines"===e||"Paths"===e){for(var u=0,c=r.length;u<c;u++)for(var l=0,f=r[u].data.length;l<f;l++)r[u].data[l]=gt(r[u].data[l],r[u].center||h,s,o,!0);var x=_t(r,"ExtrudeLines"===e?2:3);n(null,x,[x.position,x.normal,x.uv,x.indices])}else if("ExtrudePolygon"===e){var y=[],d=[];r.forEach((function(t){var n=[t];vt(n,h,s,o);var i=_t(n),e=i.position,r=i.normal,a=i.uv,u=i.indices;y.push({id:t.id,position:e,normal:r,uv:a,indices:u}),d.push(e,r,a,u)})),n(null,y,d)}else if("Line"===e||"FatLine"===e){for(var p=[],v=[],g=0,_=r.length;g<_;g++){for(var m=[],z=0,w=r[g].data.length;z<w;z++){r[g].data[z]=gt(r[g].data[z],r[g].center||h,s,o,!0);var M=Ft(r[g].data[z]);m.push(Vt(M))}var b=Lt(m);At(b,r[g].bottomHeight),p.push({id:r[g].id,position:b.buffer}),v.push(b.buffer)}n(null,p,v)}else if("Lines"===e||"FatLines"===e){for(var A=0,P=[],S=[],C=0,k=[],Z=0,F=r.length;Z<F;Z++){for(var V=0,L=0,q=r[Z].data.length;L<q;L++){r[Z].data[L]=gt(r[Z].data[L],r[Z].center||h,s,o,!0);var E=Ft(r[Z].data[L]);At(E,r[Z].bottomHeight),V+=E.length/3*2-2,k.push(Vt(E))}var I=V;P[Z]=[A,A+I],A+=I,S[Z]={position:{count:V,start:C,end:C+3*V},hide:!1},"FatLines"===e&&(S[Z].instanceStart={count:V,start:C,end:C+3*V},S[Z].instanceEnd={count:V,start:C,end:C+3*V}),C+=3*V}var O=Lt(k);n(null,{id:r.id,position:O.buffer,geometriesAttributes:S,faceMap:P},[O.buffer])}else if("ExtrudeLine"===e||"Path"===e){for(var U=0,N=r.length;U<N;U++)for(var j=0,Q=r[U].data.length;j<Q;j++)r[U].data[j]=gt(r[U].data[j],r[U].center||h,s,o,!0);var R=[],W=[];r.forEach((function(t){var n=_t([t],"ExtrudeLine"===e?2:3),i=n.position,r=n.normal,s=n.uv,o=n.indices;R.push({id:t.id,position:i,normal:r,uv:s,indices:o}),W.push(i,r,s,o)})),n(null,R,W)}else if("Bar"===e){for(var B=[],T=[],H=(r=new Float32Array(r)).length/7,X=0;X<H;){var Y=r.slice(7*X,7*(X+1)),D=Pt(Y),G=D.position,J=D.normal,K=D.uv,$=D.indices;B.push({id:parseInt(Y[6]),position:G,normal:J,uv:K,indices:$}),T.push(G,J,K,$),X++}n(null,B,T)}else if("Bars"===e){var tt=Pt(r=new Float32Array(r));n(null,tt,[tt.position,tt.normal,tt.uv,tt.indices])}else console.error("No processing logic found for type:"+e)},Object.defineProperty(t,"__esModule",{value:!0})})'),i.registerWorkerAdapter("__maptalks.three.fetchdata__",(function(t){const e=[],n=[];function r(t){t.abort?(n.splice(n.indexOf(t),1),e.length&&(n.push(e[0]),e.splice(0,1),i(n[n.length-1]))):n.length<5?(n.push(t),i(t)):e.push(t)}function i(t){fetch(t.url).then((t=>t.text())).then((e=>{new Blob([e],{type:"application/json"}).arrayBuffer().then((e=>{t.postResponse(null,e,[e]),t.abort=!0,r(t)}))})).catch((e=>{console.error(e),t.abort=!0,r(t)}))}t.initialize=function(){},t.onmessage=function(t,e){r({url:t.data,postResponse:e,abort:!1})}})));var Oo=6371008.8,No={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:Oo,metres:Oo,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:3440.069546436285,radians:1,yards:6967335.223679999},Fo={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/Oo,yards:1.0936133},Uo={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Qo(t,e,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=e||{},r.geometry=t,r}function Go(t,e,n){switch(t){case"Point":return zo(e).geometry;case"LineString":return Ho(e).geometry;case"Polygon":return Vo(e).geometry;case"MultiPoint":return Jo(e).geometry;case"MultiLineString":return Xo(e).geometry;case"MultiPolygon":return Ko(e).geometry;default:throw new Error(t+" is invalid")}}function zo(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!us(t[0])||!us(t[1]))throw new Error("coordinates must contain numbers");return Qo({type:"Point",coordinates:t},e,n)}function jo(t,e,n){return void 0===n&&(n={}),Yo(t.map((function(t){return zo(t,e)})),n)}function Vo(t,e,n){void 0===n&&(n={});for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return Qo({type:"Polygon",coordinates:t},e,n)}function qo(t,e,n){return void 0===n&&(n={}),Yo(t.map((function(t){return Vo(t,e)})),n)}function Ho(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return Qo({type:"LineString",coordinates:t},e,n)}function Wo(t,e,n){return void 0===n&&(n={}),Yo(t.map((function(t){return Ho(t,e)})),n)}function Yo(t,e){void 0===e&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function Xo(t,e,n){return void 0===n&&(n={}),Qo({type:"MultiLineString",coordinates:t},e,n)}function Jo(t,e,n){return void 0===n&&(n={}),Qo({type:"MultiPoint",coordinates:t},e,n)}function Ko(t,e,n){return void 0===n&&(n={}),Qo({type:"MultiPolygon",coordinates:t},e,n)}function Zo(t,e,n){return void 0===n&&(n={}),Qo({type:"GeometryCollection",geometries:t},e,n)}function $o(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function ts(t,e){void 0===e&&(e="kilometers");var n=No[e];if(!n)throw new Error(e+" units is invalid");return t*n}function es(t,e){void 0===e&&(e="kilometers");var n=No[e];if(!n)throw new Error(e+" units is invalid");return t/n}function ns(t,e){return is(es(t,e))}function rs(t){var e=t%360;return e<0&&(e+=360),e}function is(t){return 180*(t%(2*Math.PI))/Math.PI}function os(t){return t%360*Math.PI/180}function ss(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return ts(es(t,e),n)}function as(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var r=Uo[e];if(!r)throw new Error("invalid original units");var i=Uo[n];if(!i)throw new Error("invalid final units");return t/r*i}function us(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function ls(t){return!!t&&t.constructor===Object}function hs(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!us(t))throw new Error("bbox must only contain numbers")}))}function cs(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}var fs=Object.freeze({__proto__:null,earthRadius:Oo,factors:No,unitsFactors:Fo,areaFactors:Uo,feature:Qo,geometry:Go,point:zo,points:jo,polygon:Vo,polygons:qo,lineString:Ho,lineStrings:Wo,featureCollection:Yo,multiLineString:Xo,multiPoint:Jo,multiPolygon:Ko,geometryCollection:Zo,round:$o,radiansToLength:ts,lengthToRadians:es,lengthToDegrees:ns,bearingToAzimuth:rs,radiansToDegrees:is,degreesToRadians:os,convertLength:ss,convertArea:as,isNumber:us,isObject:ls,validateBBox:hs,validateId:cs});function ps(t,e,n){if(null!==t)for(var r,i,o,s,a,u,l,h,c=0,f=0,p=t.type,d="FeatureCollection"===p,g="Feature"===p,y=d?t.features.length:1,v=0;v<y;v++){a=(h=!!(l=d?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===l.type)?l.geometries.length:1;for(var m=0;m<a;m++){var A=0,_=0;if(null!==(s=h?l.geometries[m]:l)){u=s.coordinates;var x=s.type;switch(c=!n||"Polygon"!==x&&"MultiPolygon"!==x?0:1,x){case null:break;case"Point":if(!1===e(u,f,v,A,_))return!1;f++,A++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(!1===e(u[r],f,v,A,_))return!1;f++,"MultiPoint"===x&&A++}"LineString"===x&&A++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-c;i++){if(!1===e(u[r][i],f,v,A,_))return!1;f++}"MultiLineString"===x&&A++,"Polygon"===x&&_++}"Polygon"===x&&A++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(_=0,i=0;i<u[r].length;i++){for(o=0;o<u[r][i].length-c;o++){if(!1===e(u[r][i][o],f,v,A,_))return!1;f++}_++}A++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===ps(s.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ds(t,e,n,r){var i=n;return ps(t,(function(t,r,o,s,a){i=0===r&&void 0===n?t:e(i,t,r,o,s,a)}),r),i}function gs(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&!1!==e(t.features[n].properties,n);n++);break;case"Feature":e(t.properties,0)}}function ys(t,e,n){var r=n;return gs(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r}function vs(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function ms(t,e,n){var r=n;return vs(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r}function As(t){var e=[];return ps(t,(function(t){e.push(t)})),e}function _s(t,e){var n,r,i,o,s,a,u,l,h,c,f=0,p="FeatureCollection"===t.type,d="Feature"===t.type,g=p?t.features.length:1;for(n=0;n<g;n++){for(a=p?t.features[n].geometry:d?t.geometry:t,l=p?t.features[n].properties:d?t.properties:{},h=p?t.features[n].bbox:d?t.bbox:void 0,c=p?t.features[n].id:d?t.id:void 0,s=(u=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=u?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,f,l,h,c))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],f,l,h,c))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,l,h,c))return!1;f++}}function xs(t,e,n){var r=n;return _s(t,(function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)})),r}function ws(t,e){_s(t,(function(t,n,r,i,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(Qo(t,r,{bbox:i,id:o}),n,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var u=0;u<t.coordinates.length;u++){var l=t.coordinates[u];if(!1===e(Qo({type:s,coordinates:l},r),n,u))return!1}}))}function bs(t,e,n){var r=n;return ws(t,(function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)})),r}function Es(t,e){ws(t,(function(t,n,r){var i=0;if(t.geometry){var o=t.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var s,a=0,u=0,l=0;return!1!==ps(t,(function(o,h,c,f,p){if(void 0===s||n>a||f>u||p>l)return s=o,a=n,u=f,l=p,void(i=0);var d=Ho([s,o],t.properties);if(!1===e(d,n,r,p,i))return!1;i++,s=o}))&&void 0}}}))}function Is(t,e,n){var r=n,i=!1;return Es(t,(function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0})),r}function Cs(t,e){if(!t)throw new Error("geojson is required");ws(t,(function(t,n,r){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,n,r,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===e(Ho(o[s],t.properties),n,r,s))return!1}}}))}function Ss(t,e,n){var r=n;return Cs(t,(function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)})),r}function Ms(t,e){if(!ls(e=e||{}))throw new Error("options is invalid");var n,r=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.segmentIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),a=a||t.features[r].properties,n=t.features[r].geometry;break;case"Feature":a=a||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;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 s<0&&(s=u.length+s-1),Ho([u[s],u[s+1]],a,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s-1),Ho([u[o][s],u[o][s+1]],a,e);case"MultiLineString":return i<0&&(i=u.length+i),s<0&&(s=u[i].length+s-1),Ho([u[i][s],u[i][s+1]],a,e);case"MultiPolygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),s<0&&(s=u[i][o].length-s-1),Ho([u[i][o][s],u[i][o][s+1]],a,e)}throw new Error("geojson is invalid")}function Bs(t,e){if(!ls(e=e||{}))throw new Error("options is invalid");var n,r=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.coordIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),a=a||t.features[r].properties,n=t.features[r].geometry;break;case"Feature":a=a||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var u=n.coordinates;switch(n.type){case"Point":return zo(u,a,e);case"MultiPoint":return i<0&&(i=u.length+i),zo(u[i],a,e);case"LineString":return s<0&&(s=u.length+s),zo(u[s],a,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s),zo(u[o][s],a,e);case"MultiLineString":return i<0&&(i=u.length+i),s<0&&(s=u[i].length+s),zo(u[i][s],a,e);case"MultiPolygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),s<0&&(s=u[i][o].length-s),zo(u[i][o][s],a,e)}throw new Error("geojson is invalid")}var Ts=Object.freeze({__proto__:null,coordAll:As,coordEach:ps,coordReduce:ds,featureEach:vs,featureReduce:ms,findPoint:Bs,findSegment:Ms,flattenEach:ws,flattenReduce:bs,geomEach:_s,geomReduce:xs,lineEach:Cs,lineReduce:Ss,propEach:gs,propReduce:ys,segmentEach:Es,segmentReduce:Is});function ks(t){var e=[1/0,1/0,-1/0,-1/0];return ps(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}function Ps(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ls(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Rs(t){if(t.length>1&&us(t[0])&&us(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return Rs(t[0]);throw new Error("coordinates must only contain numbers")}function Ds(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function Os(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function Ns(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var r=0,i=t.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!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+o.geometry.type)}}function Fs(t){return"Feature"===t.type?t.geometry:t}function Us(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}ks.default=ks;var Qs=Object.freeze({__proto__:null,getCoord:Ps,getCoords:Ls,containsNumber:Rs,geojsonType:Ds,featureOf:Os,collectionOf:Ns,getGeom:Fs,getType:Us}),Gs=Object.getOwnPropertySymbols,zs=Object.prototype.hasOwnProperty,js=Object.prototype.propertyIsEnumerable;
|
|
17
|
+
function(t){var e=t/2,n=t+e,r=1e4,i=Br(2*n,2*n),o=i.getContext("2d");return o.shadowBlur=e,o.shadowColor="black",o.shadowOffsetX=o.shadowOffsetY=r,o.beginPath(),o.arc(n-r,n-r,t,0,2*Math.PI,!0),o.closePath(),o.fill(),i}(n._size||n.size||13),o=i.width/2,s=i.height/2,a=e,u={};for(var l in a.forEach((function(t){var e=void 0===t.count?1:t.count,n=Math.min(1,e/r).toFixed(2);u[n]=u[n]||[],u[n].push(t)})),u)if(!isNaN(l)){var h=u[l];t.beginPath(),n.withoutAlpha||(t.globalAlpha=l),h.forEach((function(e){var n=e.coordinate,a=void 0===e.count?1:e.count;t.globalAlpha=a/r,t.drawImage(i,n[0]-o,n[1]-s)}))}}jr.prototype.setMax=function(t){this.max=t||100},jr.prototype.setMin=function(t){this.min=t||0},jr.prototype.setMaxSize=function(t){this.maxSize=t||35},jr.prototype.setMinSize=function(t){this.minSize=t||0},jr.prototype.initPalette=function(){var t=this.gradient,e=Br(256,1),n=this.paletteCtx=e.getContext("2d"),r=n.createLinearGradient(0,0,256,1);for(var i in t)r.addColorStop(parseFloat(i),t[i]);n.fillStyle=r,n.fillRect(0,0,256,1)},jr.prototype.getColor=function(t){var e=this.getImageData(t);return"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]/256+")"},jr.prototype.getImageData=function(t){var e=this.paletteCtx.getImageData(0,0,256,1).data;if(void 0===t)return e;var n=this.max,r=this.min;t>n&&(t=n),t<r&&(t=r);var i=4*Math.floor((t-r)/(n-r)*255);return[e[i],e[i+1],e[i+2],e[i+3]]},jr.prototype.getSize=function(t){var e=this.max,n=this.min,r=this.maxSize,i=this.minSize;return t>e&&(t=e),t<n&&(t=n),e>n?i+(t-n)/(e-n)*(r-i):r},jr.prototype.getLegend=function(t){var e=this.gradient,n=t.width||20,r=t.height||180,i=Br(n,r),o=i.getContext("2d"),s=o.createLinearGradient(0,r,0,0);for(var a in e)s.addColorStop(parseFloat(a),e[a]);return o.fillStyle=s,o.fillRect(0,0,n,r),i};var Wr={draw:function(t,e,n){if(!(t.canvas.width<=0||t.canvas.height<=0)){var r=n.strength||.3;t.strokeStyle="rgba(0,0,0,"+r+")";var i=Br(t.canvas.width,t.canvas.height),o=i.getContext("2d");o.scale(devicePixelRatio,devicePixelRatio),n=n||{},t.save();var s=new jr({gradient:n.gradient});if(Hr(o,e,n),!n.absolute){var a=o.getImageData(0,0,t.canvas.width,t.canvas.height);Vr(a.data,s.getImageData(),n),t.putImageData(a,0,0),t.restore()}s=null,i=null}},drawGray:Hr,colorize:Vr};const Yr={altitude:0,interactive:!1,min:0,max:100,size:13,gradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},gridScale:.5},Xr=2048;class Jr extends W{constructor(t,e,n,r){Array.isArray(t)||(t=[t]);let s=1/0,a=1/0,u=-1/0,l=-1/0;const h=[];for(let e=0,n=t.length;e<n;e++){const{coordinate:n,lnglat:i,xy:o}=t[e],c=n||i||o;if(!c){console.warn("not find coordinate");continue}const f=r.coordinateToVector3(c);h.push(f);const{x:p,y:d}=f;s=Math.min(s,p),a=Math.min(a,d),u=Math.max(u,p),l=Math.max(l,d)}e=i.Util.extend({},Yr,e,{layer:r,points:t});let{gridScale:c,altitude:f,size:p}=e;const d=Math.abs(u-s),g=Math.abs(l-a),y=Math.max(d*c,g*c);if(y>Xr){console.warn(`gridScale: ${c} it's too big. I hope it's a smaller value,canvas max size is 2048* 2048`);c=Xr/(y/c)}let v=Math.ceil(d*c),m=Math.ceil(g*c);const A=v/d,_=m/g,x=[],w=Math.ceil(2*p);for(let e=0,n=h.length;e<n;e++){const n=h[e];n.x-=s,n.y-=a,n.x*=A,n.y*=_,n.y=m-n.y,n.x+=w,n.y+=w,x.push({coordinate:[n.x,n.y],count:t[e].count})}v+=2*w,m+=2*w;let b=Br(v,m),E=b.getContext("2d");Wr.drawGray(E,x,e);const I=E.getImageData(0,0,E.canvas.width,E.canvas.height);let C=-1/0;const S=new Float32Array(I.data.length/4),M=new Float32Array(I.data.length/4);for(let t=3,e=I.data.length,n=0;t<e;t+=4){const e=I.data[t];C=Math.max(C,e),M[n]=e,e<=0&&(S[n]=1),n++}const B=new jr({gradient:e.gradient});Wr.colorize(I.data,B.getImageData(),e),b=null,E=null;const T=Lr(d,g,v-1,m-1),k=T.getIndex().array,P=T.attributes.position.array,L=new Float32Array(P.length),D=new Uint32Array(6*P.length),N=new o.Color;let F=0;for(let t=0,e=P.length,n=0,r=k.length,i=0,o=I.data.length,s=0;t<Math.max(e,r,o);t+=3){if(t<e){const e=M[s];e>0&&(P[t+2]=e/C)}if(n<r){const t=k[n],e=k[n+1],r=k[n+2];S[t]&&S[e]&&S[r]||(D[F]=t,D[F+1]=e,D[F+2]=r,F+=3)}if(i<o){const t=`rgb(${I.data[i]},${I.data[i+1]},${I.data[i+2]})`;N.setStyle(t),L[n]=N.r,L[n+1]=N.g,L[n+2]=N.b}n+=3,i+=4,s++}const U=new Uint32Array(F);for(let t=0;t<F;t++)U[t]=D[t];T.setIndex(new o.BufferAttribute(U,1)),R(T,"color",new o.BufferAttribute(L,3,!0)),n.vertexColors=O(),super(),this._initOptions(e),this._createMesh(T,n);const Q=r.altitudeToVector3(f,f).x;this.getObject3d().position.copy(new o.Vector3((s+u)/2,(a+l)/2,Q)),this.type="HeatMap"}}const Kr=new o.Color;let Zr=1;class $r{constructor(t){this.object3ds=[],this.layer=t,this.camera=t.getCamera(),this.renderer=t.getThreeRenderer(),this.pickingTexture=L>=152?new o.WebGLRenderTarget(1,1,{format:o.RGBAFormat,colorSpace:o.SRGBColorSpace}):new o.WebGLRenderTarget(1,1,{}),this.pickingScene=new o.Scene}getColor(){return Kr.setHex(Zr),Zr++,Kr}add(t){if(t){const e=t._colorIndex;e&&(this.object3ds[e]=t,this.pickingScene.add(t))}return this}remove(t){if(t){const e=t._colorIndex;e&&(this.object3ds[e]=null,this.pickingScene.remove(t))}return this}isEmpty(){if(0===this.pickingScene.children.length)return!0;for(let t=0,e=this.pickingScene.children.length;t<e;t++){const e=this.pickingScene.children[t];if(e){const t=e.__parent;if(t&&!0===t.getOptions().interactive)return!1}}return!0}pick(t){if(!t)return;if(this.isEmpty())return;const{camera:e,renderer:n,pickingTexture:r,pickingScene:i,object3ds:o,layer:s}=this,a=this.pickingScene.children.length;for(let t=0;t<a;t++){const e=this.pickingScene.children[t];e&&e.__parent&&(e.__parent.picked=!1)}const{width:u,height:l}=s._getRenderer().canvas,h=r.width,c=r.height;u===h&&l===c||r.setSize(u,l),n.setRenderTarget(r),n.clear(),e&&e.layers&&this.camera.layers.set(0),n.render(i,e);const f=new Uint8Array(4),{x:p,y:d}=t;let g=window.devicePixelRatio;const y=s.getMap();y&&(g=y.getDevicePixelRatio?y.getDevicePixelRatio():y.options.devicePixelRatio);const v=p*g,m=r.height-d*g;n.readRenderTargetPixels(r,Math.round(v),Math.round(m),1,1,f);const A=f[0]<<16|f[1]<<8|f[2],_=o[A];if(_)_.__parent&&(o[A].__parent.picked=!0);else for(let t=0;t<a;t++){const e=this.pickingScene.children[t];if(e&&e.__parent){const t=e.__parent;if(t._colorMap&&null!=t._colorMap[A]){t.picked=!0,t.index=t._colorMap[A];break}}}n.setRenderTarget(null)}}const ti={bottomHeight:0,altitude:0};class ei extends W{constructor(t,e,n,r){e=i.Util.extend({},ti,e,{layer:r,lineString:t}),super(),this._initOptions(e);const{asynchronous:o}=e,{lineStrings:s,center:a}=Ve(t),u=new j;let l;if(o){const e=i.Util.GUID();this.getOptions().id=e,this.getOptions().center=a,dn.push({id:e,data:s,lineString:t,center:a,layer:r,baseObject:this})}else{const t=[],n={};for(let i=0,o=s.length;i<o;i++){const o=Ue(s[i],r,a,!1).positions;we(o,e.bottomHeight,r,n),t.push(qe(o))}l=He(t),u.setPositions(l)}this._setMaterialRes(r,n),this._createLine2(u,n);const{altitude:h}=e,c=r.altitudeToVector3(h,h).x,f=r.coordinateToVector3(a,c);this.getObject3d().position.copy(f),o||(this._setPickObject3d(l,n.linewidth),this._init()),this.type="FatLine"}_init(){const t=this.getLayer().getPick();this.on("add",(()=>{t.add(this.pickObject3d)})),this.on("remove",(()=>{t.remove(this.pickObject3d)}))}_setMaterialRes(t,e){const n=t.getMap();if(!n)return this;const r=n.getSize(),i=r.width,o=r.height;e.resolution.set(i,o)}_setPickObject3d(t,e){const n=new j;n.setPositions(t);const r=this.getLayer().getPick().getColor(),i=[];for(let e=0,n=t.length/3;e<n;e++)i.push(r.r,r.g,r.b);n.setColors(i);const o=new G({color:"#fff",linewidth:e,vertexColors:O()});this._setMaterialRes(this.getLayer(),o);const s=r.getHex(),a=new V(n,o);a.position.copy(this.getObject3d().position),a._colorIndex=s,this.setPickObject3d(a)}identify(t){return this.picked}setSymbol(t){if(t&&t instanceof o.Material){t.needsUpdate=!0;const e=this.getMap().getSize(),n=e.width,r=e.height;t.resolution.set(n,r),this.getObject3d().material=t}return this}_workerLoad(t){const e=new Float32Array(t.position),n=this.getObject3d();if(n.geometry.setPositions(e),n.computeLineDistances(),this._setPickObject3d(e,n.material.linewidth),this._init(),this.isAdd){this.getLayer().getPick().add(this.pickObject3d)}this._fire("workerload",{target:this})}_animation(){const t=this.getLayer();if(!t)return this;[this.getObject3d(),this.getPickObject3d()].forEach((e=>{e&&this._setMaterialRes(t,e.material)}))}}const ni={altitude:0,colors:null};class ri extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const o=[],s=[],a=t.length;for(let e=0;e<a;e++){const n=Ve(t[e]);o.push(n.center),s.push(n.lineStrings)}const u=xe(o);e=i.Util.extend({},ni,e,{layer:r,lineStrings:t,coordinate:u}),super(),this._initOptions(e);const{asynchronous:l}=e,h=new j,c=[],f={};let p,d,g=[],y=0,v=[];if(l)gn.push({id:i.Util.GUID(),data:s,key:e.key,center:u,layer:r,baseObject:this,lineStrings:t,option:e});else{for(let t=0;t<a;t++){const n=s[t];let o=0;for(let t=0,s=n.length;t<s;t++){const s=Me(n[t]),a=i.Util.extend({},e,s),{positions:l}=Ue(n[t],r,u,!1);we(l,a.bottomHeight,r,f),o+=l.length/3*2-2,v.push(qe(l))}g[t]={position:{count:o,start:y,end:y+3*o},instanceStart:{count:o,start:y,end:y+3*o},instanceEnd:{count:o,start:y,end:y+3*o},hide:!1},y+=3*o}p=He(v),h.setPositions(p)}this._setMaterialRes(r,n),this._createLine2(h,n);const{altitude:m}=e,A=r.altitudeToVector3(m,m).x,_=r.coordinateToVector3(u,A);this.getObject3d().position.copy(_),this._baseObjects=c,this._datas=t,this._geometriesAttributes=g,this.faceIndex=null,this.index=null,this._geometryCache=new j,l||(d=new Float32Array(p),this._geometryCache.setPositions(d)),this._colorMap={},this.isHide=!1,this._initBaseObjectsEvent(c),l||(this._setPickObject3d(d,n.linewidth),this._init()),this.type="FatLines"}_setMaterialRes(t,e){const n=t.getMap();if(!n)return this;const r=n.getSize(),i=r.width,o=r.height;e.resolution.set(i,o)}_setPickObject3d(t,e){if(!this._colorMap)return;const n=this._geometryCache||new j;n.setPositions(t);const r=this.getLayer().getPick(),{_geometriesAttributes:i}=this,o=be(i);let s=0;for(let t=0,e=i.length;t<e;t++){const e=r.getColor(),n=e.getHex();this._colorMap[n]=t;const{count:a}=i[t].position;this._datas[t].colorIndex=n;for(let t=0;t<a;t++)o[s]=e.r,o[s+1]=e.g,o[s+2]=e.b,s+=3}n.setColors(o);const a=new G({color:"#fff",linewidth:e,vertexColors:O()});this._setMaterialRes(this.getLayer(),a);const u=r.getColor().getHex(),l=new V(n,a);l.position.copy(this.getObject3d().position),l._colorIndex=u,this.setPickObject3d(l)}identify(t){return this.picked}setSymbol(t){if(t&&t instanceof o.Material){t.needsUpdate=!0;const e=this.getMap().getSize(),n=e.width,r=e.height;t.resolution.set(n,r),this.getObject3d().material=t}return this}getSelectMesh(){const t=this._getIndex();if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],n=i.Util.extend({},this.getOptions(),{index:t},Z(e)?e.properties:e.getProperties());this._baseObjects[t]=new ei(e,n,this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}_updateAttribute(t,e){const{indexs:n}=this._getHideGeometryIndex(e),r=this._geometryCache.attributes[e].array,i=r.length;for(let e=0;e<i;e++)t.array[e]=r[e];for(let r=0;r<n.length;r++){const i=n[r],{start:o,end:s}=this._geometriesAttributes[i][e];for(let e=o;e<s;e++)t.array[e]=-1e5}return this}_showGeometry(t,e){let n;if(t&&(n=t.getOptions().index),null!=n){const t=this._geometriesAttributes[n],{hide:r}=t;if(r===e)return this;t.hide=e;const i=this.getObject3d().geometry;this._updateAttribute(i.attributes.instanceStart,"instanceStart"),this._updateAttribute(i.attributes.instanceEnd,"instanceEnd"),i.attributes.instanceStart.data.needsUpdate=!0,i.attributes.instanceEnd.data.needsUpdate=!0,this.isHide=e}return this}_workerLoad(t){const{geometriesAttributes:e}=t;this._geometriesAttributes=e;const n=this.getObject3d(),r=new Float32Array(t.position),i=new Float32Array(r);if(n.geometry.setPositions(new Float32Array(r)),this._geometryCache.setPositions(i),this._setPickObject3d(i,n.material.linewidth),this._init(),this.isAdd){this.getLayer().getPick().add(this.pickObject3d)}this._fire("workerload",{target:this})}_animation(){const t=this.getLayer();if(!t)return this;[this.getObject3d(),this.getPickObject3d()].forEach((e=>{e&&this._setMaterialRes(t,e.material)}))}}const ii={radius:10,height:100,altitude:0,topColor:"",bottomColor:"#2d2f61",heightEnable:!0};class oi extends W{constructor(t,e,n,r){e=i.Util.extend({},ii,e,{layer:r,coordinate:t}),super(),this._initOptions(e);const{height:o,radius:s,topColor:a,bottomColor:u,altitude:l}=e,h=r.altitudeToVector3(o,o).x,c=r.distanceToVector3(s,s).x,f=Dn().clone();f.scale(2*c,2*c,h),a&&(Ln(f,u,a,"z",h/2),n.vertexColors=O()),this._createMesh(f,n);const p=r.altitudeToVector3(l,l).x,d=r.coordinateToVector3(t,p);this.getObject3d().position.copy(d),this.type="Box"}}const si={radius:10,height:100,altitude:0,topColor:null,bottomColor:"#2d2f61"};class ai extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const o=t.length,s=xe(t),a=r.coordinateToVector3(s),u=[],l=[],h=[];let c=0;e=i.Util.extend({},{altitude:0,layer:r,points:t},si,e);const f={},p={};for(let s=0;s<o;s++){const o=i.Util.extend({index:s},e,t[s]),{radius:d,altitude:g,topColor:y,bottomColor:v,height:m,coordinate:A}=o,_=Ae(d,r,f),x=_e(m,r,p),w=_e(g,r,p),b=Dn().clone();b.scale(2*_,2*_,x),y&&(Ln(b,v,y,"z",x/2),n.vertexColors=O());const E=r.coordinateToVector3(A).sub(a),I=b.attributes.position.array;for(let t=0,e=I.length;t<e;t+=3)I[t+2]+=w,I[t]+=E.x,I[t+1]+=E.y,I[t+2]+=E.z;u.push(b);const C=new oi(A,o,n,r);l.push(C),b.index.count;const S=b.attributes.position.count;b.attributes.normal.count,b.attributes.uv.count,h[s]={position:{count:S,start:c,end:c+3*S},hide:!1},c+=3*S}super(),this._initOptions(e);const d=Rn(u);this._createMesh(d,n);const g=e.altitude,y=r.altitudeToVector3(g,g).x,v=a.clone();v.z=y,this.getObject3d().position.copy(v),this._baseObjects=l,this._datas=t,this._geometriesAttributes=h,this.faceIndex=null,this._geometryCache=In(d),this.isHide=!1,this._colorMap={},this._initBaseObjectsEvent(l),this._setPickObject3d(),this._init(),this.type="Boxs"}identify(t){return this.picked}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function ui(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})})),e}var li={exports:{}};function hi(t,e,n){n=n||2;var r,i,o,s,a,u,l,h=e&&e.length,c=h?e[0]*n:t.length,f=ci(t,0,c,n,!0),p=[];if(!f||f.next===f.prev)return p;if(h&&(f=function(t,e,n,r){var i,o,s,a=[];for(i=0,o=e.length;i<o;i++)(s=ci(t,e[i]*r,i<o-1?e[i+1]*r:t.length,r,!1))===s.next&&(s.steiner=!0),a.push(wi(s));for(a.sort(mi),i=0;i<a.length;i++)n=Ai(a[i],n);return n}(t,e,f,n)),t.length>80*n){r=o=t[0],i=s=t[1];for(var d=n;d<c;d+=n)(a=t[d])<r&&(r=a),(u=t[d+1])<i&&(i=u),a>o&&(o=a),u>s&&(s=u);l=0!==(l=Math.max(o-r,s-i))?32767/l:0}return pi(f,p,n,r,i,l,0),p}function ci(t,e,n,r,i){var o,s;if(i===Di(t,e,n,r)>0)for(o=e;o<n;o+=r)s=Pi(o,t[o],t[o+1],s);else for(o=n-r;o>=e;o-=r)s=Pi(o,t[o],t[o+1],s);return s&&Ci(s,s.next)&&(Li(s),s=s.next),s}function fi(t,e){if(!t)return t;e||(e=t);var n,r=t;do{if(n=!1,r.steiner||!Ci(r,r.next)&&0!==Ii(r.prev,r,r.next))r=r.next;else{if(Li(r),(r=e=r.prev)===r.next)break;n=!0}}while(n||r!==e);return e}function pi(t,e,n,r,i,o,s){if(t){!s&&o&&function(t,e,n,r){var i=t;do{0===i.z&&(i.z=xi(i.x,i.y,e,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,n,r,i,o,s,a,u,l=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,r=n,a=0,e=0;e<l&&(a++,r=r.nextZ);e++);for(u=l;a>0||u>0&&r;)0!==a&&(0===u||!r||n.z<=r.z)?(i=n,n=n.nextZ,a--):(i=r,r=r.nextZ,u--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;n=r}o.nextZ=null,l*=2}while(s>1)}(i)}(t,r,i,o);for(var a,u,l=t;t.prev!==t.next;)if(a=t.prev,u=t.next,o?gi(t,r,i,o):di(t))e.push(a.i/n|0),e.push(t.i/n|0),e.push(u.i/n|0),Li(t),t=u.next,l=u.next;else if((t=u)===l){s?1===s?pi(t=yi(fi(t),e,n),e,n,r,i,o,2):2===s&&vi(t,e,n,r,i,o):pi(fi(t),e,n,r,i,o,1);break}}}function di(t){var e=t.prev,n=t,r=t.next;if(Ii(e,n,r)>=0)return!1;for(var i=e.x,o=n.x,s=r.x,a=e.y,u=n.y,l=r.y,h=i<o?i<s?i:s:o<s?o:s,c=a<u?a<l?a:l:u<l?u:l,f=i>o?i>s?i:s:o>s?o:s,p=a>u?a>l?a:l:u>l?u:l,d=r.next;d!==e;){if(d.x>=h&&d.x<=f&&d.y>=c&&d.y<=p&&bi(i,a,o,u,s,l,d.x,d.y)&&Ii(d.prev,d,d.next)>=0)return!1;d=d.next}return!0}function gi(t,e,n,r){var i=t.prev,o=t,s=t.next;if(Ii(i,o,s)>=0)return!1;for(var a=i.x,u=o.x,l=s.x,h=i.y,c=o.y,f=s.y,p=a<u?a<l?a:l:u<l?u:l,d=h<c?h<f?h:f:c<f?c:f,g=a>u?a>l?a:l:u>l?u:l,y=h>c?h>f?h:f:c>f?c:f,v=xi(p,d,e,n,r),m=xi(g,y,e,n,r),A=t.prevZ,_=t.nextZ;A&&A.z>=v&&_&&_.z<=m;){if(A.x>=p&&A.x<=g&&A.y>=d&&A.y<=y&&A!==i&&A!==s&&bi(a,h,u,c,l,f,A.x,A.y)&&Ii(A.prev,A,A.next)>=0)return!1;if(A=A.prevZ,_.x>=p&&_.x<=g&&_.y>=d&&_.y<=y&&_!==i&&_!==s&&bi(a,h,u,c,l,f,_.x,_.y)&&Ii(_.prev,_,_.next)>=0)return!1;_=_.nextZ}for(;A&&A.z>=v;){if(A.x>=p&&A.x<=g&&A.y>=d&&A.y<=y&&A!==i&&A!==s&&bi(a,h,u,c,l,f,A.x,A.y)&&Ii(A.prev,A,A.next)>=0)return!1;A=A.prevZ}for(;_&&_.z<=m;){if(_.x>=p&&_.x<=g&&_.y>=d&&_.y<=y&&_!==i&&_!==s&&bi(a,h,u,c,l,f,_.x,_.y)&&Ii(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function yi(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!Ci(i,o)&&Si(i,r,r.next,o)&&Ti(i,o)&&Ti(o,i)&&(e.push(i.i/n|0),e.push(r.i/n|0),e.push(o.i/n|0),Li(r),Li(r.next),r=t=o),r=r.next}while(r!==t);return fi(r)}function vi(t,e,n,r,i,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&Ei(s,a)){var u=ki(s,a);return s=fi(s,s.next),u=fi(u,u.next),pi(s,e,n,r,i,o,0),void pi(u,e,n,r,i,o,0)}a=a.next}s=s.next}while(s!==t)}function mi(t,e){return t.x-e.x}function Ai(t,e){var n=function(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&a>s&&(s=a,n=r.x<r.next.x?r:r.next,a===i))return n}r=r.next}while(r!==e);if(!n)return null;var u,l=n,h=n.x,c=n.y,f=1/0;r=n;do{i>=r.x&&r.x>=h&&i!==r.x&&bi(o<c?i:s,o,h,c,o<c?s:i,o,r.x,r.y)&&(u=Math.abs(o-r.y)/(i-r.x),Ti(r,t)&&(u<f||u===f&&(r.x>n.x||r.x===n.x&&_i(n,r)))&&(n=r,f=u)),r=r.next}while(r!==l);return n}(t,e);if(!n)return e;var r=ki(n,t);return fi(r,r.next),fi(n,n.next)}function _i(t,e){return Ii(t.prev,t,e.prev)<0&&Ii(e.next,t,t.next)<0}function xi(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function wi(t){var e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function bi(t,e,n,r,i,o,s,a){return(i-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(r-a)>=(n-s)*(e-a)&&(n-s)*(o-a)>=(i-s)*(r-a)}function Ei(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&Si(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(Ti(t,e)&&Ti(e,t)&&function(t,e){var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.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!==t);return r}(t,e)&&(Ii(t.prev,t,e.prev)||Ii(t,e.prev,e))||Ci(t,e)&&Ii(t.prev,t,t.next)>0&&Ii(e.prev,e,e.next)>0)}function Ii(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Ci(t,e){return t.x===e.x&&t.y===e.y}function Si(t,e,n,r){var i=Bi(Ii(t,e,n)),o=Bi(Ii(t,e,r)),s=Bi(Ii(n,r,t)),a=Bi(Ii(n,r,e));return i!==o&&s!==a||(!(0!==i||!Mi(t,n,e))||(!(0!==o||!Mi(t,r,e))||(!(0!==s||!Mi(n,t,r))||!(0!==a||!Mi(n,e,r)))))}function Mi(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function Bi(t){return t>0?1:t<0?-1:0}function Ti(t,e){return Ii(t.prev,t,t.next)<0?Ii(t,e,t.next)>=0&&Ii(t,t.prev,e)>=0:Ii(t,e,t.prev)<0||Ii(t,t.next,e)<0}function ki(t,e){var n=new Ri(t.i,t.x,t.y),r=new Ri(e.i,e.x,e.y),i=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=i,i.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function Pi(t,e,n,r){var i=new Ri(t,e,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 Li(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ri(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Di(t,e,n,r){for(var i=0,o=e,s=n-r;o<n;o+=r)i+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return i}li.exports=hi,li.exports.default=hi,hi.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(Di(t,0,o,n));if(i)for(var a=0,u=e.length;a<u;a++){var l=e[a]*n,h=a<u-1?e[a+1]*n:t.length;s-=Math.abs(Di(t,l,h,n))}var c=0;for(a=0;a<r.length;a+=3){var f=r[a]*n,p=r[a+1]*n,d=r[a+2]*n;c+=Math.abs((t[f]-t[d])*(t[p+1]-t[f+1])-(t[f]-t[p])*(t[d+1]-t[f+1]))}return 0===s&&0===c?0:Math.abs((c-s)/s)},hi.flatten=function(t){for(var e=t[0][0].length,n={vertices:[],holes:[],dimensions:e},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var s=0;s<e;s++)n.vertices.push(t[i][o][s]);i>0&&(r+=t[i-1].length,n.holes.push(r))}return n};var Oi=li.exports;function Ni(t,e,n){var r=e[0],i=e[1],o=n[0]-r,s=n[1]-i;if(0!==o||0!==s){var a=((t[0]-r)*o+(t[1]-i)*s)/(o*o+s*s);a>1?(r=n[0],i=n[1]):a>0&&(r+=o*a,i+=s*a)}return(o=t[0]-r)*o+(s=t[1]-i)*s}function Fi(t,e,n,r,i){for(var o,s=r,a=e+1;a<n;a++){var u=Ni(t[a],t[e],t[n]);u>s&&(o=a,s=u)}s>r&&(o-e>1&&Fi(t,e,o,r,i),i.push(t[o]),n-o>1&&Fi(t,o,n,r,i))}function Ui(t,e){var n=t.length-1,r=[t[0]];return Fi(t,0,n,e,r),r.push(t[n]),r}function Qi(t,e,n){if(t.length<=2)return t;var r=void 0!==e?e*e:1;return t=n?t:function(t,e){for(var n,r,i,o,s,a=t[0],u=[a],l=1,h=t.length;l<h;l++)n=t[l],i=a,o=void 0,s=void 0,o=(r=n)[0]-i[0],s=r[1]-i[1],o*o+s*s>e&&(u.push(n),a=n);return a!==n&&u.push(n),u}(t,r),t=Ui(t,r)}function Gi(t,e){return t[0]*e[0]+t[1]*e[1]}function zi(t,e){const n=e[0],r=e[1],i=Math.sqrt(n*n+r*r);return t[0]=n/i,t[1]=r/i,t}function ji(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t}function Vi(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function qi(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Hi(t,e){const n=e[0],r=e[1],i=e[2],o=Math.sqrt(n*n+r*r+i*i);return t[0]=n/o,t[1]=r/o,t[2]=i/o,t}function Wi(t,e,n){var r=e[0],i=e[1],o=e[2],s=n[0],a=n[1],u=n[2];return t[0]=i*u-o*a,t[1]=o*s-r*u,t[2]=r*a-i*s,t}const Yi=[];function Xi(t,e,n,r){const i=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}(e,n),o=Math.acos(i)*r;return ji(Yi,n,e,-i),function(t,e){const n=e[0],r=e[1],i=e[2],o=Math.sqrt(n*n+r*r+i*i);t[0]=n/o,t[1]=r/o,t[2]=i/o}(Yi,Yi),function(t,e,n){t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}(t,e,Math.cos(o)),ji(t,t,Yi,Math.sin(o)),t}function Ji(t,e,n,r,i,o,s,a,u,l){const h=s-i,c=a-o,f=(h*(e-o)-c*(t-i))/(c*(n-t)-h*(r-e));return u&&(u[l=l||0]=t+f*(n-t),u[l+1]=e+f*(r-e)),f}function Ki(t,e,n){if(n-e<3)return 0;let r=0;for(let i=2*(n-1),o=2*e;o<2*n;){const e=t[i],n=t[i+1],s=t[o],a=t[o+1];i=o,o+=2,r+=e*a-s*n}return r}function Zi(t,e,n=2){return Oi(t,e,n)}const $i=[],to=[],eo=[];function no(t,e,n,r,i,o,s,a,u){const l=null!=s;let h,c,f,p=i,d=null;l&&(d=new Uint32Array(r-n));let g=[];for(let i=n;i<r;i++){const y=i===r-1?n:i+1,v=i===n?r-1:i-1,m=t[2*v],A=t[2*v+1],_=t[2*i],x=t[2*i+1],w=t[2*y],b=t[2*y+1];$i[0]=_-m,$i[1]=x-A,to[0]=w-_,to[1]=b-x,zi($i,$i),zi(to,to),l&&(d[i]=p);let E,I,C=!1;if(a||i!==n)if(a||i!==r-1){Vi(eo,to,$i);const t=eo[1];eo[1]=-eo[0],eo[0]=t,zi(eo,eo);const n=Gi(eo,to),r=Math.sqrt(1-n*n),i=o*Math.min(10,1/r);if(l&&1/r>s&&o*n<0){const t=_+eo[0]*o,n=x+eo[1]*o,i=Math.acos(r)/2,s=Math.tan(i)*Math.abs(o);e[2*p]=t+eo[1]*s,e[2*p+1]=n-eo[0]*s,p++,e[2*p]=t-eo[1]*s,e[2*p+1]=n+eo[0]*s,p++}else E=_+eo[0]*i,I=x+eo[1]*i,C=!0;if(C){if(u&&null!=h){const t=Ji(m,A,h,c,_,x,E,I,g,0);t>=-.01&&t<=1.01&&(e[2*f]=E=g[0],e[2*f+1]=I=g[1])}h=e[2*p]=E,c=e[2*p+1]=I,f=p,p++}}else eo[0]=$i[1],eo[1]=-$i[0],zi(eo,eo),E=_+eo[0]*o,I=x+eo[1]*o,C=!0;else eo[0]=to[1],eo[1]=-to[0],zi(eo,eo),h=e[2*p]=_+eo[0]*o,c=e[2*p+1]=x+eo[1]*o,f=p,p++}return d}function ro(t,e,n,r,i){const o=null!=r?[]:new Float32Array(t.length);if(no(t,o,0,e&&e.length?e[0]:t.length/2,0,n,r,i,!0),e)for(let s=0;s<e.length;s++){const a=e[s];no(t,o,a,e[s+1]||t.length/2,null!=r?o.length/2:a,n,r,i,!1)}return o}function io(t,e,n,r){for(let i=0;i<Math.floor((r-n)/2);i++)for(let o=0;o<e;o++){const s=(i+n)*e+o,a=(r-i-1)*e+o,u=t[s];t[s]=t[a],t[a]=u}return t}function oo(t,e){let n=t.length/2,r=0,i=e&&e.length?e[0]:n;Ki(t,r,i)>0&&io(t,2,r,i);for(let o=1;o<(e?e.length:0)+1;o++)r=e[o-1],i=e[o]||n,Ki(t,r,i)<0&&io(t,2,r,i)}const so=[[0,0],[1,0],[1,1],[0,0],[1,1],[0,1]];function ao(t,e,n){let r=0,i=t[e],o=t[e+1];const s=i,a=o;for(let s=e+2;s<n;s+=2){const e=t[s],n=t[s+1];r+=Math.sqrt((e-i)*(e-i)+(n-o)*(n-o)),i=e,o=n}return r+=Math.sqrt((i-s)*(i-s)+(o-a)*(o-a)),r}function uo(t,{vertices:e,topVertices:n,splittedMap:r,depth:i,rect:o},s,a,u,l){const h=a-s,c=l.smoothBevel?1:2,f=Math.min(i/2,l.bevelSize),p=l.bevelSegments,d=u.vertex,g=u.ringPerimeter,y=Math.max(o.width,o.height,i,g);function v(t){const n=(t+1)%h,r=e[2*t],i=e[2*t+1],o=e[2*n],s=e[2*n+1];return r===o&&i===s}if(f>0){const o=[0,0,1],a=[],l=[0,0,-1],g=[];let m=0,A=new Float32Array(h);for(let _=0;_<2;_++){const x=0===_?i-f:f;for(let i=0;i<=p*c;i++){let w,b,E=0;for(let I=0;I<h;I++){const C=2*(I%h+s),S=r?2*r[C/2]:C;a[0]=e[C]-n[S],a[1]=e[C+1]-n[S+1],a[2]=0;const M=Math.sqrt(a[0]*a[0]+a[1]*a[1]);a[0]/=M,a[1]/=M;const B=(Math.floor(i/c)+i%c)/p;0===_?Xi(g,o,a,B):Xi(g,a,l,B);const T=0===_?B:1-B,k=f*Math.sin(T*Math.PI/2),P=M*Math.cos(T*Math.PI/2),L=f*M/Math.sqrt(k*k+P*P),R=g[0]*L+n[S],D=g[1]*L+n[S+1],O=g[2]*L+x;if(t.position[3*u.vertex]=R,t.position[3*u.vertex+1]=D,t.position[3*u.vertex+2]=O,I>0&&(E+=Math.sqrt((w-R)*(w-R)+(b-D)*(b-D))),i>0||_>0){let e=3*(u.vertex-h),n=t.position[e],r=t.position[e+1],i=t.position[e+2];A[I]+=Math.sqrt((n-R)*(n-R)+(r-D)*(r-D)+(i-O)*(i-O))}if(t.uv[2*u.vertex]=E/y,t.uv[2*u.vertex+1]=A[I]/y,w=R,b=D,u.vertex++,!v(I)&&(c>1&&i%c||1===c&&i>=1))for(let e=0;e<6;e++){const n=(so[e][0]+I)%h,r=so[e][1]+m;t.indices[u.index++]=(r-1)*h+n+d}}m++}}}else for(let n=0;n<2;n++){const r=0===n?i-f:f;let o,a,l=0;for(let n=0;n<h;n++){const i=2*(n%h+s),c=e[i],f=e[i+1];t.position[3*u.vertex]=c,t.position[3*u.vertex+1]=f,t.position[3*u.vertex+2]=r,n>0&&(l+=Math.sqrt((o-c)*(o-c)+(a-f)*(a-f))),t.uv[2*u.vertex]=l/y,t.uv[2*u.vertex+1]=r/y,o=c,a=f,u.vertex++}}const m=f>0?p*c+1:1;for(let e=0;e<h;e++)if(!v(e))for(let n=0;n<6;n++){const r=(so[n][0]+e)%h,i=so[n][1]+m;t.indices[u.index++]=(i-1)*h+r+d}}function lo({indices:t,topVertices:e,rect:n,depth:r},i,o,s){if(e.length<=4)return;const a=o.vertex,u=t.length;for(let e=0;e<u;e++)i.indices[o.index++]=a+t[e];const l=Math.max(n.width,n.height);for(let t=0;t<(s.excludeBottom?1:2);t++)for(let s=0;s<e.length;s+=2){const a=e[s],u=e[s+1];i.position[3*o.vertex]=a,i.position[3*o.vertex+1]=u,i.position[3*o.vertex+2]=(1-t)*r,i.uv[2*o.vertex]=(a-n.x)/l,i.uv[2*o.vertex+1]=(u-n.y)/l,o.vertex++}if(!s.excludeBottom){const n=e.length/2;for(let e=0;e<u;e+=3)for(let r=0;r<3;r++)i.indices[o.index++]=a+n+t[e+2-r]}}function ho(t,e,n,r){const i=null==n||"auto"===n;if(!0===n)return{vertices:t,holes:e};const o=[],s=e&&[],a=t.length/2,u=[],l=[],h=[];let c=0,f=0;const p=(e?e.length:0)+1;for(let n=0;n<p;n++){0===n?f=e&&e.length?e[0]:a:(c=e[n-1],f=e[n]||a);for(let e=c;e<f;e++){const n=t[2*e],s=t[2*e+1],a=e===f-1?c:e+1,p=t[2*a],d=t[2*a+1];if(i){const i=e===c?f-1:e-1,a=t[2*i],g=t[2*i+1];u[0]=a-n,u[1]=g-s,l[0]=p-n,l[1]=d-s,zi(u,u),zi(l,l);1-(.5*Gi(u,l)+.5)>r?(o.push(n,s),h.push(e)):(o.push(n,s,n,s),h.push(e,e))}else o.push(n,s,n,s),h.push(e,e)}n<p-1&&s&&s.push(o.length/2)}return{vertices:new Float32Array(o),splittedMap:h,holes:s}}function co(t,e){let n=0,r=0;for(let i=0;i<t.length;i++){const{indices:o,vertices:s,splittedMap:a,topVertices:u,depth:l}=t[i],h=Math.min(l/2,e.bevelSize)>0?e.bevelSegments:0,c=t[i].holes||[];n+=o.length*(e.excludeBottom?1:2),r+=u.length/2*(e.excludeBottom?1:2);const f=2+2*h;let p=0,d=0;for(let t=0;t<c.length+1;t++){0===t?d=c.length?c[0]:s.length/2:(p=c[t-1],d=c[t]||s.length/2);n+=6*((a?a[d-1]+1:d)-(a?a[p]:p))*(f-1);const i=d-p;r+=i*f+(e.smoothBevel?0:h*i*2)}}const i={position:new Float32Array(3*r),indices:new(r>65535?Uint32Array:Uint16Array)(n),uv:new Float32Array(2*r)},o={vertex:0,index:0,ringPerimeter:0};for(let n=0;n<t.length;n++)lo(t[n],i,o,e);for(let n=0;n<t.length;n++){const{holes:r,vertices:s}=t[n],a=s.length/2;let u=0,l=r&&r.length?r[0]:a;if(o.ringPerimeter=ao(t[n].topVertices,u,l),uo(i,t[n],u,l,o,e),r)for(let s=0;s<r.length;s++)u=r[s],l=r[s+1]||a,o.ringPerimeter=ao(t[n].topVertices,u,l),uo(i,t[n],u,l,o,e)}for(let t=0;t<i.uv.length;t++){const e=i.uv[t];e>0&&Math.round(e)===e?i.uv[t]=1:i.uv[t]=e%1}return i.normal=function(t,e){function n(t,e,n,r){t[0]=e,t[1]=n,t[2]=r}const r=[],i=[],o=[],s=[],a=[],u=[],l=t.length,h=new Float32Array(e.length);for(let c=0;c<l;){const l=3*t[c++],f=3*t[c++],p=3*t[c++];n(r,e[l],e[l+1],e[l+2]),n(i,e[f],e[f+1],e[f+2]),n(o,e[p],e[p+1],e[p+2]),qi(s,r,i),qi(a,i,o),Wi(u,s,a);for(let t=0;t<3;t++)h[l+t]=h[l+t]+u[t],h[f+t]=h[f+t]+u[t],h[p+t]=h[p+t]+u[t]}for(var c=0;c<h.length;)n(u,h[c],h[c+1],h[c+2]),Hi(u,u),h[c++]=u[0],h[c++]=u[1],h[c++]=u[2];return h}(i.indices,i.position),i.boundingRect=t[0]&&t[0].rect,i}function fo(t,e){const n=[];for(let r=0;r<t.length;r++){const i=t[r],o=[],s=i.length;let a=i[s-1][0],u=i[s-1][1],l=0;for(let t=0;t<s;t++){let n=i[t][0],r=i[t][1];const s=n-a,h=r-u;l+=Math.sqrt(s*s+h*h),l>e&&(o.push(i[t]),l=0),a=n,u=r}o.length>=3&&n.push(o)}return n.length>0?n:null}function po(t,e){const n=[];for(let r=0;r<t.length;r++){let i=t[r];i=Qi(i,e,!0),i.length>=3&&n.push(i)}return n.length>0?n:null}function go(t,e){e=Object.assign({},e);const n=[1/0,1/0],r=[-1/0,-1/0];for(let e=0;e<t.length;e++)yo(t[e][0],n,r);e.boundingRect=e.boundingRect||{x:n[0],y:n[1],width:r[0]-n[0],height:r[1]-n[1]},function(t){t.depth=t.depth||1,t.bevelSize=t.bevelSize||0,t.bevelSegments=null==t.bevelSegments?2:t.bevelSegments,t.smoothBevel=t.smoothBevel||!1,t.simplify=t.simplify||0,null==t.smoothSide&&(t.smoothSide="auto"),null==t.smoothSideThreshold&&(t.smoothSideThreshold=.9),"number"==typeof t.depth&&(t.bevelSize=Math.min(t.bevelSegments>0?t.bevelSize:0,t.depth/2)),t.bevelSize>0||(t.bevelSegments=0),t.bevelSegments=Math.round(t.bevelSegments);const e=t.boundingRect;if(t.translate=t.translate||[0,0],t.scale=t.scale||[1,1],t.fitRect){let n=null==t.fitRect.x?e.x||0:t.fitRect.x,r=null==t.fitRect.y?e.y||0:t.fitRect.y,i=t.fitRect.width,o=t.fitRect.height;null==i?null!=o?i=o/e.height*e.width:(i=e.width,o=e.height):null==o&&(o=i/e.width*e.height),t.scale=[i/e.width,o/e.height],t.translate=[(n-e.x)*t.scale[0],(r-e.y)*t.scale[1]]}}(e);const i=[],o=e.translate||[0,0],s=e.scale||[1,1],a=e.boundingRect,u={x:a.x*s[0]+o[0],y:a.y*s[1]+o[1],width:a.width*s[0],height:a.height*s[1]},l=Math.min(a.width,a.height)/1e5;for(let n=0;n<t.length;n++){let r=fo(t[n],l);if(!r)continue;const a=e.simplify/Math.max(s[0],s[1]);if(a>0&&(r=po(r,a)),!r)continue;const{vertices:h,holes:c,dimensions:f}=Oi.flatten(r);for(let t=0;t<h.length;)h[t]=h[t++]*s[0]+o[0],h[t]=h[t++]*s[1]+o[1];if(oo(h,c),2!==f)throw new Error("Only 2D polygon points are supported");const p=e.bevelSize>0?ro(h,c,e.bevelSize,null,!0):h,d=Zi(p,c,f),g=ho(h,c,e.smoothSide,e.smoothSideThreshold);i.push({indices:d,vertices:g.vertices,rawVertices:h,topVertices:p,holes:g.holes,splittedMap:g.splittedMap,rect:u,depth:"function"==typeof e.depth?e.depth(n):e.depth})}return co(i,e)}function yo(t,e,n){for(let r=0;r<t.length;r++)e[0]=Math.min(t[r][0],e[0]),e[1]=Math.min(t[r][1],e[1]),n[0]=Math.max(t[r][0],n[0]),n[1]=Math.max(t[r][1],n[1])}const vo={bottomHeight:0,width:3,cornerRadius:0,altitude:0,topColor:null,bottomColor:"#2d2f61",heightEnable:!0};class mo extends W{constructor(t,e,n,r){e=i.Util.extend({},vo,e,{layer:r,lineString:t}),super(),this._initOptions(e);const{width:o,cornerRadius:s,bottomHeight:a,altitude:u,asynchronous:l}=e,h=r.distanceToVector3(s,s).x,c=r.distanceToVector3(o,o).x,{lineStrings:f,center:p}=Ve(t);let d;if(l){d=Sn();const e=i.Util.GUID();this.getOptions().id=e,this.getOptions().center=p,mn.push({id:e,data:f,layer:r,center:p,lineString:t,baseObject:this})}else{const t=[],e={};for(let n=0,i=f.length;n<i;n++){const i=je(f[n],c,h,r,p);we(i,a,r,e),t.push(i)}d=xn(t)}this._createMesh(d,n);const g=r.altitudeToVector3(u,u).x,y=r.coordinateToVector3(p,g);this.getObject3d().position.copy(y),this.type="Path"}_workerLoad(t){const e=En(t);this.getObject3d().geometry=e,this._fire("workerload",{target:this})}}const Ao={width:3,cornerRadius:0,altitude:0,topColor:null,bottomColor:"#2d2f61"};class _o extends(nr(W)){constructor(t,e,n,r){Array.isArray(t)||(t=[t]);const o=[],s=[],a=t.length;for(let e=0;e<a;e++){const n=Ve(t[e]);o.push(n.center),s.push(n.lineStrings)}const u=xe(o);e=i.Util.extend({},Ao,e,{layer:r,lineStrings:t,coordinate:u});const{altitude:l,asynchronous:h}=e;let c;const f=[],p=[];if(super(),h)c=Sn(),An.push({id:i.Util.GUID(),layer:r,key:e.key,center:u,data:s,lineStrings:t,baseObject:this,option:e});else{const n=[];let o=0;const l={},h={};for(let c=0;c<a;c++){const a=t[c],f=i.Util.extend({},e,Me(a),{index:c}),{cornerRadius:d,width:g,bottomHeight:y}=f,v=Ae(g,r,l),m=Ae(d,r,h),A=s[c],_=[];let x=0;for(let t=0,e=A.length;t<e;t++){const e=je(A[t],v,m,r,u);x=we(e,y,r,l),_.push(e)}const w=wn(_);n.push(w);const{position:b,normal:E,indices:I}=w;I.length;const C=b.length/3;E.length,p[c]={position:{middleZ:x,count:C,start:o,end:o+3*C},hide:!1},o+=3*C}c=xn(n)}this._initOptions(e),this._createMesh(c,n);const d=r.altitudeToVector3(l,l).x,g=r.coordinateToVector3(u,d);this.getObject3d().position.copy(g),this._baseObjects=f,this._datas=t,this._geometriesAttributes=p,this.faceIndex=null,this._geometryCache=In(c),this.isHide=!1,this._colorMap={},this._initBaseObjectsEvent(f),h||(this._setPickObject3d(),this._init()),this.type="Paths"}getSelectMesh(){const t=this._getIndex();if(null!=t){if(!this._baseObjects[t]){const e=this._datas[t],n=Object.assign({},this.options,Z(e)?e.properties:e.getProperties(),{index:t});this._baseObjects[t]=new mo(e,n,this.getObject3d().material,this.getLayer()),this._proxyEvent(this._baseObjects[t])}return{data:this._datas[t],baseObject:this._baseObjects[t]}}}identify(t){return this.picked}_workerLoad(t){const{geometriesAttributes:e}=t;this._geometriesAttributes=e;const n=En(t);if(this._geometryCache=In(n),this.getObject3d().geometry=n,this._setPickObject3d(),this._init(),this.isAdd){this.getLayer().getPick().add(this.pickObject3d)}this._fire("workerload",{target:this})}}const xo=Math.PI/180,wo=[[4e3,220],[2e3,100],[1e3,30],[500,15],[100,5],[50,2],[10,1],[5,.7],[2,.1],[1,.05],[.5,.02],[.4,.01],[.1,.005],[.05,.002],[.01,.001]],bo=["mouseout","mousemove","click","mousedown","mouseup","dblclick","contextmenu","touchstart","touchmove","touchend"],Eo=new i.Coordinate(0,0),Io=new i.Point(0,0),Co=new o.Vector3,So=new Map,Mo="__webglFramebuffer",Bo=new o.Vector4;class To extends i.CanvasLayer{constructor(t,e){super(t,e),this._animationBaseObjectMap={},this._needsUpdate=!0,this._mousemoveTimeOut=0,this._mousedownTime=0,this._baseObjects=[],this._delayMeshes=[],this._meshes=[],this.type="ThreeLayer"}isMercator(){const t=this.getMap();if(!t)return!1;const e=t.getSpatialReference(),n=e._projection,r=e._resolutions;return!!(n&&"EPSG:3857"===n.code&&r&&r.length&&156543===Math.floor(r[0])&&t.getGLRes)}isRendering(){const t=this.getMap();return!!t&&(t.isInteracting()||t.isAnimating())}prepareToDraw(...t){}draw(t,e,n,r,i,o){this.renderScene(o,this)}drawOnInteracting(t,e,n,r,i,o,s){this.renderScene(s,this)}_transformHeight(t,e){if(!t)return 0;if(0===(e=e||0))return 0;return this.altitudeToVector3(e,e,null,Co).x}coordinateToVector3(t,e=0,n){const r=this.getMap();if(!r)return null;const s=Array.isArray(t);s?(Eo.x=t[0],Eo.y=t[1]):t instanceof i.Coordinate||(t=new i.Coordinate(t));const a=Ro(r),u=Do(r,s?Eo:t,a,Io);return n&&(n.x=u.x,n.y=u.y,n.z=e),new o.Vector3(u.x,u.y,e)}coordinatiesToGLFloatArray(t,e,n){const r=this.getMap();if(!r)return null;const o=Ro(r),s=t.length,a=new Float32Array(2*s),u=new Float32Array(3*s);So.clear();for(let l=0;l<s;l++){let s=t[l];const h=Array.isArray(s);h?(Eo.x=s[0],Eo.y=s[1]):s instanceof i.Coordinate||(s=new i.Coordinate(s));const c=Do(r,h?Eo:s,o,Io);c.x-=e.x,c.y-=e.y;const f=2*l;a[f]=c.x,a[f+1]=c.y;const p=s;let d=p.z||p[2]||0;if(n&&!So.has(d)){const t=this._transformHeight(n,d);So.set(d,t)}let g=0;n&&(g=So.get(d)||0);const y=3*l;u[y]=c.x,u[y+1]=c.y,u[y+2]=g}return{positions:u,positons2d:a}}coordinatiesToGLArray(t,e){const n=this.getMap();if(!n)return null;const r=Ro(n),o=t.length,s=new Array(o);for(let a=0;a<o;a++){let o=t[a];const u=Array.isArray(o);u?(Eo.x=o[0],Eo.y=o[1]):o instanceof i.Coordinate||(o=new i.Coordinate(o));const l=Do(n,u?Eo:o,r,Io);l.x-=e.x,l.y-=e.y,s[a]=[l.x,l.y]}return s}distanceToVector3(t,e,n){if(0===t&&0===e||!i.Util.isNumber(t)||!i.Util.isNumber(e))return new o.Vector3(0,0,0);const r=this.getMap(),s=Ro(r);let a=n||r.getCenter();a instanceof i.Coordinate||(a=new i.Coordinate(a));const u=r.locate(a,t,e),l=Do(r,a,s),h=Do(r,u,s),c=Math.abs(h.x-l.x)*i.Util.sign(t),f=Math.abs(h.y-l.y)*i.Util.sign(e);return new o.Vector3(c,f,0)}altitudeToVector3(t,e,n,r){if(0===t||!i.Util.isNumber(t))return new o.Vector3(0,0,0);const s=this.getMap();if(s.altitudeToPoint){const e=Ro(s);let n=s.altitudeToPoint(t,e);return t<0&&n>0&&(n=-n),r?(r.x=n,r.y=n,r.z=0,r):new o.Vector3(n,n,0)}return this.distanceToVector3(t,t,n)}toShape(t){if(!t)return null;if(t instanceof i.MultiPolygon)return t.getGeometries().map((t=>this.toShape(t)));const e=t.getCenter(),n=this.coordinateToVector3(e),r=t.getShell().map((t=>{const e=this.coordinateToVector3(t).sub(n);return new o.Vector2(e.x,e.y)})),s=new o.Shape(r),a=t.getHoles();return a&&a.length>0&&(s.holes=a.map((t=>{const e=t.map((t=>{const e=this.coordinateToVector3(t).sub(n);return new o.Vector2(e.x,e.y)}));return new o.Shape(e)}))),s}toExtrudeMesh(t,e,n,r){if(!t)return null;if(t instanceof i.MultiPolygon)return t.getGeometries().map((t=>this.toExtrudeMesh(t,e,n,r)));const s=t.getCoordinates();s.forEach((t=>{for(let e=t.length-1;e>=1;e--)t[e].equals(t[e-1])&&t.splice(e,1)})),t.setCoordinates(s);const a=this.toShape(t),u=this.coordinateToVector3(t.getCenter());r=i.Util.isNumber(r)?r:e,r=this.altitudeToVector3(r,r).x;const l=this.altitudeToVector3(e,e).x,h={bevelEnabled:!1,bevelSize:1};h[parseInt(o.REVISION)>=93?"depth":"amount"]=r;const c=new o.ExtrudeGeometry(a,h);let f=c;o.BufferGeometry.prototype.fromGeometry&&(f=new o.BufferGeometry,f.fromGeometry(c));const p=new o.Mesh(f,n);return p.position.set(u.x,u.y,l-r),p}toExtrudePolygon(t,e,n){return new Vn(t,e,n,this)}toBar(t,e,n){return new Nn(t,e,n,this)}toLine(t,e,n){return new Qn(t,e,n,this)}toExtrudeLine(t,e,n){return new zn(t,e,n,this)}toModel(t,e){return new Hn(t,e,this)}toExtrudeLineTrail(t,e,n){return new $n(t,e,n,this)}toExtrudePolygons(t,e,n){return new or(t,e,n,this)}toPoint(t,e,n){return new lr(t,e,n,this)}toPoints(t,e,n){return new gr(t,e,n,this)}toBars(t,e,n){return new vr(t,e,n,this)}toExtrudeLines(t,e,n){return new Ar(t,e,n,this)}toLines(t,e,n){return new xr(t,e,n,this)}toThreeVectorTileLayer(t,e,n){return new Pr(t,e,n,this)}toTerrain(t,e,n){return new Qr(t,e,n,this)}toTerrainVectorTileLayer(t,e,n){return new zr(t,e,n,this)}toHeatMap(t,e,n){return new Jr(t,e,n,this)}toFatLine(t,e,n){return new ei(t,e,n,this)}toFatLines(t,e,n){return new ri(t,e,n,this)}toBox(t,e,n){return new oi(t,e,n,this)}toBoxs(t,e,n){return new ai(t,e,n,this)}toPath(t,e,n){return new mo(t,e,n,this)}toPaths(t,e,n){return new _o(t,e,n,this)}getBaseObjects(){return this.getMeshes().filter((t=>t instanceof W))}getMeshes(){const t=this.getScene();if(!t)return[];const e=[];for(let n=0,r=t.children.length;n<r;n++){const r=t.children[n];r instanceof o.Object3D&&!(r instanceof o.Camera)&&e.push(r.__parent||r)}return e}clear(){return this.clearMesh()}clearBaseObjects(){return this.removeMesh(this.getBaseObjects())}clearMesh(){const t=this.getScene();if(!t)return this;for(let e=t.children.length-1;e>=0;e--){const n=t.children[e];if(n instanceof o.Object3D&&!(n instanceof o.Camera)){t.remove(n);const e=n.__parent;e&&e instanceof W&&(e.isAdd=!1,e.options.layer=null,e._fire("remove",{target:e}),delete this._animationBaseObjectMap[n.uuid],e._hideUI())}}return this._meshes=[],this}lookAt(t){const e=this.getCamera();return e&&e.lookAt&&t&&e.lookAt(t),this}getCamera(){const t=this._getRenderer();return t?t.camera:null}getScene(){const t=this._getRenderer();return t?t.scene:null}renderScene(t,e){const n=this._getRenderer();return n&&(n.clearCanvas(),n.renderScene(t),e||n.setToRedraw()),this}loop(t=!1){const e=this._delayMeshes;if(!e.length)return;const n=this.getMap();if(!n||n.isAnimating()||n.isInteracting())return;const r=this.options.loopRenderCount||50,i=e.slice(0,r);i&&this.addMesh(i,t),e.splice(0,r)}renderPickScene(){const t=this._getRenderer();if(t){const e=t.pick;e&&e.pick(this._containerPoint)}return this}getThreeRenderer(){const t=this._getRenderer();return t?t.context:null}getPick(){const t=this._getRenderer();return t?t.pick:null}delayAddMesh(t){if(!t)return this;Array.isArray(t)||(t=[t]);for(let e=0,n=t.length;e<n;e++)this._delayMeshes.push(t[e]);return this}addMesh(t,e=!0){if(!t)return this;Array.isArray(t)||(t=[t]);const n=this.getScene();if(t.forEach((t=>{t instanceof W?(n.add(t.getObject3d()),t.isAdd||(t.isAdd=!0,t.options.layer=this,t._fire("add",{target:t})),t._animation&&i.Util.isFunction(t._animation)&&(this._animationBaseObjectMap[t.getObject3d().uuid]=t)):t instanceof o.Object3D&&n.add(t);-1===this._meshes.indexOf(t)&&this._meshes.push(t)})),this._zoomend(),e){const t=this._getRenderer();t&&t.setToRedraw()}return this}removeMesh(t,e=!0){if(!t)return this;Array.isArray(t)||(t=[t]);const n=this.getScene();if(t.forEach((t=>{if(t instanceof W){n.remove(t.getObject3d()),t.isAdd&&(t.isAdd=!1,t.options.layer=null,t._fire("remove",{target:t}),t._hideUI()),t._animation&&i.Util.isFunction(t._animation)&&delete this._animationBaseObjectMap[t.getObject3d().uuid];const e=this._delayMeshes;if(e.length)for(let n=0,r=e.length;n<r;n++)if(e[n]===t){e.splice(n,1);break}}else t instanceof o.Object3D&&n.remove(t);for(let e=0,n=this._meshes.length;e<n;e++){const n=this._meshes[e];n&&(n===t&&this._meshes.splice(e,1))}})),e){const t=this._getRenderer();t&&t.setToRedraw()}return this}_initRaycaster(){return this._raycaster||(this._raycaster=new o.Raycaster,this._mouse=new o.Vector2),this}getRaycaster(){return this._raycaster}identify(t,e){if(!t)return console.error("coordinate is null,it should be Coordinate"),[];if(Array.isArray(t)&&(t=new i.Coordinate(t)),!(t instanceof i.Coordinate))return console.error("coordinate type is error,it should be Coordinate"),[];const n=this.getMap().coordToContainerPoint(t);this._containerPoint=n;const{x:r,y:s}=n;this._initRaycaster(),this.fire("identify",{coordinate:t,options:e});const a=this._raycaster,u=this._mouse,l=this.getCamera(),h=this.getScene(),c=this.getMap().getSize();if(!h)return[];const f=c.width,p=c.height;u.x=r/f*2-1,u.y=-s/p*2+1,a.setFromCamera(u,l),a.layers&&a.layers.enableAll&&a.layers.enableAll(),function(t,e){L>113?t.params.Line.threshold=e:t.linePrecision=e}(a,this._getLinePrecision(this.getMap().getResolution()));const d=[],g=[];h.children.forEach((t=>{const e=t.__parent;if(e&&e.getOptions){const n=e;n.getOptions().interactive&&n.isVisible()&&(n.identify&&i.Util.isFunction(n.identify)?g.push(n):d.push(t))}else(t instanceof o.Mesh||t instanceof o.Group)&&d.push(t)}));let y=[];const v=a.intersectObjects(d,!0);v&&Array.isArray(v)&&v.length&&(y=v.map((t=>{let e=t.object;const n=t.instanceId;e=this._recursionMesh(e)||{};const r=e.__parent||e;return r.faceIndex=t.faceIndex,r.index=t.index,r.intersect=t,i.Util.isNumber(n)&&(r.instanceId=n),r}))),this.renderPickScene(),g.length&&g.forEach((e=>{e.identify(t)&&y.push(e)}));const m=y.length;for(let t=0;t<m;t++)if(y[t])for(let e=t+1;e<m;e++)y[t]===y[e]&&y.splice(e,1);let A=y.filter((t=>t instanceof W));A=A.sort(((t,e)=>t.options.pickWeight-e.options.pickWeight)),y.forEach((t=>{t instanceof W||A.push(t)}));const _=(e=i.Util.extend({},e)).count;return i.Util.isNumber(_)&&_>0?A.slice(0,_):y}identifyAtPoint(t,e={}){const n=this.getMap();if(!n)return[];const r=n.containerPointToCoordinate(t);return this.identify(r,e)}_recursionMesh(t){for(;t&&t.parent!==this.getScene();)t=t.parent;return t}_getLinePrecision(t=10){for(let e=0,n=wo.length;e<n;e++){const[n,r]=wo[e];if(t>n)return r}return.01}fireGeoEvent(t,e,n){if(!(t instanceof W))return this;n=n||e.type;const r=this._getEventParams(e),{coordinate:i}=r,o=this.getMap();function s(t,e){e=e||n;const r=t.getInfoWindow();r&&!r._owner&&r.addTo(t);((r?r.options:{}).autoOpenOn||"click")===e&&(o.options.supportPluginEvent||t.openInfoWindow(i),t.fire("showinfowindow",{infoWindow:r}))}if("mousemove"===n){t.fire(n,Object.assign({},r,{target:t,selectMesh:t.getSelectMesh?t.getSelectMesh():null}));const e=t.getToolTip();e&&!e._owner&&e.addTo(t),t.openToolTip(i),s(t)}else"mouseover"===n?t._mouseover||(t.fire("mouseover",Object.assign({},r,{target:t,type:"mouseover",selectMesh:t.getSelectMesh?t.getSelectMesh():null})),t._mouseover=!0,s(t,"mouseover")):"mouseout"===n?t.getSelectMesh?t.isHide||(t._mouseover=!1,t.fire("mouseout",Object.assign({},r,{target:t,type:"mouseout",selectMesh:null})),t.closeToolTip()):(t._mouseover=!1,t.fire("mouseout",Object.assign({},r,{target:t,type:"mouseout"})),t.closeToolTip()):(t.fire(n,Object.assign({},r,{target:t,selectMesh:t.getSelectMesh?t.getSelectMesh():null})),s(t))}_emptyIdentify(t={}){const e=t.domEvent,n=this.getScene();if(!n)return this;const r=this.map||this.getMap();if(!r)return this;const i=r._getEventParams?r._getEventParams(e):this._getEventParams(e);for(let t=0,e=n.children.length;t<e;t++){const e=(n.children[t]||{}).__parent;e&&e.fire("empty",Object.assign({},i,{target:e}))}}_identifyBaseObjectEvents(t){if(!this.options.geometryEvents)return this;const e=this.map||this.getMap();if(e.isInteracting()||!e.options.geometryEvents||e._ignoreEvent(t))return this;const n=t.type,r=e._getEventParams?e._getEventParams(t):this._getEventParams(t);r.type=n;const{type:o,coordinate:s}=r,a=i.Util.now();if(this._mousemoveTimeOut&&"mousemove"===o&&a-this._mousemoveTimeOut<64)return this;this._mousemoveTimeOut=a,"mousedown"!==o&&"touchstart"!==o||(this._mousedownTime=i.Util.now());let u=!1;if("click"===o||"touchend"===o){const t=e.options.clickTimeThreshold||280;u=i.Util.now()-this._mousedownTime<t}if("click"===o&&!u)return this;const l=this.options.identifyCountOnEvent;let h=Math.max(0,i.Util.isNumber(l)?l:0);0===h&&(h=1/0);const c=t=>{const e=[];this._baseObjects&&this._baseObjects.forEach((n=>{let r=!0;t.forEach((t=>{n===t&&(r=!1)})),r&&e.push(n)})),e.forEach((t=>{t&&t instanceof W&&(t.getSelectMesh?t.isHide||(t._mouseover=!1,t.fire("mouseout",Object.assign({},r,{target:t,type:"mouseout",selectMesh:null})),t.closeToolTip()):(t._mouseover=!1,t.fire("mouseout",Object.assign({},r,{target:t,type:"mouseout"})),t.closeToolTip()))}))};if("mouseout"===o)return c([]),this._baseObjects=[],this;const f=this.identify(s,{count:h}),p=this.getScene();if(0===f.length&&p)for(let t=0,e=p.children.length;t<e;t++){const e=(p.children[t]||{}).__parent;e&&e.fire("empty",Object.assign({},r,{target:e}))}function d(t,e){e=e||o;const n=t.getInfoWindow();n&&!n._owner&&n.addTo(t);((n?n.options:{}).autoOpenOn||"click")===e&&(t.openInfoWindow(s),t.fire("showinfowindow",{infoWindow:n}))}if("mousemove"===o?(c(f),f.forEach((t=>{if(t instanceof W){t._mouseover||(t.fire("mouseover",Object.assign({},r,{target:t,type:"mouseover",selectMesh:t.getSelectMesh?t.getSelectMesh():null})),t._mouseover=!0,d(t,"mouseover")),t.fire(o,Object.assign({},r,{target:t,selectMesh:t.getSelectMesh?t.getSelectMesh():null}));const e=t.getToolTip();e&&!e._owner&&e.addTo(t),t.openToolTip(s),d(t)}})),this._baseObjects=f):f.forEach((t=>{t instanceof W&&(t.fire(o,Object.assign({},r,{target:t,selectMesh:t.getSelectMesh?t.getSelectMesh():null})),d(t))})),"touchend"===o&&u){const e=i.Util.extend({},r,{domEvent:t});f.forEach((t=>{t instanceof W&&(t.fire("click",Object.assign({},e,{target:t,selectMesh:t.getSelectMesh?t.getSelectMesh():null})),d(t,"click"))}))}return this}_getEventParams(t){const e=this.getMap(),n={domEvent:t};if(!e)return n;const r=t.touches&&t.touches.length>0?t.touches[0]:t.changedTouches&&t.changedTouches.length>0?t.changedTouches[0]:t;if(r){const t=(0,i.DomUtil.getEventContainerPoint)(r,e._containerDOM);n.coordinate=e.containerPointToCoordinate(t),n.containerPoint=t,n.viewPoint=e.containerPointToViewPoint(t),n.pont2d=e._containerPointToPoint(t)}return n}_zoomend(){const t=this.getScene();if(!t)return;const e=this.getMap().getZoom();t.children.forEach((t=>{const n=t.__parent;if(n&&n.getOptions){const t=n;t.zoomChange&&i.Util.isFunction(t.zoomChange)&&t.zoomChange(e);const r=t.getMinZoom(),o=t.getMaxZoom();e<r||e>o?(t.isVisible()&&(t.getObject3d().visible=!1),t._zoomVisible=!1):r<=e&&e<=o&&(t._visible&&(t.getObject3d().visible=!0),t._zoomVisible=!0)}}))}_getGeometryEventMapPanel(){const t=this.map||this.getMap();return t._panels.allLayers||t._containerDOM}onAdd(){super.onAdd();const t=this.map||this.getMap();if(!t)return this;const e=this._getGeometryEventMapPanel();return this._identifyBaseObjectEventsThis||(this._identifyBaseObjectEventsThis=this._identifyBaseObjectEvents.bind(this)),this._zoomendThis||(this._zoomendThis=this._zoomend.bind(this)),this._emptyIdentifyThis||(this._emptyIdentifyThis=this._emptyIdentify.bind(this)),t.options.supportPluginEvent?this.on("identifyempty",this._emptyIdentifyThis):i.DomUtil.on(e,bo.join(" "),this._identifyBaseObjectEventsThis,this),this._needsUpdate=!0,this._animationBaseObjectMap||(this._animationBaseObjectMap={}),t.on("zooming zoomend",this._zoomendThis,this),this}onRemove(){super.onRemove();const t=this.map||this.getMap();if(!t)return this;const e=this._getGeometryEventMapPanel();return t.options.supportPluginEvent?this.off("identifyempty",this._emptyIdentifyThis):i.DomUtil.off(e,bo.join(" "),this._identifyBaseObjectEventsThis,this),t.off("zooming zoomend",this._zoomendThis,this),this}_addBaseObjectsWhenInit(){return this.addMesh(this._meshes),this}_callbackBaseObjectAnimation(){const t=this;if(t._animationBaseObjectMap)for(const e in t._animationBaseObjectMap){t._animationBaseObjectMap[e]._animation()}return this}_getFovRatio(){const t=this.getMap().getFov();return Math.tan(t/2*xo)}}To.mergeOptions({renderer:"gl",doubleBuffer:!1,glOptions:null,geometryEvents:!0,identifyCountOnEvent:0,forceRenderOnZooming:!0,loopRenderCount:50});const ko={bloom:!0};class Po extends i.renderer.CanvasLayerRenderer{constructor(){super(...arguments),this._renderTime=0,this._renderTarget=null}getPrepareParams(){return[this.scene,this.camera]}getDrawParams(){return[this.scene,this.camera]}_drawLayer(){super._drawLayer.apply(this,arguments)}hitDetect(){return!1}createCanvas(){super.createCanvas(),this.createContext()}createContext(){if(this.canvas.gl&&this.canvas.gl.wrap)this.gl=this.canvas.gl.wrap();else{const t=this.layer.options.glOptions||{alpha:!0,depth:!0,antialias:!0,stencil:!0,preserveDrawingBuffer:!1};t.preserveDrawingBuffer=!0,this.gl=this.gl||this._createGLContext(this.canvas,t)}this._initThreeRenderer(),this.layer.onCanvasCreate(this.context,this.scene,this.camera)}_initThreeRenderer(){this.matrix4=new o.Matrix4;const t=new o.WebGLRenderer({context:this.gl,alpha:!0});t.autoClear=!1,t.setClearColor(new o.Color(1,1,1),0),t.setSize(this.canvas.width,this.canvas.height),t.clear(),this.context=t;const e=this.scene=new o.Scene,n=this.layer.getMap(),r=n.getFov()*Math.PI/180,i=this.camera=new o.PerspectiveCamera(r,n.width/n.height,n.cameraNear,n.cameraFar);i.matrixAutoUpdate=!1,this._syncCamera(),e.add(i),this.pick=new $r(this.layer),_n.star(),this.layer._addBaseObjectsWhenInit()}onCanvasCreate(){super.onCanvasCreate()}resizeCanvas(t){if(!this.canvas)return;let e,n=this.getMap();e=t||n.getSize();const r=n.getDevicePixelRatio?n.getDevicePixelRatio():i.Browser.retina?2:1,o=this.canvas,{width:s,height:a,cssWidth:u,cssHeight:l}=i.Util.calCanvasSize(e,r);if(!this.layer._canvas||o.style.width===u&&o.style.height===l||(o.style.width=u,o.style.height=l),o.width===s&&o.height===a)return this;o.width=s,o.height=a,this.context.setSize(o.width,o.height)}clearCanvas(){this.canvas&&this.context.clear()}prepareCanvas(){return this.canvas?this.clearCanvas():this.createCanvas(),this.layer.fire("renderstart",{context:this.context}),null}renderScene(t){if(this.layer._callbackBaseObjectAnimation(),this._syncCamera(),t&&t.renderTarget){const{width:e,height:n}=t.renderTarget.fbo;this._renderTarget?(this._renderTarget.viewport.set(0,0,e,n),this._renderTarget.scissor.set(0,0,e,n)):(this._renderTarget=new o.WebGLRenderTarget(e,n,{depthBuffer:!1}),this.context.setRenderTarget(this._renderTarget),this.context.render(this.scene,this.camera));const r=this.context.properties.get(this._renderTarget),i=r[Mo];r[Mo]=t.renderTarget.getFramebuffer(t.renderTarget.fbo),this.context.setRenderTarget(this._renderTarget);const s=1===t.bloom&&t.sceneFilter,a=this.scene.children||[];let u=!1;if(s){const e=t.sceneFilter;u=e(ko);for(let t=0,n=a.length;t<n;t++){if(!a[t]||!a[t].layers)continue;const n=a[t].__parent;a[t].bloom=!1,n&&(a[t].bloom=n.bloom);let r=0;(a[t]&&e(a[t])||!n)&&u&&(r=1),a[t].__layer!==r&&(Lo(a[t],r),a[t].__layer=r)}}else for(let t=0,e=a.length;t<e;t++)a[t]&&a[t].layers&&0!==a[t].__layer&&(Lo(a[t],0),a[t].__layer=0);this.camera.layers.set(u?1:0),this.context.render(this.scene,this.camera),r[Mo]=i}else{const{width:t,height:e}=this.canvas,n=this.context.getViewport(Bo);n.width===t&&n.height===e||this.context.setViewport(0,0,t,e),this.context.render(this.scene,this.camera)}this.context.setRenderTarget(null),this.completeRender()}remove(){delete this._drawContext,this._renderTarget&&(this._renderTarget.dispose(),delete this._renderTarget),super.remove()}_syncCamera(){const t=this.getMap(),e=this.camera;e.matrix.elements=t.cameraWorldMatrix,e.projectionMatrix.elements=t.projMatrix,this.matrix4.invert?e.projectionMatrixInverse.elements=this.matrix4.copy(e.projectionMatrix).invert().elements:e.projectionMatrixInverse&&(e.projectionMatrixInverse.elements=this.matrix4.getInverse(e.projectionMatrix).elements)}_createGLContext(t,e){const n=["webgl2","webgl","experimental-webgl"];let r=null;for(let i=0;i<n.length;++i){try{r=t.getContext(n[i],e)}catch(t){}if(r)break}return r}}function Lo(t,e){if(!t)return;t.layers&&t.layers.set(e);const n=t.children;if(n&&n.length)for(let t=0,r=n.length;t<r;t++)Lo(n[t],e)}function Ro(t){return t.getGLRes?t.getGLRes():t.getGLZoom()}function Do(t,e,n,r){return t.coordToPointAtRes?t.coordToPointAtRes(e,n,r):t.coordinateToPoint(e,n,r)}To.registerRenderer("gl",Po),i.registerWorkerAdapter&&(i.registerWorkerAdapter("__maptalks.three__",'(function(t){"use strict";\n/*!\n * poly-extrude v0.16.0\n */function n(t,n){for(var i=0;i<n.length;i++){var e=n[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function i(t,n){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},i(t,n)}function e(t,n,i){void 0===i&&(i=2);var e,s,h,a=n&&n.length,u=a?n[0]*i:t.length,c=r(t,0,u,i,!0),x=[];if(!c||c.next===c.prev)return x;if(a&&(c=function(t,n,i,e){for(var s=[],o=0,h=n.length;o<h;o++){var a=r(t,n[o]*e,o<h-1?n[o+1]*e:t.length,e,!1);a===a.next&&(a.steiner=!0),s.push(d(a))}s.sort(l);for(var u=0;u<s.length;u++)i=f(s[u],i);return i}(t,n,c,i)),t.length>80*i){e=1/0,s=1/0;for(var y=-1/0,p=-1/0,v=i;v<u;v+=i){var g=t[v],_=t[v+1];g<e&&(e=g),_<s&&(s=_),g>y&&(y=g),_>p&&(p=_)}h=0!==(h=Math.max(y-e,p-s))?32767/h:0}return o(c,x,i,e,s,h,0),x}function r(t,n,i,e,r){var s;if(r===function(t,n,i,e){for(var r=0,s=n,o=i-e;s<i;s+=e)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}(t,n,i,e)>0)for(var o=n;o<i;o+=e)s=P(o/e|0,t[o],t[o+1],s);else for(var h=i-e;h>=n;h-=e)s=P(h/e|0,t[h],t[h+1],s);return s&&m(s,s.next)&&(S(s),s=s.next),s}function s(t,n){if(!t)return t;n||(n=t);var i,e=t;do{if(i=!1,e.steiner||!m(e,e.next)&&0!==_(e.prev,e,e.next))e=e.next;else{if(S(e),(e=n=e.prev)===e.next)break;i=!0}}while(i||e!==n);return n}function o(t,n,i,e,r,l,f){if(t){!f&&l&&function(t,n,i,e){var r=t;do{0===r.z&&(r.z=y(r.x,r.y,n,i,e)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var n,i=1;do{var e=t,r=void 0;t=null;var s=null;for(n=0;e;){n++;for(var o=e,h=0,a=0;a<i&&(h++,o=o.nextZ);a++);for(var u=i;h>0||u>0&&o;)0!==h&&(0===u||!o||e.z<=o.z)?(r=e,e=e.nextZ,h--):(r=o,o=o.nextZ,u--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;e=o}s.nextZ=null,i*=2}while(n>1)}(r)}(t,e,r,l);for(var x=t;t.prev!==t.next;){var d=t.prev,p=t.next;if(l?a(t,e,r,l):h(t))n.push(d.i,t.i,p.i),S(t),t=p.next,x=p.next;else if((t=p)===x){f?1===f?o(t=u(s(t),n),n,i,e,r,l,2):2===f&&c(t,n,i,e,r,l):o(s(t),n,i,e,r,l,1);break}}}}function h(t){var n=t.prev,i=t,e=t.next;if(_(n,i,e)>=0)return!1;for(var r=n.x,s=i.x,o=e.x,h=n.y,a=i.y,u=e.y,c=Math.min(r,s,o),l=Math.min(h,a,u),f=Math.max(r,s,o),x=Math.max(h,a,u),y=e.next;y!==n;){if(y.x>=c&&y.x<=f&&y.y>=l&&y.y<=x&&v(r,h,s,a,o,u,y.x,y.y)&&_(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function a(t,n,i,e){var r=t.prev,s=t,o=t.next;if(_(r,s,o)>=0)return!1;for(var h=r.x,a=s.x,u=o.x,c=r.y,l=s.y,f=o.y,x=Math.min(h,a,u),d=Math.min(c,l,f),p=Math.max(h,a,u),g=Math.max(c,l,f),m=y(x,d,n,i,e),z=y(p,g,n,i,e),w=t.prevZ,M=t.nextZ;w&&w.z>=m&&M&&M.z<=z;){if(w.x>=x&&w.x<=p&&w.y>=d&&w.y<=g&&w!==r&&w!==o&&v(h,c,a,l,u,f,w.x,w.y)&&_(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,M.x>=x&&M.x<=p&&M.y>=d&&M.y<=g&&M!==r&&M!==o&&v(h,c,a,l,u,f,M.x,M.y)&&_(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;w&&w.z>=m;){if(w.x>=x&&w.x<=p&&w.y>=d&&w.y<=g&&w!==r&&w!==o&&v(h,c,a,l,u,f,w.x,w.y)&&_(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;M&&M.z<=z;){if(M.x>=x&&M.x<=p&&M.y>=d&&M.y<=g&&M!==r&&M!==o&&v(h,c,a,l,u,f,M.x,M.y)&&_(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function u(t,n){var i=t;do{var e=i.prev,r=i.next.next;!m(e,r)&&z(e,i,i.next,r)&&b(e,r)&&b(r,e)&&(n.push(e.i,i.i,r.i),S(i),S(i.next),i=t=r),i=i.next}while(i!==t);return s(i)}function c(t,n,i,e,r,h){var a=t;do{for(var u=a.next.next;u!==a.prev;){if(a.i!==u.i&&g(a,u)){var c=A(a,u);return a=s(a,a.next),c=s(c,c.next),o(a,n,i,e,r,h,0),void o(c,n,i,e,r,h,0)}u=u.next}a=a.next}while(a!==t)}function l(t,n){var i=t.x-n.x;0===i&&(0===(i=t.y-n.y)&&(i=(t.next.y-t.y)/(t.next.x-t.x)-(n.next.y-n.y)/(n.next.x-n.x)));return i}function f(t,n){var i=function(t,n){var i,e=n,r=t.x,s=t.y,o=-1/0;if(m(t,e))return e;do{if(m(t,e.next))return e.next;if(s<=e.y&&s>=e.next.y&&e.next.y!==e.y){var h=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(h<=r&&h>o&&(o=h,i=e.x<e.next.x?e:e.next,h===r))return i}e=e.next}while(e!==n);if(!i)return null;var a=i,u=i.x,c=i.y,l=1/0;e=i;do{if(r>=e.x&&e.x>=u&&r!==e.x&&p(s<c?r:o,s,u,c,s<c?o:r,s,e.x,e.y)){var f=Math.abs(s-e.y)/(r-e.x);b(e,t)&&(f<l||f===l&&(e.x>i.x||e.x===i.x&&x(i,e)))&&(i=e,l=f)}e=e.next}while(e!==a);return i}(t,n);if(!i)return n;var e=A(i,t);return s(e,e.next),s(i,i.next)}function x(t,n){return _(t.prev,t,n.prev)<0&&_(n.next,t,t.next)<0}function y(t,n,i,e,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-e)*r|0)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function d(t){var n=t,i=t;do{(n.x<i.x||n.x===i.x&&n.y<i.y)&&(i=n),n=n.next}while(n!==t);return i}function p(t,n,i,e,r,s,o,h){return(r-o)*(n-h)>=(t-o)*(s-h)&&(t-o)*(e-h)>=(i-o)*(n-h)&&(i-o)*(s-h)>=(r-o)*(e-h)}function v(t,n,i,e,r,s,o,h){return!(t===o&&n===h)&&p(t,n,i,e,r,s,o,h)}function g(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==n.i&&i.next.i!==n.i&&z(i,i.next,t,n))return!0;i=i.next}while(i!==t);return!1}(t,n)&&(b(t,n)&&b(n,t)&&function(t,n){var i=t,e=!1,r=(t.x+n.x)/2,s=(t.y+n.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(e=!e),i=i.next}while(i!==t);return e}(t,n)&&(_(t.prev,t,n.prev)||_(t,n.prev,n))||m(t,n)&&_(t.prev,t,t.next)>0&&_(n.prev,n,n.next)>0)}function _(t,n,i){return(n.y-t.y)*(i.x-n.x)-(n.x-t.x)*(i.y-n.y)}function m(t,n){return t.x===n.x&&t.y===n.y}function z(t,n,i,e){var r=M(_(t,n,i)),s=M(_(t,n,e)),o=M(_(i,e,t)),h=M(_(i,e,n));return r!==s&&o!==h||(!(0!==r||!w(t,i,n))||(!(0!==s||!w(t,e,n))||(!(0!==o||!w(i,t,e))||!(0!==h||!w(i,n,e)))))}function w(t,n,i){return n.x<=Math.max(t.x,i.x)&&n.x>=Math.min(t.x,i.x)&&n.y<=Math.max(t.y,i.y)&&n.y>=Math.min(t.y,i.y)}function M(t){return t>0?1:t<0?-1:0}function b(t,n){return _(t.prev,t,t.next)<0?_(t,n,t.next)>=0&&_(t,t.prev,n)>=0:_(t,n,t.prev)<0||_(t,t.next,n)<0}function A(t,n){var i=C(t.i,t.x,t.y),e=C(n.i,n.x,n.y),r=t.next,s=n.prev;return t.next=n,n.prev=t,i.next=r,r.prev=i,e.next=i,i.prev=e,s.next=e,e.prev=s,e}function P(t,n,i,e){var r=C(t,n,i);return e?(r.next=e.next,r.prev=e,e.next.prev=r,e.next=r):(r.prev=r,r.next=r),r}function S(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function C(t,n,i){return{i:t,x:n,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}var k=new(function(){function t(t,n,i,e){void 0===t&&(t=0),void 0===n&&(n=0),void 0===i&&(i=0),void 0===e&&(e=1),this.isQuaternion=!0,this._x=t,this._y=n,this._z=i,this._w=e}t.slerpFlat=function(t,n,i,e,r,s,o){var h=i[e+0],a=i[e+1],u=i[e+2],c=i[e+3],l=r[s+0],f=r[s+1],x=r[s+2],y=r[s+3];if(0===o)return t[n+0]=h,t[n+1]=a,t[n+2]=u,void(t[n+3]=c);if(1===o)return t[n+0]=l,t[n+1]=f,t[n+2]=x,void(t[n+3]=y);if(c!==y||h!==l||a!==f||u!==x){var d=1-o,p=h*l+a*f+u*x+c*y,v=p>=0?1:-1,g=1-p*p;if(g>Number.EPSILON){var _=Math.sqrt(g),m=Math.atan2(_,p*v);d=Math.sin(d*m)/_,o=Math.sin(o*m)/_}var z=o*v;if(h=h*d+l*z,a=a*d+f*z,u=u*d+x*z,c=c*d+y*z,d===1-o){var w=1/Math.sqrt(h*h+a*a+u*u+c*c);h*=w,a*=w,u*=w,c*=w}}t[n]=h,t[n+1]=a,t[n+2]=u,t[n+3]=c},t.multiplyQuaternionsFlat=function(t,n,i,e,r,s){var o=i[e],h=i[e+1],a=i[e+2],u=i[e+3],c=r[s],l=r[s+1],f=r[s+2],x=r[s+3];return t[n]=o*x+u*c+h*f-a*l,t[n+1]=h*x+u*l+a*c-o*f,t[n+2]=a*x+u*f+o*l-h*c,t[n+3]=u*x-o*c-h*l-a*f,t};var i,e,r,s=t.prototype;return s.set=function(t,n,i,e){return this._x=t,this._y=n,this._z=i,this._w=e,this._onChangeCallback(),this},s.clone=function(){return new this.constructor(this._x,this._y,this._z,this._w)},s.copy=function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},s.setFromEuler=function(t,n){void 0===n&&(n=!0);var i=t._x,e=t._y,r=t._z,s=t._order,o=Math.cos,h=Math.sin,a=o(i/2),u=o(e/2),c=o(r/2),l=h(i/2),f=h(e/2),x=h(r/2);switch(s){case"XYZ":this._x=l*u*c+a*f*x,this._y=a*f*c-l*u*x,this._z=a*u*x+l*f*c,this._w=a*u*c-l*f*x;break;case"YXZ":this._x=l*u*c+a*f*x,this._y=a*f*c-l*u*x,this._z=a*u*x-l*f*c,this._w=a*u*c+l*f*x;break;case"ZXY":this._x=l*u*c-a*f*x,this._y=a*f*c+l*u*x,this._z=a*u*x+l*f*c,this._w=a*u*c-l*f*x;break;case"ZYX":this._x=l*u*c-a*f*x,this._y=a*f*c+l*u*x,this._z=a*u*x-l*f*c,this._w=a*u*c+l*f*x;break;case"YZX":this._x=l*u*c+a*f*x,this._y=a*f*c+l*u*x,this._z=a*u*x-l*f*c,this._w=a*u*c-l*f*x;break;case"XZY":this._x=l*u*c-a*f*x,this._y=a*f*c-l*u*x,this._z=a*u*x+l*f*c,this._w=a*u*c+l*f*x;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!0===n&&this._onChangeCallback(),this},s.setFromAxisAngle=function(t,n){var i=n/2,e=Math.sin(i);return this._x=t.x*e,this._y=t.y*e,this._z=t.z*e,this._w=Math.cos(i),this._onChangeCallback(),this},s.setFromRotationMatrix=function(t){var n=t.elements,i=n[0],e=n[4],r=n[8],s=n[1],o=n[5],h=n[9],a=n[2],u=n[6],c=n[10],l=i+o+c;if(l>0){var f=.5/Math.sqrt(l+1);this._w=.25/f,this._x=(u-h)*f,this._y=(r-a)*f,this._z=(s-e)*f}else if(i>o&&i>c){var x=2*Math.sqrt(1+i-o-c);this._w=(u-h)/x,this._x=.25*x,this._y=(e+s)/x,this._z=(r+a)/x}else if(o>c){var y=2*Math.sqrt(1+o-i-c);this._w=(r-a)/y,this._x=(e+s)/y,this._y=.25*y,this._z=(h+u)/y}else{var d=2*Math.sqrt(1+c-i-o);this._w=(s-e)/d,this._x=(r+a)/d,this._y=(h+u)/d,this._z=.25*d}return this._onChangeCallback(),this},s.setFromUnitVectors=function(t,n){var i=t.dot(n)+1;return i<Number.EPSILON?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*n.z-t.z*n.y,this._y=t.z*n.x-t.x*n.z,this._z=t.x*n.y-t.y*n.x,this._w=i),this.normalize()},s.rotateTowards=function(t,n){var i=this.angleTo(t);if(0===i)return this;var e=Math.min(1,n/i);return this.slerp(t,e),this},s.identity=function(){return this.set(0,0,0,1)},s.invert=function(){return this.conjugate()},s.conjugate=function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},s.dot=function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},s.lengthSq=function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},s.length=function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},s.normalize=function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},s.multiply=function(t){return this.multiplyQuaternions(this,t)},s.premultiply=function(t){return this.multiplyQuaternions(t,this)},s.multiplyQuaternions=function(t,n){var i=t._x,e=t._y,r=t._z,s=t._w,o=n._x,h=n._y,a=n._z,u=n._w;return this._x=i*u+s*o+e*a-r*h,this._y=e*u+s*h+r*o-i*a,this._z=r*u+s*a+i*h-e*o,this._w=s*u-i*o-e*h-r*a,this._onChangeCallback(),this},s.slerp=function(t,n){if(0===n)return this;if(1===n)return this.copy(t);var i=this._x,e=this._y,r=this._z,s=this._w,o=s*t._w+i*t._x+e*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=s,this._x=i,this._y=e,this._z=r,this;var h=1-o*o;if(h<=Number.EPSILON){var a=1-n;return this._w=a*s+n*this._w,this._x=a*i+n*this._x,this._y=a*e+n*this._y,this._z=a*r+n*this._z,this.normalize(),this}var u=Math.sqrt(h),c=Math.atan2(u,o),l=Math.sin((1-n)*c)/u,f=Math.sin(n*c)/u;return this._w=s*l+this._w*f,this._x=i*l+this._x*f,this._y=e*l+this._y*f,this._z=r*l+this._z*f,this._onChangeCallback(),this},s.slerpQuaternions=function(t,n,i){return this.copy(t).slerp(n,i)},s.random=function(){var t=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),e=Math.sqrt(1-i),r=Math.sqrt(i);return this.set(e*Math.sin(t),e*Math.cos(t),r*Math.sin(n),r*Math.cos(n))},s.equals=function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},s.fromArray=function(t,n){return void 0===n&&(n=0),this._x=t[n],this._y=t[n+1],this._z=t[n+2],this._w=t[n+3],this._onChangeCallback(),this},s.toArray=function(t,n){return void 0===t&&(t=[]),void 0===n&&(n=0),t[n]=this._x,t[n+1]=this._y,t[n+2]=this._z,t[n+3]=this._w,t},s.fromBufferAttribute=function(t,n){return this._x=t.getX(n),this._y=t.getY(n),this._z=t.getZ(n),this._w=t.getW(n),this._onChangeCallback(),this},s.toJSON=function(){return this.toArray()},s._onChange=function(t){return this._onChangeCallback=t,this},s._onChangeCallback=function(){},i=t,(e=[{key:"x",get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},{key:"y",get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},{key:"z",get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},{key:"w",get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}])&&n(i.prototype,e),r&&n(i,r),Object.defineProperty(i,"prototype",{writable:!1}),t}()),V=function(){function t(t,n,i){void 0===t&&(t=0),void 0===n&&(n=0),void 0===i&&(i=0),this.x=t,this.y=n,this.z=i}var n=t.prototype;return n.set=function(t,n,i){return void 0===i&&(i=this.z),this.x=t,this.y=n,this.z=i,this},n.clone=function(){return new this.constructor(this.x,this.y,this.z)},n.copy=function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},n.add=function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},n.addScalar=function(t){return this.x+=t,this.y+=t,this.z+=t,this},n.addVectors=function(t,n){return this.x=t.x+n.x,this.y=t.y+n.y,this.z=t.z+n.z,this},n.addScaledVector=function(t,n){return this.x+=t.x*n,this.y+=t.y*n,this.z+=t.z*n,this},n.sub=function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},n.subScalar=function(t){return this.x-=t,this.y-=t,this.z-=t,this},n.subVectors=function(t,n){return this.x=t.x-n.x,this.y=t.y-n.y,this.z=t.z-n.z,this},n.multiply=function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this},n.multiplyScalar=function(t){return this.x*=t,this.y*=t,this.z*=t,this},n.multiplyVectors=function(t,n){return this.x=t.x*n.x,this.y=t.y*n.y,this.z=t.z*n.z,this},n.applyAxisAngle=function(t,n){return this.applyQuaternion(k.setFromAxisAngle(t,n))},n.applyMatrix4=function(t){var n=this.x,i=this.y,e=this.z,r=t.elements,s=1/(r[3]*n+r[7]*i+r[11]*e+r[15]);return this.x=(r[0]*n+r[4]*i+r[8]*e+r[12])*s,this.y=(r[1]*n+r[5]*i+r[9]*e+r[13])*s,this.z=(r[2]*n+r[6]*i+r[10]*e+r[14])*s,this},n.applyQuaternion=function(t){var n=this.x,i=this.y,e=this.z,r=t.x,s=t.y,o=t.z,h=t.w,a=h*n+s*e-o*i,u=h*i+o*n-r*e,c=h*e+r*i-s*n,l=-r*n-s*i-o*e;return this.x=a*h+l*-r+u*-o-c*-s,this.y=u*h+l*-s+c*-r-a*-o,this.z=c*h+l*-o+a*-s-u*-r,this},n.divide=function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},n.divideScalar=function(t){return this.multiplyScalar(1/t)},n.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},n.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},n.clamp=function(t,n){return this.x=Math.max(t.x,Math.min(n.x,this.x)),this.y=Math.max(t.y,Math.min(n.y,this.y)),this.z=Math.max(t.z,Math.min(n.z,this.z)),this},n.clampScalar=function(t,n){return this.x=Math.max(t,Math.min(n,this.x)),this.y=Math.max(t,Math.min(n,this.y)),this.z=Math.max(t,Math.min(n,this.z)),this},n.clampLength=function(t,n){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(n,i)))},n.dot=function(t){return this.x*t.x+this.y*t.y+this.z*t.z},n.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z},n.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},n.normalize=function(){return this.divideScalar(this.length()||1)},n.setLength=function(t){return this.normalize().multiplyScalar(t)},n.lerp=function(t,n){return this.x+=(t.x-this.x)*n,this.y+=(t.y-this.y)*n,this.z+=(t.z-this.z)*n,this},n.lerpVectors=function(t,n,i){return this.x=t.x+(n.x-t.x)*i,this.y=t.y+(n.y-t.y)*i,this.z=t.z+(n.z-t.z)*i,this},n.cross=function(t){return this.crossVectors(this,t)},n.crossVectors=function(t,n){var i=t.x,e=t.y,r=t.z,s=n.x,o=n.y,h=n.z;return this.x=e*h-r*o,this.y=r*s-i*h,this.z=i*o-e*s,this},n.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},n.equals=function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},n.fromArray=function(t,n){return void 0===n&&(n=0),this.x=t[n],this.y=t[n+1],this.z=t[n+2],this},n.random=function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this},t}();function Z(t){let n,i,e=0,r=1;const s=t.length;for(;r<s;)n=i||t[0],i=t[r],e+=(i[0]-n[0])*(i[1]+n[1]),r++;return e>0}function F(t,n,i){return t[0]=n[0]-i[0],t[1]=n[1]-i[1],t[2]=n[2]-i[2],t}function L(t,n){const i=n[0],e=n[1],r=n[2],s=Math.sqrt(i*i+e*e+r*r)||1;return t[0]=i/s,t[1]=e/s,t[2]=r/s,t}function q(t,n,i){const e=n[0],r=n[1],s=n[2],o=i[0],h=i[1],a=i[2];return t[0]=r*a-s*h,t[1]=s*o-e*a,t[2]=e*h-r*o,t}function E(t,n){function i(t,n,i,e){t[0]=n,t[1]=i,t[2]=e}const e=[],r=[],s=[],o=[],h=[],a=[],u=t.length,c=new Float32Array(n.length);let l=0;for(;l<u;){const u=3*t[l],f=3*t[l+1],x=3*t[l+2];i(e,n[u],n[u+1],n[u+2]),i(r,n[f],n[f+1],n[f+2]),i(s,n[x],n[x+1],n[x+2]),F(h,s,r),F(o,e,r),q(a,h,o);for(let t=0;t<3;t++)c[u+t]+=a[t],c[f+t]+=a[t],c[x+t]+=a[t];l+=3}let f=0;const x=c.length;for(;f<x;)i(a,c[f],c[f+1],c[f+2]),L(a,a),c[f]=a[0]||0,c[f+1]=a[1]||0,c[f+2]=a[2]||0,f+=3;return c}function I(t){if(1===t.length){return{position:t[0].position,normal:t[0].normal,uv:t[0].uv,indices:t[0].indices,results:t}}let n=0,i=0;for(let e=0,r=t.length;e<r;e++){const{position:r,indices:s}=t[e];n+=r.length,i+=s.length}const e={position:new Float32Array(n),normal:new Float32Array(n),uv:new Float32Array(n/3*2),indices:new Uint32Array(i),results:t};let r=0,s=0,o=0,h=0;for(let n=0,i=t.length;n<i;n++){const{position:i,indices:a,normal:u,uv:c}=t[n];e.position.set(i,r),e.normal.set(u,r),e.uv.set(c,h);let l=0;const f=a.length;for(;l<f;){const t=a[l]+s;e.indices[o]=t,o++,l++}h+=c.length,r+=i.length,s+=i.length/3}return e}function O(t){return 180*t/Math.PI}function U(t){return t/180*Math.PI}function N(t,n,i,e,r,s){const o=3*i,h=3*e,a=3*r,u=3*s,c=n[o],l=n[o+1],f=n[o+2],x=n[h],y=n[h+1],d=n[h+2],p=n[a],v=n[a+1],g=n[a+2],_=n[u],m=n[u+1],z=n[u+2];let w=t.length-1;Math.abs(l-y)<Math.abs(c-x)?(t[++w]=c,t[++w]=1-f,t[++w]=x,t[++w]=1-d,t[++w]=p,t[++w]=1-g,t[++w]=_,t[++w]=1-z):(t[++w]=l,t[++w]=1-f,t[++w]=y,t[++w]=1-d,t[++w]=v,t[++w]=1-g,t[++w]=m,t[++w]=1-z)}function j(t,n){n=Object.assign({},{depth:2,top:!0},n);const i=t.map((t=>{for(let n=0,i=t.length;n<i;n++){const i=t[n];Q(i),0===n?Z(i)||(t[n]=i.reverse()):Z(i)&&(t[n]=i.reverse()),R(i)&&i.splice(i.length-1,1)}const i=function(t,n){const i=function(t){let n=0,i=0;const e=t.length;for(;i<e;)n+=t[i].length,i++;return n}(t),e=t.length,r=[],s=new Float32Array(2*i),o=[],h=[],a=3*i,u=2*i,c=n.depth;let l=0,f=0,x=0;for(let n=0;n<e;n++){const i=t[n];n>0&&r.push(l/2);let e=0;const y=i.length;for(;e<y;){const t=i[e],n=t[0],r=t[1],y=t[2]||0;s[l++]=n,s[l++]=r,o[f]=n,o[f+1]=r,o[f+2]=c+y,o[a+f]=n,o[a+f+1]=r,o[a+f+2]=y,h[x]=n,h[x+1]=r,h[u+x]=n,h[u+x+1]=r,f+=3,x+=2,e++}}return{flatVertices:s,holes:r,points:o,count:i,uv:h}}(t,n);i.polygon=t;return function(t,n,i){const e=[],{count:r}=t,s=i.top;for(let t=0,i=n.length;t<i;t+=3){const o=n[t],h=n[t+1],a=n[t+2];s&&(e[t]=o,e[t+1]=h,e[t+2]=a);let u=i+t;const c=r+o,l=r+h,f=r+a;s||(u=t),e[u]=c,e[u+1]=l,e[u+2]=f}t.indices=e}(i,e(i.flatVertices,i.holes,2),n),function(t,n){const{points:i,indices:e,polygon:r,uv:s}=t,o=n.depth;let h=i.length-1,a=e.length-1;for(let t=0,n=r.length;t<n;t++){const n=r[t];let u=0;const c=n.length;for(;u<c;){const t=n[u];let r=n[u+1];u===c-1&&(r=n[0]);const l=i.length/3,f=t[0],x=t[1],y=t[2]||0,d=r[0],p=r[1],v=r[2]||0;i[++h]=f,i[++h]=x,i[++h]=y+o,i[++h]=d,i[++h]=p,i[++h]=v+o,i[++h]=f,i[++h]=x,i[++h]=y,i[++h]=d,i[++h]=p,i[++h]=v;const g=l+2,_=l+3,m=l,z=l+1;e[++a]=g,e[++a]=m,e[++a]=_,e[++a]=m,e[++a]=z,e[++a]=_,N(s,i,g,_,m,z),u++}}}(i,n),i.position=new Float32Array(i.points),i.indices=new Uint32Array(i.indices),i.uv=new Float32Array(i.uv),i.normal=E(i.indices,i.position),i})),r=I(i);return r.polygons=t,r}function Q(t){R(t)||t.push(t[0])}function R(t){const n=t.length,[i,e]=t[0],[r,s]=t[n-1];return i===r&&e===s}function W(t,n){!function(t){t.lineWidth=Math.max(0,t.lineWidth),t.depth=Math.max(0,t.depth),t.sideDepth=Math.max(0,t.sideDepth)}(n=Object.assign({},{depth:2,lineWidth:1,bottomStickGround:!1,pathUV:!1},n));const i=t.map((t=>{const i=function(t,n){let i=n.lineWidth/2;n.isSlope&&(i*=2);const e=[],r=[],s=[],o=t.length;let h=0;for(;h<o;){let n=t[h],a=t[h+1];const u=t[h];h===o-1&&(n=t[o-2],a=t[o-1]);const c=a[1]-n[1],l=a[0]-n[0];let f=0;const x=O(Math.atan(c/l));if(0===h||h===o-1)f=x,f-=90;else{const i=t[h-1];B.x=i[0]-n[0],B.y=i[1]-n[1],T.x=a[0]-n[0],T.y=a[1]-n[1];f=x-H(B,T)/2}const y=U(f),d=u,p=[Math.cos(y)+d[0],Math.sin(y)+d[1]],[v,g]=Y(n,a,i);let _=D(v[0],v[1],d,p),m=D(g[0],g[1],d,p);if(!_||!m){const t=e.length,n=e[t-2],i=e[t-1];if(!n||!i)continue;_=[n[0],n[1]],m=[i[0],i[1]]}_[2]=u[2]||0,m[2]=u[2]||0,e.push(_,m),X(_,n,a)?(r.push(_),s.push(m)):(r.push(m),s.push(_)),h++}return{offsetPoints:e,leftPoints:r,rightPoints:s,line:t}}(t,n);return i.line=t,function(t,n){const i=n.bottomStickGround,e=n.depth,r=t.depths;let s=e,o=e;r&&(s=r[0],o=r[1]);const{leftPoints:h,rightPoints:a}=t,u=t.line,c=n.pathUV;if(c){!function(t){let n=0;for(let i=0,e=t.length;i<e;i++){const e=t[i],r=t[i+1];if(0===i&&(e.distance=0),e&&r){const[t,i,s]=e,[o,h,a]=r,u=t-o,c=i-h,l=(s||0)-(a||0);n+=Math.sqrt(u*u+c*c+l*l),r.distance=n}}}(u);for(let t=0,n=u.length;t<n;t++)h[t].distance=a[t].distance=u[t].distance}let l=0,f=h.length;const x=[],y=[],d=[];for(;l<f;){const t=3*l,[n,e,r]=h[l];x[t]=n,x[t+1]=e,x[t+2]=s+r;const[y,p,v]=a[l],g=3*f+t;x[g]=y,x[g+1]=p,x[g+2]=o+v;const _=2*f*3+t;x[_]=n,x[_+1]=e,x[_+2]=r,i&&(x[_+2]=0);const m=2*f*3+3*f+t;if(x[m]=y,x[m+1]=p,x[m+2]=v,i&&(x[m+2]=0),c){const t=u[l].distance,n=2*l;d[n]=t,d[n+1]=1;const i=2*f+n;d[i]=t,d[i+1]=0;const e=2*f*2+n;d[e]=t,d[e+1]=1;const r=2*f*2+2*f+n;d[r]=t,d[r+1]=0}l++}if(!c){l=0,f=x.length;let t=d.length-1;for(;l<f;){const n=x[l],i=x[l+1];d[++t]=n,d[++t]=i,l+=3}}l=0,f=h.length;let p=y.length-1;for(;l<f-1;){const t=l,n=l+1,i=t+f,e=n+f;y[++p]=t,y[++p]=i,y[++p]=n,y[++p]=i,y[++p]=e,y[++p]=n;const r=l+2*f,s=r+1,o=r+f,h=s+f;y[++p]=r,y[++p]=o,y[++p]=s,y[++p]=o,y[++p]=h,y[++p]=s,l++}if(t.indices=y,t.points=x,t.uv=d,r)for(f=h.length,l=0;l<f;)h[l].depth=s,a[l].depth=o,l++}(i,n),function(t,n){const{points:i,indices:e,leftPoints:r,rightPoints:s,uv:o}=t,h=n.depth,a=n.bottomStickGround,u=[r,s],c=t.depths,l=n.pathUV,f=n.lineWidth;let x=i.length-1,y=e.length-1,d=o.length-1;function p(t,n){const r=i.length/3,s=c?t.depth:h,u=c?n.depth:h;i[++x]=t[0],i[++x]=t[1],i[++x]=s+t[2],i[++x]=n[0],i[++x]=n[1],i[++x]=u+n[2],i[++x]=t[0],i[++x]=t[1],i[++x]=a?0:t[2],i[++x]=n[0],i[++x]=n[1],i[++x]=a?0:n[2];const p=r+2,v=r+3,g=r,_=r+1;e[++y]=p,e[++y]=g,e[++y]=v,e[++y]=g,e[++y]=_,e[++y]=v,l?(o[++d]=t.distance,o[++d]=s/f,o[++d]=n.distance,o[++d]=u/f,o[++d]=t.distance,o[++d]=0,o[++d]=n.distance,o[++d]=0):N(o,i,p,v,g,_)}for(let t=0,n=u.length;t<n;t++){let n=u[t];t>0&&(n=n.map((t=>t)),n=n.reverse());let i=0;const e=n.length-1;for(;i<e;){p(n[i],n[i+1]),i++}}const v=r.length,g=[s[0],r[0],r[v-1],s[v-1]];for(let t=0;t<g.length;t+=2){p(g[t],g[t+1])}}(i,n),i.position=new Float32Array(i.points),i.indices=new Uint32Array(i.indices),i.uv=new Float32Array(i.uv),i.normal=E(i.indices,i.position),i})),e=I(i);return e.lines=t,e}const B={x:0,y:0},T={x:0,y:0};const H=({x:t,y:n},{x:i,y:e})=>{const r=t*i+n*e,s=t*e-n*i;return(Math.atan2(s,r)/Math.PI*180+360)%360};function X(t,n,i){const[e,r]=n,[s,o]=i,[h,a]=t;return(r-o)*h+(s-e)*a+e*o-s*r>0}function Y(t,n,i){const e=n[1]-t[1],r=n[0]-t[0],s=Math.atan2(e,r),o=s+Math.PI/2;let h=Math.cos(o)*i,a=Math.sin(o)*i;const u=[t[0]+h,t[1]+a],c=[n[0]+h,n[1]+a],l=s-Math.PI/2;h=Math.cos(l)*i,a=Math.sin(l)*i;return[[u,c],[[t[0]+h,t[1]+a],[n[0]+h,n[1]+a]]]}function D(t,n,i,e){const r=n[0]-t[0],s=n[1]-t[1],o=e[0]-i[0],h=e[1]-i[1];if(0===r&&0===o)return null;if(0===s&&0===h)return null;const a=s/r,u=h/o,c=t[1]-a*t[0],l=i[1]-u*i[0];let f,x;return 0===r?(f=t[0],x=u*f+l):0===o?(f=i[0],x=a*f+c):0===s?(x=t[1],f=(x-l)/u):0===h?(x=i[1],f=(x-c)/a):(f=(l-c)/(a-u),x=a*f+c),[f,x]}function G(t,n){n=Object.assign({},{radius:1,height:2,radialSegments:6},n);const i=Math.round(Math.max(4,n.radialSegments));let{radius:e,height:r}=n;e=e,r=r;const s=360/i/360*Math.PI*2,o=i+1,h=new Float32Array(3*o*2),[a,u]=t;let c=0,l=0;const f=3*o,x=2*o,y=[],d=[];let p=y.length-1;for(let t=-1;t<i;t++){const n=s*t,i=Math.cos(n)*e+a,o=Math.sin(n)*e+u;h[c]=i,h[c+1]=o,h[c+2]=0,h[c+f]=i,h[c+1+f]=o,h[c+2+f]=r;let v=0,g=0;v=.5+i/e/2,g=.5+o/e/2,d[l]=v,d[l+1]=g,d[l+x]=v,d[l+1+x]=g,c+=3,l+=2,t>1&&(y[++p]=0,y[++p]=t-1,y[++p]=t)}c-=3,h[c]=h[0],h[c+1]=h[1],h[c+2]=h[2];const v=h.length;h[v-3]=h[0],h[v-2]=h[1],h[v-1]=r;const g=y.length;p=y.length-1;for(let t=0;t<g;t++){const n=y[t];y[++p]=n+o}const _=new Float32Array(2*(3*o*2-6));let m=-1;c=2*o,l=0,p=y.length-1;let z=d.length-1;for(let t=0,n=h.length/2;t<n-3;t+=3){const n=h[t],i=h[t+1],s=h[t+3],a=h[t+4];_[++m]=n,_[++m]=i,_[++m]=r,_[++m]=s,_[++m]=a,_[++m]=r,_[++m]=n,_[++m]=i,_[++m]=0,_[++m]=s,_[++m]=a,_[++m]=0;const u=c+2,f=c+3,x=c,v=c+1;y[++p]=x,y[++p]=u,y[++p]=v,y[++p]=u,y[++p]=f,y[++p]=v,c+=4;const g=l/o,w=(l+1)/o;d[++z]=g,d[++z]=r/e/2,d[++z]=w,d[++z]=r/e/2,d[++z]=g,d[++z]=0,d[++z]=w,d[++z]=0,l++}const w=new Float32Array(h.length+_.length);w.set(h,0),w.set(_,h.length);const M=E(y,w);return{points:h,indices:new Uint32Array(y),position:w,normal:M,uv:new Float32Array(d)}}var J=function(){function t(){this.pos=new V,this.dir=new V,this.right=new V,this.up=new V,this.dist=0,this.widthScale=1,this.sharp=!1}var n=t.prototype;return n.lerpPathPoints=function(t,n,i){this.pos.lerpVectors(t.pos,n.pos,i),this.dir.lerpVectors(t.dir,n.dir,i),this.up.lerpVectors(t.up,n.up,i),this.right.lerpVectors(t.right,n.right,i),this.dist=(n.dist-t.dist)*i+t.dist,this.widthScale=(n.widthScale-t.widthScale)*i+t.widthScale},n.copy=function(t){this.pos.copy(t.pos),this.dir.copy(t.dir),this.up.copy(t.up),this.right.copy(t.right),this.dist=t.dist,this.widthScale=t.widthScale},t}(),K=function(){function t(t,n,i,e,r,s,o,h,a,u,c,l,f,x,y,d){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],void 0!==t&&this.set(t,n,i,e,r,s,o,h,a,u,c,l,f,x,y,d)}var n=t.prototype;return n.set=function(t,n,i,e,r,s,o,h,a,u,c,l,f,x,y,d){var p=this.elements;return p[0]=t,p[4]=n,p[8]=i,p[12]=e,p[1]=r,p[5]=s,p[9]=o,p[13]=h,p[2]=a,p[6]=u,p[10]=c,p[14]=l,p[3]=f,p[7]=x,p[11]=y,p[15]=d,this},n.multiply=function(t){return this.multiplyMatrices(this,t)},n.makeRotationAxis=function(t,n){var i=Math.cos(n),e=Math.sin(n),r=1-i,s=t.x,o=t.y,h=t.z,a=r*s,u=r*o;return this.set(a*s+i,a*o-e*h,a*h+e*o,0,a*o+e*h,u*o+i,u*h-e*s,0,a*h-e*o,u*h+e*s,r*h*h+i,0,0,0,0,1),this},n.equals=function(t){for(var n=this.elements,i=t.elements,e=0;e<16;e++)if(n[e]!==i[e])return!1;return!0},t}();function $(t,n,i,e){return function(t,n){var i=1-t;return i*i*n}(t,n)+function(t,n){return 2*(1-t)*t*n}(t,i)+function(t,n){return t*t*n}(t,e)}var tt=function(t){var n,e;function r(n,i,e){var r;return void 0===n&&(n=new V),void 0===i&&(i=new V),void 0===e&&(e=new V),(r=t.call(this)||this).isQuadraticBezierCurve3=!0,r.type="QuadraticBezierCurve3",r.v0=n,r.v1=i,r.v2=e,r}return e=t,(n=r).prototype=Object.create(e.prototype),n.prototype.constructor=n,i(n,e),r.prototype.getPoint=function(t,n){void 0===n&&(n=new V);var i=n,e=this.v0,r=this.v1,s=this.v2;return i.set($(t,e.x,r.x,s.x),$(t,e.y,r.y,s.y),$(t,e.z,r.z,s.z)),i},r}(function(){function t(){this.type="Curve",this.arcLengthDivisions=200}var n=t.prototype;return n.getPoint=function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},n.getPointAt=function(t,n){var i=this.getUtoTmapping(t);return this.getPoint(i,n)},n.getPoints=function(t){void 0===t&&(t=5);for(var n=[],i=0;i<=t;i++)n.push(this.getPoint(i/t));return n},n.getLength=function(){var t=this.getLengths();return t[t.length-1]},n.getLengths=function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var n,i=[],e=this.getPoint(0),r=0;i.push(0);for(var s=1;s<=t;s++)r+=(n=this.getPoint(s/t)).distanceTo(e),i.push(r),e=n;return this.cacheArcLengths=i,i},n.getUtoTmapping=function(t,n){var i,e=this.getLengths(),r=0,s=e.length;i=n||t*e[s-1];for(var o,h=0,a=s-1;h<=a;)if((o=e[r=Math.floor(h+(a-h)/2)]-i)<0)h=r+1;else{if(!(o>0)){a=r;break}a=r-1}if(e[r=a]===i)return r/(s-1);var u=e[r];return(r+(i-u)/(e[r+1]-u))/(s-1)},t}()),nt=new V,it=new V,et=new V,rt=new K,st=new tt;var ot=function(){function t(){this.array=[],this.count=0}var n=t.prototype;return n.set=function(t,n,i,e,r){if(void 0===n&&(n=.1),void 0===i&&(i=10),void 0===e&&(e=null),void 0===r&&(r=!1),(t=t.slice(0)).length<2)return console.warn("PathPointList: points length less than 2."),void(this.count=0);r&&!t[0].equals(t[t.length-1])&&t.push((new V).copy(t[0]));for(var s=0,o=t.length;s<o;s++)if(0===s)this._start(t[s],t[s+1],e);else if(s===o-1)if(r){this._corner(t[s],t[1],n,i,e);var h=this.array[0].dist;this.array[0].copy(this.array[this.count-1]),this.array[0].dist=h}else this._end(t[s]);else this._corner(t[s],t[s+1],n,i,e)},n.distance=function(){return this.count>0?this.array[this.count-1].dist:0},n._getByIndex=function(t){return this.array[t]||(this.array[t]=new J),this.array[t]},n._start=function(t,n,i){this.count=0;var e=this._getByIndex(this.count);if(e.pos.copy(t),e.dir.subVectors(n,t),i)e.up.copy(i);else{var r=Number.MAX_VALUE,s=Math.abs(e.dir.x),o=Math.abs(e.dir.y),h=Math.abs(e.dir.z);s<r&&(r=s,e.up.set(1,0,0)),o<r&&(r=o,e.up.set(0,1,0)),h<r&&e.up.set(0,0,1)}e.right.crossVectors(e.dir,e.up).normalize(),e.up.crossVectors(e.right,e.dir).normalize(),e.dist=0,e.widthScale=1,e.sharp=!1,e.dir.normalize(),this.count++},n._end=function(t){var n=this.array[this.count-1],i=this._getByIndex(this.count);i.pos.copy(t),i.dir.subVectors(t,n.pos);var e=i.dir.length();i.dir.normalize(),i.up.copy(n.up);var r=nt.crossVectors(n.dir,i.dir);if(r.length()>Number.EPSILON){r.normalize();var s=Math.acos(Math.min(Math.max(n.dir.dot(i.dir),-1),1));i.up.applyMatrix4(rt.makeRotationAxis(r,s))}i.right.crossVectors(i.dir,i.up).normalize(),i.dist=n.dist+e,i.widthScale=1,i.sharp=!1,this.count++},n._corner=function(t,n,i,e,r){if(i>0&&e>0){for(var s=function(t,n,i,e,r,s){var o=nt.subVectors(n,t),h=it.subVectors(i,n),a=o.length(),u=h.length();o.normalize(),h.normalize();var c=Math.min(.999999*(r?a/2:a),e);s.v0.copy(n).sub(o.multiplyScalar(c)),s.v1.copy(n);var l=Math.min(u/2*.999999,e);return s.v2.copy(n).add(h.multiplyScalar(l)),s}(this.array[this.count-1].pos,t,n,i,this.count-1==0,st),o=s.getPoints(e),h=0;h<e;h++)this._sharpCorner(o[h],o[h+1],r,0===h?1:0);o[e].equals(n)||this._sharpCorner(o[e],n,r,2)}else this._sharpCorner(t,n,r,0,!0)},n._sharpCorner=function(t,n,i,e,r){void 0===e&&(e=0),void 0===r&&(r=!1);var s=this.array[this.count-1],o=this._getByIndex(this.count),h=nt.subVectors(t,s.pos),a=it.subVectors(n,t),u=h.length();if(h.normalize(),a.normalize(),o.pos.copy(t),1===e?o.dir.copy(h):2===e?o.dir.copy(a):(o.dir.addVectors(h,a),o.dir.normalize()),i)1===o.dir.dot(i)?o.right.crossVectors(a,i).normalize():o.right.crossVectors(o.dir,i).normalize(),o.up.crossVectors(o.right,o.dir).normalize();else{o.up.copy(s.up);var c=et.crossVectors(s.dir,o.dir);if(c.length()>Number.EPSILON){c.normalize();var l=Math.acos(Math.min(Math.max(s.dir.dot(o.dir),-1),1));o.up.applyMatrix4(rt.makeRotationAxis(c,l))}o.right.crossVectors(o.dir,o.up).normalize()}o.dist=s.dist+u;var f=h.dot(a);o.widthScale=Math.min(1/Math.sqrt((1+f)/2),1.415)||1,o.sharp=Math.abs(f-1)>.05&&r,this.count++},t}();const ht=new V(0,0,1),at=new V,ut=new V,ct=new V,lt=new V,ft=new V,xt=new V;function yt(t,n){n=Object.assign({},{lineWidth:1,cornerRadius:0,cornerSplit:10},n);const i=t.map((t=>{const i=function(t){const n=[];for(let i=0,e=t.length;i<e;i++){const e=t[i],[r,s,o]=e,h=new V(r,s,o||0);n[i]=h}return n}(t),e=new ot;e.set(i,n.cornerRadius,n.cornerSplit,ht);const r=function(t,n){const i=n.lineWidth||.1,e=1,r=i/2,s=i,o=t.distance(),h=e*o;let a=0;const u=[],c=[],l=[],f=[];let x=0;if(0===o)return{position:u,normal:c,uv:l,indices:f,count:a};const y=r/s;let d,p=u.length-1,v=c.length-1,g=l.length-1,_=f.length-1;function m(t){const n=0===u.length,i=t.sharp&&!n,e=t.dist/s,o=t.dir,h=t.up,d=t.right;if(at.copy(d).multiplyScalar(r*t.widthScale),ut.copy(d).multiplyScalar(-r*t.widthScale),at.add(t.pos),ut.add(t.pos),i){ct.fromArray(u,u.length-6).sub(ut),lt.fromArray(u,u.length-3).sub(at);const t=ct.length()-lt.length();let n,i;t>0?(n=ct,i=ut):(n=lt,i=at),ft.copy(n).setLength(Math.abs(t)).add(i);let r=xt.copy(i).sub(ft).normalize().dot(o)*xt.copy(i).sub(ft).length()*2;xt.copy(o).setLength(r).add(ft),t>0?(u[++p]=ft.x,u[++p]=ft.y,u[++p]=ft.z,u[++p]=at.x,u[++p]=at.y,u[++p]=at.z,u[++p]=ut.x,u[++p]=ut.y,u[++p]=ut.z,u[++p]=at.x,u[++p]=at.y,u[++p]=at.z,u[++p]=xt.x,u[++p]=xt.y,u[++p]=xt.z,u[++p]=at.x,u[++p]=at.y,u[++p]=at.z,x+=6,f[++_]=x-6,f[++_]=x-8,f[++_]=x-7,f[++_]=x-6,f[++_]=x-7,f[++_]=x-5,f[++_]=x-4,f[++_]=x-6,f[++_]=x-5,f[++_]=x-2,f[++_]=x-4,f[++_]=x-1,a+=12):(u[++p]=ut.x,u[++p]=ut.y,u[++p]=ut.z,u[++p]=ft.x,u[++p]=ft.y,u[++p]=ft.z,u[++p]=ut.x,u[++p]=ut.y,u[++p]=ut.z,u[++p]=at.x,u[++p]=at.y,u[++p]=at.z,u[++p]=ut.x,u[++p]=ut.y,u[++p]=ut.z,u[++p]=xt.x,u[++p]=xt.y,u[++p]=xt.z,x+=6,f[++_]=x-6,f[++_]=x-8,f[++_]=x-7,f[++_]=x-6,f[++_]=x-7,f[++_]=x-5,f[++_]=x-6,f[++_]=x-5,f[++_]=x-3,f[++_]=x-2,f[++_]=x-3,f[++_]=x-1,a+=12);for(let t=0;t<6;t++)c[++v]=h.x,c[++v]=h.y,c[++v]=h.z;l[++g]=e-y,l[++g]=0,l[++g]=e-y,l[++g]=1,l[++g]=e,l[++g]=0,l[++g]=e,l[++g]=1,l[++g]=e+y,l[++g]=0,l[++g]=e+y,l[++g]=1}else u[++p]=ut.x,u[++p]=ut.y,u[++p]=ut.z,u[++p]=at.x,u[++p]=at.y,u[++p]=at.z,c[++v]=h.x,c[++v]=h.y,c[++v]=h.z,c[++v]=h.x,c[++v]=h.y,c[++v]=h.z,l[++g]=e,l[++g]=0,l[++g]=e,l[++g]=1,x+=2,n||(f[++_]=x-2,f[++_]=x-4,f[++_]=x-3,f[++_]=x-2,f[++_]=x-3,f[++_]=x-1,a+=6)}if(h>0)for(let n=0;n<t.count;n++){const i=t.array[n];if(i.dist>h){const e=t.array[n-1];d=new J;const r=(h-e.dist)/(i.dist-e.dist);d.lerpPathPoints(e,i,r),m(d);break}m(i)}else d=t.array[0];return{position:u,normal:c,uv:l,indices:f,count:a}}(e,n);return{position:new Float32Array(r.position),indices:new Uint32Array(r.indices),uv:new Float32Array(r.uv),normal:new Float32Array(r.normal),line:t,count:r.count}})),e=I(i);return e.lines=t,e}new V(0,0,1),new V;var dt={x:0,y:0},pt={x:0,y:0};function vt(t,n,i,e){for(var r=t.length,s=0;s<r;s++){var o=t[s].data;n=t[s].center||n;for(var h=0,a=o.length;h<a;h++)for(var u=o[h],c=0,l=u.length;c<l;c++)t[s].data[h][c]=gt(u[c],n,i,e)}}function gt(t,n,i,e,r){for(var s,o=[],h=r?3:2,a=0,u=(s=i?new Float64Array(t):new Float32Array(t)).length;a<u;a+=h){var c=s[a],l=s[a+1],f=s[a+2];if(n&&i&&e){dt.x=c,dt.y=l;var x=kt(dt,pt);dt.x=x.x,dt.y=x.y,c=(x=Vt(e,dt,i,pt)).x,l=x.y,c-=n[0],l-=n[1]}r?o.push([c,l,f]):o.push([c,l])}return o}function _t(t,n){void 0===n&&(n=1);for(var i=t.length,e=[],r=[],s=0,o=0;o<i;o++){var h=void 0;1===n?h=mt(t[o]):2===n?h=zt(t[o]):3===n&&(h=wt(t[o]));var a=t[o].bottomHeight||0,u=h.position;r.push(h);var c=u.length/3;e[o]={position:{middleZ:a+(t[o].height||0)/2,count:c,start:s,end:s+3*c},hide:!1},s+=3*c}var l=bt(r),f=l.position,x=l.normal,y=l.uv,d=l.indices;return{position:f.buffer,normal:x.buffer,uv:y.buffer,indices:d.buffer,geometriesAttributes:e}}function mt(t){var n=t.data,i=t.height,e=t.bottomHeight,r=j(n,{depth:i,top:t.top}),s=r.position,o=r.normal,h=r.uv,a=r.indices;return At(s,e),{position:s,normal:o,uv:h,indices:a}}function zt(t){var n=t.data,i=t.height,e=t.width,r=t.bottomHeight,s=W(n,{lineWidth:e,depth:i,pathUV:t.pathUV}),o=s.position,h=s.normal,a=s.uv,u=s.indices;return At(o,r),{position:o,normal:h,uv:a,indices:u}}function wt(t){var n=t.data,i=t.cornerRadius,e=t.width,r=t.bottomHeight,s=yt(n,{lineWidth:e,cornerRadius:i}),o=s.position,h=s.normal,a=s.uv,u=s.indices;return At(o,r),{position:o,normal:h,uv:a,indices:u}}function Mt(t,n){for(var i=new Float32Array(n),e=0,r=0;r<t.length;++r)i.set(t[r],e),e+=t[r].length;return i}function bt(t){for(var n={},i={},e=0;e<t.length;++e){var r=t[e];for(var s in r)void 0===n[s]&&(n[s]=[],i[s]=0),n[s].push(r[s]),i[s]+=r[s].length}var o={},h=0,a=[];for(var u in n)if("indices"===u)for(var c=n[u],l=0,f=c.length;l<f;l++){for(var x=c[l],y=0,d=x.length;y<d;y++)a.push(x[y]+h);h+=n.position[l].length/3}else{var p=Mt(n[u],i[u]);if(!p)return null;o[u]=p}return o.indices=new Uint32Array(a),o}function At(t,n){if(void 0!==n&&"number"==typeof n&&0!==n)for(var i=0,e=t.length;i<e;i+=3)t[i+2]+=n}function Pt(t){for(var n=[],i=0,e=t.length;i<e;i+=7){var r=t[i],s=t[i+1],o=t[i+2],h=t[i+3],a=t[i+4],u=t[i+5];n.push({radialSegments:o,radius:h,height:a,altitude:u,center:[r,s]})}for(var c=n.length,l=[],f=[],x=0,y=0;y<c;y++){var d=G(n[y].center||[0,0],n[y]),p=d.position;if(n[y].altitude)for(var v=n[y].altitude,g=0,_=p.length;g<_;g+=3)d[g+2]+=v;f.push(d);var m=p.length/3;l[y]={position:{middleZ:n[y].height/2,count:m,start:x,end:x+3*m},hide:!1},x+=3*m}var z=bt(f),w=z.position,M=z.normal,b=z.uv,A=z.indices;return{position:w.buffer,normal:M.buffer,uv:b.buffer,indices:A.buffer,geometriesAttributes:l}}var St=Math.PI/180,Ct=6378137*Math.PI/180;function kt(t,n){var i,e=85.0511287798,r=t.x,s=Math.max(Math.min(e,t.y),-e);i=0===s?0:Math.log(Math.tan((90+s)*St/2))/St;var o=r*Ct,h=i*Ct;return n?(n.x=o,n.y=h,n):{x:o,y:h}}function Vt(t,n,i,e){var r=t[0]*(n.x-t[2])/i,s=-t[1]*(n.y-t[3])/i;return e?(e.x=r,e.y=s,e):{x:r,y:s}}function Zt(t){void 0===t&&(t=[]);for(var n=t.length,i=new Float32Array(3*n),e=0;e<n;e++){var r=t[e],s=3*e;i[s]=r[0],i[s+1]=r[1],i[s+2]=r[2]||0}return i}function Ft(t){for(var n=new Float32Array(2*t.length-6),i=0,e=0,r=t.length/3;e<r;e++){var s=t[3*e],o=t[3*e+1],h=t[3*e+2];if(e>0&&e<r-1){var a=3*i;n[a]=s,n[a+1]=o,n[a+2]=h,i++}var u=3*i;n[u]=s,n[u+1]=o,n[u+2]=h,i++}return n}function Lt(t){var n=0,i=t.length;if(1===i)return t[0];for(var e=0;e<i;e++)n+=t[e].length;for(var r=new Float32Array(n),s=0,o=0;o<i;o++)r.set(t[o],s),s+=t[o].length;return r}t.initialize=function(){},t.onmessage=function(t,n){var i=t.data,e=i.type,r=i.datas,s=i.glRes,o=i.matrix,h=i.center;if("ExtrudePolygons"===e){vt(r,h,s,o);var a=_t(r);n(null,a,[a.position,a.normal,a.uv,a.indices])}else if("ExtrudeLines"===e||"Paths"===e){for(var u=0,c=r.length;u<c;u++)for(var l=0,f=r[u].data.length;l<f;l++)r[u].data[l]=gt(r[u].data[l],r[u].center||h,s,o,!0);var x=_t(r,"ExtrudeLines"===e?2:3);n(null,x,[x.position,x.normal,x.uv,x.indices])}else if("ExtrudePolygon"===e){var y=[],d=[];r.forEach((function(t){var n=[t];vt(n,h,s,o);var i=_t(n),e=i.position,r=i.normal,a=i.uv,u=i.indices;y.push({id:t.id,position:e,normal:r,uv:a,indices:u}),d.push(e,r,a,u)})),n(null,y,d)}else if("Line"===e||"FatLine"===e){for(var p=[],v=[],g=0,_=r.length;g<_;g++){for(var m=[],z=0,w=r[g].data.length;z<w;z++){r[g].data[z]=gt(r[g].data[z],r[g].center||h,s,o,!0);var M=Zt(r[g].data[z]);m.push(Ft(M))}var b=Lt(m);At(b,r[g].bottomHeight),p.push({id:r[g].id,position:b.buffer}),v.push(b.buffer)}n(null,p,v)}else if("Lines"===e||"FatLines"===e){for(var A=0,P=[],S=[],C=0,k=[],V=0,Z=r.length;V<Z;V++){for(var F=0,L=0,q=r[V].data.length;L<q;L++){r[V].data[L]=gt(r[V].data[L],r[V].center||h,s,o,!0);var E=Zt(r[V].data[L]);At(E,r[V].bottomHeight),F+=E.length/3*2-2,k.push(Ft(E))}var I=F;P[V]=[A,A+I],A+=I,S[V]={position:{count:F,start:C,end:C+3*F},hide:!1},"FatLines"===e&&(S[V].instanceStart={count:F,start:C,end:C+3*F},S[V].instanceEnd={count:F,start:C,end:C+3*F}),C+=3*F}var O=Lt(k);n(null,{id:r.id,position:O.buffer,geometriesAttributes:S,faceMap:P},[O.buffer])}else if("ExtrudeLine"===e||"Path"===e){for(var U=0,N=r.length;U<N;U++)for(var j=0,Q=r[U].data.length;j<Q;j++)r[U].data[j]=gt(r[U].data[j],r[U].center||h,s,o,!0);var R=[],W=[];r.forEach((function(t){var n=_t([t],"ExtrudeLine"===e?2:3),i=n.position,r=n.normal,s=n.uv,o=n.indices;R.push({id:t.id,position:i,normal:r,uv:s,indices:o}),W.push(i,r,s,o)})),n(null,R,W)}else if("Bar"===e){for(var B=[],T=[],H=(r=new Float32Array(r)).length/7,X=0;X<H;){var Y=r.slice(7*X,7*(X+1)),D=Pt(Y),G=D.position,J=D.normal,K=D.uv,$=D.indices;B.push({id:parseInt(Y[6]),position:G,normal:J,uv:K,indices:$}),T.push(G,J,K,$),X++}n(null,B,T)}else if("Bars"===e){var tt=Pt(r=new Float32Array(r));n(null,tt,[tt.position,tt.normal,tt.uv,tt.indices])}else console.error("No processing logic found for type:"+e)},Object.defineProperty(t,"__esModule",{value:!0})})'),i.registerWorkerAdapter("__maptalks.three.fetchdata__",(function(t){const e=[],n=[];function r(t){t.abort?(n.splice(n.indexOf(t),1),e.length&&(n.push(e[0]),e.splice(0,1),i(n[n.length-1]))):n.length<5?(n.push(t),i(t)):e.push(t)}function i(t){fetch(t.url).then((t=>t.text())).then((e=>{new Blob([e],{type:"application/json"}).arrayBuffer().then((e=>{t.postResponse(null,e,[e]),t.abort=!0,r(t)}))})).catch((e=>{console.error(e),t.abort=!0,r(t)}))}t.initialize=function(){},t.onmessage=function(t,e){r({url:t.data,postResponse:e,abort:!1})}})));var Oo=6371008.8,No={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:250826616.45599997,kilometers:6371.0088,kilometres:6371.0088,meters:Oo,metres:Oo,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:3440.069546436285,radians:1,yards:6967335.223679999},Fo={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/Oo,yards:1.0936133},Uo={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function Qo(t,e,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=e||{},r.geometry=t,r}function Go(t,e,n){switch(t){case"Point":return zo(e).geometry;case"LineString":return Ho(e).geometry;case"Polygon":return Vo(e).geometry;case"MultiPoint":return Jo(e).geometry;case"MultiLineString":return Xo(e).geometry;case"MultiPolygon":return Ko(e).geometry;default:throw new Error(t+" is invalid")}}function zo(t,e,n){if(void 0===n&&(n={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!us(t[0])||!us(t[1]))throw new Error("coordinates must contain numbers");return Qo({type:"Point",coordinates:t},e,n)}function jo(t,e,n){return void 0===n&&(n={}),Yo(t.map((function(t){return zo(t,e)})),n)}function Vo(t,e,n){void 0===n&&(n={});for(var r=0,i=t;r<i.length;r++){var o=i[r];if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var s=0;s<o[o.length-1].length;s++)if(o[o.length-1][s]!==o[0][s])throw new Error("First and last Position are not equivalent.")}return Qo({type:"Polygon",coordinates:t},e,n)}function qo(t,e,n){return void 0===n&&(n={}),Yo(t.map((function(t){return Vo(t,e)})),n)}function Ho(t,e,n){if(void 0===n&&(n={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");return Qo({type:"LineString",coordinates:t},e,n)}function Wo(t,e,n){return void 0===n&&(n={}),Yo(t.map((function(t){return Ho(t,e)})),n)}function Yo(t,e){void 0===e&&(e={});var n={type:"FeatureCollection"};return e.id&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.features=t,n}function Xo(t,e,n){return void 0===n&&(n={}),Qo({type:"MultiLineString",coordinates:t},e,n)}function Jo(t,e,n){return void 0===n&&(n={}),Qo({type:"MultiPoint",coordinates:t},e,n)}function Ko(t,e,n){return void 0===n&&(n={}),Qo({type:"MultiPolygon",coordinates:t},e,n)}function Zo(t,e,n){return void 0===n&&(n={}),Qo({type:"GeometryCollection",geometries:t},e,n)}function $o(t,e){if(void 0===e&&(e=0),e&&!(e>=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n}function ts(t,e){void 0===e&&(e="kilometers");var n=No[e];if(!n)throw new Error(e+" units is invalid");return t*n}function es(t,e){void 0===e&&(e="kilometers");var n=No[e];if(!n)throw new Error(e+" units is invalid");return t/n}function ns(t,e){return is(es(t,e))}function rs(t){var e=t%360;return e<0&&(e+=360),e}function is(t){return 180*(t%(2*Math.PI))/Math.PI}function os(t){return t%360*Math.PI/180}function ss(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return ts(es(t,e),n)}function as(t,e,n){if(void 0===e&&(e="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var r=Uo[e];if(!r)throw new Error("invalid original units");var i=Uo[n];if(!i)throw new Error("invalid final units");return t/r*i}function us(t){return!isNaN(t)&&null!==t&&!Array.isArray(t)}function ls(t){return!!t&&t.constructor===Object}function hs(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!us(t))throw new Error("bbox must only contain numbers")}))}function cs(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")}var fs=Object.freeze({__proto__:null,earthRadius:Oo,factors:No,unitsFactors:Fo,areaFactors:Uo,feature:Qo,geometry:Go,point:zo,points:jo,polygon:Vo,polygons:qo,lineString:Ho,lineStrings:Wo,featureCollection:Yo,multiLineString:Xo,multiPoint:Jo,multiPolygon:Ko,geometryCollection:Zo,round:$o,radiansToLength:ts,lengthToRadians:es,lengthToDegrees:ns,bearingToAzimuth:rs,radiansToDegrees:is,degreesToRadians:os,convertLength:ss,convertArea:as,isNumber:us,isObject:ls,validateBBox:hs,validateId:cs});function ps(t,e,n){if(null!==t)for(var r,i,o,s,a,u,l,h,c=0,f=0,p=t.type,d="FeatureCollection"===p,g="Feature"===p,y=d?t.features.length:1,v=0;v<y;v++){a=(h=!!(l=d?t.features[v].geometry:g?t.geometry:t)&&"GeometryCollection"===l.type)?l.geometries.length:1;for(var m=0;m<a;m++){var A=0,_=0;if(null!==(s=h?l.geometries[m]:l)){u=s.coordinates;var x=s.type;switch(c=!n||"Polygon"!==x&&"MultiPolygon"!==x?0:1,x){case null:break;case"Point":if(!1===e(u,f,v,A,_))return!1;f++,A++;break;case"LineString":case"MultiPoint":for(r=0;r<u.length;r++){if(!1===e(u[r],f,v,A,_))return!1;f++,"MultiPoint"===x&&A++}"LineString"===x&&A++;break;case"Polygon":case"MultiLineString":for(r=0;r<u.length;r++){for(i=0;i<u[r].length-c;i++){if(!1===e(u[r][i],f,v,A,_))return!1;f++}"MultiLineString"===x&&A++,"Polygon"===x&&_++}"Polygon"===x&&A++;break;case"MultiPolygon":for(r=0;r<u.length;r++){for(_=0,i=0;i<u[r].length;i++){for(o=0;o<u[r][i].length-c;o++){if(!1===e(u[r][i][o],f,v,A,_))return!1;f++}_++}A++}break;case"GeometryCollection":for(r=0;r<s.geometries.length;r++)if(!1===ps(s.geometries[r],e,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function ds(t,e,n,r){var i=n;return ps(t,(function(t,r,o,s,a){i=0===r&&void 0===n?t:e(i,t,r,o,s,a)}),r),i}function gs(t,e){var n;switch(t.type){case"FeatureCollection":for(n=0;n<t.features.length&&!1!==e(t.features[n].properties,n);n++);break;case"Feature":e(t.properties,0)}}function ys(t,e,n){var r=n;return gs(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r}function vs(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var n=0;n<t.features.length&&!1!==e(t.features[n],n);n++);}function ms(t,e,n){var r=n;return vs(t,(function(t,i){r=0===i&&void 0===n?t:e(r,t,i)})),r}function As(t){var e=[];return ps(t,(function(t){e.push(t)})),e}function _s(t,e){var n,r,i,o,s,a,u,l,h,c,f=0,p="FeatureCollection"===t.type,d="Feature"===t.type,g=p?t.features.length:1;for(n=0;n<g;n++){for(a=p?t.features[n].geometry:d?t.geometry:t,l=p?t.features[n].properties:d?t.properties:{},h=p?t.features[n].bbox:d?t.bbox:void 0,c=p?t.features[n].id:d?t.id:void 0,s=(u=!!a&&"GeometryCollection"===a.type)?a.geometries.length:1,i=0;i<s;i++)if(null!==(o=u?a.geometries[i]:a))switch(o.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===e(o,f,l,h,c))return!1;break;case"GeometryCollection":for(r=0;r<o.geometries.length;r++)if(!1===e(o.geometries[r],f,l,h,c))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===e(null,f,l,h,c))return!1;f++}}function xs(t,e,n){var r=n;return _s(t,(function(t,i,o,s,a){r=0===i&&void 0===n?t:e(r,t,i,o,s,a)})),r}function ws(t,e){_s(t,(function(t,n,r,i,o){var s,a=null===t?null:t.type;switch(a){case null:case"Point":case"LineString":case"Polygon":return!1!==e(Qo(t,r,{bbox:i,id:o}),n,0)&&void 0}switch(a){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var u=0;u<t.coordinates.length;u++){var l=t.coordinates[u];if(!1===e(Qo({type:s,coordinates:l},r),n,u))return!1}}))}function bs(t,e,n){var r=n;return ws(t,(function(t,i,o){r=0===i&&0===o&&void 0===n?t:e(r,t,i,o)})),r}function Es(t,e){ws(t,(function(t,n,r){var i=0;if(t.geometry){var o=t.geometry.type;if("Point"!==o&&"MultiPoint"!==o){var s,a=0,u=0,l=0;return!1!==ps(t,(function(o,h,c,f,p){if(void 0===s||n>a||f>u||p>l)return s=o,a=n,u=f,l=p,void(i=0);var d=Ho([s,o],t.properties);if(!1===e(d,n,r,p,i))return!1;i++,s=o}))&&void 0}}}))}function Is(t,e,n){var r=n,i=!1;return Es(t,(function(t,o,s,a,u){r=!1===i&&void 0===n?t:e(r,t,o,s,a,u),i=!0})),r}function Cs(t,e){if(!t)throw new Error("geojson is required");ws(t,(function(t,n,r){if(null!==t.geometry){var i=t.geometry.type,o=t.geometry.coordinates;switch(i){case"LineString":if(!1===e(t,n,r,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===e(Ho(o[s],t.properties),n,r,s))return!1}}}))}function Ss(t,e,n){var r=n;return Cs(t,(function(t,i,o,s){r=0===i&&void 0===n?t:e(r,t,i,o,s)})),r}function Ms(t,e){if(!ls(e=e||{}))throw new Error("options is invalid");var n,r=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.segmentIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),a=a||t.features[r].properties,n=t.features[r].geometry;break;case"Feature":a=a||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;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 s<0&&(s=u.length+s-1),Ho([u[s],u[s+1]],a,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s-1),Ho([u[o][s],u[o][s+1]],a,e);case"MultiLineString":return i<0&&(i=u.length+i),s<0&&(s=u[i].length+s-1),Ho([u[i][s],u[i][s+1]],a,e);case"MultiPolygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),s<0&&(s=u[i][o].length-s-1),Ho([u[i][o][s],u[i][o][s+1]],a,e)}throw new Error("geojson is invalid")}function Bs(t,e){if(!ls(e=e||{}))throw new Error("options is invalid");var n,r=e.featureIndex||0,i=e.multiFeatureIndex||0,o=e.geometryIndex||0,s=e.coordIndex||0,a=e.properties;switch(t.type){case"FeatureCollection":r<0&&(r=t.features.length+r),a=a||t.features[r].properties,n=t.features[r].geometry;break;case"Feature":a=a||t.properties,n=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=t;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var u=n.coordinates;switch(n.type){case"Point":return zo(u,a,e);case"MultiPoint":return i<0&&(i=u.length+i),zo(u[i],a,e);case"LineString":return s<0&&(s=u.length+s),zo(u[s],a,e);case"Polygon":return o<0&&(o=u.length+o),s<0&&(s=u[o].length+s),zo(u[o][s],a,e);case"MultiLineString":return i<0&&(i=u.length+i),s<0&&(s=u[i].length+s),zo(u[i][s],a,e);case"MultiPolygon":return i<0&&(i=u.length+i),o<0&&(o=u[i].length+o),s<0&&(s=u[i][o].length-s),zo(u[i][o][s],a,e)}throw new Error("geojson is invalid")}var Ts=Object.freeze({__proto__:null,coordAll:As,coordEach:ps,coordReduce:ds,featureEach:vs,featureReduce:ms,findPoint:Bs,findSegment:Ms,flattenEach:ws,flattenReduce:bs,geomEach:_s,geomReduce:xs,lineEach:Cs,lineReduce:Ss,propEach:gs,propReduce:ys,segmentEach:Es,segmentReduce:Is});function ks(t){var e=[1/0,1/0,-1/0,-1/0];return ps(t,(function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])})),e}function Ps(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if("Feature"===t.type&&null!==t.geometry&&"Point"===t.geometry.type)return t.geometry.coordinates;if("Point"===t.type)return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ls(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Rs(t){if(t.length>1&&us(t[0])&&us(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return Rs(t[0]);throw new Error("coordinates must only contain numbers")}function Ds(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)}function Os(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)}function Ns(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var r=0,i=t.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!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+o.geometry.type)}}function Fs(t){return"Feature"===t.type?t.geometry:t}function Us(t,e){return"FeatureCollection"===t.type?"FeatureCollection":"GeometryCollection"===t.type?"GeometryCollection":"Feature"===t.type&&null!==t.geometry?t.geometry.type:t.type}ks.default=ks;var Qs=Object.freeze({__proto__:null,getCoord:Ps,getCoords:Ls,containsNumber:Rs,geojsonType:Ds,featureOf:Os,collectionOf:Ns,getGeom:Fs,getType:Us}),Gs=Object.getOwnPropertySymbols,zs=Object.prototype.hasOwnProperty,js=Object.prototype.propertyIsEnumerable;
|
|
18
18
|
/*
|
|
19
19
|
object-assign
|
|
20
20
|
(c) Sindre Sorhus
|
|
@@ -186,7 +186,7 @@ function(){return"undefined"==typeof window&&(self.window=self),function(t){var
|
|
|
186
186
|
Custom bundle of @unicode-font-resolver/client v1.0.2 (https://github.com/lojjic/unicode-font-resolver)
|
|
187
187
|
for use in Troika text rendering.
|
|
188
188
|
Original MIT license applies
|
|
189
|
-
*/const cU=sU({name:"FontResolver",dependencies:[function(t,e){const n=Object.create(null),r=Object.create(null);function i(e,i){let o=n[e];o?i(o):r[e]?r[e].push(i):(r[e]=[i],function(e,n){const r=t=>{console.error(`Failure loading font ${e}`,t)};try{const i=new XMLHttpRequest;i.open("get",e,!0),i.responseType="arraybuffer",i.onload=function(){if(i.status>=400)r(new Error(i.statusText));else if(i.status>0)try{const r=t(i.response);r.src=e,n(r)}catch(t){r(t)}},i.onerror=r,i.send()}catch(t){r(t)}}(e,(t=>{t.src=e,n[e]=t,r[e].forEach((e=>e(t))),delete r[e]})))}return function(t,r,{lang:o,fonts:s=[],style:a="normal",weight:u="normal",unicodeFontsURL:l}={}){const h=new Uint8Array(t.length),c=[];t.length||g();const f=new Map,p=[];if("italic"!==a&&(a="normal"),"number"!=typeof u&&(u="bold"===u?700:400),s&&!Array.isArray(s)&&(s=[s]),(s=s.slice().filter((t=>!t.lang||t.lang.test(o))).reverse()).length){const e=1,r=2;let o=0;!function a(u=0){for(let l=u,d=t.length;l<d;l++){const u=t.codePointAt(l);if(o===e&&c[h[l-1]].supportsCodePoint(u)||l>0&&/\s/.test(t[l]))h[l]=h[l-1],o===r&&(p[p.length-1][1]=l);else for(let t=h[l],d=s.length;t<=d;t++)if(t===d){(o===r?p[p.length-1]:p[p.length]=[l,l])[1]=l,o=r}else{h[l]=t;const{src:r,unicodeRange:p}=s[t];if(!p||y(u,p)){const t=n[r];if(!t)return void i(r,(()=>{a(l)}));if(t.supportsCodePoint(u)){let n=f.get(t);"number"!=typeof n&&(n=c.length,c.push(t),f.set(t,n)),h[l]=n,o=e;break}}}u>65535&&l+1<d&&(h[l+1]=h[l],l++,o===r&&(p[p.length-1][1]=l))}d()}()}else p.push([0,t.length-1]),d();function d(){if(p.length){const n=p.map((e=>t.substring(e[0],e[1]+1))).join("\n");e.getFontsForString(n,{lang:o||void 0,style:a,weight:u,dataUrl:l}).then((({fontUrls:t,chars:e})=>{const n=c.length;let r=0;p.forEach((t=>{for(let i=0,o=t[1]-t[0];i<=o;i++)h[t[0]+i]=e[r++]+n;r++}));let o=0;t.forEach(((e,r)=>{i(e,(e=>{c[r+n]=e,++o===t.length&&g()}))}))}))}else g()}function g(){r({chars:h,fonts:c})}function y(t,e){for(let n=0;n<e.length;n++){const[r,i=r]=e[n];if(r<=t&&t<=i)return!0}return!1}}},hU,function(){return function(t){var e=function(){this.buckets=new Map};e.prototype.add=function(t){var e=t>>5;this.buckets.set(e,(this.buckets.get(e)||0)|1<<(31&t))},e.prototype.has=function(t){var e=this.buckets.get(t>>5);return void 0!==e&&!!(e&1<<(31&t))},e.prototype.serialize=function(){var t=[];return this.buckets.forEach((function(e,n){t.push((+n).toString(36)+":"+e.toString(36))})),t.join(",")},e.prototype.deserialize=function(t){var e=this;this.buckets.clear(),t.split(",").forEach((function(t){var n=t.split(":");e.buckets.set(parseInt(n[0],36),parseInt(n[1],36))}))};var n=Math.pow(2,8),r=n-1,i=~r;function o(t){var e=function(t){return t&i}(t).toString(16),r=function(t){return(t&i)+n-1}(t).toString(16);return"codepoint-index/plane"+(t>>16)+"/"+e+"-"+r+".json"}function s(t,e){var n=t&r,i=e.codePointAt(n/6|0);return!!((i=(i||48)-48)&1<<n%6)}function a(t,e){!function(t,e){var n;(n=t,n.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map((function(t){return t.split("-").map((function(t){return parseInt(t.trim(),16)}))}))).forEach((function(t){var n=t[0],r=t[1];void 0===r&&(r=n),e(n,r)}))}(t,(function(t,n){for(var r=t;r<=n;r++)e(r)}))}var u={},l={},h=new WeakMap,c="https://cdn.jsdelivr.net/gh/lojjic/unicode-font-resolver@v1.0.1/packages/data";function f(t){var n=h.get(t);return n||(n=new e,a(t.ranges,(function(t){return n.add(t)})),h.set(t,n)),n}var p,d=new Map;function g(t,e,n){return t[e]?e:t[n]?n:function(t){for(var e in t)return e}(t)}function y(t,e){var n=e;if(!t.includes(n)){n=1/0;for(var r=0;r<t.length;r++)Math.abs(t[r]-e)<Math.abs(n-e)&&(n=t[r])}return n}function v(t){return p||(p=new Set,a("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",(function(t){p.add(t)}))),p.has(t)}return t.CodePointSet=e,t.clearCache=function(){u={},l={}},t.getFontsForString=function(t,e){void 0===e&&(e={});var n,r=e.lang;void 0===r&&(r=/\p{Script=Hangul}/u.test(n=t)?"ko":/\p{Script=Hiragana}|\p{Script=Katakana}/u.test(n)?"ja":"en");var i=e.category;void 0===i&&(i="sans-serif");var a=e.style;void 0===a&&(a="normal");var h=e.weight;void 0===h&&(h=400);var p=(e.dataUrl||c).replace(/\/$/g,""),m=new Map,A=new Uint8Array(t.length),_={},x={},w=new Array(t.length),b=new Map,E=!1;function I(t){var e=d.get(t);return e||(e=fetch(p+"/"+t).then((function(t){if(!t.ok)throw new Error(t.statusText);return t.json().then((function(t){if(!Array.isArray(t)||1!==t[0])throw new Error("Incorrect schema version; need 1, got "+t[0]);return t[1]}))})).catch((function(e){if(p!==c)return E||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+p+'", trying default CDN. '+e.message),E=!0),p=c,d.delete(t),I(t);throw e})),d.set(t,e)),e}for(var C=function(e){var n=t.codePointAt(e),r=o(n);w[e]=r,u[r]||b.has(r)||b.set(r,I(r).then((function(t){u[r]=t}))),n>65535&&(e++,S=e)},S=0;S<t.length;S++)C(S);return Promise.all(b.values()).then((function(){b.clear();for(var e=function(e){var i=t.codePointAt(e),o=null,a=u[w[e]],h=void 0;for(var c in a){var f=x[c];if(void 0===f&&(f=x[c]=new RegExp(c).test(r||"en")),f){for(var p in h=c,a[c])if(s(i,a[c][p])){o=p;break}break}}if(!o)t:for(var d in a)if(d!==h)for(var g in a[d])if(s(i,a[d][g])){o=g;break t}o||(console.debug("No font coverage for U+"+i.toString(16)),o="latin"),w[e]=o,l[o]||b.has(o)||b.set(o,I("font-meta/"+o+".json").then((function(t){l[o]=t}))),i>65535&&(e++,n=e)},n=0;n<t.length;n++)e(n);return Promise.all(b.values())})).then((function(){for(var e,n=null,r=0;r<t.length;r++){var o=t.codePointAt(r);if(n&&(v(o)||f(n).has(o)))A[r]=A[r-1];else{n=l[w[r]];var s=_[n.id];if(!s){var u=n.typeforms,c=g(u,i,"sans-serif"),d=g(u[c],a,"normal"),x=y(null===(e=u[c])||void 0===e?void 0:e[d],h);s=_[n.id]=p+"/font-files/"+n.id+"/"+c+"."+d+"."+x+".woff"}var b=m.get(s);null==b&&(b=m.size,m.set(s,b)),A[r]=b}o>65535&&(r++,A[r]=A[r-1])}return{fontUrls:Array.from(m.keys()),chars:A}}))},Object.defineProperty(t,"__esModule",{value:!0}),t}({})}],init:(t,e,n)=>t(e,n())});const fU=()=>(self.performance||Date).now(),pU=lU();let dU;const gU=[];let yU=0;function vU(){const t=fU();for(;gU.length&&fU()-t<5;)gU.shift()();yU=gU.length?setTimeout(vU,0):0}const mU=(...t)=>new Promise(((e,n)=>{gU.push((()=>{const r=fU();try{pU.webgl.generateIntoCanvas(...t),e({timing:fU()-r})}catch(t){n(t)}})),yU||(yU=setTimeout(vU,0))})),AU=4,_U=2e3,xU={};let wU=0;function bU(t,e,n,r,i,o,s,a,u,l){const h="TroikaTextSDFGenerator_JS_"+wU++%AU;let c=xU[h];return c||(c=xU[h]={workerModule:sU({name:h,workerId:h,dependencies:[lU,fU],init(t,e){const n=t().javascript.generate;return function(...t){const r=e();return{textureData:n(...t),timing:e()-r}}},getTransferables:t=>[t.textureData.buffer]}),requests:0,idleTimer:null}),c.requests++,clearTimeout(c.idleTimer),c.workerModule(t,e,n,r,i,o).then((({textureData:n,timing:r})=>{const i=fU(),o=new Uint8Array(4*n.length);for(let t=0;t<n.length;t++)o[4*t+l]=n[t];return pU.webglUtils.renderImageData(s,o,a,u,t,e,1<<3-l),r+=fU()-i,0==--c.requests&&(c.idleTimer=setTimeout((()=>{!function(t){iU[t]&&iU[t].forEach((function(t){t()})),rU[t]&&(rU[t].terminate(),delete rU[t])}(h)}),_U)),{timing:r}}))}const EU=pU.webglUtils.resizeWebGLCanvasWithoutClearing,IU={defaultFontURL:null,unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048,useWorker:!0},CU=new n.Color;function SU(){return(self.performance||Date).now()}const MU=Object.create(null);function BU(t,e){t=function(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}({},t);const r=SU(),{defaultFontURL:i}=IU,o=[];if(i&&o.push({label:"default",src:PU(i)}),t.font&&o.push({label:"user",src:PU(t.font)}),t.font=o,t.text=""+t.text,t.sdfGlyphSize=t.sdfGlyphSize||IU.sdfGlyphSize,t.unicodeFontsURL=t.unicodeFontsURL||IU.unicodeFontsURL,null!=t.colorRanges){let e={};for(let n in t.colorRanges)if(t.colorRanges.hasOwnProperty(n)){let r=t.colorRanges[n];"number"!=typeof r&&(r=CU.set(r).getHex()),e[n]=r}t.colorRanges=e}Object.freeze(t);const{textureWidth:s,sdfExponent:a}=IU,{sdfGlyphSize:u}=t,l=s/u*4;let h=MU[u];if(!h){const t=document.createElement("canvas");t.width=s,t.height=256*u/l,h=MU[u]={glyphCount:0,sdfGlyphSize:u,sdfCanvas:t,sdfTexture:new n.Texture(t,void 0,void 0,void 0,n.LinearFilter,n.LinearFilter),contextLost:!1,glyphsByFont:new Map},h.sdfTexture.generateMipmaps=!1,function(t){const e=t.sdfCanvas;e.addEventListener("webglcontextlost",(e=>{console.log("Context Lost",e),e.preventDefault(),t.contextLost=!0})),e.addEventListener("webglcontextrestored",(e=>{console.log("Context Restored",e),t.contextLost=!1;const n=[];t.glyphsByFont.forEach((e=>{e.forEach((e=>{n.push(TU(e,t,!0))}))})),Promise.all(n).then((()=>{LU(t),t.sdfTexture.needsUpdate=!0}))}))}(h)}const{sdfTexture:c,sdfCanvas:f}=h;DU(t).then((n=>{const{glyphIds:i,glyphFontIndices:o,fontData:p,glyphPositions:d,fontSize:g,timings:y}=n,v=[],m=new Float32Array(4*i.length);let A=0,_=0;const x=SU(),w=p.map((t=>{let e=h.glyphsByFont.get(t.src);return e||h.glyphsByFont.set(t.src,e=new Map),e}));i.forEach(((t,e)=>{const r=o[e],{src:s,unitsPerEm:a}=p[r];let l=w[r].get(t);if(!l){const{path:e,pathBounds:i}=n.glyphData[s][t],o=Math.max(i[2]-i[0],i[3]-i[1])/u*(IU.sdfMargin*u+.5),a=h.glyphCount++,c=[i[0]-o,i[1]-o,i[2]+o,i[3]+o];w[r].set(t,l={path:e,atlasIndex:a,sdfViewBox:c}),v.push(l)}const{sdfViewBox:c}=l,f=d[_++],y=d[_++],x=g/a;m[A++]=f+c[0]*x,m[A++]=y+c[1]*x,m[A++]=f+c[2]*x,m[A++]=y+c[3]*x,i[e]=l.atlasIndex})),y.quads=(y.quads||0)+(SU()-x);const b=SU();y.sdf={};const E=f.height,I=Math.ceil(h.glyphCount/l),C=Math.pow(2,Math.ceil(Math.log2(I*u)));C>E&&(console.info(`Increasing SDF texture size ${E}->${C}`),EU(f,s,C),c.dispose()),Promise.all(v.map((e=>TU(e,h,t.gpuAccelerateSDF).then((({timing:t})=>{y.sdf[e.atlasIndex]=t}))))).then((()=>{v.length&&!h.contextLost&&(LU(h),c.needsUpdate=!0),y.sdfTotal=SU()-b,y.total=SU()-r,e(Object.freeze({parameters:t,sdfTexture:c,sdfGlyphSize:u,sdfExponent:a,glyphBounds:m,glyphAtlasIndices:i,glyphColors:n.glyphColors,caretPositions:n.caretPositions,chunkedBounds:n.chunkedBounds,ascender:n.ascender,descender:n.descender,lineHeight:n.lineHeight,capHeight:n.capHeight,xHeight:n.xHeight,topBaseline:n.topBaseline,blockBounds:n.blockBounds,visibleBounds:n.visibleBounds,timings:n.timings}))}))})),Promise.resolve().then((()=>{h.contextLost||function(t){t._warm||(pU.webgl.isSupported(t),t._warm=!0)}(f)}))}function TU({path:t,atlasIndex:e,sdfViewBox:n},{sdfGlyphSize:r,sdfCanvas:i,contextLost:o},s){if(o)return Promise.resolve({timing:-1});const{textureWidth:a,sdfExponent:u}=IU,l=Math.max(n[2]-n[0],n[3]-n[1]),h=Math.floor(e/4);return function(t,e,n,r,i,o,s,a,u,l,h=!0){return h?mU(t,e,n,r,i,o,s,a,u,l).then(null,(h=>(dU||(console.warn("WebGL SDF generation failed, falling back to JS",h),dU=!0),bU(t,e,n,r,i,o,s,a,u,l)))):bU(t,e,n,r,i,o,s,a,u,l)}(r,r,t,n,l,u,i,h%(a/r)*r,Math.floor(h/(a/r))*r,e%4,s)}let kU;function PU(t){return kU||(kU="undefined"==typeof document?{}:document.createElement("a")),kU.href=t,kU.href}function LU(t){if("function"!=typeof createImageBitmap){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:e,sdfTexture:n}=t,{width:r,height:i}=e,o=t.sdfCanvas.getContext("webgl");let s=n.image.data;s&&s.length===r*i*4||(s=new Uint8Array(r*i*4),n.image={width:r,height:i,data:s},n.flipY=!1,n.isDataTexture=!0),o.readPixels(0,0,r,i,o.RGBA,o.UNSIGNED_BYTE,s)}}const RU=sU({name:"Typesetter",dependencies:[function(t,e){const n=1/0,r=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,i="[^\\S\\u00A0]",o=new RegExp(`${i}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function s({text:s="",font:c,lang:f,sdfGlyphSize:p=64,fontSize:d=400,fontWeight:g=1,fontStyle:y="normal",letterSpacing:v=0,lineHeight:m="normal",maxWidth:A=n,direction:_,textAlign:x="left",textIndent:w=0,whiteSpace:b="normal",overflowWrap:E="normal",anchorX:I=0,anchorY:C=0,metricsOnly:S=!1,unicodeFontsURL:M,preResolvedFonts:B=null,includeCaretPositions:T=!1,chunkedBoundsSize:k=8192,colorRanges:P=null},L){const R=l(),D={fontLoad:0,typesetting:0};s.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),s=s.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),d=+d,v=+v,A=+A,m=m||"normal",w=+w,function({text:e,lang:n,fonts:r,style:i,weight:o,preResolvedFonts:s,unicodeFontsURL:a},u){const l=({chars:t,fonts:e})=>{let n,r;const i=[];for(let o=0;o<t.length;o++)t[o]!==r?(r=t[o],i.push(n={start:o,end:o,fontObj:e[t[o]]})):n.end=o;u(i)};s?l(s):t(e,l,{lang:n,fonts:r,style:i,weight:o,unicodeFontsURL:a})}({text:s,lang:f,style:y,weight:g,fonts:"string"==typeof c?[{src:c}]:c,unicodeFontsURL:M,preResolvedFonts:B},(t=>{D.fontLoad=l()-R;const c=isFinite(A);let f=null,p=null,g=null,y=null,M=null,B=null,O=null,N=null,F=0,U=0,Q="nowrap"!==b;const G=new Map,z=l();let j=w,V=0,q=new h;const H=[q];t.forEach((t=>{const{fontObj:e}=t,{ascender:n,descender:a,unitsPerEm:u,lineGap:l,capHeight:f,xHeight:p}=e;let g=G.get(e);if(!g){const t=d/u,r="normal"===m?(n-a+l)*t:m*d,i=(r-(n-a)*t)/2,o=Math.min(r,(n-a)*t),s=(n+a)/2*t+o/2;g={index:G.size,src:e.src,fontObj:e,fontSizeMult:t,unitsPerEm:u,ascender:n*t,descender:a*t,capHeight:f*t,xHeight:p*t,lineHeight:r,baseline:-i-n*t,caretTop:s,caretBottom:s-o},G.set(e,g)}const{fontSizeMult:y}=g,_=s.slice(t.start,t.end+1);let x,b;e.forEachGlyph(_,d,v,((e,n,a,u)=>{n+=V,u+=t.start,x=n,b=e;const l=s.charAt(u),f=e.advanceWidth*y,p=q.count;let m;if("isEmpty"in e||(e.isWhitespace=!!l&&new RegExp(i).test(l),e.canBreakAfter=!!l&&o.test(l),e.isEmpty=e.xMin===e.xMax||e.yMin===e.yMax||r.test(l)),e.isWhitespace||e.isEmpty||U++,Q&&c&&!e.isWhitespace&&n+f+j>A&&p){if(q.glyphAt(p-1).glyphObj.canBreakAfter)m=new h,j=-n;else for(let t=p;t--;){if(0===t&&"break-word"===E){m=new h,j=-n;break}if(q.glyphAt(t).glyphObj.canBreakAfter){m=q.splitAt(t+1);const e=m.glyphAt(0).x;j-=e;for(let t=m.count;t--;)m.glyphAt(t).x-=e;break}}m&&(q.isSoftWrapped=!0,q=m,H.push(q),F=A)}let _=q.glyphAt(q.count);_.glyphObj=e,_.x=n+j,_.y=a,_.width=f,_.charIndex=u,_.fontData=g,"\n"===l&&(q=new h,H.push(q),j=-(n+f+v*d)+w)})),V=x+b.advanceWidth*y+v*d}));let W=0;H.forEach((t=>{let e=!0;for(let n=t.count;n--;){const r=t.glyphAt(n);e&&!r.glyphObj.isWhitespace&&(t.width=r.x+r.width,t.width>F&&(F=t.width),e=!1);let{lineHeight:i,capHeight:o,xHeight:s,baseline:a}=r.fontData;i>t.lineHeight&&(t.lineHeight=i);const u=a-t.baseline;u<0&&(t.baseline+=u,t.cap+=u,t.ex+=u),t.cap=Math.max(t.cap,t.baseline+o),t.ex=Math.max(t.ex,t.baseline+s)}t.baseline-=W,t.cap-=W,t.ex-=W,W+=t.lineHeight}));let Y=0,X=0;if(I&&("number"==typeof I?Y=-I:"string"==typeof I&&(Y=-F*("left"===I?0:"center"===I?.5:"right"===I?1:a(I)))),C&&("number"==typeof C?X=-C:"string"==typeof C&&(X="top"===C?0:"top-baseline"===C?-H[0].baseline:"top-cap"===C?-H[0].cap:"top-ex"===C?-H[0].ex:"middle"===C?W/2:"bottom"===C?W:"bottom-baseline"===C?-H[H.length-1].baseline:a(C)*W)),!S){const t=e.getEmbeddingLevels(s,_);f=new Uint16Array(U),p=new Uint8Array(U),g=new Float32Array(2*U),y={},O=[n,n,-1/0,-1/0],N=[],T&&(B=new Float32Array(4*s.length)),P&&(M=new Uint8Array(3*U));let r,i,o=0,a=-1,l=-1;if(H.forEach(((h,c)=>{let{count:d,width:v}=h;if(d>0){let c=0;for(let t=d;t--&&h.glyphAt(t).glyphObj.isWhitespace;)c++;let m=0,A=0;if("center"===x)m=(F-v)/2;else if("right"===x)m=F-v;else if("justify"===x&&h.isSoftWrapped){let t=0;for(let e=d-c;e--;)h.glyphAt(e).glyphObj.isWhitespace&&t++;A=(F-v)/t}if(A||m){let t=0;for(let e=0;e<d;e++){let n=h.glyphAt(e);const r=n.glyphObj;n.x+=m+t,0!==A&&r.isWhitespace&&e<d-c&&(t+=A,n.width+=A)}}const _=e.getReorderSegments(s,t,h.glyphAt(0).charIndex,h.glyphAt(h.count-1).charIndex);for(let t=0;t<_.length;t++){const[e,n]=_[t];let r=1/0,i=-1/0;for(let t=0;t<d;t++)if(h.glyphAt(t).charIndex>=e){let e=t,o=t;for(;o<d;o++){let t=h.glyphAt(o);if(t.charIndex>n)break;o<d-c&&(r=Math.min(r,t.x),i=Math.max(i,t.x+t.width))}for(let t=e;t<o;t++){const e=h.glyphAt(t);e.x=i-(e.x+e.width-r)}break}}let w;const b=t=>w=t;for(let c=0;c<d;c++){const d=h.glyphAt(c);w=d.glyphObj;const v=w.index,m=1&t.levels[d.charIndex];if(m){const t=e.getMirroredCharacter(s[d.charIndex]);t&&d.fontData.fontObj.forEachGlyph(t,0,0,b)}if(T){const{charIndex:t,fontData:e}=d,n=d.x+Y,r=d.x+d.width+Y;B[4*t]=m?r:n,B[4*t+1]=m?n:r,B[4*t+2]=h.baseline+e.caretBottom+X,B[4*t+3]=h.baseline+e.caretTop+X;const i=t-a;i>1&&u(B,a,i),a=t}if(P){const{charIndex:t}=d;for(;t>l;)l++,P.hasOwnProperty(l)&&(i=P[l])}if(!w.isWhitespace&&!w.isEmpty){const t=o++,{fontSizeMult:e,src:s,index:a}=d.fontData,u=y[s]||(y[s]={});u[v]||(u[v]={path:w.path,pathBounds:[w.xMin,w.yMin,w.xMax,w.yMax]});const l=d.x+Y,c=d.y+h.baseline+X;g[2*t]=l,g[2*t+1]=c;const m=l+w.xMin*e,A=c+w.yMin*e,_=l+w.xMax*e,x=c+w.yMax*e;m<O[0]&&(O[0]=m),A<O[1]&&(O[1]=A),_>O[2]&&(O[2]=_),x>O[3]&&(O[3]=x),t%k==0&&(r={start:t,end:t,rect:[n,n,-1/0,-1/0]},N.push(r)),r.end++;const b=r.rect;if(m<b[0]&&(b[0]=m),A<b[1]&&(b[1]=A),_>b[2]&&(b[2]=_),x>b[3]&&(b[3]=x),f[t]=v,p[t]=a,P){const e=3*t;M[e]=i>>16&255,M[e+1]=i>>8&255,M[e+2]=255&i}}}}})),B){const t=s.length-a;t>1&&u(B,a,t)}}const J=[];G.forEach((({index:t,src:e,unitsPerEm:n,ascender:r,descender:i,lineHeight:o,capHeight:s,xHeight:a})=>{J[t]={src:e,unitsPerEm:n,ascender:r,descender:i,lineHeight:o,capHeight:s,xHeight:a}})),D.typesetting=l()-z,L({glyphIds:f,glyphFontIndices:p,glyphPositions:g,glyphData:y,fontData:J,caretPositions:B,glyphColors:M,chunkedBounds:N,fontSize:d,topBaseline:X+H[0].baseline,blockBounds:[Y,X-W,Y+F,X],visibleBounds:O,timings:D})}))}function a(t){let e=t.match(/^([\d.]+)%$/),n=e?parseFloat(e[1]):NaN;return isNaN(n)?0:n/100}function u(t,e,n){const r=t[4*e],i=t[4*e+1],o=t[4*e+2],s=t[4*e+3],a=(i-r)/n;for(let i=0;i<n;i++){const n=4*(e+i);t[n]=r+a*i,t[n+1]=r+a*(i+1),t[n+2]=o,t[n+3]=s}}function l(){return(self.performance||Date).now()}function h(){this.data=[]}const c=["glyphObj","x","y","width","charIndex","fontData"];return h.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/c.length)},glyphAt(t){let e=h.flyweight;return e.data=this.data,e.index=t,e},splitAt(t){let e=new h;return e.data=this.data.splice(t*c.length),e}},h.flyweight=c.reduce(((t,e,n,r)=>(Object.defineProperty(t,e,{get(){return this.data[this.index*c.length+n]},set(t){this.data[this.index*c.length+n]=t}}),t)),{data:null,index:0}),{typeset:s,measure:function(t,e){s({...t,metricsOnly:!0},(t=>{const[n,r,i,o]=t.blockBounds;e({width:i-n,height:o-r})}))}}},cU,function(){var t=function(t){var e={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},n={},r={};n.L=1,r[1]="L",Object.keys(e).forEach((function(t,e){n[t]=1<<e+1,r[n[t]]=t})),Object.freeze(n);var i=n.LRI|n.RLI|n.FSI,o=n.L|n.R|n.AL,s=n.B|n.S|n.WS|n.ON|n.FSI|n.LRI|n.RLI|n.PDI,a=n.BN|n.RLE|n.LRE|n.RLO|n.LRO|n.PDF,u=n.S|n.WS|n.B|i|n.PDI|a,l=null;function h(t){return function(){if(!l){l=new Map;var t=function(t){if(e.hasOwnProperty(t)){var r=0;e[t].split(",").forEach((function(e){var i=e.split("+"),o=i[0],s=i[1];o=parseInt(o,36),s=s?parseInt(s,36):0,l.set(r+=o,n[t]);for(var a=0;a<s;a++)l.set(++r,n[t])}))}};for(var r in e)t(r)}}(),l.get(t.codePointAt(0))||n.L}var c,f,p,d="14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",g="6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye";function y(t,e){var n,r=0,i=new Map,o=e&&new Map;return t.split(",").forEach((function t(s){if(-1!==s.indexOf("+"))for(var a=+s;a--;)t(n);else{n=s;var u=s.split(">"),l=u[0],h=u[1];l=String.fromCodePoint(r+=parseInt(l,36)),h=String.fromCodePoint(r+=parseInt(h,36)),i.set(l,h),e&&o.set(h,l)}})),{map:i,reverseMap:o}}function v(){if(!c){var t=y(d,!0),e=t.map,n=t.reverseMap;c=e,f=n,p=y(g,!1).map}}function m(t){return v(),c.get(t)||null}function A(t){return v(),f.get(t)||null}function _(t){return v(),p.get(t)||null}var x=n.L,w=n.R,b=n.EN,E=n.ES,I=n.ET,C=n.AN,S=n.CS,M=n.B,B=n.S,T=n.ON,k=n.BN,P=n.NSM,L=n.AL,R=n.LRO,D=n.RLO,O=n.LRE,N=n.RLE,F=n.PDF,U=n.LRI,Q=n.RLI,G=n.FSI,z=n.PDI;var j;function V(t){return function(){if(!j){var t=y("14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",!0),e=t.map;t.reverseMap.forEach((function(t,n){e.set(n,t)})),j=e}}(),j.get(t)||null}function q(t,e,n,r){var i=t.length;n=Math.max(0,null==n?0:+n),r=Math.min(i-1,null==r?i-1:+r);var o=[];return e.paragraphs.forEach((function(i){var s=Math.max(n,i.start),a=Math.min(r,i.end);if(s<a){for(var l=e.levels.slice(s,a+1),c=a;c>=s&&h(t[c])&u;c--)l[c]=i.level;for(var f=i.level,p=1/0,d=0;d<l.length;d++){var g=l[d];g>f&&(f=g),g<p&&(p=1|g)}for(var y=f;y>=p;y--)for(var v=0;v<l.length;v++)if(l[v]>=y){for(var m=v;v+1<l.length&&l[v+1]>=y;)v++;v>m&&o.push([m+s,v+s])}}})),o}function H(t,e,n,r){for(var i=q(t,e,n,r),o=[],s=0;s<t.length;s++)o[s]=s;return i.forEach((function(t){for(var e=t[0],n=t[1],r=o.slice(e,n+1),i=r.length;i--;)o[n-i]=r[i]})),o}return t.closingToOpeningBracket=A,t.getBidiCharType=h,t.getBidiCharTypeName=function(t){return r[h(t)]},t.getCanonicalBracket=_,t.getEmbeddingLevels=function(t,e){for(var n=new Uint32Array(t.length),r=0;r<t.length;r++)n[r]=h(t[r]);var l=new Map;function c(t,e){var r=n[t];n[t]=e,l.set(r,l.get(r)-1),r&s&&l.set(s,l.get(s)-1),l.set(e,(l.get(e)||0)+1),e&s&&l.set(s,(l.get(s)||0)+1)}for(var f=new Uint8Array(t.length),p=new Map,d=[],g=null,y=0;y<t.length;y++)g||d.push(g={start:y,end:t.length-1,level:"rtl"===e?1:"ltr"===e?0:Ge(y,!1)}),n[y]&M&&(g.end=y,g=null);for(var v=N|O|D|R|i|z|F|M,j=function(t){return t+(1&t?1:2)},V=function(t){return t+(1&t?2:1)},q=0;q<d.length;q++){var H=[{_level:(g=d[q]).level,_override:0,_isolate:0}],W=void 0,Y=0,X=0,J=0;l.clear();for(var K=g.start;K<=g.end;K++){var Z=n[K];if(W=H[H.length-1],l.set(Z,(l.get(Z)||0)+1),Z&s&&l.set(s,(l.get(s)||0)+1),Z&v)if(Z&(N|O)){f[K]=W._level;var $=(Z===N?V:j)(W._level);$<=125&&!Y&&!X?H.push({_level:$,_override:0,_isolate:0}):Y||X++}else if(Z&(D|R)){f[K]=W._level;var tt=(Z===D?V:j)(W._level);tt<=125&&!Y&&!X?H.push({_level:tt,_override:Z&D?w:x,_isolate:0}):Y||X++}else if(Z&i){Z&G&&(Z=1===Ge(K+1,!0)?Q:U),f[K]=W._level,W._override&&c(K,W._override);var et=(Z===Q?V:j)(W._level);et<=125&&0===Y&&0===X?(J++,H.push({_level:et,_override:0,_isolate:1,_isolInitIndex:K})):Y++}else if(Z&z){if(Y>0)Y--;else if(J>0){for(X=0;!H[H.length-1]._isolate;)H.pop();var nt=H[H.length-1]._isolInitIndex;null!=nt&&(p.set(nt,K),p.set(K,nt)),H.pop(),J--}W=H[H.length-1],f[K]=W._level,W._override&&c(K,W._override)}else Z&F?(0===Y&&(X>0?X--:!W._isolate&&H.length>1&&(H.pop(),W=H[H.length-1])),f[K]=W._level):Z&M&&(f[K]=g.level);else f[K]=W._level,W._override&&Z!==k&&c(K,W._override)}for(var rt=[],it=null,ot=g.start;ot<=g.end;ot++){var st=n[ot];if(!(st&a)){var at=f[ot],ut=st&i,lt=st===z;it&&at===it._level?(it._end=ot,it._endsWithIsolInit=ut):rt.push(it={_start:ot,_end:ot,_level:at,_startsWithPDI:lt,_endsWithIsolInit:ut})}}for(var ht=[],ct=0;ct<rt.length;ct++){var ft=rt[ct];if(!ft._startsWithPDI||ft._startsWithPDI&&!p.has(ft._start)){for(var pt=[it=ft],dt=void 0;it&&it._endsWithIsolInit&&null!=(dt=p.get(it._end));)for(var gt=ct+1;gt<rt.length;gt++)if(rt[gt]._start===dt){pt.push(it=rt[gt]);break}for(var yt=[],vt=0;vt<pt.length;vt++)for(var mt=pt[vt],At=mt._start;At<=mt._end;At++)yt.push(At);for(var _t=f[yt[0]],xt=g.level,wt=yt[0]-1;wt>=0;wt--)if(!(n[wt]&a)){xt=f[wt];break}var bt=yt[yt.length-1],Et=f[bt],It=g.level;if(!(n[bt]&i))for(var Ct=bt+1;Ct<=g.end;Ct++)if(!(n[Ct]&a)){It=f[Ct];break}ht.push({_seqIndices:yt,_sosType:Math.max(xt,_t)%2?w:x,_eosType:Math.max(It,Et)%2?w:x})}}for(var St=0;St<ht.length;St++){var Mt=ht[St],Bt=Mt._seqIndices,Tt=Mt._sosType,kt=Mt._eosType,Pt=1&f[Bt[0]]?w:x;if(l.get(P))for(var Lt=0;Lt<Bt.length;Lt++){var Rt=Bt[Lt];if(n[Rt]&P){for(var Dt=Tt,Ot=Lt-1;Ot>=0;Ot--)if(!(n[Bt[Ot]]&a)){Dt=n[Bt[Ot]];break}c(Rt,Dt&(i|z)?T:Dt)}}if(l.get(b))for(var Nt=0;Nt<Bt.length;Nt++){var Ft=Bt[Nt];if(n[Ft]&b)for(var Ut=Nt-1;Ut>=-1;Ut--){var Qt=-1===Ut?Tt:n[Bt[Ut]];if(Qt&o){Qt===L&&c(Ft,C);break}}}if(l.get(L))for(var Gt=0;Gt<Bt.length;Gt++){var zt=Bt[Gt];n[zt]&L&&c(zt,w)}if(l.get(E)||l.get(S))for(var jt=1;jt<Bt.length-1;jt++){var Vt=Bt[jt];if(n[Vt]&(E|S)){for(var qt=0,Ht=0,Wt=jt-1;Wt>=0&&(qt=n[Bt[Wt]])&a;Wt--);for(var Yt=jt+1;Yt<Bt.length&&(Ht=n[Bt[Yt]])&a;Yt++);qt===Ht&&(n[Vt]===E?qt===b:qt&(b|C))&&c(Vt,qt)}}if(l.get(b))for(var Xt=0;Xt<Bt.length;Xt++){var Jt=Bt[Xt];if(n[Jt]&b){for(var Kt=Xt-1;Kt>=0&&n[Bt[Kt]]&(I|a);Kt--)c(Bt[Kt],b);for(Xt++;Xt<Bt.length&&n[Bt[Xt]]&(I|a|b);Xt++)n[Bt[Xt]]!==b&&c(Bt[Xt],b)}}if(l.get(I)||l.get(E)||l.get(S))for(var Zt=0;Zt<Bt.length;Zt++){var $t=Bt[Zt];if(n[$t]&(I|E|S)){c($t,T);for(var te=Zt-1;te>=0&&n[Bt[te]]&a;te--)c(Bt[te],T);for(var ee=Zt+1;ee<Bt.length&&n[Bt[ee]]&a;ee++)c(Bt[ee],T)}}if(l.get(b))for(var ne=0,re=Tt;ne<Bt.length;ne++){var ie=Bt[ne],oe=n[ie];oe&b?re===x&&c(ie,x):oe&o&&(re=oe)}if(l.get(s)){for(var se=w|b|C,ae=se|x,ue=[],le=[],he=0;he<Bt.length;he++)if(n[Bt[he]]&s){var ce=t[Bt[he]],fe=void 0;if(null!==m(ce)){if(!(le.length<63))break;le.push({char:ce,seqIndex:he})}else if(null!==(fe=A(ce)))for(var pe=le.length-1;pe>=0;pe--){var de=le[pe].char;if(de===fe||de===A(_(ce))||m(_(de))===ce){ue.push([le[pe].seqIndex,he]),le.length=pe;break}}}ue.sort((function(t,e){return t[0]-e[0]}));for(var ge=0;ge<ue.length;ge++){for(var ye=ue[ge],ve=ye[0],me=ye[1],Ae=!1,_e=0,xe=ve+1;xe<me;xe++){var we=Bt[xe];if(n[we]&ae){Ae=!0;var be=n[we]&se?w:x;if(be===Pt){_e=be;break}}}if(Ae&&!_e){_e=Tt;for(var Ee=ve-1;Ee>=0;Ee--){var Ie=Bt[Ee];if(n[Ie]&ae){var Ce=n[Ie]&se?w:x;_e=Ce!==Pt?Ce:Pt;break}}}if(_e){if(n[Bt[ve]]=n[Bt[me]]=_e,_e!==Pt)for(var Se=ve+1;Se<Bt.length;Se++)if(!(n[Bt[Se]]&a)){h(t[Bt[Se]])&P&&(n[Bt[Se]]=_e);break}if(_e!==Pt)for(var Me=me+1;Me<Bt.length;Me++)if(!(n[Bt[Me]]&a)){h(t[Bt[Me]])&P&&(n[Bt[Me]]=_e);break}}}for(var Be=0;Be<Bt.length;Be++)if(n[Bt[Be]]&s){for(var Te=Be,ke=Be,Pe=Tt,Le=Be-1;Le>=0;Le--){if(!(n[Bt[Le]]&a)){Pe=n[Bt[Le]]&se?w:x;break}Te=Le}for(var Re=kt,De=Be+1;De<Bt.length;De++){if(!(n[Bt[De]]&(s|a))){Re=n[Bt[De]]&se?w:x;break}ke=De}for(var Oe=Te;Oe<=ke;Oe++)n[Bt[Oe]]=Pe===Re?Pe:Pt;Be=ke}}}for(var Ne=g.start;Ne<=g.end;Ne++){var Fe=f[Ne],Ue=n[Ne];if(1&Fe?Ue&(x|b|C)&&f[Ne]++:Ue&w?f[Ne]++:Ue&(C|b)&&(f[Ne]+=2),Ue&a&&(f[Ne]=0===Ne?g.level:f[Ne-1]),Ne===g.end||h(t[Ne])&(B|M))for(var Qe=Ne;Qe>=0&&h(t[Qe])&u;Qe--)f[Qe]=g.level}}return{levels:f,paragraphs:d};function Ge(e,r){for(var o=e;o<t.length;o++){var s=n[o];if(s&(w|L))return 1;if(s&(M|x)||r&&s===z)return 0;if(s&i){var a=ze(o);o=-1===a?t.length:a}}return 0}function ze(e){for(var r=1,o=e+1;o<t.length;o++){var s=n[o];if(s&M)break;if(s&z){if(0==--r)return o}else s&i&&r++}return-1}},t.getMirroredCharacter=V,t.getMirroredCharactersMap=function(t,e,n,r){var i=t.length;n=Math.max(0,null==n?0:+n),r=Math.min(i-1,null==r?i-1:+r);for(var o=new Map,s=n;s<=r;s++)if(1&e[s]){var a=V(t[s]);null!==a&&o.set(s,a)}return o},t.getReorderSegments=q,t.getReorderedIndices=H,t.getReorderedString=function(t,e,n,r){var i=H(t,e,n,r),o=[].concat(t);return i.forEach((function(n,r){o[r]=(1&e.levels[n]?V(t[n]):null)||t[n]})),o.join("")},t.openingToClosingBracket=m,Object.defineProperty(t,"__esModule",{value:!0}),t}({});return t}],init:(t,e,n)=>t(e,n())}),DU=sU({name:"Typesetter",dependencies:[RU],init:t=>function(e){return new Promise((n=>{t.typeset(e,n)}))},getTransferables(t){const e=[];for(let n in t)t[n]&&t[n].buffer&&e.push(t[n].buffer);return e}});DU.onMainThread;const OU={};const NU="aTroikaGlyphIndex";class FU extends n.InstancedBufferGeometry{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new n.Sphere,this.boundingBox=new n.Box3}computeBoundingSphere(){}computeBoundingBox(){}set detail(t){if(t!==this._detail){this._detail=t,("number"!=typeof t||t<1)&&(t=1);let e=function(t){let e=OU[t];return e||(e=OU[t]=new n.PlaneGeometry(1,1,t,t).translate(.5,.5,0)),e}(t);["position","normal","uv"].forEach((t=>{this.attributes[t]=e.attributes[t].clone()})),this.setIndex(e.getIndex().clone())}}get detail(){return this._detail}set curveRadius(t){t!==this._curveRadius&&(this._curveRadius=t,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(t,e,n,r,i){this.updateAttributeData("aTroikaGlyphBounds",t,4),this.updateAttributeData(NU,e,1),this.updateAttributeData("aTroikaGlyphColor",i,3),this._blockBounds=n,this._chunkedBounds=r,this.instanceCount=e.length,this._updateBounds()}_updateBounds(){const t=this._blockBounds;if(t){const{curveRadius:e,boundingBox:n}=this;if(e){const{PI:r,floor:i,min:o,max:s,sin:a,cos:u}=Math,l=r/2,h=2*r,c=Math.abs(e),f=t[0]/c,p=t[2]/c,d=i((f+l)/h)!==i((p+l)/h)?-c:o(a(f)*c,a(p)*c),g=i((f-l)/h)!==i((p-l)/h)?c:s(a(f)*c,a(p)*c),y=i((f+r)/h)!==i((p+r)/h)?2*c:s(c-u(f)*c,c-u(p)*c);n.min.set(d,t[1],e<0?-y:0),n.max.set(g,t[3],e<0?0:y)}else n.min.set(t[0],t[1],0),n.max.set(t[2],t[3],0);n.getBoundingSphere(this.boundingSphere)}}applyClipRect(t){let e=this.getAttribute(NU).count,n=this._chunkedBounds;if(n)for(let r=n.length;r--;){e=n[r].end;let i=n[r].rect;if(i[1]<t.w&&i[3]>t.y&&i[0]<t.z&&i[2]>t.x)break}this.instanceCount=e}updateAttributeData(t,e,r){const i=this.getAttribute(t);e?i&&i.array.length===e.length?(i.array.set(e),i.needsUpdate=!0):(this.setAttribute(t,new n.InstancedBufferAttribute(e,r)),delete this._maxInstanceCount,this.dispose()):i&&this.deleteAttribute(t)}}const UU=new n.MeshBasicMaterial({color:16777215,side:n.DoubleSide,transparent:!0}),QU=8421504,GU=new n.Matrix4,zU=new n.Vector3,jU=new n.Vector3,VU=[],qU=new n.Vector3,HU="+x+y";function WU(t){return Array.isArray(t)?t[0]:t}let YU=()=>{const t=new n.Mesh(new n.PlaneGeometry(1,1),UU);return YU=()=>t,t},XU=()=>{const t=new n.Mesh(new n.PlaneGeometry(1,1,32,1),UU);return XU=()=>t,t};const JU={type:"syncstart"},KU={type:"synccomplete"},ZU=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],$U=ZU.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class tQ extends n.Mesh{constructor(){super(new FU,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=QU,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=HU,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(t){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(t):(this._isSyncing=!0,this.dispatchEvent(JU),BU({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},(e=>{this._isSyncing=!1,this._textRenderInfo=e,this.geometry.updateGlyphs(e.glyphBounds,e.glyphAtlasIndices,e.blockBounds,e.chunkedBounds,e.glyphColors);const n=this._queuedSyncs;n&&(this._queuedSyncs=null,this._needsSync=!0,this.sync((()=>{n.forEach((t=>t&&t()))}))),this.dispatchEvent(KU),t&&t()}))))}onBeforeRender(t,e,n,r,i,o){this.sync(),i.isTroikaTextMaterial&&this._prepareForRender(i)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(t){return function(t){const e=WF(t,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new n.Vector2},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new n.Vector4(0,0,0,0)},uTroikaClipRect:{value:new n.Vector4(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new n.Vector2},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new n.Color},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new n.Matrix3},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:"\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform vec4 uTroikaTotalBounds;\nuniform vec4 uTroikaClipRect;\nuniform mat3 uTroikaOrient;\nuniform bool uTroikaUseGlyphColors;\nuniform float uTroikaEdgeOffset;\nuniform float uTroikaBlurRadius;\nuniform vec2 uTroikaPositionOffset;\nuniform float uTroikaCurveRadius;\nattribute vec4 aTroikaGlyphBounds;\nattribute float aTroikaGlyphIndex;\nattribute vec3 aTroikaGlyphColor;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec3 vTroikaGlyphColor;\nvarying vec2 vTroikaGlyphDimensions;\n",vertexTransform:"\nvec4 bounds = aTroikaGlyphBounds;\nbounds.xz += uTroikaPositionOffset.x;\nbounds.yw -= uTroikaPositionOffset.y;\n\nvec4 outlineBounds = vec4(\n bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius,\n bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius\n);\nvec4 clippedBounds = vec4(\n clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),\n clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)\n);\n\nvec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);\n\nposition.xy = mix(bounds.xy, bounds.zw, clippedXY);\n\nuv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);\n\nfloat rad = uTroikaCurveRadius;\nif (rad != 0.0) {\n float angle = position.x / rad;\n position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);\n normal.xz = vec2(sin(angle), cos(angle));\n}\n \nposition = uTroikaOrient * position;\nnormal = uTroikaOrient * normal;\n\nvTroikaGlyphUV = clippedXY.xy;\nvTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);\n\n\nfloat txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;\nvec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;\nvec2 txStartUV = txUvPerSquare * vec2(\n mod(floor(aTroikaGlyphIndex / 4.0), txCols),\n floor(floor(aTroikaGlyphIndex / 4.0) / txCols)\n);\nvTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);\nvTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);\n",fragmentDefs:"\nuniform sampler2D uTroikaSDFTexture;\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform float uTroikaSDFExponent;\nuniform float uTroikaEdgeOffset;\nuniform float uTroikaFillOpacity;\nuniform float uTroikaBlurRadius;\nuniform vec3 uTroikaStrokeColor;\nuniform float uTroikaStrokeWidth;\nuniform float uTroikaStrokeOpacity;\nuniform bool uTroikaSDFDebug;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec2 vTroikaGlyphDimensions;\n\nfloat troikaSdfValueToSignedDistance(float alpha) {\n // Inverse of exponential encoding in webgl-sdf-generator\n \n float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);\n float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;\n float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);\n return signedDist;\n}\n\nfloat troikaGlyphUvToSdfValue(vec2 glyphUV) {\n vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);\n vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);\n float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1\n return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;\n}\n\nfloat troikaGlyphUvToDistance(vec2 uv) {\n return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));\n}\n\nfloat troikaGetAADist() {\n \n #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300\n return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;\n #else\n return vTroikaGlyphDimensions.x / 64.0;\n #endif\n}\n\nfloat troikaGetFragDistValue() {\n vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);\n float distance = troikaGlyphUvToDistance(clampedGlyphUV);\n \n // Extrapolate distance when outside bounds:\n distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : \n length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);\n\n \n\n return distance;\n}\n\nfloat troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {\n #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)\n float alpha = step(-distanceOffset, -distance);\n #else\n\n float alpha = smoothstep(\n distanceOffset + aaDist,\n distanceOffset - aaDist,\n distance\n );\n #endif\n\n return alpha;\n}\n",fragmentColorTransform:"\nfloat aaDist = troikaGetAADist();\nfloat fragDistance = troikaGetFragDistValue();\nfloat edgeAlpha = uTroikaSDFDebug ?\n troikaGlyphUvToSdfValue(vTroikaGlyphUV) :\n troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius));\n\n#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)\nvec4 fillRGBA = gl_FragColor;\nfillRGBA.a *= uTroikaFillOpacity;\nvec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);\nif (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;\ngl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(\n -uTroikaStrokeWidth - aaDist,\n -uTroikaStrokeWidth + aaDist,\n fragDistance\n));\ngl_FragColor.a *= edgeAlpha;\n#endif\n\nif (edgeAlpha == 0.0) {\n discard;\n}\n",customRewriter({vertexShader:t,fragmentShader:e}){let n=/\buniform\s+vec3\s+diffuse\b/;return n.test(e)&&(e=e.replace(n,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),n.test(t)||(t=t.replace(UF,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:t,fragmentShader:e}}});return e.transparent=!0,e.forceSinglePass=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}(t)}get material(){let t=this._derivedMaterial;const e=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=UU.clone());if(t&&t.isDerivedFrom(e)||(t=this._derivedMaterial=this.createDerivedMaterial(e),e.addEventListener("dispose",(function n(){e.removeEventListener("dispose",n),t.dispose()}))),this.hasOutline()){let e=t._outlineMtl;return e||(e=t._outlineMtl=Object.create(t,{id:{value:t.id+.1}}),e.isTextOutlineMaterial=!0,e.depthWrite=!1,e.map=null,t.addEventListener("dispose",(function n(){t.removeEventListener("dispose",n),e.dispose()}))),[e,t]}return t}set material(t){t&&t.isTroikaTextMaterial?(this._derivedMaterial=t,this._baseMaterial=t.baseMaterial):this._baseMaterial=t}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(t){this.geometry.detail=t}get curveRadius(){return this.geometry.curveRadius}set curveRadius(t){this.geometry.curveRadius=t}get customDepthMaterial(){return WU(this.material).getDepthMaterial()}set customDepthMaterial(t){}get customDistanceMaterial(){return WU(this.material).getDistanceMaterial()}set customDistanceMaterial(t){}_prepareForRender(t){const e=t.isTextOutlineMaterial,r=t.uniforms,i=this.textRenderInfo;if(i){const{sdfTexture:t,blockBounds:n}=i;r.uTroikaSDFTexture.value=t,r.uTroikaSDFTextureSize.value.set(t.image.width,t.image.height),r.uTroikaSDFGlyphSize.value=i.sdfGlyphSize,r.uTroikaSDFExponent.value=i.sdfExponent,r.uTroikaTotalBounds.value.fromArray(n),r.uTroikaUseGlyphColors.value=!e&&!!i.glyphColors;let o,s,a,u=0,l=0,h=0,c=0,f=0;if(e){let{outlineWidth:t,outlineOffsetX:e,outlineOffsetY:n,outlineBlur:r,outlineOpacity:i}=this;u=this._parsePercent(t)||0,l=Math.max(0,this._parsePercent(r)||0),o=i,c=this._parsePercent(e)||0,f=this._parsePercent(n)||0}else h=Math.max(0,this._parsePercent(this.strokeWidth)||0),h&&(a=this.strokeColor,r.uTroikaStrokeColor.value.set(null==a?QU:a),s=this.strokeOpacity,null==s&&(s=1)),o=this.fillOpacity;r.uTroikaEdgeOffset.value=u,r.uTroikaPositionOffset.value.set(c,f),r.uTroikaBlurRadius.value=l,r.uTroikaStrokeWidth.value=h,r.uTroikaStrokeOpacity.value=s,r.uTroikaFillOpacity.value=null==o?1:o,r.uTroikaCurveRadius.value=this.curveRadius||0;let p=this.clipRect;if(p&&Array.isArray(p)&&4===p.length)r.uTroikaClipRect.value.fromArray(p);else{const t=100*(this.fontSize||.1);r.uTroikaClipRect.value.set(n[0]-t,n[1]-t,n[2]+t,n[3]+t)}this.geometry.applyClipRect(r.uTroikaClipRect.value)}r.uTroikaSDFDebug.value=!!this.debugSDF,t.polygonOffset=!!this.depthOffset,t.polygonOffsetFactor=t.polygonOffsetUnits=this.depthOffset||0;const o=e?this.outlineColor||0:this.color;if(null==o)delete t.color;else{const e=t.hasOwnProperty("color")?t.color:t.color=new n.Color;o===e._input&&"object"!=typeof o||e.set(e._input=o)}let s=this.orientation||HU;if(s!==t._orientation){let e=r.uTroikaOrient.value;s=s.replace(/[^-+xyz]/g,"");let n=s!==HU&&s.match(/^([-+])([xyz])([-+])([xyz])$/);if(n){let[,t,r,i,o]=n;zU.set(0,0,0)[r]="-"===t?1:-1,jU.set(0,0,0)[o]="-"===i?-1:1,GU.lookAt(qU,zU.cross(jU),jU),e.setFromMatrix4(GU)}else e.identity();t._orientation=s}}_parsePercent(t){if("string"==typeof t){let e=t.match(/^(-?[\d.]+)%$/),n=e?parseFloat(e[1]):NaN;t=(isNaN(n)?0:n/100)*this.fontSize}return t}localPositionToTextCoords(t,e=new n.Vector2){e.copy(t);const r=this.curveRadius;return r&&(e.x=Math.atan2(t.x,Math.abs(r)-Math.abs(t.z))*Math.abs(r)),e}worldPositionToTextCoords(t,e=new n.Vector2){return zU.copy(t),this.localPositionToTextCoords(this.worldToLocal(zU),e)}raycast(t,e){const{textRenderInfo:n,curveRadius:r}=this;if(n){const i=n.blockBounds,o=r?XU():YU(),s=o.geometry,{position:a,uv:u}=s.attributes;for(let t=0;t<u.count;t++){let e=i[0]+u.getX(t)*(i[2]-i[0]);const n=i[1]+u.getY(t)*(i[3]-i[1]);let o=0;r&&(o=r-Math.cos(e/r)*r,e=Math.sin(e/r)*r),a.setXYZ(t,e,n,o)}s.boundingSphere=this.geometry.boundingSphere,s.boundingBox=this.geometry.boundingBox,o.matrixWorld=this.matrixWorld,o.material.side=this.material.side,VU.length=0,o.raycast(t,VU);for(let t=0;t<VU.length;t++)VU[t].object=this,e.push(VU[t])}}copy(t){const e=this.geometry;return super.copy(t),this.geometry=e,$U.forEach((e=>{this[e]=t[e]})),this}clone(){return(new this.constructor).copy(this)}}ZU.forEach((t=>{const e="_private_"+t;Object.defineProperty(tQ.prototype,t,{get(){return this[e]},set(t){t!==this[e]&&(this[e]=t,this._needsSync=!0)}})})),new n.Box3,new n.Color;var eQ={altitude:0,height:0,interactive:!1};W.prototype._createSDFText=function(){return this.object3d=new tQ,this.object3d.__parent=this,this};var nQ=function(t){function e(t,n,r,o){var s;h(this,e),r=i.Util.extend({},eQ,r,{layer:o}),s=l(this,e);var a=r.altitude;s._initOptions(r),console.log(r,"fffffffff"),s._createSDFText(),s.getObject3d().text=r.text,s.getObject3d().fontSize=r.fontSize,s.getObject3d().color=r.color,s.getObject3d().letterSpacing=r.letterSpacing||0,s.getObject3d().textAlign="center",s.getObject3d().anchorX=r.anchorX||"center",s.getObject3d().anchorY=r.anchorY||"middle",s.getObject3d().renderOrder=r.renderOrder,s.getObject3d().material=n,s.getObject3d().font=r.fontfile;var u=o.distanceToVector3(a,a).x,c=o.coordinateToVector3(t,u);return s.getObject3d().position.copy(c),s}return m(e,t),p(e)}(W),rQ=function(){return p((function t(e,n,r){var i=this;h(this,t),0!=e.length?(this.map=r.map,this.threeLayer=r,this.textWidth=n.textWidth||40,this.textHeight=n.textHeight||40,this.beginSizeZoom=n.beginSizeZoom||3,this.endSizeZoom=n.endSizeZoom||12,this.spanSizeZoom=this.endSizeZoom-this.beginSizeZoom,this.stepSize=1/(this.endSizeZoom-this.beginSizeZoom+1),this.textDx=n.textDx||0,this.textDy=n.textDy||0,this.anchorX=n.anchorX,this.anchorY=n.anchorY,this.minZoom=n.pointMinZoom||3,this.maxZoom=n.pointMaxZoom||20,this.fontSize=n.fontSize||.4,this.letterSpacing=n.letterSpacing||0,this.textField=n.textField,this.altitude=n.altitude,this.zoomChangeCallback=n.zoomChangeCallback,this.meshs=[],this.m=this.createBillboardMaterial(new o.MeshBasicMaterial),console.log(e,"77777777777777"),e.forEach((function(t){if(t[i.textField]){console.log(t);var e=new nQ([t.longitude,t.latitude],i.m,{minZoom:i.minZoom,maxZoom:i.maxZoom,text:t[i.textField],color:t.color||"#fff",renderOrder:n.pointOrder||5,fontSize:i.fontSize,letterSpacing:i.letterSpacing,altitude:i.altitude,anchorX:i.anchorX,anchorY:i.anchorY},r);e.zoomChange=function(){i.m.uniforms.cameraToCenterDistance.value=i.map.cameraToCenterDistance,i.m.uniforms.zoomScale.value=76.43702828517625/i.map.getResolution();var t=i._getRate();i.m.uniforms.size.value=[i.textWidth*t,i.textHeight*t],i.m.uniforms.xyOffset.value=[i.textDx*t,i.textDy*t],i.zoomChangeCallback&&i.zoomChangeCallback(e)},i.meshs.push(e)}})),this.dataItems=e,r.addMesh(this.meshs),this._bindMapEvents()):console.error("需要绘制的点位数量为0")}),[{key:"createBillboardMaterial",value:function(t,e){return WF(t,Object.assign({uniforms:{canvasSize:{value:[this.map.width,this.map.height]},cameraToCenterDistance:{type:"f",value:this.map.cameraToCenterDistance},zoomScale:{type:"f",value:76.43702828517625/this.map.getResolution()},size:{value:[this.textWidth*this._getRate(),this.textHeight*this._getRate()]},xyOffset:{value:[this.textDx*this._getRate(),this.textDy*this._getRate()]}},vertexDefs:"\n uniform vec2 canvasSize;\n uniform float cameraToCenterDistance;\n uniform float zoomScale;\n uniform vec2 size;\n uniform vec2 xyOffset;\n ",vertexMainOutro:"\n\n vec2 iconSize = vec2(24, 24);\n vec3 c = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);\n float k = gl_Position.w;\n float l = (1. - cameraToCenterDistance / k);\n float m = clamp(.5 + .5 * (1. - l), .0, 4.);\n vec2 A = position.xy;\n A = A * size;\n \n vec2 B = A * 2. / canvasSize;\n gl_Position.xy += B * m * k;\n\n //float C = k / cameraToCenterDistance;\n //vec2 B = A;\n //gl_Position = projectionMatrix * modelViewMatrix * vec4(vec3(B, .0) / zoomScale * C * m, 1.);\n\n\n gl_Position.xy += xyOffset * 2. / canvasSize * k;\n "},e))}},{key:"_getRate",value:function(){var t=this.map.getZoom()-this.beginSizeZoom;return(t=t>this.spanSizeZoom?this.spanSizeZoom:t)*this.stepSize+this.stepSize}},{key:"_bindMapEvents",value:function(){this.map.on("pitch",this._setSizeOn,this)}},{key:"_setSizeOn",value:function(){this.m.uniforms.cameraToCenterDistance.value=this.map.cameraToCenterDistance}},{key:"show",value:function(){this.meshs.forEach((function(t){t.show()}))}},{key:"hide",value:function(){this.meshs.forEach((function(t){t.hide()}))}},{key:"pointShowHideByCode",value:function(t,e,n){for(var r=1/0,o=1/0,s=-1/0,a=-1/0,u=0;u<this.dataItems.length;u++){var l=this.dataItems[u];t.includes(l.code)?(r=Math.min(r,this.dataItems[u].longitude),o=Math.min(o,this.dataItems[u].latitude),s=Math.max(s,this.dataItems[u].longitude),a=Math.max(a,this.dataItems[u].latitude),l.visibility=1):l.visibility=.1}this.updateByVisibility(),e&&this.map.fitExtent(new i.Extent(r,o,s,a),n||0)}},{key:"updateByVisibility",value:function(){var t=this;this.meshs.forEach((function(e,n){.1===t.dataItems[n].visibility?e.hide():e.show()}))}},{key:"dispose",value:function(){var t,e=this;this.meshs.forEach((function(t){e.threeLayer.removeMesh(t),t.object3d.dispose()})),null===(t=this.m)||void 0===t||t.dispose()}}],[{key:"preloadFont",value:function(t){return new Promise((function(t){!function({font:t,characters:e,sdfGlyphSize:n},r){BU({font:t,sdfGlyphSize:n,text:Array.isArray(e)?e.join("\n"):""+e},r)}({font:"/NotoSerifSC-Regular.otf"},(function(){t()}))}))}}])}(),iQ="__webglFramebuffer",oQ=new o.Vector4,sQ={bloom:!0},aQ=1*o.REVISION>154?Math.PI:1;function uQ(t,e){if(t){t.layers&&t.layers.set(e);var n=t.children;if(n&&n.length)for(var r=0,i=n.length;r<i;r++)uQ(n[r],e)}}Po.prototype.renderScene=function(t){if(this.layer._callbackBaseObjectAnimation(),this._syncCamera(),t&&t.renderTarget){var e=t.renderTarget.fbo,n=e.width,r=e.height;this._renderTarget?(this._renderTarget.viewport.set(0,0,n,r),this._renderTarget.scissor.set(0,0,n,r)):(this._renderTarget=new o.WebGLRenderTarget(n,r,{depthBuffer:!1}),this.context.setRenderTarget(this._renderTarget),this.context.render(this.scene,this.camera));var i=this.context.properties.get(this._renderTarget),s=i[iQ];i[iQ]=t.renderTarget.getFramebuffer(t.renderTarget.fbo),this.context.setRenderTarget(this._renderTarget);var a=1===t.bloom&&t.sceneFilter,u=this.scene.children||[],l=!1;if(a){var h=t.sceneFilter;l=h(sQ);for(var c=0,f=u.length;c<f;c++)if(u[c]&&u[c].layers){var p=u[c].__parent;u[c].bloom=!1,p&&(u[c].bloom=p.bloom);var d=0;(u[c]&&h(u[c])||!p)&&l&&(d=1),u[c].__layer!==d&&(uQ(u[c],d),u[c].__layer=d)}}else for(var g=0,y=u.length;g<y;g++)u[g]&&u[g].layers&&0!==u[g].__layer&&(uQ(u[g],0),u[g].__layer=0);this.camera.layers.set(l?1:0),this.context.render(this.scene,this.camera),i[iQ]=s}else{var v=this.canvas,m=v.width,A=v.height,_=this.context.getViewport(oQ);_.width===m&&_.height===A||this.context.setViewport(0,0,m,A),this.context.render(this.scene,this.camera),this.layer.updateComposer()}this.context.setRenderTarget(null),this.completeRender()},To.prototype.initEnvironment=function(t){var e=this.getScene(),n=(new DF).load(t,(function(){n.mapping=o.EquirectangularReflectionMapping,e.environment=n}))},To.prototype.initBloom=function(){var t=this.getThreeRenderer(),e=this.getScene(),n=this.getCamera();this.composer=new NN(t,{frameBufferType:o.HalfFloatType}),this.composer.addPass(new AF(e,n))},To.prototype.delComposer=function(){var t;null===(t=this.composer)||void 0===t||t.dispose()},To.prototype.updateComposer=function(){var t;null===(t=this.composer)||void 0===t||t.render()},To.prototype.getComposer=function(){return this.composer},To.prototype._recursionMesh=function(t){for(;t&&t.parent!==this.getScene()&&!t.parent.customType;)t=t.parent;return t},To.prototype.identify=function(t,e){var n=this;if(!t)return console.error("coordinate is null,it should be Coordinate"),[];if(Array.isArray(t)&&(t=new i.Coordinate(t)),!(t instanceof i.Coordinate))return console.error("coordinate type is error,it should be Coordinate"),[];var r=this.getMap().coordToContainerPoint(t);this._containerPoint=r;var s=r.x,a=r.y;this._initRaycaster(),this.fire("identify",{coordinate:t,options:e});var u=this._raycaster,l=this._mouse,h=this.getCamera(),c=this.getScene(),f=this.getMap().getSize();if(!c)return[];var p=f.width,d=f.height;l.x=s/p*2-1,l.y=-a/d*2+1,u.setFromCamera(l,h),u.layers&&u.layers.enableAll&&u.layers.enableAll(),function(t,e){t.linePrecision=e}(u,this._getLinePrecision(this.getMap().getResolution()));var g=[],y=[];c.children.forEach((function(t){var e=t.__parent;if(e&&e.getOptions){var n=e;n.getOptions().interactive&&n.isVisible()&&(n.identify&&i.Util.isFunction(n.identify)?y.push(n):g.push(t))}else(t instanceof o.Mesh||t instanceof o.Group)&&t.customType&&t.children.forEach((function(t){var e=t.__parent;if(e&&e.getOptions){var n=e;n.getOptions().interactive&&n.isVisible()&&(n.identify&&i.Util.isFunction(n.identify)?y.push(n):g.push(t))}}))}));var v=[],m=u.intersectObjects(g,!0);m&&Array.isArray(m)&&m.length&&(v=m.map((function(t){var e=t.object,r=t.instanceId,o=(e=n._recursionMesh(e)||{}).__parent||e;return o.faceIndex=t.faceIndex,o.index=t.index,o.intersect=t,i.Util.isNumber(r)&&(o.instanceId=r),o}))),this.renderPickScene(),y.length&&y.forEach((function(e){e.identify(t)&&v.push(e)}));for(var A=v.length,_=0;_<A;_++)if(v[_])for(var x=_+1;x<A;x++)v[_]===v[x]&&v.splice(x,1);var w=(e=i.Util.extend({},e)).count;return v.sort((function(t,e){return e.object3d.renderOrder-t.object3d.renderOrder})),i.Util.isNumber(w)&&w>0?v.slice(0,w):v},To.prototype._zoomend=function(){var t=this.getScene();if(t){var e=this.getMap().getZoom();t.children.forEach((function(t){if(t.customType)t.children.forEach((function(t){var n=t.__parent;if(n&&n.getOptions){var r=n;r.zoomChange&&i.Util.isFunction(r.zoomChange)&&r.zoomChange(e);var o=r.getMinZoom(),s=r.getMaxZoom();e<o||e>s?(r.isVisible()&&(r.getObject3d().visible=!1),r._zoomVisible=!1):o<=e&&e<=s&&(r._visible&&(r.getObject3d().visible=!0),r._zoomVisible=!0)}}));else{var n=t.__parent;if(n&&n.getOptions){var r=n;r.zoomChange&&i.Util.isFunction(r.zoomChange)&&r.zoomChange(e);var o=r.getMinZoom(),s=r.getMaxZoom();e<o||e>s?(r.isVisible()&&(r.getObject3d().visible=!1),r._zoomVisible=!1):o<=e&&e<=s&&(r._visible&&(r.getObject3d().visible=!0),r._zoomVisible=!0)}}}))}},To.prototype.addMesh1=function(t,e){var n=this,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t)return this;Array.isArray(t)||(t=[t]);var i=this.getScene(),o=void 0;if(e&&(o=i.getObjectByProperty("customId",e)),t.forEach((function(t){if(t instanceof W){var e;if(o)o.add(t.getObject3d());else console.log("组不存在,销毁创建的对象"),null===(e=t.parent)||void 0===e||e.dispose();t.isAdd||(t.isAdd=!0,t.options.layer=n,t._fire("add",{target:t}))}})),this._zoomend(),r){var s=this._getRenderer();s&&s.setToRedraw()}return this},To.prototype.removeMesh1=function(t,e){var n=this,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t)return this;Array.isArray(t)||(t=[t]);var s=this.getScene(),a=s.getObjectByProperty("customId",e);if(t.forEach((function(t){if(t instanceof W){a?a.remove(t.getObject3d()):s.remove(t.getObject3d()),t.isAdd&&(t.isAdd=!1,t._fire("remove",{target:t})),t._animation&&i.Util.isFunction(t._animation)&&delete n._animationBaseObjectMap[t.getObject3d().uuid];var e=n._delayMeshes;if(e.length)for(var r=0,u=e.length;r<u;r++)if(e[r]===t){e.splice(r,1);break}}else t instanceof o.Object3D&&s.remove(t)})),r){var u=this._getRenderer();u&&u.setToRedraw()}return this};var lQ=function(){return p((function t(e,n,r){var i=this;h(this,t),this.map=n,this.animationId=null,this.updatables=[];var s=XC();this.threeLayer=new To(s,{forceRenderOnMoving:!0,forceRenderOnRotating:!0,identifyCountOnEvent:1}),this.clock=new o.Clock;var a=function(){i.threeLayer._needsUpdate=!i.threeLayer._needsUpdate,i.threeLayer._needsUpdate&&i.threeLayer.redraw();var t,e=i.clock.getDelta(),n=d(i.updatables);try{for(n.s();!(t=n.n()).done;){t.value.tick(e)}}catch(t){n.e(t)}finally{n.f()}i.statsFlag&&i.stats.update(),i.animationId=requestAnimationFrame(a)};this.threeLayer.prepareToDraw=function(t,e,n){var r=new o.DirectionalLight(16777215);r.position.set(0,-10,10).normalize(),e.add(r),a()},null!=r&&r.groupLayer?this.threeLayer.addTo(r.groupLayer):this.threeLayer.addTo(n),this.groupLayer=null==r?void 0:r.groupLayer,this.layerId=s,this.layerName=e,this.dirty=!1,this.initFlag=!1,this.bloomFlag=(null==r?void 0:r.bloomFlag)||!1,this.bloomStrength=null==r?void 0:r.bloomStrength,this.bloomThreshold=null==r?void 0:r.bloomThreshold,this.bloomRadius=null==r?void 0:r.bloomRadius,this.hdrPath=null==r?void 0:r.hdrPath,this.ambientLightIntensity=(null==r?void 0:r.ambientLightIntensity)||1,this.stats=new kF,this.stats.dom.style.display="none",document.body.appendChild(this.stats.dom),this.statsFlag=!1}),[{key:"createGroup",value:(t=u(w().mark((function t(e){return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.threeLayer.getScene()){t.next=4;break}return t.abrupt("return",this.getIdByName(this.threeLayer.getScene(),e));case 4:if(!0!==this.initFlag){t.next=10;break}return t.next=7,JC(200);case 7:case 13:return t.abrupt("return",this.getIdByName(this.threeLayer.getScene(),e));case 10:return this.initFlag=!0,t.next=13,this.prepareToDraw();case 14:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})},{key:"removeGroup",value:function(t){if(this.threeLayer.getScene()){var e=this.threeLayer.getScene().getObjectByName(t);this.threeLayer.getScene().remove(e)}}},{key:"getIdByName",value:function(t,e){var n=t.getObjectByName(e);return n||(n=new mD(t,e)),n.customId}},{key:"setGroupVisible",value:function(t,e){this.threeLayer.getScene().getObjectByProperty("customId",t).visible=e}},{key:"getLayerId",value:function(){return this.layerId}},{key:"changeLayerId",value:function(){if(this.threeLayer){var t=XC();this.threeLayer.setId(t),this.layerId=t}}},{key:"setVisible",value:function(t,e){this.threeLayer&&(!0===t?(this.threeLayer.show(),e&&e()):(this.threeLayer.hide(),e&&e()))}},{key:"prepareToDraw",value:function(){var t=this,e=function(){t.threeLayer._needsUpdate=!t.threeLayer._needsUpdate,t.threeLayer._needsUpdate&&t.threeLayer.redraw();var n,r=t.clock.getDelta(),i=d(t.updatables);try{for(i.s();!(n=i.n()).done;){n.value.tick(r)}}catch(t){i.e(t)}finally{i.f()}t.statsFlag&&t.stats.update(),t.animationId=requestAnimationFrame(e)};return new Promise((function(n){var r=t;t.threeLayer.prepareToDraw=function(t,i,s){r.hdrPath&&this.initEnvironment(r.hdrPath);var a=new o.DirectionalLight(16777215,1*aQ);a.position.set(0,-10,10).normalize(),i.add(a),i.add(new o.AmbientLight(16777215,r.ambientLightIntensity*aQ)),e(),this.initBloom(),n()}}))}},{key:"drawRadar",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new xS(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new xS(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawRadar1",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new wS(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new wS(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawRadar2",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new bS(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new bS(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawRadar3",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new ES(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new ES(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawSector",value:function(t,e,n,r){var i=this;return new Promise((function(o){if(i.threeLayer.getScene()){var s=new SS(t,e,n||{},i.threeLayer,r);o(s)}else i.initFlag=!0,i.prepareToDraw().then((function(){var s=new SS(t,e,n||{},i.threeLayer,r);o(s)}))}))}},{key:"drawRing",value:function(t,e,n,r,i){var o=this;return new Promise((function(s){if(o.threeLayer.getScene()){var a=new FF(t,e,n,r||{},o.threeLayer,i);s(a)}else o.initFlag=!0,o.prepareToDraw().then((function(){var a=new FF(t,e,n,r||{},o.threeLayer,i);s(a)}))}))}},{key:"drawSectorImg",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new kS(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new kS(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawImage",value:function(t,e,n,r,i){var o=this;return new Promise((function(s){if(o.threeLayer.getScene()){var a=new mS(t,e,n,r,o.threeLayer,i);s(a)}else o.initFlag=!0,o.prepareToDraw().then((function(){var a=new mS(t,e,n,r,o.threeLayer,i);s(a)}))}))}},{key:"drawShock",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new shockEffect(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new shockEffect(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"drawPoybyHeight",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new RF(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new RF(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"drawSdfText",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=null;t.length>0?o=new rQ(t,e,r.threeLayer,n):i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=null;t.length>0?o=new rQ(t,e,r.threeLayer,n):i(o)}))}))}},{key:"drawPlaneMarker",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=null;t.length>0?(o=new ZS(t,e,r.threeLayer,n)).addPoint().then((function(){i(o)})):i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=null;t.length>0?(o=new ZS(t,e,r.threeLayer,n)).addPoint().then((function(){i(o)})):i(o)}))}))}},{key:"draw3dtiles",value:function(t,e){var n=this;return new Promise((function(r){if(n.threeLayer.getScene()){var i=new dD(t,e,n.threeLayer,n);r(i)}else n.initFlag=!0,n.prepareToDraw().then((function(){var i=new dD(t,e,n.threeLayer,n);r(i)}))}))}},{key:"createGltfLoadTool",value:function(t){var e=this;return new Promise((function(n){if(e.threeLayer.getScene()){var r=new vD(t,e.threeLayer);n(r)}else e.initFlag=!0,e.prepareToDraw().then((function(){var r=new vD(t,e.threeLayer);n(r)}))}))}},{key:"drawFbxModel",value:function(t,e,n,r){var i=this;return new Promise((function(o){if(i.threeLayer.getScene()){var s=new vO(t,e,n,i.threeLayer,r);o(s)}else i.initFlag=!0,i.prepareToDraw().then((function(){var s=new vO(t,e,n,i.threeLayer,r);o(s)}))}))}},{key:"drawRippleWall",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new _O(t,e||{},r.threeLayer,n,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new _O(t,e||{},r.threeLayer,n,r);i(o)}))}))}},{key:"drawWall",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new xO(t,e||{},r.threeLayer,n,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new xO(t,e||{},r.threeLayer,n,r);i(o)}))}))}},{key:"drawRippleWallImg",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new wO(t,e||{},r.threeLayer,n,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new wO(t,e||{},r.threeLayer,n,r);i(o)}))}))}},{key:"drawBloomLine",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new IN(t,e,r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new IN(t,e,r.threeLayer,n);i(o)}))}))}},{key:"createBloomClass",value:function(t){var e=this;return new Promise((function(n){if(e.threeLayer.getScene()){var r=new BF(e.threeLayer,t);n(r)}else e.initFlag=!0,e.prepareToDraw().then((function(){var r=new BF(e.threeLayer,t);n(r)}))}))}},{key:"createOutlineBloom",value:function(t){var e=this;return new Promise((function(n){if(e.threeLayer.getScene()){var r=new TF(e.threeLayer,t);n(r)}else e.initFlag=!0,e.prepareToDraw().then((function(){var r=new TF(e.threeLayer,t);n(r)}))}))}},{key:"drawPolyline",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new CO(t,e,r.threeLayer,n);o.addLine().then((function(){i(o)}))}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new CO(t,e,r.threeLayer,n);o.addLine().then((function(){i(o)}))}))}))}},{key:"drawPolygon",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new mN(t,e,r.threeLayer,n);o.generatePolygon().then((function(){i(o)}))}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new mN(t,e,r.threeLayer,n);lineObject.generatePolygon().then((function(){i(o)}))}))}))}},{key:"drawExtrudePolygon",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new xN(t,e,r.threeLayer,n);o.generatePolygon().then((function(){i(o)}))}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new xN(t,e,r.threeLayer,n);lineObject.generatePolygon().then((function(){i(o)}))}))}))}},{key:"drawLinePlane",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new BO(t,e,r.threeLayer,n,r);o.addLine().then((function(){i(o)}))}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new BO(t,e,r.threeLayer,n,r);o.addLine().then((function(){i(o)}))}))}))}},{key:"drawVerticalFatLine",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new ZO(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new ZO(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"drawTube",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new iN(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new iN(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"drawPlaneGif",value:function(t,e,n,r,i){var o=this;return new Promise((function(s){if(o.threeLayer.getScene()){var a=new eN(t,e,n,r||{},o.threeLayer,o,i);s(a)}else o.initFlag=!0,o.prepareToDraw().then((function(){var a=new eN(t,e,n,r||{},o.threeLayer,o,i);s(a)}))}))}},{key:"drawTripHeight",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new lN(t,e||{},r.threeLayer,r,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new lN(t,e||{},r.threeLayer,r,n);i(o)}))}))}},{key:"drawTripHeight1",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new hN(t,e||{},r.threeLayer,r,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new hN(t,e||{},r.threeLayer,r,n);i(o)}))}))}},{key:"drawTripLine",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new cN(t,e||{},r.threeLayer,r,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new cN(t,e||{},r.threeLayer,r,n);i(o)}))}))}},{key:"drawTripLine1",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new fN(t,e||{},r.threeLayer,r,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new fN(t,e||{},r.threeLayer,r,n);i(o)}))}))}},{key:"drawArrow2D",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new EN(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new EN(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"setStateFlag",value:function(){this.statsFlag=!this.statsFlag,this.statsFlag?this.stats.dom.style.display="":this.stats.dom.style.display="none"}},{key:"dispose",value:function(){this.animationId&&cancelAnimationFrame(this.animationId);var t=this.threeLayer.getMeshes();this.threeLayer.delComposer(),this.threeLayer.clear(),t.forEach((function(t){}));var e=this.threeLayer.getCamera(),n=this.threeLayer.getScene(),r=this.threeLayer.getPick(),i=r.pickingTexture;r.pickingScene;var o=this.threeLayer.getRenderer();n.remove(e),e=null,n=null,i.dispose(),i=null,this.groupLayer?this.groupLayer.removeLayer(this.threeLayer):(o.context.dispose(),o.context.forceContextLoss(),o.context=null,o.remove(),o=null,this.map.removeLayer(this.threeLayer))}}]);var t}(),hQ=function(){return p((function t(e,n){var r=this;h(this,t),this.map=n,this.animationId=null,this.updatables=[];var i=XC();this.threeLayer=new To(i,{forceRenderOnMoving:!0,forceRenderOnRotating:!0,identifyCountOnEvent:1}),this.clock=new o.Clock;var s=function(){var t;(r.threeLayer._needsUpdate=!r.threeLayer._needsUpdate,r.threeLayer._needsUpdate)&&(null===(t=r.threeLayer)||void 0===t||null===(t=t.getRenderer())||void 0===t||t.clearCanvas(),r.threeLayer.renderScene());var e,n=r.clock.getDelta(),i=d(r.updatables);try{for(i.s();!(e=i.n()).done;){e.value.tick(n)}}catch(t){i.e(t)}finally{i.f()}r.animationId=requestAnimationFrame(s)};this.threeLayer.prepareToDraw=function(t,e,n){var r=new o.DirectionalLight(16777215);r.position.set(0,-10,10).normalize(),e.add(r),s()},this.threeLayer.addTo(n),this.layerId=i,this.layerName=e,this.dirty=!1,this.initFlag=!1}),[{key:"createGroup",value:(t=u(w().mark((function t(e){return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.threeLayer.getScene()){t.next=4;break}return t.abrupt("return",this.getIdByName(this.threeLayer.getScene(),e));case 4:if(!0!==this.initFlag){t.next=10;break}return t.next=7,JC(200);case 7:case 13:return t.abrupt("return",this.getIdByName(this.threeLayer.getScene(),e));case 10:return this.initFlag=!0,t.next=13,this.prepareToDraw();case 14:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})},{key:"removeGroup",value:function(t){if(this.threeLayer.getScene()){var e=this.threeLayer.getScene().getObjectByName(t);this.threeLayer.getScene().remove(e)}}},{key:"getIdByName",value:function(t,e){var n=t.getObjectByName(e);return n||(n=new mD(t,e)),n.customId}},{key:"setGroupVisible",value:function(t,e){this.threeLayer.getScene().getObjectByProperty("customId",t).visible=e}},{key:"getLayerId",value:function(){return this.layerId}},{key:"changeLayerId",value:function(){if(this.threeLayer){var t=XC();this.threeLayer.setId(t),this.layerId=t}}},{key:"setVisible",value:function(t,e){this.threeLayer&&(!0===t?(this.threeLayer.show(),e&&e()):(this.threeLayer.hide(),e&&e()))}},{key:"prepareToDraw",value:function(){var t=this,e=function(){var n;(t.threeLayer._needsUpdate=!t.threeLayer._needsUpdate,t.threeLayer._needsUpdate)&&(null===(n=t.threeLayer)||void 0===n||null===(n=n.getRenderer())||void 0===n||n.clearCanvas(),t.threeLayer.renderScene());var r,i=t.clock.getDelta(),o=d(t.updatables);try{for(o.s();!(r=o.n()).done;){r.value.tick(i)}}catch(t){o.e(t)}finally{o.f()}t.animationId=requestAnimationFrame(e)};return new Promise((function(n){t.threeLayer.prepareToDraw=function(t,r,i){var s=new o.DirectionalLight(16777215);s.position.set(0,-10,10).normalize(),r.add(s),r.add(new o.AmbientLight(16777215)),e(),n()}}))}},{key:"drawRadar",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new xS(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new xS(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawSector",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new SS(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new SS(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawSectorImg",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new kS(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new kS(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawImage",value:function(t,e,n,r,i){var o=this;return new Promise((function(s){if(o.threeLayer.getScene()){var a=new mS(t,e,n,r,o.threeLayer,i);s(a)}else o.initFlag=!0,o.prepareToDraw().then((function(){var a=new mS(t,e,n,r,o.threeLayer,i);s(a)}))}))}},{key:"drawShock",value:function(t,e){var n=this;return new Promise((function(r){if(n.threeLayer.getScene()){var i=new RS(t,e||{},n.threeLayer,n);r(i)}else n.initFlag=!0,n.prepareToDraw().then((function(){var i=new RS(t,e||{},n.threeLayer,n);r(i)}))}))}},{key:"drawPlaneMarker",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=null;t.length>0?(o=new ZS(t,e,r.threeLayer,n)).addPoint().then((function(){i(o)})):i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=null;t.length>0?(o=new ZS(t,e,r.threeLayer,n)).addPoint().then((function(){i(o)})):i(o)}))}))}},{key:"draw3dtiles",value:function(t,e){var n=this;return new Promise((function(r){if(n.threeLayer.getScene()){var i=new dD(t,e,n.threeLayer,n);r(i)}else n.initFlag=!0,n.prepareToDraw().then((function(){var i=new dD(t,e,n.threeLayer,n);r(i)}))}))}},{key:"createGltfLoadTool",value:function(t){var e=this;return new Promise((function(n){if(e.threeLayer.getScene()){var r=new vD(t,e.threeLayer);n(r)}else e.initFlag=!0,e.prepareToDraw().then((function(){var r=new vD(t,e.threeLayer);n(r)}))}))}},{key:"drawFbxModel",value:function(t,e,n,r){var i=this;return new Promise((function(o){if(i.threeLayer.getScene()){var s=new vO(t,e,n,i.threeLayer,r);o(s)}else i.initFlag=!0,i.prepareToDraw().then((function(){var s=new vO(t,e,n,i.threeLayer,r);o(s)}))}))}},{key:"drawRippleWall",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new _O(t,e||{},r.threeLayer,n,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new _O(t,e||{},r.threeLayer,n,r);i(o)}))}))}},{key:"drawRippleWallImg",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new wO(t,e||{},r.threeLayer,n,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new wO(t,e||{},r.threeLayer,n,r);i(o)}))}))}},{key:"drawPolyline",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new CO(t,e,r.threeLayer,n);o.addLine().then((function(){i(o)}))}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new CO(t,e,r.threeLayer,n);o.addLine().then((function(){i(o)}))}))}))}},{key:"drawPolygon",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new mN(t,e,r.threeLayer,n);o.generatePolygon().then((function(){i(o)}))}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new mN(t,e,r.threeLayer,n);lineObject.generatePolygon().then((function(){i(o)}))}))}))}},{key:"drawLinePlane",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new BO(t,e,r.threeLayer,n,r);o.addLine().then((function(){i(o)}))}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new BO(t,e,r.threeLayer,n,r);o.addLine().then((function(){i(o)}))}))}))}},{key:"drawVerticalFatLine",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new ZO(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new ZO(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"drawTube",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new iN(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new iN(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"drawPlaneGif",value:function(t,e,n,r,i){var o=this;return new Promise((function(s){if(o.threeLayer.getScene()){var a=new eN(t,e,n,r||{},o.threeLayer,o,i);s(a)}else o.initFlag=!0,o.prepareToDraw().then((function(){var a=new eN(t,e,n,r||{},o.threeLayer,o,i);s(a)}))}))}},{key:"drawTripHeight",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new lN(t,e||{},r.threeLayer,r,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new lN(t,e||{},r.threeLayer,r,n);i(o)}))}))}},{key:"drawTripLine",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new cN(t,e||{},r.threeLayer,r,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new cN(t,e||{},r.threeLayer,r,n);i(o)}))}))}},{key:"drawArrow2D",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new EN(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new EN(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"dispose",value:function(){this.animationId&&cancelAnimationFrame(this.animationId);var t=this.threeLayer.getMeshes();this.threeLayer.clear(),t.forEach((function(t){}));var e=this.threeLayer.getCamera(),n=this.threeLayer.getScene(),r=this.threeLayer.getPick(),i=r.pickingTexture;r.pickingScene;var o=this.threeLayer.getRenderer();n.remove(e),e=null,n=null,i.dispose(),i=null,o.context.dispose(),o.context.forceContextLoss(),o.context=null,o.remove(),o=null,this.map.removeLayer(this.threeLayer)}}]);var t}(),cQ=function(){return p((function t(e,n,r,o){h(this,t),this.map=o,this.geometry=null,this.selectGeometry=null,this.isEndSelect=!1,this.drawTool=new i.DrawTool({mode:e,symbol:{lineColor:r.lineColor||"#E40D56",lineWidth:2,lineDasharray:[5,5],polygonFill:r.polygonFill||"#E40D56",polygonOpacity:.2}}).addTo(this.map).enable(),this._bindEvent(),this._drawEnd=n,this.mode=e,this.toolLayer=new i.VectorLayer(i.Util.GUID(),{geometryEvents:!1,hitDetect:!1}).addTo(this.map),this.geometry&&(this.toolLayer.addGeometry(this.geometry),this._drawEnd&&("Circle"===this.mode?this._drawEnd(this.geometry.getCoordinates(),this.geometry.getRadius()):this._drawEnd(this.geometry.getCoordinates()))),r.zIndex&&this.toolLayer.setZIndex(r.zIndex),this.type="drawTool"}),[{key:"getZIndex",value:function(){this.toolLayer&&this.toolLayer.getZIndex()}},{key:"setZIndex",value:function(t){this.toolLayer&&this.toolLayer.setZIndex(t)}},{key:"selectGeometryByPoint",value:function(){this.map.on("click",this._selectGeometry,this)}},{key:"endSelect",value:function(){this.toolLayer&&this.selectGeometry&&(this._changeSymbol(!1),this.selectGeometry.endEdit(),this.selectGeometry=null),this.map.off("click",this._selectGeometry,this)}},{key:"_selectGeometry",value:function(t){if(this.disableTool(),this.toolLayer){var e=this.toolLayer.identify(t.coordinate);this.selectGeometry&&(this.selectGeometry.endEdit(),this._changeSymbol(!1)),e&&(this.selectGeometry=e[0]),this.selectGeometry&&this._changeSymbol(!0)}}},{key:"_closeMapEvent",value:function(){this.map.off("click",this._selectGeometry,this)}},{key:"_changeSymbol",value:function(t){t?this.selectGeometry.setSymbol({lineColor:"#00ffff",lineWidth:2,lineDasharray:[5,5],polygonFill:"#00ffff",polygonOpacity:.2}):this.selectGeometry.setSymbol({lineColor:"#E40D56",lineWidth:2,lineDasharray:[5,5],polygonFill:"#E40D56",polygonOpacity:.2})}},{key:"deleteGeometry",value:function(){this.toolLayer&&this.selectGeometry&&(this.selectGeometry.endEdit(),this.toolLayer.removeGeometry(this.selectGeometry))}},{key:"undoDrawGeometry",value:function(){if(this.toolLayer){var t=this.toolLayer.getGeometries();if(t.length<1)return;this.toolLayer.removeGeometry(t[t.length-1])}}},{key:"_bindEvent",value:function(){this.drawTool.on("drawend",this.drawEnd,this)}},{key:"_closeEvent",value:function(){this.drawTool.off("drawend",this.drawEnd,this)}},{key:"drawEnd",value:function(t){this.toolLayer&&this.toolLayer.addGeometry(t.geometry),this._drawEnd&&("Circle"===this.mode?this._drawEnd(t.geometry.getCoordinates(),t.geometry.getRadius()):this._drawEnd(t.geometry.getCoordinates())),this.geometry=t.geometry}},{key:"disableTool",value:function(){this.drawTool.disable()}},{key:"clearGeometry",value:function(){this.toolLayer&&this.toolLayer.clear()}},{key:"setMode",value:function(t,e){this._drawEnd&&delete this._drawEnd,this._drawEnd=e,this.drawTool.setMode(t).enable(),this.mode=t}},{key:"startEdit",value:function(){this.disableTool(),this.selectGeometry&&this.selectGeometry.startEdit()}},{key:"endEdit",value:function(t){this.selectGeometry&&(this.selectGeometry.endEdit(),t&&("Circle"===this.mode?t(this.selectGeometry.getCoordinates(),this.geometry.getRadius()):t(this.selectGeometry.getCoordinates())))}},{key:"dispose",value:function(){this.drawTool&&(this._closeEvent(),this.endEdit(),this.disableTool(),delete this.drawTool),this._drawEnd&&delete this._drawEnd,this.geometry&&delete this.geometry,this.selectGeometry&&delete this.selectGeometry,this.map&&this._closeMapEvent(),this.map.removeLayer(this.toolLayer),delete this.toolLayer}}])}();function fQ(){this.PI=3.141592653589793,this.x_PI=52.35987755982988,this.a=6378245,this.ee=.006693421622965943,this.EARTHRADIUS=6370996.81,this.MCBAND=[12890594.86,8362377.87,5591021,3481989.83,1678043.12,0],this.LLBAND=[75,60,45,30,15,0],this.MC2LL=[[1.410526172116255e-8,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,17337981.2],[-7.435856389565537e-9,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,10260144.86],[-3.030883460898826e-8,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,6856817.37],[-1.981981304930552e-8,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,4482777.06],[3.09191371068437e-9,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,2555164.4],[2.890871144776878e-9,8983055095805407e-21,-3.068298e-8,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],this.LL2MC=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,647795574.6671607,-4082003173.641316,10774905663.51142,-15171875531.51559,12053065338.62167,-5124939663.577472,913311935.9512032,67.5],[.00337398766765,111320.7020202162,4481351.045890365,-23393751.19931662,79682215.47186455,-115964993.2797253,97236711.15602145,-43661946.33752821,8477230.501135234,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837.749470245,992013.7397791013,-1221952.21711287,1340652.697009075,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758.690035394,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],this._transformlat=function(t,e){var n=2*t-100+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(e*this.PI)+40*Math.sin(e/3*this.PI))/3,n+=2*(160*Math.sin(e/12*this.PI)+320*Math.sin(e*this.PI/30))/3},this._transformlng=function(t,e){var n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(t*this.PI)+40*Math.sin(t/3*this.PI))/3,n+=2*(150*Math.sin(t/12*this.PI)+300*Math.sin(t/30*this.PI))/3},this._out_of_china=function(t,e){return t<72.004||t>137.8347||e<.8293||e>55.8271||!1},this._getLoop=function(t,e,n){for(;t>n;)t-=n-e;for(;t<e;)t+=n-e;return t},this._getRange=function(t,e,n){return null!=e&&(t=Math.max(t,e)),null!=n&&(t=Math.min(t,n)),t}}fQ.prototype.BD2GCJ=function(t,e){var n=t-.0065,r=e-.006,i=Math.sqrt(n*n+r*r)-2e-5*Math.sin(r*this.x_PI),o=Math.atan2(r,n)-3e-6*Math.cos(n*this.x_PI);return[i*Math.cos(o),i*Math.sin(o)]},fQ.prototype.GCJ2BD=function(t,e){var n=Math.sqrt(t*t+e*e)+2e-5*Math.sin(e*this.x_PI),r=Math.atan2(e,t)+3e-6*Math.cos(t*this.x_PI);return[n*Math.cos(r)+.0065,n*Math.sin(r)+.006]},fQ.prototype.WGS2GCJ=function(t,e){if(this._out_of_china(t,e))return[t,e];var n=this._transformlat(t-105,e-35),r=this._transformlng(t-105,e-35),i=e/180*this.PI,o=Math.sin(i);o=1-this.ee*o*o;var s=Math.sqrt(o);return n=180*n/(this.a*(1-this.ee)/(o*s)*this.PI),[t+(r=180*r/(this.a/s*Math.cos(i)*this.PI)),e+n]},fQ.prototype.GCJ2WGS=function(t,e){if(this._out_of_china(t,e))return[t,e];var n=this._transformlat(t-105,e-35),r=this._transformlng(t-105,e-35),i=e/180*this.PI,o=Math.sin(i);o=1-this.ee*o*o;var s=Math.sqrt(o);return n=180*n/(this.a*(1-this.ee)/(o*s)*this.PI),[2*t-(t+(r=180*r/(this.a/s*Math.cos(i)*this.PI))),2*e-(e+n)]},fQ.prototype.WGS2BD=function(t,e){var n=this.WGS2GCJ(t,e);return n=this.GCJ2BD(n[0],n[1])},fQ.prototype.BD2WGS=function(t,e){var n=this.BD2GCJ(t,e);return n=this.GCJ2WGS(n[0],n[1])},fQ.prototype.BD_MKT2WGS=function(t,e){var n=null;t=Math.abs(t),e=Math.abs(e);for(var r=0;r<this.MCBAND.length;r++)if(e>=this.MCBAND[r]){n=this.MC2LL[r];break}t=n[0]+n[1]*Math.abs(t);var i=Math.abs(e)/n[9];return e=n[2]+n[3]*i+n[4]*i*i+n[5]*i*i*i+n[6]*i*i*i*i+n[7]*i*i*i*i*i+n[8]*i*i*i*i*i*i,[t*=t<0?-1:1,e*=e<0?-1:1]},fQ.prototype.BD_WGS2MKT=function(t,e){var n=null;t=this._getLoop(t,-180,180),e=this._getRange(e,-74,74);for(var r=0;r<this.LLBAND.length;r++)if(e>=this.LLBAND[r]){n=this.LL2MC[r];break}if(null!=n)for(r=this.LLBAND.length-1;r>=0;r--)if(e<=-this.LLBAND[r]){n=this.LL2MC[r];break}t=n[0]+n[1]*Math.abs(t);var i=Math.abs(e)/n[9];return e=n[2]+n[3]*i+n[4]*i*i+n[5]*i*i*i+n[6]*i*i*i*i+n[7]*i*i*i*i*i+n[8]*i*i*i*i*i*i,[t*=t<0?-1:1,e*=e<0?-1:1]};var pQ=function(){return p((function t(e,n,r){h(this,t),this.map=n,this.overlayer=new i.VectorLayer("overLayer",{geometryEvents:!1,hitDetect:!1,forceRenderOnMoving:!0,forceRenderOnRotating:!0,enableSimplify:!1}),this.overlayer.addTo(this.map);var o=new i.MultiPolygon(e,{symbol:{polygonFill:r.color||"#000",polygonOpacity:r.opacity||1,lineWidth:0}});this.overlayer.addGeometry(o)}),[{key:"dispose",value:function(){this.map.removeLayer(this.overlayer),delete this.toolLayer}}])}();
|
|
189
|
+
*/const cU=sU({name:"FontResolver",dependencies:[function(t,e){const n=Object.create(null),r=Object.create(null);function i(e,i){let o=n[e];o?i(o):r[e]?r[e].push(i):(r[e]=[i],function(e,n){const r=t=>{console.error(`Failure loading font ${e}`,t)};try{const i=new XMLHttpRequest;i.open("get",e,!0),i.responseType="arraybuffer",i.onload=function(){if(i.status>=400)r(new Error(i.statusText));else if(i.status>0)try{const r=t(i.response);r.src=e,n(r)}catch(t){r(t)}},i.onerror=r,i.send()}catch(t){r(t)}}(e,(t=>{t.src=e,n[e]=t,r[e].forEach((e=>e(t))),delete r[e]})))}return function(t,r,{lang:o,fonts:s=[],style:a="normal",weight:u="normal",unicodeFontsURL:l}={}){const h=new Uint8Array(t.length),c=[];t.length||g();const f=new Map,p=[];if("italic"!==a&&(a="normal"),"number"!=typeof u&&(u="bold"===u?700:400),s&&!Array.isArray(s)&&(s=[s]),(s=s.slice().filter((t=>!t.lang||t.lang.test(o))).reverse()).length){const e=1,r=2;let o=0;!function a(u=0){for(let l=u,d=t.length;l<d;l++){const u=t.codePointAt(l);if(o===e&&c[h[l-1]].supportsCodePoint(u)||l>0&&/\s/.test(t[l]))h[l]=h[l-1],o===r&&(p[p.length-1][1]=l);else for(let t=h[l],d=s.length;t<=d;t++)if(t===d){(o===r?p[p.length-1]:p[p.length]=[l,l])[1]=l,o=r}else{h[l]=t;const{src:r,unicodeRange:p}=s[t];if(!p||y(u,p)){const t=n[r];if(!t)return void i(r,(()=>{a(l)}));if(t.supportsCodePoint(u)){let n=f.get(t);"number"!=typeof n&&(n=c.length,c.push(t),f.set(t,n)),h[l]=n,o=e;break}}}u>65535&&l+1<d&&(h[l+1]=h[l],l++,o===r&&(p[p.length-1][1]=l))}d()}()}else p.push([0,t.length-1]),d();function d(){if(p.length){const n=p.map((e=>t.substring(e[0],e[1]+1))).join("\n");e.getFontsForString(n,{lang:o||void 0,style:a,weight:u,dataUrl:l}).then((({fontUrls:t,chars:e})=>{const n=c.length;let r=0;p.forEach((t=>{for(let i=0,o=t[1]-t[0];i<=o;i++)h[t[0]+i]=e[r++]+n;r++}));let o=0;t.forEach(((e,r)=>{i(e,(e=>{c[r+n]=e,++o===t.length&&g()}))}))}))}else g()}function g(){r({chars:h,fonts:c})}function y(t,e){for(let n=0;n<e.length;n++){const[r,i=r]=e[n];if(r<=t&&t<=i)return!0}return!1}}},hU,function(){return function(t){var e=function(){this.buckets=new Map};e.prototype.add=function(t){var e=t>>5;this.buckets.set(e,(this.buckets.get(e)||0)|1<<(31&t))},e.prototype.has=function(t){var e=this.buckets.get(t>>5);return void 0!==e&&!!(e&1<<(31&t))},e.prototype.serialize=function(){var t=[];return this.buckets.forEach((function(e,n){t.push((+n).toString(36)+":"+e.toString(36))})),t.join(",")},e.prototype.deserialize=function(t){var e=this;this.buckets.clear(),t.split(",").forEach((function(t){var n=t.split(":");e.buckets.set(parseInt(n[0],36),parseInt(n[1],36))}))};var n=Math.pow(2,8),r=n-1,i=~r;function o(t){var e=function(t){return t&i}(t).toString(16),r=function(t){return(t&i)+n-1}(t).toString(16);return"codepoint-index/plane"+(t>>16)+"/"+e+"-"+r+".json"}function s(t,e){var n=t&r,i=e.codePointAt(n/6|0);return!!((i=(i||48)-48)&1<<n%6)}function a(t,e){!function(t,e){var n;(n=t,n.replace(/U\+/gi,"").replace(/^,+|,+$/g,"").split(/,+/).map((function(t){return t.split("-").map((function(t){return parseInt(t.trim(),16)}))}))).forEach((function(t){var n=t[0],r=t[1];void 0===r&&(r=n),e(n,r)}))}(t,(function(t,n){for(var r=t;r<=n;r++)e(r)}))}var u={},l={},h=new WeakMap,c="https://cdn.jsdelivr.net/gh/lojjic/unicode-font-resolver@v1.0.1/packages/data";function f(t){var n=h.get(t);return n||(n=new e,a(t.ranges,(function(t){return n.add(t)})),h.set(t,n)),n}var p,d=new Map;function g(t,e,n){return t[e]?e:t[n]?n:function(t){for(var e in t)return e}(t)}function y(t,e){var n=e;if(!t.includes(n)){n=1/0;for(var r=0;r<t.length;r++)Math.abs(t[r]-e)<Math.abs(n-e)&&(n=t[r])}return n}function v(t){return p||(p=new Set,a("9-D,20,85,A0,1680,2000-200A,2028-202F,205F,3000",(function(t){p.add(t)}))),p.has(t)}return t.CodePointSet=e,t.clearCache=function(){u={},l={}},t.getFontsForString=function(t,e){void 0===e&&(e={});var n,r=e.lang;void 0===r&&(r=/\p{Script=Hangul}/u.test(n=t)?"ko":/\p{Script=Hiragana}|\p{Script=Katakana}/u.test(n)?"ja":"en");var i=e.category;void 0===i&&(i="sans-serif");var a=e.style;void 0===a&&(a="normal");var h=e.weight;void 0===h&&(h=400);var p=(e.dataUrl||c).replace(/\/$/g,""),m=new Map,A=new Uint8Array(t.length),_={},x={},w=new Array(t.length),b=new Map,E=!1;function I(t){var e=d.get(t);return e||(e=fetch(p+"/"+t).then((function(t){if(!t.ok)throw new Error(t.statusText);return t.json().then((function(t){if(!Array.isArray(t)||1!==t[0])throw new Error("Incorrect schema version; need 1, got "+t[0]);return t[1]}))})).catch((function(e){if(p!==c)return E||(console.error('unicode-font-resolver: Failed loading from dataUrl "'+p+'", trying default CDN. '+e.message),E=!0),p=c,d.delete(t),I(t);throw e})),d.set(t,e)),e}for(var C=function(e){var n=t.codePointAt(e),r=o(n);w[e]=r,u[r]||b.has(r)||b.set(r,I(r).then((function(t){u[r]=t}))),n>65535&&(e++,S=e)},S=0;S<t.length;S++)C(S);return Promise.all(b.values()).then((function(){b.clear();for(var e=function(e){var i=t.codePointAt(e),o=null,a=u[w[e]],h=void 0;for(var c in a){var f=x[c];if(void 0===f&&(f=x[c]=new RegExp(c).test(r||"en")),f){for(var p in h=c,a[c])if(s(i,a[c][p])){o=p;break}break}}if(!o)t:for(var d in a)if(d!==h)for(var g in a[d])if(s(i,a[d][g])){o=g;break t}o||(console.debug("No font coverage for U+"+i.toString(16)),o="latin"),w[e]=o,l[o]||b.has(o)||b.set(o,I("font-meta/"+o+".json").then((function(t){l[o]=t}))),i>65535&&(e++,n=e)},n=0;n<t.length;n++)e(n);return Promise.all(b.values())})).then((function(){for(var e,n=null,r=0;r<t.length;r++){var o=t.codePointAt(r);if(n&&(v(o)||f(n).has(o)))A[r]=A[r-1];else{n=l[w[r]];var s=_[n.id];if(!s){var u=n.typeforms,c=g(u,i,"sans-serif"),d=g(u[c],a,"normal"),x=y(null===(e=u[c])||void 0===e?void 0:e[d],h);s=_[n.id]=p+"/font-files/"+n.id+"/"+c+"."+d+"."+x+".woff"}var b=m.get(s);null==b&&(b=m.size,m.set(s,b)),A[r]=b}o>65535&&(r++,A[r]=A[r-1])}return{fontUrls:Array.from(m.keys()),chars:A}}))},Object.defineProperty(t,"__esModule",{value:!0}),t}({})}],init:(t,e,n)=>t(e,n())});const fU=()=>(self.performance||Date).now(),pU=lU();let dU;const gU=[];let yU=0;function vU(){const t=fU();for(;gU.length&&fU()-t<5;)gU.shift()();yU=gU.length?setTimeout(vU,0):0}const mU=(...t)=>new Promise(((e,n)=>{gU.push((()=>{const r=fU();try{pU.webgl.generateIntoCanvas(...t),e({timing:fU()-r})}catch(t){n(t)}})),yU||(yU=setTimeout(vU,0))})),AU=4,_U=2e3,xU={};let wU=0;function bU(t,e,n,r,i,o,s,a,u,l){const h="TroikaTextSDFGenerator_JS_"+wU++%AU;let c=xU[h];return c||(c=xU[h]={workerModule:sU({name:h,workerId:h,dependencies:[lU,fU],init(t,e){const n=t().javascript.generate;return function(...t){const r=e();return{textureData:n(...t),timing:e()-r}}},getTransferables:t=>[t.textureData.buffer]}),requests:0,idleTimer:null}),c.requests++,clearTimeout(c.idleTimer),c.workerModule(t,e,n,r,i,o).then((({textureData:n,timing:r})=>{const i=fU(),o=new Uint8Array(4*n.length);for(let t=0;t<n.length;t++)o[4*t+l]=n[t];return pU.webglUtils.renderImageData(s,o,a,u,t,e,1<<3-l),r+=fU()-i,0==--c.requests&&(c.idleTimer=setTimeout((()=>{!function(t){iU[t]&&iU[t].forEach((function(t){t()})),rU[t]&&(rU[t].terminate(),delete rU[t])}(h)}),_U)),{timing:r}}))}const EU=pU.webglUtils.resizeWebGLCanvasWithoutClearing,IU={defaultFontURL:null,unicodeFontsURL:null,sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048,useWorker:!0},CU=new n.Color;function SU(){return(self.performance||Date).now()}const MU=Object.create(null);function BU(t,e){t=function(t,e){for(let n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}({},t);const r=SU(),{defaultFontURL:i}=IU,o=[];if(i&&o.push({label:"default",src:PU(i)}),t.font&&o.push({label:"user",src:PU(t.font)}),t.font=o,t.text=""+t.text,t.sdfGlyphSize=t.sdfGlyphSize||IU.sdfGlyphSize,t.unicodeFontsURL=t.unicodeFontsURL||IU.unicodeFontsURL,null!=t.colorRanges){let e={};for(let n in t.colorRanges)if(t.colorRanges.hasOwnProperty(n)){let r=t.colorRanges[n];"number"!=typeof r&&(r=CU.set(r).getHex()),e[n]=r}t.colorRanges=e}Object.freeze(t);const{textureWidth:s,sdfExponent:a}=IU,{sdfGlyphSize:u}=t,l=s/u*4;let h=MU[u];if(!h){const t=document.createElement("canvas");t.width=s,t.height=256*u/l,h=MU[u]={glyphCount:0,sdfGlyphSize:u,sdfCanvas:t,sdfTexture:new n.Texture(t,void 0,void 0,void 0,n.LinearFilter,n.LinearFilter),contextLost:!1,glyphsByFont:new Map},h.sdfTexture.generateMipmaps=!1,function(t){const e=t.sdfCanvas;e.addEventListener("webglcontextlost",(e=>{console.log("Context Lost",e),e.preventDefault(),t.contextLost=!0})),e.addEventListener("webglcontextrestored",(e=>{console.log("Context Restored",e),t.contextLost=!1;const n=[];t.glyphsByFont.forEach((e=>{e.forEach((e=>{n.push(TU(e,t,!0))}))})),Promise.all(n).then((()=>{LU(t),t.sdfTexture.needsUpdate=!0}))}))}(h)}const{sdfTexture:c,sdfCanvas:f}=h;DU(t).then((n=>{const{glyphIds:i,glyphFontIndices:o,fontData:p,glyphPositions:d,fontSize:g,timings:y}=n,v=[],m=new Float32Array(4*i.length);let A=0,_=0;const x=SU(),w=p.map((t=>{let e=h.glyphsByFont.get(t.src);return e||h.glyphsByFont.set(t.src,e=new Map),e}));i.forEach(((t,e)=>{const r=o[e],{src:s,unitsPerEm:a}=p[r];let l=w[r].get(t);if(!l){const{path:e,pathBounds:i}=n.glyphData[s][t],o=Math.max(i[2]-i[0],i[3]-i[1])/u*(IU.sdfMargin*u+.5),a=h.glyphCount++,c=[i[0]-o,i[1]-o,i[2]+o,i[3]+o];w[r].set(t,l={path:e,atlasIndex:a,sdfViewBox:c}),v.push(l)}const{sdfViewBox:c}=l,f=d[_++],y=d[_++],x=g/a;m[A++]=f+c[0]*x,m[A++]=y+c[1]*x,m[A++]=f+c[2]*x,m[A++]=y+c[3]*x,i[e]=l.atlasIndex})),y.quads=(y.quads||0)+(SU()-x);const b=SU();y.sdf={};const E=f.height,I=Math.ceil(h.glyphCount/l),C=Math.pow(2,Math.ceil(Math.log2(I*u)));C>E&&(console.info(`Increasing SDF texture size ${E}->${C}`),EU(f,s,C),c.dispose()),Promise.all(v.map((e=>TU(e,h,t.gpuAccelerateSDF).then((({timing:t})=>{y.sdf[e.atlasIndex]=t}))))).then((()=>{v.length&&!h.contextLost&&(LU(h),c.needsUpdate=!0),y.sdfTotal=SU()-b,y.total=SU()-r,e(Object.freeze({parameters:t,sdfTexture:c,sdfGlyphSize:u,sdfExponent:a,glyphBounds:m,glyphAtlasIndices:i,glyphColors:n.glyphColors,caretPositions:n.caretPositions,chunkedBounds:n.chunkedBounds,ascender:n.ascender,descender:n.descender,lineHeight:n.lineHeight,capHeight:n.capHeight,xHeight:n.xHeight,topBaseline:n.topBaseline,blockBounds:n.blockBounds,visibleBounds:n.visibleBounds,timings:n.timings}))}))})),Promise.resolve().then((()=>{h.contextLost||function(t){t._warm||(pU.webgl.isSupported(t),t._warm=!0)}(f)}))}function TU({path:t,atlasIndex:e,sdfViewBox:n},{sdfGlyphSize:r,sdfCanvas:i,contextLost:o},s){if(o)return Promise.resolve({timing:-1});const{textureWidth:a,sdfExponent:u}=IU,l=Math.max(n[2]-n[0],n[3]-n[1]),h=Math.floor(e/4);return function(t,e,n,r,i,o,s,a,u,l,h=!0){return h?mU(t,e,n,r,i,o,s,a,u,l).then(null,(h=>(dU||(console.warn("WebGL SDF generation failed, falling back to JS",h),dU=!0),bU(t,e,n,r,i,o,s,a,u,l)))):bU(t,e,n,r,i,o,s,a,u,l)}(r,r,t,n,l,u,i,h%(a/r)*r,Math.floor(h/(a/r))*r,e%4,s)}let kU;function PU(t){return kU||(kU="undefined"==typeof document?{}:document.createElement("a")),kU.href=t,kU.href}function LU(t){if("function"!=typeof createImageBitmap){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:e,sdfTexture:n}=t,{width:r,height:i}=e,o=t.sdfCanvas.getContext("webgl");let s=n.image.data;s&&s.length===r*i*4||(s=new Uint8Array(r*i*4),n.image={width:r,height:i,data:s},n.flipY=!1,n.isDataTexture=!0),o.readPixels(0,0,r,i,o.RGBA,o.UNSIGNED_BYTE,s)}}const RU=sU({name:"Typesetter",dependencies:[function(t,e){const n=1/0,r=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,i="[^\\S\\u00A0]",o=new RegExp(`${i}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function s({text:s="",font:c,lang:f,sdfGlyphSize:p=64,fontSize:d=400,fontWeight:g=1,fontStyle:y="normal",letterSpacing:v=0,lineHeight:m="normal",maxWidth:A=n,direction:_,textAlign:x="left",textIndent:w=0,whiteSpace:b="normal",overflowWrap:E="normal",anchorX:I=0,anchorY:C=0,metricsOnly:S=!1,unicodeFontsURL:M,preResolvedFonts:B=null,includeCaretPositions:T=!1,chunkedBoundsSize:k=8192,colorRanges:P=null},L){const R=l(),D={fontLoad:0,typesetting:0};s.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),s=s.replace(/\r\n/g,"\n").replace(/\r/g,"\n")),d=+d,v=+v,A=+A,m=m||"normal",w=+w,function({text:e,lang:n,fonts:r,style:i,weight:o,preResolvedFonts:s,unicodeFontsURL:a},u){const l=({chars:t,fonts:e})=>{let n,r;const i=[];for(let o=0;o<t.length;o++)t[o]!==r?(r=t[o],i.push(n={start:o,end:o,fontObj:e[t[o]]})):n.end=o;u(i)};s?l(s):t(e,l,{lang:n,fonts:r,style:i,weight:o,unicodeFontsURL:a})}({text:s,lang:f,style:y,weight:g,fonts:"string"==typeof c?[{src:c}]:c,unicodeFontsURL:M,preResolvedFonts:B},(t=>{D.fontLoad=l()-R;const c=isFinite(A);let f=null,p=null,g=null,y=null,M=null,B=null,O=null,N=null,F=0,U=0,Q="nowrap"!==b;const G=new Map,z=l();let j=w,V=0,q=new h;const H=[q];t.forEach((t=>{const{fontObj:e}=t,{ascender:n,descender:a,unitsPerEm:u,lineGap:l,capHeight:f,xHeight:p}=e;let g=G.get(e);if(!g){const t=d/u,r="normal"===m?(n-a+l)*t:m*d,i=(r-(n-a)*t)/2,o=Math.min(r,(n-a)*t),s=(n+a)/2*t+o/2;g={index:G.size,src:e.src,fontObj:e,fontSizeMult:t,unitsPerEm:u,ascender:n*t,descender:a*t,capHeight:f*t,xHeight:p*t,lineHeight:r,baseline:-i-n*t,caretTop:s,caretBottom:s-o},G.set(e,g)}const{fontSizeMult:y}=g,_=s.slice(t.start,t.end+1);let x,b;e.forEachGlyph(_,d,v,((e,n,a,u)=>{n+=V,u+=t.start,x=n,b=e;const l=s.charAt(u),f=e.advanceWidth*y,p=q.count;let m;if("isEmpty"in e||(e.isWhitespace=!!l&&new RegExp(i).test(l),e.canBreakAfter=!!l&&o.test(l),e.isEmpty=e.xMin===e.xMax||e.yMin===e.yMax||r.test(l)),e.isWhitespace||e.isEmpty||U++,Q&&c&&!e.isWhitespace&&n+f+j>A&&p){if(q.glyphAt(p-1).glyphObj.canBreakAfter)m=new h,j=-n;else for(let t=p;t--;){if(0===t&&"break-word"===E){m=new h,j=-n;break}if(q.glyphAt(t).glyphObj.canBreakAfter){m=q.splitAt(t+1);const e=m.glyphAt(0).x;j-=e;for(let t=m.count;t--;)m.glyphAt(t).x-=e;break}}m&&(q.isSoftWrapped=!0,q=m,H.push(q),F=A)}let _=q.glyphAt(q.count);_.glyphObj=e,_.x=n+j,_.y=a,_.width=f,_.charIndex=u,_.fontData=g,"\n"===l&&(q=new h,H.push(q),j=-(n+f+v*d)+w)})),V=x+b.advanceWidth*y+v*d}));let W=0;H.forEach((t=>{let e=!0;for(let n=t.count;n--;){const r=t.glyphAt(n);e&&!r.glyphObj.isWhitespace&&(t.width=r.x+r.width,t.width>F&&(F=t.width),e=!1);let{lineHeight:i,capHeight:o,xHeight:s,baseline:a}=r.fontData;i>t.lineHeight&&(t.lineHeight=i);const u=a-t.baseline;u<0&&(t.baseline+=u,t.cap+=u,t.ex+=u),t.cap=Math.max(t.cap,t.baseline+o),t.ex=Math.max(t.ex,t.baseline+s)}t.baseline-=W,t.cap-=W,t.ex-=W,W+=t.lineHeight}));let Y=0,X=0;if(I&&("number"==typeof I?Y=-I:"string"==typeof I&&(Y=-F*("left"===I?0:"center"===I?.5:"right"===I?1:a(I)))),C&&("number"==typeof C?X=-C:"string"==typeof C&&(X="top"===C?0:"top-baseline"===C?-H[0].baseline:"top-cap"===C?-H[0].cap:"top-ex"===C?-H[0].ex:"middle"===C?W/2:"bottom"===C?W:"bottom-baseline"===C?-H[H.length-1].baseline:a(C)*W)),!S){const t=e.getEmbeddingLevels(s,_);f=new Uint16Array(U),p=new Uint8Array(U),g=new Float32Array(2*U),y={},O=[n,n,-1/0,-1/0],N=[],T&&(B=new Float32Array(4*s.length)),P&&(M=new Uint8Array(3*U));let r,i,o=0,a=-1,l=-1;if(H.forEach(((h,c)=>{let{count:d,width:v}=h;if(d>0){let c=0;for(let t=d;t--&&h.glyphAt(t).glyphObj.isWhitespace;)c++;let m=0,A=0;if("center"===x)m=(F-v)/2;else if("right"===x)m=F-v;else if("justify"===x&&h.isSoftWrapped){let t=0;for(let e=d-c;e--;)h.glyphAt(e).glyphObj.isWhitespace&&t++;A=(F-v)/t}if(A||m){let t=0;for(let e=0;e<d;e++){let n=h.glyphAt(e);const r=n.glyphObj;n.x+=m+t,0!==A&&r.isWhitespace&&e<d-c&&(t+=A,n.width+=A)}}const _=e.getReorderSegments(s,t,h.glyphAt(0).charIndex,h.glyphAt(h.count-1).charIndex);for(let t=0;t<_.length;t++){const[e,n]=_[t];let r=1/0,i=-1/0;for(let t=0;t<d;t++)if(h.glyphAt(t).charIndex>=e){let e=t,o=t;for(;o<d;o++){let t=h.glyphAt(o);if(t.charIndex>n)break;o<d-c&&(r=Math.min(r,t.x),i=Math.max(i,t.x+t.width))}for(let t=e;t<o;t++){const e=h.glyphAt(t);e.x=i-(e.x+e.width-r)}break}}let w;const b=t=>w=t;for(let c=0;c<d;c++){const d=h.glyphAt(c);w=d.glyphObj;const v=w.index,m=1&t.levels[d.charIndex];if(m){const t=e.getMirroredCharacter(s[d.charIndex]);t&&d.fontData.fontObj.forEachGlyph(t,0,0,b)}if(T){const{charIndex:t,fontData:e}=d,n=d.x+Y,r=d.x+d.width+Y;B[4*t]=m?r:n,B[4*t+1]=m?n:r,B[4*t+2]=h.baseline+e.caretBottom+X,B[4*t+3]=h.baseline+e.caretTop+X;const i=t-a;i>1&&u(B,a,i),a=t}if(P){const{charIndex:t}=d;for(;t>l;)l++,P.hasOwnProperty(l)&&(i=P[l])}if(!w.isWhitespace&&!w.isEmpty){const t=o++,{fontSizeMult:e,src:s,index:a}=d.fontData,u=y[s]||(y[s]={});u[v]||(u[v]={path:w.path,pathBounds:[w.xMin,w.yMin,w.xMax,w.yMax]});const l=d.x+Y,c=d.y+h.baseline+X;g[2*t]=l,g[2*t+1]=c;const m=l+w.xMin*e,A=c+w.yMin*e,_=l+w.xMax*e,x=c+w.yMax*e;m<O[0]&&(O[0]=m),A<O[1]&&(O[1]=A),_>O[2]&&(O[2]=_),x>O[3]&&(O[3]=x),t%k==0&&(r={start:t,end:t,rect:[n,n,-1/0,-1/0]},N.push(r)),r.end++;const b=r.rect;if(m<b[0]&&(b[0]=m),A<b[1]&&(b[1]=A),_>b[2]&&(b[2]=_),x>b[3]&&(b[3]=x),f[t]=v,p[t]=a,P){const e=3*t;M[e]=i>>16&255,M[e+1]=i>>8&255,M[e+2]=255&i}}}}})),B){const t=s.length-a;t>1&&u(B,a,t)}}const J=[];G.forEach((({index:t,src:e,unitsPerEm:n,ascender:r,descender:i,lineHeight:o,capHeight:s,xHeight:a})=>{J[t]={src:e,unitsPerEm:n,ascender:r,descender:i,lineHeight:o,capHeight:s,xHeight:a}})),D.typesetting=l()-z,L({glyphIds:f,glyphFontIndices:p,glyphPositions:g,glyphData:y,fontData:J,caretPositions:B,glyphColors:M,chunkedBounds:N,fontSize:d,topBaseline:X+H[0].baseline,blockBounds:[Y,X-W,Y+F,X],visibleBounds:O,timings:D})}))}function a(t){let e=t.match(/^([\d.]+)%$/),n=e?parseFloat(e[1]):NaN;return isNaN(n)?0:n/100}function u(t,e,n){const r=t[4*e],i=t[4*e+1],o=t[4*e+2],s=t[4*e+3],a=(i-r)/n;for(let i=0;i<n;i++){const n=4*(e+i);t[n]=r+a*i,t[n+1]=r+a*(i+1),t[n+2]=o,t[n+3]=s}}function l(){return(self.performance||Date).now()}function h(){this.data=[]}const c=["glyphObj","x","y","width","charIndex","fontData"];return h.prototype={width:0,lineHeight:0,baseline:0,cap:0,ex:0,isSoftWrapped:!1,get count(){return Math.ceil(this.data.length/c.length)},glyphAt(t){let e=h.flyweight;return e.data=this.data,e.index=t,e},splitAt(t){let e=new h;return e.data=this.data.splice(t*c.length),e}},h.flyweight=c.reduce(((t,e,n,r)=>(Object.defineProperty(t,e,{get(){return this.data[this.index*c.length+n]},set(t){this.data[this.index*c.length+n]=t}}),t)),{data:null,index:0}),{typeset:s,measure:function(t,e){s({...t,metricsOnly:!0},(t=>{const[n,r,i,o]=t.blockBounds;e({width:i-n,height:o-r})}))}}},cU,function(){var t=function(t){var e={R:"13k,1a,2,3,3,2+1j,ch+16,a+1,5+2,2+n,5,a,4,6+16,4+3,h+1b,4mo,179q,2+9,2+11,2i9+7y,2+68,4,3+4,5+13,4+3,2+4k,3+29,8+cf,1t+7z,w+17,3+3m,1t+3z,16o1+5r,8+30,8+mc,29+1r,29+4v,75+73",EN:"1c+9,3d+1,6,187+9,513,4+5,7+9,sf+j,175h+9,qw+q,161f+1d,4xt+a,25i+9",ES:"17,2,6dp+1,f+1,av,16vr,mx+1,4o,2",ET:"z+2,3h+3,b+1,ym,3e+1,2o,p4+1,8,6u,7c,g6,1wc,1n9+4,30+1b,2n,6d,qhx+1,h0m,a+1,49+2,63+1,4+1,6bb+3,12jj",AN:"16o+5,2j+9,2+1,35,ed,1ff2+9,87+u",CS:"18,2+1,b,2u,12k,55v,l,17v0,2,3,53,2+1,b",B:"a,3,f+2,2v,690",S:"9,2,k",WS:"c,k,4f4,1vk+a,u,1j,335",ON:"x+1,4+4,h+5,r+5,r+3,z,5+3,2+1,2+1,5,2+2,3+4,o,w,ci+1,8+d,3+d,6+8,2+g,39+1,9,6+1,2,33,b8,3+1,3c+1,7+1,5r,b,7h+3,sa+5,2,3i+6,jg+3,ur+9,2v,ij+1,9g+9,7+a,8m,4+1,49+x,14u,2+2,c+2,e+2,e+2,e+1,i+n,e+e,2+p,u+2,e+2,36+1,2+3,2+1,b,2+2,6+5,2,2,2,h+1,5+4,6+3,3+f,16+2,5+3l,3+81,1y+p,2+40,q+a,m+13,2r+ch,2+9e,75+hf,3+v,2+2w,6e+5,f+6,75+2a,1a+p,2+2g,d+5x,r+b,6+3,4+o,g,6+1,6+2,2k+1,4,2j,5h+z,1m+1,1e+f,t+2,1f+e,d+3,4o+3,2s+1,w,535+1r,h3l+1i,93+2,2s,b+1,3l+x,2v,4g+3,21+3,kz+1,g5v+1,5a,j+9,n+v,2,3,2+8,2+1,3+2,2,3,46+1,4+4,h+5,r+5,r+a,3h+2,4+6,b+4,78,1r+24,4+c,4,1hb,ey+6,103+j,16j+c,1ux+7,5+g,fsh,jdq+1t,4,57+2e,p1,1m,1m,1m,1m,4kt+1,7j+17,5+2r,d+e,3+e,2+e,2+10,m+4,w,1n+5,1q,4z+5,4b+rb,9+c,4+c,4+37,d+2g,8+b,l+b,5+1j,9+9,7+13,9+t,3+1,27+3c,2+29,2+3q,d+d,3+4,4+2,6+6,a+o,8+6,a+2,e+6,16+42,2+1i",BN:"0+8,6+d,2s+5,2+p,e,4m9,1kt+2,2b+5,5+5,17q9+v,7k,6p+8,6+1,119d+3,440+7,96s+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+1,1ekf+75,6p+2rz,1ben+1,1ekf+1,1ekf+1",NSM:"lc+33,7o+6,7c+18,2,2+1,2+1,2,21+a,1d+k,h,2u+6,3+5,3+1,2+3,10,v+q,2k+a,1n+8,a,p+3,2+8,2+2,2+4,18+2,3c+e,2+v,1k,2,5+7,5,4+6,b+1,u,1n,5+3,9,l+1,r,3+1,1m,5+1,5+1,3+2,4,v+1,4,c+1,1m,5+4,2+1,5,l+1,n+5,2,1n,3,2+3,9,8+1,c+1,v,1q,d,1f,4,1m+2,6+2,2+3,8+1,c+1,u,1n,g+1,l+1,t+1,1m+1,5+3,9,l+1,u,21,8+2,2,2j,3+6,d+7,2r,3+8,c+5,23+1,s,2,2,1k+d,2+4,2+1,6+a,2+z,a,2v+3,2+5,2+1,3+1,q+1,5+2,h+3,e,3+1,7,g,jk+2,qb+2,u+2,u+1,v+1,1t+1,2+6,9,3+a,a,1a+2,3c+1,z,3b+2,5+1,a,7+2,64+1,3,1n,2+6,2,2,3+7,7+9,3,1d+g,1s+3,1d,2+4,2,6,15+8,d+1,x+3,3+1,2+2,1l,2+1,4,2+2,1n+7,3+1,49+2,2+c,2+6,5,7,4+1,5j+1l,2+4,k1+w,2db+2,3y,2p+v,ff+3,30+1,n9x+3,2+9,x+1,29+1,7l,4,5,q+1,6,48+1,r+h,e,13+7,q+a,1b+2,1d,3+3,3+1,14,1w+5,3+1,3+1,d,9,1c,1g,2+2,3+1,6+1,2,17+1,9,6n,3,5,fn5,ki+f,h+f,r2,6b,46+4,1af+2,2+1,6+3,15+2,5,4m+1,fy+3,as+1,4a+a,4x,1j+e,1l+2,1e+3,3+1,1y+2,11+4,2+7,1r,d+1,1h+8,b+3,3,2o+2,3,2+1,7,4h,4+7,m+1,1m+1,4,12+6,4+4,5g+7,3+2,2,o,2d+5,2,5+1,2+1,6n+3,7+1,2+1,s+1,2e+7,3,2+1,2z,2,3+5,2,2u+2,3+3,2+4,78+8,2+1,75+1,2,5,41+3,3+1,5,x+5,3+1,15+5,3+3,9,a+5,3+2,1b+c,2+1,bb+6,2+5,2d+l,3+6,2+1,2+1,3f+5,4,2+1,2+6,2,21+1,4,2,9o+1,f0c+4,1o+6,t5,1s+3,2a,f5l+1,43t+2,i+7,3+6,v+3,45+2,1j0+1i,5+1d,9,f,n+4,2+e,11t+6,2+g,3+6,2+1,2+4,7a+6,c6+3,15t+6,32+6,gzhy+6n",AL:"16w,3,2,e+1b,z+2,2+2s,g+1,8+1,b+m,2+t,s+2i,c+e,4h+f,1d+1e,1bwe+dp,3+3z,x+c,2+1,35+3y,2rm+z,5+7,b+5,dt+l,c+u,17nl+27,1t+27,4x+6n,3+d",LRO:"6ct",RLO:"6cu",LRE:"6cq",RLE:"6cr",PDF:"6cs",LRI:"6ee",RLI:"6ef",FSI:"6eg",PDI:"6eh"},n={},r={};n.L=1,r[1]="L",Object.keys(e).forEach((function(t,e){n[t]=1<<e+1,r[n[t]]=t})),Object.freeze(n);var i=n.LRI|n.RLI|n.FSI,o=n.L|n.R|n.AL,s=n.B|n.S|n.WS|n.ON|n.FSI|n.LRI|n.RLI|n.PDI,a=n.BN|n.RLE|n.LRE|n.RLO|n.LRO|n.PDF,u=n.S|n.WS|n.B|i|n.PDI|a,l=null;function h(t){return function(){if(!l){l=new Map;var t=function(t){if(e.hasOwnProperty(t)){var r=0;e[t].split(",").forEach((function(e){var i=e.split("+"),o=i[0],s=i[1];o=parseInt(o,36),s=s?parseInt(s,36):0,l.set(r+=o,n[t]);for(var a=0;a<s;a++)l.set(++r,n[t])}))}};for(var r in e)t(r)}}(),l.get(t.codePointAt(0))||n.L}var c,f,p,d="14>1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",g="6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye";function y(t,e){var n,r=0,i=new Map,o=e&&new Map;return t.split(",").forEach((function t(s){if(-1!==s.indexOf("+"))for(var a=+s;a--;)t(n);else{n=s;var u=s.split(">"),l=u[0],h=u[1];l=String.fromCodePoint(r+=parseInt(l,36)),h=String.fromCodePoint(r+=parseInt(h,36)),i.set(l,h),e&&o.set(h,l)}})),{map:i,reverseMap:o}}function v(){if(!c){var t=y(d,!0),e=t.map,n=t.reverseMap;c=e,f=n,p=y(g,!1).map}}function m(t){return v(),c.get(t)||null}function A(t){return v(),f.get(t)||null}function _(t){return v(),p.get(t)||null}var x=n.L,w=n.R,b=n.EN,E=n.ES,I=n.ET,C=n.AN,S=n.CS,M=n.B,B=n.S,T=n.ON,k=n.BN,P=n.NSM,L=n.AL,R=n.LRO,D=n.RLO,O=n.LRE,N=n.RLE,F=n.PDF,U=n.LRI,Q=n.RLI,G=n.FSI,z=n.PDI;var j;function V(t){return function(){if(!j){var t=y("14>1,j>2,t>2,u>2,1a>g,2v3>1,1>1,1ge>1,1wd>1,b>1,1j>1,f>1,ai>3,-2>3,+1,8>1k0,-1jq>1y7,-1y6>1hf,-1he>1h6,-1h5>1ha,-1h8>1qi,-1pu>1,6>3u,-3s>7,6>1,1>1,f>1,1>1,+2,3>1,1>1,+13,4>1,1>1,6>1eo,-1ee>1,3>1mg,-1me>1mk,-1mj>1mi,-1mg>1mi,-1md>1,1>1,+2,1>10k,-103>1,1>1,4>1,5>1,1>1,+10,3>1,1>8,-7>8,+1,-6>7,+1,a>1,1>1,u>1,u6>1,1>1,+5,26>1,1>1,2>1,2>2,8>1,7>1,4>1,1>1,+5,b8>1,1>1,+3,1>3,-2>1,2>1,1>1,+2,c>1,3>1,1>1,+2,h>1,3>1,a>1,1>1,2>1,3>1,1>1,d>1,f>1,3>1,1a>1,1>1,6>1,7>1,13>1,k>1,1>1,+19,4>1,1>1,+2,2>1,1>1,+18,m>1,a>1,1>1,lk>1,1>1,4>1,2>1,f>1,3>1,1>1,+3,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,6>1,4j>1,j>2,t>2,u>2,2>1,+1",!0),e=t.map;t.reverseMap.forEach((function(t,n){e.set(n,t)})),j=e}}(),j.get(t)||null}function q(t,e,n,r){var i=t.length;n=Math.max(0,null==n?0:+n),r=Math.min(i-1,null==r?i-1:+r);var o=[];return e.paragraphs.forEach((function(i){var s=Math.max(n,i.start),a=Math.min(r,i.end);if(s<a){for(var l=e.levels.slice(s,a+1),c=a;c>=s&&h(t[c])&u;c--)l[c]=i.level;for(var f=i.level,p=1/0,d=0;d<l.length;d++){var g=l[d];g>f&&(f=g),g<p&&(p=1|g)}for(var y=f;y>=p;y--)for(var v=0;v<l.length;v++)if(l[v]>=y){for(var m=v;v+1<l.length&&l[v+1]>=y;)v++;v>m&&o.push([m+s,v+s])}}})),o}function H(t,e,n,r){for(var i=q(t,e,n,r),o=[],s=0;s<t.length;s++)o[s]=s;return i.forEach((function(t){for(var e=t[0],n=t[1],r=o.slice(e,n+1),i=r.length;i--;)o[n-i]=r[i]})),o}return t.closingToOpeningBracket=A,t.getBidiCharType=h,t.getBidiCharTypeName=function(t){return r[h(t)]},t.getCanonicalBracket=_,t.getEmbeddingLevels=function(t,e){for(var n=new Uint32Array(t.length),r=0;r<t.length;r++)n[r]=h(t[r]);var l=new Map;function c(t,e){var r=n[t];n[t]=e,l.set(r,l.get(r)-1),r&s&&l.set(s,l.get(s)-1),l.set(e,(l.get(e)||0)+1),e&s&&l.set(s,(l.get(s)||0)+1)}for(var f=new Uint8Array(t.length),p=new Map,d=[],g=null,y=0;y<t.length;y++)g||d.push(g={start:y,end:t.length-1,level:"rtl"===e?1:"ltr"===e?0:Ge(y,!1)}),n[y]&M&&(g.end=y,g=null);for(var v=N|O|D|R|i|z|F|M,j=function(t){return t+(1&t?1:2)},V=function(t){return t+(1&t?2:1)},q=0;q<d.length;q++){var H=[{_level:(g=d[q]).level,_override:0,_isolate:0}],W=void 0,Y=0,X=0,J=0;l.clear();for(var K=g.start;K<=g.end;K++){var Z=n[K];if(W=H[H.length-1],l.set(Z,(l.get(Z)||0)+1),Z&s&&l.set(s,(l.get(s)||0)+1),Z&v)if(Z&(N|O)){f[K]=W._level;var $=(Z===N?V:j)(W._level);$<=125&&!Y&&!X?H.push({_level:$,_override:0,_isolate:0}):Y||X++}else if(Z&(D|R)){f[K]=W._level;var tt=(Z===D?V:j)(W._level);tt<=125&&!Y&&!X?H.push({_level:tt,_override:Z&D?w:x,_isolate:0}):Y||X++}else if(Z&i){Z&G&&(Z=1===Ge(K+1,!0)?Q:U),f[K]=W._level,W._override&&c(K,W._override);var et=(Z===Q?V:j)(W._level);et<=125&&0===Y&&0===X?(J++,H.push({_level:et,_override:0,_isolate:1,_isolInitIndex:K})):Y++}else if(Z&z){if(Y>0)Y--;else if(J>0){for(X=0;!H[H.length-1]._isolate;)H.pop();var nt=H[H.length-1]._isolInitIndex;null!=nt&&(p.set(nt,K),p.set(K,nt)),H.pop(),J--}W=H[H.length-1],f[K]=W._level,W._override&&c(K,W._override)}else Z&F?(0===Y&&(X>0?X--:!W._isolate&&H.length>1&&(H.pop(),W=H[H.length-1])),f[K]=W._level):Z&M&&(f[K]=g.level);else f[K]=W._level,W._override&&Z!==k&&c(K,W._override)}for(var rt=[],it=null,ot=g.start;ot<=g.end;ot++){var st=n[ot];if(!(st&a)){var at=f[ot],ut=st&i,lt=st===z;it&&at===it._level?(it._end=ot,it._endsWithIsolInit=ut):rt.push(it={_start:ot,_end:ot,_level:at,_startsWithPDI:lt,_endsWithIsolInit:ut})}}for(var ht=[],ct=0;ct<rt.length;ct++){var ft=rt[ct];if(!ft._startsWithPDI||ft._startsWithPDI&&!p.has(ft._start)){for(var pt=[it=ft],dt=void 0;it&&it._endsWithIsolInit&&null!=(dt=p.get(it._end));)for(var gt=ct+1;gt<rt.length;gt++)if(rt[gt]._start===dt){pt.push(it=rt[gt]);break}for(var yt=[],vt=0;vt<pt.length;vt++)for(var mt=pt[vt],At=mt._start;At<=mt._end;At++)yt.push(At);for(var _t=f[yt[0]],xt=g.level,wt=yt[0]-1;wt>=0;wt--)if(!(n[wt]&a)){xt=f[wt];break}var bt=yt[yt.length-1],Et=f[bt],It=g.level;if(!(n[bt]&i))for(var Ct=bt+1;Ct<=g.end;Ct++)if(!(n[Ct]&a)){It=f[Ct];break}ht.push({_seqIndices:yt,_sosType:Math.max(xt,_t)%2?w:x,_eosType:Math.max(It,Et)%2?w:x})}}for(var St=0;St<ht.length;St++){var Mt=ht[St],Bt=Mt._seqIndices,Tt=Mt._sosType,kt=Mt._eosType,Pt=1&f[Bt[0]]?w:x;if(l.get(P))for(var Lt=0;Lt<Bt.length;Lt++){var Rt=Bt[Lt];if(n[Rt]&P){for(var Dt=Tt,Ot=Lt-1;Ot>=0;Ot--)if(!(n[Bt[Ot]]&a)){Dt=n[Bt[Ot]];break}c(Rt,Dt&(i|z)?T:Dt)}}if(l.get(b))for(var Nt=0;Nt<Bt.length;Nt++){var Ft=Bt[Nt];if(n[Ft]&b)for(var Ut=Nt-1;Ut>=-1;Ut--){var Qt=-1===Ut?Tt:n[Bt[Ut]];if(Qt&o){Qt===L&&c(Ft,C);break}}}if(l.get(L))for(var Gt=0;Gt<Bt.length;Gt++){var zt=Bt[Gt];n[zt]&L&&c(zt,w)}if(l.get(E)||l.get(S))for(var jt=1;jt<Bt.length-1;jt++){var Vt=Bt[jt];if(n[Vt]&(E|S)){for(var qt=0,Ht=0,Wt=jt-1;Wt>=0&&(qt=n[Bt[Wt]])&a;Wt--);for(var Yt=jt+1;Yt<Bt.length&&(Ht=n[Bt[Yt]])&a;Yt++);qt===Ht&&(n[Vt]===E?qt===b:qt&(b|C))&&c(Vt,qt)}}if(l.get(b))for(var Xt=0;Xt<Bt.length;Xt++){var Jt=Bt[Xt];if(n[Jt]&b){for(var Kt=Xt-1;Kt>=0&&n[Bt[Kt]]&(I|a);Kt--)c(Bt[Kt],b);for(Xt++;Xt<Bt.length&&n[Bt[Xt]]&(I|a|b);Xt++)n[Bt[Xt]]!==b&&c(Bt[Xt],b)}}if(l.get(I)||l.get(E)||l.get(S))for(var Zt=0;Zt<Bt.length;Zt++){var $t=Bt[Zt];if(n[$t]&(I|E|S)){c($t,T);for(var te=Zt-1;te>=0&&n[Bt[te]]&a;te--)c(Bt[te],T);for(var ee=Zt+1;ee<Bt.length&&n[Bt[ee]]&a;ee++)c(Bt[ee],T)}}if(l.get(b))for(var ne=0,re=Tt;ne<Bt.length;ne++){var ie=Bt[ne],oe=n[ie];oe&b?re===x&&c(ie,x):oe&o&&(re=oe)}if(l.get(s)){for(var se=w|b|C,ae=se|x,ue=[],le=[],he=0;he<Bt.length;he++)if(n[Bt[he]]&s){var ce=t[Bt[he]],fe=void 0;if(null!==m(ce)){if(!(le.length<63))break;le.push({char:ce,seqIndex:he})}else if(null!==(fe=A(ce)))for(var pe=le.length-1;pe>=0;pe--){var de=le[pe].char;if(de===fe||de===A(_(ce))||m(_(de))===ce){ue.push([le[pe].seqIndex,he]),le.length=pe;break}}}ue.sort((function(t,e){return t[0]-e[0]}));for(var ge=0;ge<ue.length;ge++){for(var ye=ue[ge],ve=ye[0],me=ye[1],Ae=!1,_e=0,xe=ve+1;xe<me;xe++){var we=Bt[xe];if(n[we]&ae){Ae=!0;var be=n[we]&se?w:x;if(be===Pt){_e=be;break}}}if(Ae&&!_e){_e=Tt;for(var Ee=ve-1;Ee>=0;Ee--){var Ie=Bt[Ee];if(n[Ie]&ae){var Ce=n[Ie]&se?w:x;_e=Ce!==Pt?Ce:Pt;break}}}if(_e){if(n[Bt[ve]]=n[Bt[me]]=_e,_e!==Pt)for(var Se=ve+1;Se<Bt.length;Se++)if(!(n[Bt[Se]]&a)){h(t[Bt[Se]])&P&&(n[Bt[Se]]=_e);break}if(_e!==Pt)for(var Me=me+1;Me<Bt.length;Me++)if(!(n[Bt[Me]]&a)){h(t[Bt[Me]])&P&&(n[Bt[Me]]=_e);break}}}for(var Be=0;Be<Bt.length;Be++)if(n[Bt[Be]]&s){for(var Te=Be,ke=Be,Pe=Tt,Le=Be-1;Le>=0;Le--){if(!(n[Bt[Le]]&a)){Pe=n[Bt[Le]]&se?w:x;break}Te=Le}for(var Re=kt,De=Be+1;De<Bt.length;De++){if(!(n[Bt[De]]&(s|a))){Re=n[Bt[De]]&se?w:x;break}ke=De}for(var Oe=Te;Oe<=ke;Oe++)n[Bt[Oe]]=Pe===Re?Pe:Pt;Be=ke}}}for(var Ne=g.start;Ne<=g.end;Ne++){var Fe=f[Ne],Ue=n[Ne];if(1&Fe?Ue&(x|b|C)&&f[Ne]++:Ue&w?f[Ne]++:Ue&(C|b)&&(f[Ne]+=2),Ue&a&&(f[Ne]=0===Ne?g.level:f[Ne-1]),Ne===g.end||h(t[Ne])&(B|M))for(var Qe=Ne;Qe>=0&&h(t[Qe])&u;Qe--)f[Qe]=g.level}}return{levels:f,paragraphs:d};function Ge(e,r){for(var o=e;o<t.length;o++){var s=n[o];if(s&(w|L))return 1;if(s&(M|x)||r&&s===z)return 0;if(s&i){var a=ze(o);o=-1===a?t.length:a}}return 0}function ze(e){for(var r=1,o=e+1;o<t.length;o++){var s=n[o];if(s&M)break;if(s&z){if(0==--r)return o}else s&i&&r++}return-1}},t.getMirroredCharacter=V,t.getMirroredCharactersMap=function(t,e,n,r){var i=t.length;n=Math.max(0,null==n?0:+n),r=Math.min(i-1,null==r?i-1:+r);for(var o=new Map,s=n;s<=r;s++)if(1&e[s]){var a=V(t[s]);null!==a&&o.set(s,a)}return o},t.getReorderSegments=q,t.getReorderedIndices=H,t.getReorderedString=function(t,e,n,r){var i=H(t,e,n,r),o=[].concat(t);return i.forEach((function(n,r){o[r]=(1&e.levels[n]?V(t[n]):null)||t[n]})),o.join("")},t.openingToClosingBracket=m,Object.defineProperty(t,"__esModule",{value:!0}),t}({});return t}],init:(t,e,n)=>t(e,n())}),DU=sU({name:"Typesetter",dependencies:[RU],init:t=>function(e){return new Promise((n=>{t.typeset(e,n)}))},getTransferables(t){const e=[];for(let n in t)t[n]&&t[n].buffer&&e.push(t[n].buffer);return e}});DU.onMainThread;const OU={};const NU="aTroikaGlyphIndex";class FU extends n.InstancedBufferGeometry{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new n.Sphere,this.boundingBox=new n.Box3}computeBoundingSphere(){}computeBoundingBox(){}set detail(t){if(t!==this._detail){this._detail=t,("number"!=typeof t||t<1)&&(t=1);let e=function(t){let e=OU[t];return e||(e=OU[t]=new n.PlaneGeometry(1,1,t,t).translate(.5,.5,0)),e}(t);["position","normal","uv"].forEach((t=>{this.attributes[t]=e.attributes[t].clone()})),this.setIndex(e.getIndex().clone())}}get detail(){return this._detail}set curveRadius(t){t!==this._curveRadius&&(this._curveRadius=t,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(t,e,n,r,i){this.updateAttributeData("aTroikaGlyphBounds",t,4),this.updateAttributeData(NU,e,1),this.updateAttributeData("aTroikaGlyphColor",i,3),this._blockBounds=n,this._chunkedBounds=r,this.instanceCount=e.length,this._updateBounds()}_updateBounds(){const t=this._blockBounds;if(t){const{curveRadius:e,boundingBox:n}=this;if(e){const{PI:r,floor:i,min:o,max:s,sin:a,cos:u}=Math,l=r/2,h=2*r,c=Math.abs(e),f=t[0]/c,p=t[2]/c,d=i((f+l)/h)!==i((p+l)/h)?-c:o(a(f)*c,a(p)*c),g=i((f-l)/h)!==i((p-l)/h)?c:s(a(f)*c,a(p)*c),y=i((f+r)/h)!==i((p+r)/h)?2*c:s(c-u(f)*c,c-u(p)*c);n.min.set(d,t[1],e<0?-y:0),n.max.set(g,t[3],e<0?0:y)}else n.min.set(t[0],t[1],0),n.max.set(t[2],t[3],0);n.getBoundingSphere(this.boundingSphere)}}applyClipRect(t){let e=this.getAttribute(NU).count,n=this._chunkedBounds;if(n)for(let r=n.length;r--;){e=n[r].end;let i=n[r].rect;if(i[1]<t.w&&i[3]>t.y&&i[0]<t.z&&i[2]>t.x)break}this.instanceCount=e}updateAttributeData(t,e,r){const i=this.getAttribute(t);e?i&&i.array.length===e.length?(i.array.set(e),i.needsUpdate=!0):(this.setAttribute(t,new n.InstancedBufferAttribute(e,r)),delete this._maxInstanceCount,this.dispose()):i&&this.deleteAttribute(t)}}const UU=new n.MeshBasicMaterial({color:16777215,side:n.DoubleSide,transparent:!0}),QU=8421504,GU=new n.Matrix4,zU=new n.Vector3,jU=new n.Vector3,VU=[],qU=new n.Vector3,HU="+x+y";function WU(t){return Array.isArray(t)?t[0]:t}let YU=()=>{const t=new n.Mesh(new n.PlaneGeometry(1,1),UU);return YU=()=>t,t},XU=()=>{const t=new n.Mesh(new n.PlaneGeometry(1,1,32,1),UU);return XU=()=>t,t};const JU={type:"syncstart"},KU={type:"synccomplete"},ZU=["font","fontSize","fontStyle","fontWeight","lang","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],$U=ZU.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");class tQ extends n.Mesh{constructor(){super(new FU,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.unicodeFontsURL=null,this.fontSize=.1,this.fontWeight="normal",this.fontStyle="normal",this.lang=null,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=QU,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=HU,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(t){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(t):(this._isSyncing=!0,this.dispatchEvent(JU),BU({text:this.text,font:this.font,lang:this.lang,fontSize:this.fontSize||.1,fontWeight:this.fontWeight||"normal",fontStyle:this.fontStyle||"normal",letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF,unicodeFontsURL:this.unicodeFontsURL},(e=>{this._isSyncing=!1,this._textRenderInfo=e,this.geometry.updateGlyphs(e.glyphBounds,e.glyphAtlasIndices,e.blockBounds,e.chunkedBounds,e.glyphColors);const n=this._queuedSyncs;n&&(this._queuedSyncs=null,this._needsSync=!0,this.sync((()=>{n.forEach((t=>t&&t()))}))),this.dispatchEvent(KU),t&&t()}))))}onBeforeRender(t,e,n,r,i,o){this.sync(),i.isTroikaTextMaterial&&this._prepareForRender(i)}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}createDerivedMaterial(t){return function(t){const e=WF(t,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new n.Vector2},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new n.Vector4(0,0,0,0)},uTroikaClipRect:{value:new n.Vector4(0,0,0,0)},uTroikaEdgeOffset:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new n.Vector2},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new n.Color},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new n.Matrix3},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:"\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform vec4 uTroikaTotalBounds;\nuniform vec4 uTroikaClipRect;\nuniform mat3 uTroikaOrient;\nuniform bool uTroikaUseGlyphColors;\nuniform float uTroikaEdgeOffset;\nuniform float uTroikaBlurRadius;\nuniform vec2 uTroikaPositionOffset;\nuniform float uTroikaCurveRadius;\nattribute vec4 aTroikaGlyphBounds;\nattribute float aTroikaGlyphIndex;\nattribute vec3 aTroikaGlyphColor;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec3 vTroikaGlyphColor;\nvarying vec2 vTroikaGlyphDimensions;\n",vertexTransform:"\nvec4 bounds = aTroikaGlyphBounds;\nbounds.xz += uTroikaPositionOffset.x;\nbounds.yw -= uTroikaPositionOffset.y;\n\nvec4 outlineBounds = vec4(\n bounds.xy - uTroikaEdgeOffset - uTroikaBlurRadius,\n bounds.zw + uTroikaEdgeOffset + uTroikaBlurRadius\n);\nvec4 clippedBounds = vec4(\n clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw),\n clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw)\n);\n\nvec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy);\n\nposition.xy = mix(bounds.xy, bounds.zw, clippedXY);\n\nuv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy);\n\nfloat rad = uTroikaCurveRadius;\nif (rad != 0.0) {\n float angle = position.x / rad;\n position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad);\n normal.xz = vec2(sin(angle), cos(angle));\n}\n \nposition = uTroikaOrient * position;\nnormal = uTroikaOrient * normal;\n\nvTroikaGlyphUV = clippedXY.xy;\nvTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]);\n\n\nfloat txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize;\nvec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize;\nvec2 txStartUV = txUvPerSquare * vec2(\n mod(floor(aTroikaGlyphIndex / 4.0), txCols),\n floor(floor(aTroikaGlyphIndex / 4.0) / txCols)\n);\nvTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare);\nvTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0);\n",fragmentDefs:"\nuniform sampler2D uTroikaSDFTexture;\nuniform vec2 uTroikaSDFTextureSize;\nuniform float uTroikaSDFGlyphSize;\nuniform float uTroikaSDFExponent;\nuniform float uTroikaEdgeOffset;\nuniform float uTroikaFillOpacity;\nuniform float uTroikaBlurRadius;\nuniform vec3 uTroikaStrokeColor;\nuniform float uTroikaStrokeWidth;\nuniform float uTroikaStrokeOpacity;\nuniform bool uTroikaSDFDebug;\nvarying vec2 vTroikaGlyphUV;\nvarying vec4 vTroikaTextureUVBounds;\nvarying float vTroikaTextureChannel;\nvarying vec2 vTroikaGlyphDimensions;\n\nfloat troikaSdfValueToSignedDistance(float alpha) {\n // Inverse of exponential encoding in webgl-sdf-generator\n \n float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y);\n float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension;\n float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0);\n return signedDist;\n}\n\nfloat troikaGlyphUvToSdfValue(vec2 glyphUV) {\n vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV);\n vec4 rgba = texture2D(uTroikaSDFTexture, textureUV);\n float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1\n return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a;\n}\n\nfloat troikaGlyphUvToDistance(vec2 uv) {\n return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv));\n}\n\nfloat troikaGetAADist() {\n \n #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300\n return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5;\n #else\n return vTroikaGlyphDimensions.x / 64.0;\n #endif\n}\n\nfloat troikaGetFragDistValue() {\n vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize);\n float distance = troikaGlyphUvToDistance(clampedGlyphUV);\n \n // Extrapolate distance when outside bounds:\n distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : \n length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions);\n\n \n\n return distance;\n}\n\nfloat troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) {\n #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL)\n float alpha = step(-distanceOffset, -distance);\n #else\n\n float alpha = smoothstep(\n distanceOffset + aaDist,\n distanceOffset - aaDist,\n distance\n );\n #endif\n\n return alpha;\n}\n",fragmentColorTransform:"\nfloat aaDist = troikaGetAADist();\nfloat fragDistance = troikaGetFragDistValue();\nfloat edgeAlpha = uTroikaSDFDebug ?\n troikaGlyphUvToSdfValue(vTroikaGlyphUV) :\n troikaGetEdgeAlpha(fragDistance, uTroikaEdgeOffset, max(aaDist, uTroikaBlurRadius));\n\n#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL)\nvec4 fillRGBA = gl_FragColor;\nfillRGBA.a *= uTroikaFillOpacity;\nvec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity);\nif (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb;\ngl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep(\n -uTroikaStrokeWidth - aaDist,\n -uTroikaStrokeWidth + aaDist,\n fragDistance\n));\ngl_FragColor.a *= edgeAlpha;\n#endif\n\nif (edgeAlpha == 0.0) {\n discard;\n}\n",customRewriter({vertexShader:t,fragmentShader:e}){let n=/\buniform\s+vec3\s+diffuse\b/;return n.test(e)&&(e=e.replace(n,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),n.test(t)||(t=t.replace(UF,"uniform vec3 diffuse;\n$&\nvTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse;\n"))),{vertexShader:t,fragmentShader:e}}});return e.transparent=!0,e.forceSinglePass=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}(t)}get material(){let t=this._derivedMaterial;const e=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=UU.clone());if(t&&t.isDerivedFrom(e)||(t=this._derivedMaterial=this.createDerivedMaterial(e),e.addEventListener("dispose",(function n(){e.removeEventListener("dispose",n),t.dispose()}))),this.hasOutline()){let e=t._outlineMtl;return e||(e=t._outlineMtl=Object.create(t,{id:{value:t.id+.1}}),e.isTextOutlineMaterial=!0,e.depthWrite=!1,e.map=null,t.addEventListener("dispose",(function n(){t.removeEventListener("dispose",n),e.dispose()}))),[e,t]}return t}set material(t){t&&t.isTroikaTextMaterial?(this._derivedMaterial=t,this._baseMaterial=t.baseMaterial):this._baseMaterial=t}hasOutline(){return!!(this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY)}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(t){this.geometry.detail=t}get curveRadius(){return this.geometry.curveRadius}set curveRadius(t){this.geometry.curveRadius=t}get customDepthMaterial(){return WU(this.material).getDepthMaterial()}set customDepthMaterial(t){}get customDistanceMaterial(){return WU(this.material).getDistanceMaterial()}set customDistanceMaterial(t){}_prepareForRender(t){const e=t.isTextOutlineMaterial,r=t.uniforms,i=this.textRenderInfo;if(i){const{sdfTexture:t,blockBounds:n}=i;r.uTroikaSDFTexture.value=t,r.uTroikaSDFTextureSize.value.set(t.image.width,t.image.height),r.uTroikaSDFGlyphSize.value=i.sdfGlyphSize,r.uTroikaSDFExponent.value=i.sdfExponent,r.uTroikaTotalBounds.value.fromArray(n),r.uTroikaUseGlyphColors.value=!e&&!!i.glyphColors;let o,s,a,u=0,l=0,h=0,c=0,f=0;if(e){let{outlineWidth:t,outlineOffsetX:e,outlineOffsetY:n,outlineBlur:r,outlineOpacity:i}=this;u=this._parsePercent(t)||0,l=Math.max(0,this._parsePercent(r)||0),o=i,c=this._parsePercent(e)||0,f=this._parsePercent(n)||0}else h=Math.max(0,this._parsePercent(this.strokeWidth)||0),h&&(a=this.strokeColor,r.uTroikaStrokeColor.value.set(null==a?QU:a),s=this.strokeOpacity,null==s&&(s=1)),o=this.fillOpacity;r.uTroikaEdgeOffset.value=u,r.uTroikaPositionOffset.value.set(c,f),r.uTroikaBlurRadius.value=l,r.uTroikaStrokeWidth.value=h,r.uTroikaStrokeOpacity.value=s,r.uTroikaFillOpacity.value=null==o?1:o,r.uTroikaCurveRadius.value=this.curveRadius||0;let p=this.clipRect;if(p&&Array.isArray(p)&&4===p.length)r.uTroikaClipRect.value.fromArray(p);else{const t=100*(this.fontSize||.1);r.uTroikaClipRect.value.set(n[0]-t,n[1]-t,n[2]+t,n[3]+t)}this.geometry.applyClipRect(r.uTroikaClipRect.value)}r.uTroikaSDFDebug.value=!!this.debugSDF,t.polygonOffset=!!this.depthOffset,t.polygonOffsetFactor=t.polygonOffsetUnits=this.depthOffset||0;const o=e?this.outlineColor||0:this.color;if(null==o)delete t.color;else{const e=t.hasOwnProperty("color")?t.color:t.color=new n.Color;o===e._input&&"object"!=typeof o||e.set(e._input=o)}let s=this.orientation||HU;if(s!==t._orientation){let e=r.uTroikaOrient.value;s=s.replace(/[^-+xyz]/g,"");let n=s!==HU&&s.match(/^([-+])([xyz])([-+])([xyz])$/);if(n){let[,t,r,i,o]=n;zU.set(0,0,0)[r]="-"===t?1:-1,jU.set(0,0,0)[o]="-"===i?-1:1,GU.lookAt(qU,zU.cross(jU),jU),e.setFromMatrix4(GU)}else e.identity();t._orientation=s}}_parsePercent(t){if("string"==typeof t){let e=t.match(/^(-?[\d.]+)%$/),n=e?parseFloat(e[1]):NaN;t=(isNaN(n)?0:n/100)*this.fontSize}return t}localPositionToTextCoords(t,e=new n.Vector2){e.copy(t);const r=this.curveRadius;return r&&(e.x=Math.atan2(t.x,Math.abs(r)-Math.abs(t.z))*Math.abs(r)),e}worldPositionToTextCoords(t,e=new n.Vector2){return zU.copy(t),this.localPositionToTextCoords(this.worldToLocal(zU),e)}raycast(t,e){const{textRenderInfo:n,curveRadius:r}=this;if(n){const i=n.blockBounds,o=r?XU():YU(),s=o.geometry,{position:a,uv:u}=s.attributes;for(let t=0;t<u.count;t++){let e=i[0]+u.getX(t)*(i[2]-i[0]);const n=i[1]+u.getY(t)*(i[3]-i[1]);let o=0;r&&(o=r-Math.cos(e/r)*r,e=Math.sin(e/r)*r),a.setXYZ(t,e,n,o)}s.boundingSphere=this.geometry.boundingSphere,s.boundingBox=this.geometry.boundingBox,o.matrixWorld=this.matrixWorld,o.material.side=this.material.side,VU.length=0,o.raycast(t,VU);for(let t=0;t<VU.length;t++)VU[t].object=this,e.push(VU[t])}}copy(t){const e=this.geometry;return super.copy(t),this.geometry=e,$U.forEach((e=>{this[e]=t[e]})),this}clone(){return(new this.constructor).copy(this)}}ZU.forEach((t=>{const e="_private_"+t;Object.defineProperty(tQ.prototype,t,{get(){return this[e]},set(t){t!==this[e]&&(this[e]=t,this._needsSync=!0)}})})),new n.Box3,new n.Color;var eQ={altitude:0,height:0,interactive:!1};W.prototype._createSDFText=function(){return this.object3d=new tQ,this.object3d.__parent=this,this};var nQ=function(t){function e(t,n,r,o){var s;h(this,e),r=i.Util.extend({},eQ,r,{layer:o}),s=l(this,e);var a=r.altitude;s._initOptions(r),console.log(r,"fffffffff"),s._createSDFText(),s.getObject3d().text=r.text,s.getObject3d().fontSize=r.fontSize,s.getObject3d().color=r.color,s.getObject3d().letterSpacing=r.letterSpacing||0,s.getObject3d().textAlign="center",s.getObject3d().anchorX=r.anchorX||"center",s.getObject3d().anchorY=r.anchorY||"middle",s.getObject3d().renderOrder=r.renderOrder,s.getObject3d().material=n,s.getObject3d().font=r.fontfile;var u=o.distanceToVector3(a,a).x,c=o.coordinateToVector3(t,u);return s.getObject3d().position.copy(c),s}return m(e,t),p(e)}(W),rQ=function(){return p((function t(e,n,r){var i=this;h(this,t),0!=e.length?(this.map=r.map,this.threeLayer=r,this.textWidth=n.textWidth||40,this.textHeight=n.textHeight||40,this.beginSizeZoom=n.beginSizeZoom||3,this.endSizeZoom=n.endSizeZoom||12,this.spanSizeZoom=this.endSizeZoom-this.beginSizeZoom,this.stepSize=1/(this.endSizeZoom-this.beginSizeZoom+1),this.textDx=n.textDx||0,this.textDy=n.textDy||0,this.anchorX=n.anchorX,this.anchorY=n.anchorY,this.minZoom=n.pointMinZoom||3,this.maxZoom=n.pointMaxZoom||20,this.fontSize=n.fontSize||.4,this.letterSpacing=n.letterSpacing||0,this.textField=n.textField,this.altitude=n.altitude,this.zoomChangeCallback=n.zoomChangeCallback,this.meshs=[],this.m=this.createBillboardMaterial(new o.MeshBasicMaterial),console.log(e,"77777777777777"),e.forEach((function(t){if(t[i.textField]){console.log(t);var e=new nQ([t.longitude,t.latitude],i.m,{minZoom:i.minZoom,maxZoom:i.maxZoom,text:t[i.textField],color:t.color||"#fff",renderOrder:n.pointOrder||5,fontSize:i.fontSize,letterSpacing:i.letterSpacing,altitude:i.altitude,anchorX:i.anchorX,anchorY:i.anchorY},r);e.zoomChange=function(){i.m.uniforms.cameraToCenterDistance.value=i.map.cameraToCenterDistance,i.m.uniforms.zoomScale.value=76.43702828517625/i.map.getResolution();var t=i._getRate();i.m.uniforms.size.value=[i.textWidth*t,i.textHeight*t],i.m.uniforms.xyOffset.value=[i.textDx*t,i.textDy*t],i.zoomChangeCallback&&i.zoomChangeCallback(e)},i.meshs.push(e)}})),this.dataItems=e,r.addMesh(this.meshs),this._bindMapEvents()):console.error("需要绘制的点位数量为0")}),[{key:"createBillboardMaterial",value:function(t,e){return WF(t,Object.assign({uniforms:{canvasSize:{value:[this.map.width,this.map.height]},cameraToCenterDistance:{type:"f",value:this.map.cameraToCenterDistance},zoomScale:{type:"f",value:76.43702828517625/this.map.getResolution()},size:{value:[this.textWidth*this._getRate(),this.textHeight*this._getRate()]},xyOffset:{value:[this.textDx*this._getRate(),this.textDy*this._getRate()]}},vertexDefs:"\n uniform vec2 canvasSize;\n uniform float cameraToCenterDistance;\n uniform float zoomScale;\n uniform vec2 size;\n uniform vec2 xyOffset;\n ",vertexMainOutro:"\n\n vec2 iconSize = vec2(24, 24);\n vec3 c = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);\n float k = gl_Position.w;\n float l = (1. - cameraToCenterDistance / k);\n float m = clamp(.5 + .5 * (1. - l), .0, 4.);\n vec2 A = position.xy;\n A = A * size;\n \n vec2 B = A * 2. / canvasSize;\n gl_Position.xy += B * m * k;\n\n //float C = k / cameraToCenterDistance;\n //vec2 B = A;\n //gl_Position = projectionMatrix * modelViewMatrix * vec4(vec3(B, .0) / zoomScale * C * m, 1.);\n\n\n gl_Position.xy += xyOffset * 2. / canvasSize * k;\n "},e))}},{key:"_getRate",value:function(){var t=this.map.getZoom()-this.beginSizeZoom;return(t=t>this.spanSizeZoom?this.spanSizeZoom:t)*this.stepSize+this.stepSize}},{key:"_bindMapEvents",value:function(){this.map.on("pitch",this._setSizeOn,this)}},{key:"_setSizeOn",value:function(){this.m.uniforms.cameraToCenterDistance.value=this.map.cameraToCenterDistance}},{key:"show",value:function(){this.meshs.forEach((function(t){t.show()}))}},{key:"hide",value:function(){this.meshs.forEach((function(t){t.hide()}))}},{key:"pointShowHideByCode",value:function(t,e,n){for(var r=1/0,o=1/0,s=-1/0,a=-1/0,u=0;u<this.dataItems.length;u++){var l=this.dataItems[u];t.includes(l.code)?(r=Math.min(r,this.dataItems[u].longitude),o=Math.min(o,this.dataItems[u].latitude),s=Math.max(s,this.dataItems[u].longitude),a=Math.max(a,this.dataItems[u].latitude),l.visibility=1):l.visibility=.1}this.updateByVisibility(),e&&this.map.fitExtent(new i.Extent(r,o,s,a),n||0)}},{key:"updateByVisibility",value:function(){var t=this;this.meshs.forEach((function(e,n){.1===t.dataItems[n].visibility?e.hide():e.show()}))}},{key:"dispose",value:function(){var t,e=this;this.meshs.forEach((function(t){e.threeLayer.removeMesh(t),t.object3d.dispose()})),null===(t=this.m)||void 0===t||t.dispose()}}],[{key:"preloadFont",value:function(t){return new Promise((function(t){!function({font:t,characters:e,sdfGlyphSize:n},r){BU({font:t,sdfGlyphSize:n,text:Array.isArray(e)?e.join("\n"):""+e},r)}({font:"/NotoSerifSC-Regular.otf"},(function(){t()}))}))}}])}(),iQ="__webglFramebuffer",oQ=new o.Vector4,sQ={bloom:!0},aQ=1*o.REVISION>154?Math.PI:1;function uQ(t,e){if(t){t.layers&&t.layers.set(e);var n=t.children;if(n&&n.length)for(var r=0,i=n.length;r<i;r++)uQ(n[r],e)}}Po.prototype.renderScene=function(t){if(this.layer._callbackBaseObjectAnimation(),this._syncCamera(),t&&t.renderTarget){var e=t.renderTarget.fbo,n=e.width,r=e.height;this._renderTarget?(this._renderTarget.viewport.set(0,0,n,r),this._renderTarget.scissor.set(0,0,n,r)):(this._renderTarget=new o.WebGLRenderTarget(n,r,{depthBuffer:!1}),this.context.setRenderTarget(this._renderTarget),this.context.render(this.scene,this.camera));var i=this.context.properties.get(this._renderTarget),s=i[iQ];i[iQ]=t.renderTarget.getFramebuffer(t.renderTarget.fbo),this.context.setRenderTarget(this._renderTarget);var a=1===t.bloom&&t.sceneFilter,u=this.scene.children||[],l=!1;if(a){var h=t.sceneFilter;l=h(sQ);for(var c=0,f=u.length;c<f;c++)if(u[c]&&u[c].layers){var p=u[c].__parent;u[c].bloom=!1,p&&(u[c].bloom=p.bloom);var d=0;(u[c]&&h(u[c])||!p)&&(u[c].customType||l&&(d=1)),u[c].__layer!==d&&(uQ(u[c],d),u[c].__layer=d)}}else for(var g=0,y=u.length;g<y;g++)u[g]&&u[g].layers&&0!==u[g].__layer&&(uQ(u[g],0),u[g].__layer=0);this.camera.layers.set(l?1:0),this.context.render(this.scene,this.camera),i[iQ]=s}else{var v=this.canvas,m=v.width,A=v.height,_=this.context.getViewport(oQ);_.width===m&&_.height===A||this.context.setViewport(0,0,m,A),this.context.render(this.scene,this.camera),this.layer.updateComposer()}this.context.setRenderTarget(null),this.completeRender()},To.prototype.initEnvironment=function(t){var e=this.getScene(),n=(new DF).load(t,(function(){n.mapping=o.EquirectangularReflectionMapping,e.environment=n}))},To.prototype.initBloom=function(){var t=this.getThreeRenderer(),e=this.getScene(),n=this.getCamera();this.composer=new NN(t,{frameBufferType:o.HalfFloatType}),this.composer.addPass(new AF(e,n))},To.prototype.delComposer=function(){var t;null===(t=this.composer)||void 0===t||t.dispose()},To.prototype.updateComposer=function(){var t;null===(t=this.composer)||void 0===t||t.render()},To.prototype.getComposer=function(){return this.composer},To.prototype._recursionMesh=function(t){for(;t&&t.parent!==this.getScene()&&!t.parent.customType;)t=t.parent;return t},To.prototype.identify=function(t,e){var n=this;if(!t)return console.error("coordinate is null,it should be Coordinate"),[];if(Array.isArray(t)&&(t=new i.Coordinate(t)),!(t instanceof i.Coordinate))return console.error("coordinate type is error,it should be Coordinate"),[];var r=this.getMap().coordToContainerPoint(t);this._containerPoint=r;var s=r.x,a=r.y;this._initRaycaster(),this.fire("identify",{coordinate:t,options:e});var u=this._raycaster,l=this._mouse,h=this.getCamera(),c=this.getScene(),f=this.getMap().getSize();if(!c)return[];var p=f.width,d=f.height;l.x=s/p*2-1,l.y=-a/d*2+1,u.setFromCamera(l,h),u.layers&&u.layers.enableAll&&u.layers.enableAll(),function(t,e){t.linePrecision=e}(u,this._getLinePrecision(this.getMap().getResolution()));var g=[],y=[];c.children.forEach((function(t){var e=t.__parent;if(e&&e.getOptions){var n=e;n.getOptions().interactive&&n.isVisible()&&(n.identify&&i.Util.isFunction(n.identify)?y.push(n):g.push(t))}else(t instanceof o.Mesh||t instanceof o.Group)&&t.customType&&t.children.forEach((function(t){var e=t.__parent;if(e&&e.getOptions){var n=e;n.getOptions().interactive&&n.isVisible()&&(n.identify&&i.Util.isFunction(n.identify)?y.push(n):g.push(t))}}))}));var v=[],m=u.intersectObjects(g,!0);m&&Array.isArray(m)&&m.length&&(v=m.map((function(t){var e=t.object,r=t.instanceId,o=(e=n._recursionMesh(e)||{}).__parent||e;return o.faceIndex=t.faceIndex,o.index=t.index,o.intersect=t,i.Util.isNumber(r)&&(o.instanceId=r),o}))),this.renderPickScene(),y.length&&y.forEach((function(e){e.identify(t)&&v.push(e)}));for(var A=v.length,_=0;_<A;_++)if(v[_])for(var x=_+1;x<A;x++)v[_]===v[x]&&v.splice(x,1);var w=(e=i.Util.extend({},e)).count;return v.sort((function(t,e){return e.object3d.renderOrder-t.object3d.renderOrder})),i.Util.isNumber(w)&&w>0?v.slice(0,w):v},To.prototype._zoomend=function(){var t=this.getScene();if(t){var e=this.getMap().getZoom();t.children.forEach((function(t){if(t.customType)t.children.forEach((function(t){var n=t.__parent;if(n&&n.getOptions){var r=n;r.zoomChange&&i.Util.isFunction(r.zoomChange)&&r.zoomChange(e);var o=r.getMinZoom(),s=r.getMaxZoom();e<o||e>s?(r.isVisible()&&(r.getObject3d().visible=!1),r._zoomVisible=!1):o<=e&&e<=s&&(r._visible&&(r.getObject3d().visible=!0),r._zoomVisible=!0)}}));else{var n=t.__parent;if(n&&n.getOptions){var r=n;r.zoomChange&&i.Util.isFunction(r.zoomChange)&&r.zoomChange(e);var o=r.getMinZoom(),s=r.getMaxZoom();e<o||e>s?(r.isVisible()&&(r.getObject3d().visible=!1),r._zoomVisible=!1):o<=e&&e<=s&&(r._visible&&(r.getObject3d().visible=!0),r._zoomVisible=!0)}}}))}},To.prototype.addMesh1=function(t,e){var n=this,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t)return this;Array.isArray(t)||(t=[t]);var i=this.getScene(),o=void 0;if(e&&(o=i.getObjectByProperty("customId",e)),t.forEach((function(t){if(t instanceof W){var e;if(o)o.add(t.getObject3d());else console.log("组不存在,销毁创建的对象"),null===(e=t.parent)||void 0===e||e.dispose();t.isAdd||(t.isAdd=!0,t.options.layer=n,t._fire("add",{target:t}))}})),this._zoomend(),r){var s=this._getRenderer();s&&s.setToRedraw()}return this},To.prototype.removeMesh1=function(t,e){var n=this,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t)return this;Array.isArray(t)||(t=[t]);var s=this.getScene(),a=s.getObjectByProperty("customId",e);if(t.forEach((function(t){if(t instanceof W){a?a.remove(t.getObject3d()):s.remove(t.getObject3d()),t.isAdd&&(t.isAdd=!1,t._fire("remove",{target:t})),t._animation&&i.Util.isFunction(t._animation)&&delete n._animationBaseObjectMap[t.getObject3d().uuid];var e=n._delayMeshes;if(e.length)for(var r=0,u=e.length;r<u;r++)if(e[r]===t){e.splice(r,1);break}}else t instanceof o.Object3D&&s.remove(t)})),r){var u=this._getRenderer();u&&u.setToRedraw()}return this};var lQ=function(){return p((function t(e,n,r){var i=this;h(this,t),this.map=n,this.animationId=null,this.updatables=[];var s=XC();this.threeLayer=new To(s,{forceRenderOnMoving:!0,forceRenderOnRotating:!0,identifyCountOnEvent:1}),this.clock=new o.Clock;var a=function(){i.threeLayer._needsUpdate=!i.threeLayer._needsUpdate,i.threeLayer._needsUpdate&&i.threeLayer.redraw();var t,e=i.clock.getDelta(),n=d(i.updatables);try{for(n.s();!(t=n.n()).done;){t.value.tick(e)}}catch(t){n.e(t)}finally{n.f()}i.statsFlag&&i.stats.update(),i.animationId=requestAnimationFrame(a)};this.threeLayer.prepareToDraw=function(t,e,n){var r=new o.DirectionalLight(16777215);r.position.set(0,-10,10).normalize(),e.add(r),a()},null!=r&&r.groupLayer?this.threeLayer.addTo(r.groupLayer):this.threeLayer.addTo(n),this.groupLayer=null==r?void 0:r.groupLayer,this.layerId=s,this.layerName=e,this.dirty=!1,this.initFlag=!1,this.bloomFlag=(null==r?void 0:r.bloomFlag)||!1,this.bloomStrength=null==r?void 0:r.bloomStrength,this.bloomThreshold=null==r?void 0:r.bloomThreshold,this.bloomRadius=null==r?void 0:r.bloomRadius,this.hdrPath=null==r?void 0:r.hdrPath,this.ambientLightIntensity=(null==r?void 0:r.ambientLightIntensity)||1,this.stats=new kF,this.stats.dom.style.display="none",document.body.appendChild(this.stats.dom),this.statsFlag=!1}),[{key:"createGroup",value:(t=u(w().mark((function t(e){return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.threeLayer.getScene()){t.next=4;break}return t.abrupt("return",this.getIdByName(this.threeLayer.getScene(),e));case 4:if(!0!==this.initFlag){t.next=10;break}return t.next=7,JC(200);case 7:case 13:return t.abrupt("return",this.getIdByName(this.threeLayer.getScene(),e));case 10:return this.initFlag=!0,t.next=13,this.prepareToDraw();case 14:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})},{key:"removeGroup",value:function(t){if(this.threeLayer.getScene()){var e=this.threeLayer.getScene().getObjectByName(t);this.threeLayer.getScene().remove(e)}}},{key:"getIdByName",value:function(t,e){var n=t.getObjectByName(e);return n||(n=new mD(t,e)),n.customId}},{key:"setGroupVisible",value:function(t,e){this.threeLayer.getScene().getObjectByProperty("customId",t).visible=e}},{key:"getLayerId",value:function(){return this.layerId}},{key:"changeLayerId",value:function(){if(this.threeLayer){var t=XC();this.threeLayer.setId(t),this.layerId=t}}},{key:"setVisible",value:function(t,e){this.threeLayer&&(!0===t?(this.threeLayer.show(),e&&e()):(this.threeLayer.hide(),e&&e()))}},{key:"prepareToDraw",value:function(){var t=this,e=function(){t.threeLayer._needsUpdate=!t.threeLayer._needsUpdate,t.threeLayer._needsUpdate&&t.threeLayer.redraw();var n,r=t.clock.getDelta(),i=d(t.updatables);try{for(i.s();!(n=i.n()).done;){n.value.tick(r)}}catch(t){i.e(t)}finally{i.f()}t.statsFlag&&t.stats.update(),t.animationId=requestAnimationFrame(e)};return new Promise((function(n){var r=t;t.threeLayer.prepareToDraw=function(t,i,s){r.hdrPath&&this.initEnvironment(r.hdrPath);var a=new o.DirectionalLight(16777215,1*aQ);a.position.set(0,-10,10).normalize(),i.add(a),i.add(new o.AmbientLight(16777215,r.ambientLightIntensity*aQ)),e(),this.initBloom(),n()}}))}},{key:"drawRadar",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new xS(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new xS(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawRadar1",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new wS(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new wS(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawRadar2",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new bS(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new bS(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawRadar3",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new ES(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new ES(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawSector",value:function(t,e,n,r){var i=this;return new Promise((function(o){if(i.threeLayer.getScene()){var s=new SS(t,e,n||{},i.threeLayer,r);o(s)}else i.initFlag=!0,i.prepareToDraw().then((function(){var s=new SS(t,e,n||{},i.threeLayer,r);o(s)}))}))}},{key:"drawRing",value:function(t,e,n,r,i){var o=this;return new Promise((function(s){if(o.threeLayer.getScene()){var a=new FF(t,e,n,r||{},o.threeLayer,i);s(a)}else o.initFlag=!0,o.prepareToDraw().then((function(){var a=new FF(t,e,n,r||{},o.threeLayer,i);s(a)}))}))}},{key:"drawSectorImg",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new kS(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new kS(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawImage",value:function(t,e,n,r,i){var o=this;return new Promise((function(s){if(o.threeLayer.getScene()){var a=new mS(t,e,n,r,o.threeLayer,i);s(a)}else o.initFlag=!0,o.prepareToDraw().then((function(){var a=new mS(t,e,n,r,o.threeLayer,i);s(a)}))}))}},{key:"drawShock",value:function(t,e){var n=this;return new Promise((function(r){if(n.threeLayer.getScene()){var i=new RS(t,e||{},n.threeLayer,n);r(i)}else n.initFlag=!0,n.prepareToDraw().then((function(){var i=new RS(t,e||{},n.threeLayer,n);r(i)}))}))}},{key:"drawPoybyHeight",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new RF(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new RF(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"drawSdfText",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=null;t.length>0?o=new rQ(t,e,r.threeLayer,n):i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=null;t.length>0?o=new rQ(t,e,r.threeLayer,n):i(o)}))}))}},{key:"drawPlaneMarker",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=null;t.length>0?(o=new ZS(t,e,r.threeLayer,n)).addPoint().then((function(){i(o)})):i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=null;t.length>0?(o=new ZS(t,e,r.threeLayer,n)).addPoint().then((function(){i(o)})):i(o)}))}))}},{key:"draw3dtiles",value:function(t,e){var n=this;return new Promise((function(r){if(n.threeLayer.getScene()){var i=new dD(t,e,n.threeLayer,n);r(i)}else n.initFlag=!0,n.prepareToDraw().then((function(){var i=new dD(t,e,n.threeLayer,n);r(i)}))}))}},{key:"createGltfLoadTool",value:function(t){var e=this;return new Promise((function(n){if(e.threeLayer.getScene()){var r=new vD(t,e.threeLayer);n(r)}else e.initFlag=!0,e.prepareToDraw().then((function(){var r=new vD(t,e.threeLayer);n(r)}))}))}},{key:"drawFbxModel",value:function(t,e,n,r){var i=this;return new Promise((function(o){if(i.threeLayer.getScene()){var s=new vO(t,e,n,i.threeLayer,r);o(s)}else i.initFlag=!0,i.prepareToDraw().then((function(){var s=new vO(t,e,n,i.threeLayer,r);o(s)}))}))}},{key:"drawRippleWall",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new _O(t,e||{},r.threeLayer,n,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new _O(t,e||{},r.threeLayer,n,r);i(o)}))}))}},{key:"drawWall",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new xO(t,e||{},r.threeLayer,n,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new xO(t,e||{},r.threeLayer,n,r);i(o)}))}))}},{key:"drawRippleWallImg",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new wO(t,e||{},r.threeLayer,n,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new wO(t,e||{},r.threeLayer,n,r);i(o)}))}))}},{key:"drawBloomLine",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new IN(t,e,r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new IN(t,e,r.threeLayer,n);i(o)}))}))}},{key:"createBloomClass",value:function(t){var e=this;return new Promise((function(n){if(e.threeLayer.getScene()){var r=new BF(e.threeLayer,t);n(r)}else e.initFlag=!0,e.prepareToDraw().then((function(){var r=new BF(e.threeLayer,t);n(r)}))}))}},{key:"createOutlineBloom",value:function(t){var e=this;return new Promise((function(n){if(e.threeLayer.getScene()){var r=new TF(e.threeLayer,t);n(r)}else e.initFlag=!0,e.prepareToDraw().then((function(){var r=new TF(e.threeLayer,t);n(r)}))}))}},{key:"drawPolyline",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new CO(t,e,r.threeLayer,n);o.addLine().then((function(){i(o)}))}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new CO(t,e,r.threeLayer,n);o.addLine().then((function(){i(o)}))}))}))}},{key:"drawPolygon",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new mN(t,e,r.threeLayer,n);o.generatePolygon().then((function(){i(o)}))}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new mN(t,e,r.threeLayer,n);lineObject.generatePolygon().then((function(){i(o)}))}))}))}},{key:"drawExtrudePolygon",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new xN(t,e,r.threeLayer,n);o.generatePolygon().then((function(){i(o)}))}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new xN(t,e,r.threeLayer,n);lineObject.generatePolygon().then((function(){i(o)}))}))}))}},{key:"drawLinePlane",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new BO(t,e,r.threeLayer,n,r);o.addLine().then((function(){i(o)}))}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new BO(t,e,r.threeLayer,n,r);o.addLine().then((function(){i(o)}))}))}))}},{key:"drawVerticalFatLine",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new ZO(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new ZO(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"drawTube",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new iN(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new iN(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"drawPlaneGif",value:function(t,e,n,r,i){var o=this;return new Promise((function(s){if(o.threeLayer.getScene()){var a=new eN(t,e,n,r||{},o.threeLayer,o,i);s(a)}else o.initFlag=!0,o.prepareToDraw().then((function(){var a=new eN(t,e,n,r||{},o.threeLayer,o,i);s(a)}))}))}},{key:"drawTripHeight",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new lN(t,e||{},r.threeLayer,r,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new lN(t,e||{},r.threeLayer,r,n);i(o)}))}))}},{key:"drawTripHeight1",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new hN(t,e||{},r.threeLayer,r,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new hN(t,e||{},r.threeLayer,r,n);i(o)}))}))}},{key:"drawTripLine",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new cN(t,e||{},r.threeLayer,r,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new cN(t,e||{},r.threeLayer,r,n);i(o)}))}))}},{key:"drawTripLine1",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new fN(t,e||{},r.threeLayer,r,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new fN(t,e||{},r.threeLayer,r,n);i(o)}))}))}},{key:"drawArrow2D",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new EN(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new EN(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"setStateFlag",value:function(){this.statsFlag=!this.statsFlag,this.statsFlag?this.stats.dom.style.display="":this.stats.dom.style.display="none"}},{key:"dispose",value:function(){this.animationId&&cancelAnimationFrame(this.animationId);var t=this.threeLayer.getMeshes();this.threeLayer.delComposer(),this.threeLayer.clear(),t.forEach((function(t){}));var e=this.threeLayer.getCamera(),n=this.threeLayer.getScene(),r=this.threeLayer.getPick(),i=r.pickingTexture;r.pickingScene;var o=this.threeLayer.getRenderer();n.remove(e),e=null,n=null,i.dispose(),i=null,this.groupLayer?this.groupLayer.removeLayer(this.threeLayer):(o.context.dispose(),o.context.forceContextLoss(),o.context=null,o.remove(),o=null,this.map.removeLayer(this.threeLayer))}}]);var t}(),hQ=function(){return p((function t(e,n){var r=this;h(this,t),this.map=n,this.animationId=null,this.updatables=[];var i=XC();this.threeLayer=new To(i,{forceRenderOnMoving:!0,forceRenderOnRotating:!0,identifyCountOnEvent:1}),this.clock=new o.Clock;var s=function(){var t;(r.threeLayer._needsUpdate=!r.threeLayer._needsUpdate,r.threeLayer._needsUpdate)&&(null===(t=r.threeLayer)||void 0===t||null===(t=t.getRenderer())||void 0===t||t.clearCanvas(),r.threeLayer.renderScene());var e,n=r.clock.getDelta(),i=d(r.updatables);try{for(i.s();!(e=i.n()).done;){e.value.tick(n)}}catch(t){i.e(t)}finally{i.f()}r.animationId=requestAnimationFrame(s)};this.threeLayer.prepareToDraw=function(t,e,n){var r=new o.DirectionalLight(16777215);r.position.set(0,-10,10).normalize(),e.add(r),s()},this.threeLayer.addTo(n),this.layerId=i,this.layerName=e,this.dirty=!1,this.initFlag=!1}),[{key:"createGroup",value:(t=u(w().mark((function t(e){return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.threeLayer.getScene()){t.next=4;break}return t.abrupt("return",this.getIdByName(this.threeLayer.getScene(),e));case 4:if(!0!==this.initFlag){t.next=10;break}return t.next=7,JC(200);case 7:case 13:return t.abrupt("return",this.getIdByName(this.threeLayer.getScene(),e));case 10:return this.initFlag=!0,t.next=13,this.prepareToDraw();case 14:case"end":return t.stop()}}),t,this)}))),function(e){return t.apply(this,arguments)})},{key:"removeGroup",value:function(t){if(this.threeLayer.getScene()){var e=this.threeLayer.getScene().getObjectByName(t);this.threeLayer.getScene().remove(e)}}},{key:"getIdByName",value:function(t,e){var n=t.getObjectByName(e);return n||(n=new mD(t,e)),n.customId}},{key:"setGroupVisible",value:function(t,e){this.threeLayer.getScene().getObjectByProperty("customId",t).visible=e}},{key:"getLayerId",value:function(){return this.layerId}},{key:"changeLayerId",value:function(){if(this.threeLayer){var t=XC();this.threeLayer.setId(t),this.layerId=t}}},{key:"setVisible",value:function(t,e){this.threeLayer&&(!0===t?(this.threeLayer.show(),e&&e()):(this.threeLayer.hide(),e&&e()))}},{key:"prepareToDraw",value:function(){var t=this,e=function(){var n;(t.threeLayer._needsUpdate=!t.threeLayer._needsUpdate,t.threeLayer._needsUpdate)&&(null===(n=t.threeLayer)||void 0===n||null===(n=n.getRenderer())||void 0===n||n.clearCanvas(),t.threeLayer.renderScene());var r,i=t.clock.getDelta(),o=d(t.updatables);try{for(o.s();!(r=o.n()).done;){r.value.tick(i)}}catch(t){o.e(t)}finally{o.f()}t.animationId=requestAnimationFrame(e)};return new Promise((function(n){t.threeLayer.prepareToDraw=function(t,r,i){var s=new o.DirectionalLight(16777215);s.position.set(0,-10,10).normalize(),r.add(s),r.add(new o.AmbientLight(16777215)),e(),n()}}))}},{key:"drawRadar",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new xS(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new xS(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawSector",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new SS(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new SS(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawSectorImg",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new kS(t,e,n||{},r.threeLayer,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new kS(t,e,n||{},r.threeLayer,r);i(o)}))}))}},{key:"drawImage",value:function(t,e,n,r,i){var o=this;return new Promise((function(s){if(o.threeLayer.getScene()){var a=new mS(t,e,n,r,o.threeLayer,i);s(a)}else o.initFlag=!0,o.prepareToDraw().then((function(){var a=new mS(t,e,n,r,o.threeLayer,i);s(a)}))}))}},{key:"drawShock",value:function(t,e){var n=this;return new Promise((function(r){if(n.threeLayer.getScene()){var i=new RS(t,e||{},n.threeLayer,n);r(i)}else n.initFlag=!0,n.prepareToDraw().then((function(){var i=new RS(t,e||{},n.threeLayer,n);r(i)}))}))}},{key:"drawPlaneMarker",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=null;t.length>0?(o=new ZS(t,e,r.threeLayer,n)).addPoint().then((function(){i(o)})):i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=null;t.length>0?(o=new ZS(t,e,r.threeLayer,n)).addPoint().then((function(){i(o)})):i(o)}))}))}},{key:"draw3dtiles",value:function(t,e){var n=this;return new Promise((function(r){if(n.threeLayer.getScene()){var i=new dD(t,e,n.threeLayer,n);r(i)}else n.initFlag=!0,n.prepareToDraw().then((function(){var i=new dD(t,e,n.threeLayer,n);r(i)}))}))}},{key:"createGltfLoadTool",value:function(t){var e=this;return new Promise((function(n){if(e.threeLayer.getScene()){var r=new vD(t,e.threeLayer);n(r)}else e.initFlag=!0,e.prepareToDraw().then((function(){var r=new vD(t,e.threeLayer);n(r)}))}))}},{key:"drawFbxModel",value:function(t,e,n,r){var i=this;return new Promise((function(o){if(i.threeLayer.getScene()){var s=new vO(t,e,n,i.threeLayer,r);o(s)}else i.initFlag=!0,i.prepareToDraw().then((function(){var s=new vO(t,e,n,i.threeLayer,r);o(s)}))}))}},{key:"drawRippleWall",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new _O(t,e||{},r.threeLayer,n,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new _O(t,e||{},r.threeLayer,n,r);i(o)}))}))}},{key:"drawRippleWallImg",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new wO(t,e||{},r.threeLayer,n,r);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new wO(t,e||{},r.threeLayer,n,r);i(o)}))}))}},{key:"drawPolyline",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new CO(t,e,r.threeLayer,n);o.addLine().then((function(){i(o)}))}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new CO(t,e,r.threeLayer,n);o.addLine().then((function(){i(o)}))}))}))}},{key:"drawPolygon",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new mN(t,e,r.threeLayer,n);o.generatePolygon().then((function(){i(o)}))}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new mN(t,e,r.threeLayer,n);lineObject.generatePolygon().then((function(){i(o)}))}))}))}},{key:"drawLinePlane",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new BO(t,e,r.threeLayer,n,r);o.addLine().then((function(){i(o)}))}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new BO(t,e,r.threeLayer,n,r);o.addLine().then((function(){i(o)}))}))}))}},{key:"drawVerticalFatLine",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new ZO(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new ZO(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"drawTube",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new iN(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new iN(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"drawPlaneGif",value:function(t,e,n,r,i){var o=this;return new Promise((function(s){if(o.threeLayer.getScene()){var a=new eN(t,e,n,r||{},o.threeLayer,o,i);s(a)}else o.initFlag=!0,o.prepareToDraw().then((function(){var a=new eN(t,e,n,r||{},o.threeLayer,o,i);s(a)}))}))}},{key:"drawTripHeight",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new lN(t,e||{},r.threeLayer,r,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new lN(t,e||{},r.threeLayer,r,n);i(o)}))}))}},{key:"drawTripLine",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new cN(t,e||{},r.threeLayer,r,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new cN(t,e||{},r.threeLayer,r,n);i(o)}))}))}},{key:"drawArrow2D",value:function(t,e,n){var r=this;return new Promise((function(i){if(r.threeLayer.getScene()){var o=new EN(t,e||{},r.threeLayer,n);i(o)}else r.initFlag=!0,r.prepareToDraw().then((function(){var o=new EN(t,e||{},r.threeLayer,n);i(o)}))}))}},{key:"dispose",value:function(){this.animationId&&cancelAnimationFrame(this.animationId);var t=this.threeLayer.getMeshes();this.threeLayer.clear(),t.forEach((function(t){}));var e=this.threeLayer.getCamera(),n=this.threeLayer.getScene(),r=this.threeLayer.getPick(),i=r.pickingTexture;r.pickingScene;var o=this.threeLayer.getRenderer();n.remove(e),e=null,n=null,i.dispose(),i=null,o.context.dispose(),o.context.forceContextLoss(),o.context=null,o.remove(),o=null,this.map.removeLayer(this.threeLayer)}}]);var t}(),cQ=function(){return p((function t(e,n,r,o){h(this,t),this.map=o,this.geometry=null,this.selectGeometry=null,this.isEndSelect=!1,this.drawTool=new i.DrawTool({mode:e,symbol:{lineColor:r.lineColor||"#E40D56",lineWidth:2,lineDasharray:[5,5],polygonFill:r.polygonFill||"#E40D56",polygonOpacity:.2}}).addTo(this.map).enable(),this._bindEvent(),this._drawEnd=n,this.mode=e,this.toolLayer=new i.VectorLayer(i.Util.GUID(),{geometryEvents:!1,hitDetect:!1}).addTo(this.map),this.geometry&&(this.toolLayer.addGeometry(this.geometry),this._drawEnd&&("Circle"===this.mode?this._drawEnd(this.geometry.getCoordinates(),this.geometry.getRadius()):this._drawEnd(this.geometry.getCoordinates()))),r.zIndex&&this.toolLayer.setZIndex(r.zIndex),this.type="drawTool"}),[{key:"getZIndex",value:function(){this.toolLayer&&this.toolLayer.getZIndex()}},{key:"setZIndex",value:function(t){this.toolLayer&&this.toolLayer.setZIndex(t)}},{key:"selectGeometryByPoint",value:function(){this.map.on("click",this._selectGeometry,this)}},{key:"endSelect",value:function(){this.toolLayer&&this.selectGeometry&&(this._changeSymbol(!1),this.selectGeometry.endEdit(),this.selectGeometry=null),this.map.off("click",this._selectGeometry,this)}},{key:"_selectGeometry",value:function(t){if(this.disableTool(),this.toolLayer){var e=this.toolLayer.identify(t.coordinate);this.selectGeometry&&(this.selectGeometry.endEdit(),this._changeSymbol(!1)),e&&(this.selectGeometry=e[0]),this.selectGeometry&&this._changeSymbol(!0)}}},{key:"_closeMapEvent",value:function(){this.map.off("click",this._selectGeometry,this)}},{key:"_changeSymbol",value:function(t){t?this.selectGeometry.setSymbol({lineColor:"#00ffff",lineWidth:2,lineDasharray:[5,5],polygonFill:"#00ffff",polygonOpacity:.2}):this.selectGeometry.setSymbol({lineColor:"#E40D56",lineWidth:2,lineDasharray:[5,5],polygonFill:"#E40D56",polygonOpacity:.2})}},{key:"deleteGeometry",value:function(){this.toolLayer&&this.selectGeometry&&(this.selectGeometry.endEdit(),this.toolLayer.removeGeometry(this.selectGeometry))}},{key:"undoDrawGeometry",value:function(){if(this.toolLayer){var t=this.toolLayer.getGeometries();if(t.length<1)return;this.toolLayer.removeGeometry(t[t.length-1])}}},{key:"_bindEvent",value:function(){this.drawTool.on("drawend",this.drawEnd,this)}},{key:"_closeEvent",value:function(){this.drawTool.off("drawend",this.drawEnd,this)}},{key:"drawEnd",value:function(t){this.toolLayer&&this.toolLayer.addGeometry(t.geometry),this._drawEnd&&("Circle"===this.mode?this._drawEnd(t.geometry.getCoordinates(),t.geometry.getRadius()):this._drawEnd(t.geometry.getCoordinates())),this.geometry=t.geometry}},{key:"disableTool",value:function(){this.drawTool.disable()}},{key:"clearGeometry",value:function(){this.toolLayer&&this.toolLayer.clear()}},{key:"setMode",value:function(t,e){this._drawEnd&&delete this._drawEnd,this._drawEnd=e,this.drawTool.setMode(t).enable(),this.mode=t}},{key:"startEdit",value:function(){this.disableTool(),this.selectGeometry&&this.selectGeometry.startEdit()}},{key:"endEdit",value:function(t){this.selectGeometry&&(this.selectGeometry.endEdit(),t&&("Circle"===this.mode?t(this.selectGeometry.getCoordinates(),this.geometry.getRadius()):t(this.selectGeometry.getCoordinates())))}},{key:"dispose",value:function(){this.drawTool&&(this._closeEvent(),this.endEdit(),this.disableTool(),delete this.drawTool),this._drawEnd&&delete this._drawEnd,this.geometry&&delete this.geometry,this.selectGeometry&&delete this.selectGeometry,this.map&&this._closeMapEvent(),this.map.removeLayer(this.toolLayer),delete this.toolLayer}}])}();function fQ(){this.PI=3.141592653589793,this.x_PI=52.35987755982988,this.a=6378245,this.ee=.006693421622965943,this.EARTHRADIUS=6370996.81,this.MCBAND=[12890594.86,8362377.87,5591021,3481989.83,1678043.12,0],this.LLBAND=[75,60,45,30,15,0],this.MC2LL=[[1.410526172116255e-8,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,17337981.2],[-7.435856389565537e-9,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,10260144.86],[-3.030883460898826e-8,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,6856817.37],[-1.981981304930552e-8,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,4482777.06],[3.09191371068437e-9,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,2555164.4],[2.890871144776878e-9,8983055095805407e-21,-3.068298e-8,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],this.LL2MC=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,647795574.6671607,-4082003173.641316,10774905663.51142,-15171875531.51559,12053065338.62167,-5124939663.577472,913311935.9512032,67.5],[.00337398766765,111320.7020202162,4481351.045890365,-23393751.19931662,79682215.47186455,-115964993.2797253,97236711.15602145,-43661946.33752821,8477230.501135234,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837.749470245,992013.7397791013,-1221952.21711287,1340652.697009075,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758.690035394,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],this._transformlat=function(t,e){var n=2*t-100+3*e+.2*e*e+.1*t*e+.2*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(e*this.PI)+40*Math.sin(e/3*this.PI))/3,n+=2*(160*Math.sin(e/12*this.PI)+320*Math.sin(e*this.PI/30))/3},this._transformlng=function(t,e){var n=300+t+2*e+.1*t*t+.1*t*e+.1*Math.sqrt(Math.abs(t));return n+=2*(20*Math.sin(6*t*this.PI)+20*Math.sin(2*t*this.PI))/3,n+=2*(20*Math.sin(t*this.PI)+40*Math.sin(t/3*this.PI))/3,n+=2*(150*Math.sin(t/12*this.PI)+300*Math.sin(t/30*this.PI))/3},this._out_of_china=function(t,e){return t<72.004||t>137.8347||e<.8293||e>55.8271||!1},this._getLoop=function(t,e,n){for(;t>n;)t-=n-e;for(;t<e;)t+=n-e;return t},this._getRange=function(t,e,n){return null!=e&&(t=Math.max(t,e)),null!=n&&(t=Math.min(t,n)),t}}fQ.prototype.BD2GCJ=function(t,e){var n=t-.0065,r=e-.006,i=Math.sqrt(n*n+r*r)-2e-5*Math.sin(r*this.x_PI),o=Math.atan2(r,n)-3e-6*Math.cos(n*this.x_PI);return[i*Math.cos(o),i*Math.sin(o)]},fQ.prototype.GCJ2BD=function(t,e){var n=Math.sqrt(t*t+e*e)+2e-5*Math.sin(e*this.x_PI),r=Math.atan2(e,t)+3e-6*Math.cos(t*this.x_PI);return[n*Math.cos(r)+.0065,n*Math.sin(r)+.006]},fQ.prototype.WGS2GCJ=function(t,e){if(this._out_of_china(t,e))return[t,e];var n=this._transformlat(t-105,e-35),r=this._transformlng(t-105,e-35),i=e/180*this.PI,o=Math.sin(i);o=1-this.ee*o*o;var s=Math.sqrt(o);return n=180*n/(this.a*(1-this.ee)/(o*s)*this.PI),[t+(r=180*r/(this.a/s*Math.cos(i)*this.PI)),e+n]},fQ.prototype.GCJ2WGS=function(t,e){if(this._out_of_china(t,e))return[t,e];var n=this._transformlat(t-105,e-35),r=this._transformlng(t-105,e-35),i=e/180*this.PI,o=Math.sin(i);o=1-this.ee*o*o;var s=Math.sqrt(o);return n=180*n/(this.a*(1-this.ee)/(o*s)*this.PI),[2*t-(t+(r=180*r/(this.a/s*Math.cos(i)*this.PI))),2*e-(e+n)]},fQ.prototype.WGS2BD=function(t,e){var n=this.WGS2GCJ(t,e);return n=this.GCJ2BD(n[0],n[1])},fQ.prototype.BD2WGS=function(t,e){var n=this.BD2GCJ(t,e);return n=this.GCJ2WGS(n[0],n[1])},fQ.prototype.BD_MKT2WGS=function(t,e){var n=null;t=Math.abs(t),e=Math.abs(e);for(var r=0;r<this.MCBAND.length;r++)if(e>=this.MCBAND[r]){n=this.MC2LL[r];break}t=n[0]+n[1]*Math.abs(t);var i=Math.abs(e)/n[9];return e=n[2]+n[3]*i+n[4]*i*i+n[5]*i*i*i+n[6]*i*i*i*i+n[7]*i*i*i*i*i+n[8]*i*i*i*i*i*i,[t*=t<0?-1:1,e*=e<0?-1:1]},fQ.prototype.BD_WGS2MKT=function(t,e){var n=null;t=this._getLoop(t,-180,180),e=this._getRange(e,-74,74);for(var r=0;r<this.LLBAND.length;r++)if(e>=this.LLBAND[r]){n=this.LL2MC[r];break}if(null!=n)for(r=this.LLBAND.length-1;r>=0;r--)if(e<=-this.LLBAND[r]){n=this.LL2MC[r];break}t=n[0]+n[1]*Math.abs(t);var i=Math.abs(e)/n[9];return e=n[2]+n[3]*i+n[4]*i*i+n[5]*i*i*i+n[6]*i*i*i*i+n[7]*i*i*i*i*i+n[8]*i*i*i*i*i*i,[t*=t<0?-1:1,e*=e<0?-1:1]};var pQ=function(){return p((function t(e,n,r){h(this,t),this.map=n,this.overlayer=new i.VectorLayer("overLayer",{geometryEvents:!1,hitDetect:!1,forceRenderOnMoving:!0,forceRenderOnRotating:!0,enableSimplify:!1}),this.overlayer.addTo(this.map);var o=new i.MultiPolygon(e,{symbol:{polygonFill:r.color||"#000",polygonOpacity:r.opacity||1,lineWidth:0}});this.overlayer.addGeometry(o)}),[{key:"dispose",value:function(){this.map.removeLayer(this.overlayer),delete this.toolLayer}}])}();
|
|
190
190
|
/*!
|
|
191
191
|
* maptalks.animatemarker v0.4.1
|
|
192
192
|
* LICENSE : MIT
|