@antv/g-lite 2.7.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.min.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @antv/g-lite
|
|
3
3
|
* @description A core module for rendering engine implements DOM API.
|
|
4
|
-
* @version 2.7.
|
|
5
|
-
* @date
|
|
4
|
+
* @version 2.7.1
|
|
5
|
+
* @date 10/10/2026, 9:45:35 AM
|
|
6
6
|
* @author AntVis
|
|
7
7
|
* @docs https://g.antv.antgroup.com/
|
|
8
8
|
*/
|
|
9
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,function(t){"use strict";function e(t){return e="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},e(t)}function n(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function r(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(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 a(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach(function(e){r(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var r=0;e.length>r;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var l=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),c=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),h=function(){return u(function t(){o(this,t),this.plugins=[]},[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach(function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)})}}])}(),f=function(){return u(function t(e){o(this,t),this.clipSpaceNearZ=c.NEGATIVE_ONE,this.plugins=[],this.config=a({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)},[{key:"registerPlugin",value:function(t){-1===this.plugins.findIndex(function(e){return e===t})&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex(function(e){return e===t});e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find(function(e){return e.name===t})}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}();function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function v(t,e){if(t){if("string"==typeof t)return d(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)?d(t,e):void 0}}function p(t){return function(t){if(Array.isArray(t))return d(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||v(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 y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}function g(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(g=function(){return!!t})()}function m(t,n){if(n&&("object"==e(n)||"function"==typeof n))return n;if(void 0!==n)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)}function k(t,e,n){return e=y(e),m(t,g()?Reflect.construct(e,n||[],y(t).constructor):e.apply(t,n))}function E(t,e){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},E(t,e)}function x(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 b(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,a,o,s=[],u=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||v(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.")}()}var T={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,r,a,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,a||t,o),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function o(t,e){0===--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,a=Array(i);i>r;r++)a[r]=e[r].fn;return a},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,a,o){var s=n?n+t:t;if(!this._events[s])return!1;var u,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,r),!0;case 4:return c.fn.call(c.context,e,r,i),!0;case 5:return c.fn.call(c.context,e,r,i,a),!0;case 6:return c.fn.call(c.context,e,r,i,a,o),!0}for(l=1,u=Array(h-1);h>l;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var f,d=c.length;for(l=0;d>l;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,r);break;case 4:c[l].fn.call(c[l].context,e,r,i);break;default:if(!u)for(f=1,u=Array(h-1);h>f;f++)u[f-1]=arguments[f];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var a=n?n+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||o(this,a);else{for(var u=0,l=[],c=s.length;c>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&l.push(s[u]);l.length?this._events[a]=1===l.length?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&o(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(T);var M=T.exports,w=1e-6,S="undefined"!=typeof Float32Array?Float32Array:Array;function N(){var t=new S(9);return S!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function P(){var t=new S(16);return S!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function C(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function A(t,e,n,r,i,a,o,s,u,l,c,h,f,d,v,p,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=h,t[11]=f,t[12]=d,t[13]=v,t[14]=p,t[15]=y,t}function O(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function R(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function L(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],y=e[14],g=e[15],m=n*s-r*o,k=n*u-i*o,E=n*l-a*o,x=r*u-i*s,b=r*l-a*s,T=i*l-a*u,M=c*p-h*v,w=c*y-f*v,S=c*g-d*v,N=h*y-f*p,P=h*g-d*p,C=f*g-d*y,A=m*C-k*P+E*N+x*S-b*w+T*M;return A?(t[0]=(s*C-u*P+l*N)*(A=1/A),t[1]=(i*P-r*C-a*N)*A,t[2]=(p*T-y*b+g*x)*A,t[3]=(f*b-h*T-d*x)*A,t[4]=(u*S-o*C-l*w)*A,t[5]=(n*C-i*S+a*w)*A,t[6]=(y*E-v*T-g*k)*A,t[7]=(c*T-f*E+d*k)*A,t[8]=(o*P-s*S+l*M)*A,t[9]=(r*S-n*P-a*M)*A,t[10]=(v*b-p*E+g*m)*A,t[11]=(h*E-c*b-d*m)*A,t[12]=(s*w-o*N-u*M)*A,t[13]=(n*N-r*w+i*M)*A,t[14]=(p*k-v*x-y*m)*A,t[15]=(c*x-h*k+f*m)*A,t):null}function I(t){var e=t[0],n=t[1],r=t[2],i=t[4],a=t[5],o=t[6],s=t[8],u=t[9],l=t[10],c=t[12],h=t[13],f=t[14],d=e*a-n*i,v=e*o-r*i,p=n*o-r*a,y=s*h-u*c,g=s*f-l*c,m=u*f-l*h;return t[7]*(e*m-n*g+r*y)-t[3]*(i*m-a*g+o*y)+t[15]*(s*p-u*v+l*d)-t[11]*(c*p-h*v+f*d)}function D(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],d=e[10],v=e[11],p=e[12],y=e[13],g=e[14],m=e[15],k=n[0],E=n[1],x=n[2],b=n[3];return t[0]=k*r+E*s+x*h+b*p,t[1]=k*i+E*u+x*f+b*y,t[2]=k*a+E*l+x*d+b*g,t[3]=k*o+E*c+x*v+b*m,t[4]=(k=n[4])*r+(E=n[5])*s+(x=n[6])*h+(b=n[7])*p,t[5]=k*i+E*u+x*f+b*y,t[6]=k*a+E*l+x*d+b*g,t[7]=k*o+E*c+x*v+b*m,t[8]=(k=n[8])*r+(E=n[9])*s+(x=n[10])*h+(b=n[11])*p,t[9]=k*i+E*u+x*f+b*y,t[10]=k*a+E*l+x*d+b*g,t[11]=k*o+E*c+x*v+b*m,t[12]=(k=n[12])*r+(E=n[13])*s+(x=n[14])*h+(b=n[15])*p,t[13]=k*i+E*u+x*f+b*y,t[14]=k*a+E*l+x*d+b*g,t[15]=k*o+E*c+x*v+b*m,t}function _(t,e,n){var r,i,a,o,s,u,l,c,h,f,d,v,p=n[0],y=n[1],g=n[2];return e===t?(t[12]=e[0]*p+e[4]*y+e[8]*g+e[12],t[13]=e[1]*p+e[5]*y+e[9]*g+e[13],t[14]=e[2]*p+e[6]*y+e[10]*g+e[14],t[15]=e[3]*p+e[7]*y+e[11]*g+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],d=e[10],v=e[11],t[0]=r=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=f,t[10]=d,t[11]=v,t[12]=r*p+s*y+h*g+e[12],t[13]=i*p+u*y+f*g+e[13],t[14]=a*p+l*y+d*g+e[14],t[15]=o*p+c*y+v*g+e[15]),t}function G(t,e,n){var r=n[0],i=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function F(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+l*r,t[5]=o*i+c*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=l*i-a*r,t[9]=c*i-o*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function B(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-l*r,t[1]=o*i-c*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=a*r+l*i,t[9]=o*r+c*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function V(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function U(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function z(t,e,n){var r,i,a,o=n[0],s=n[1],u=n[2],l=Math.sqrt(o*o+s*s+u*u);return w>l?null:(o*=l=1/l,s*=l,u*=l,r=Math.sin(e),t[0]=o*o*(a=1-(i=Math.cos(e)))+i,t[1]=s*o*a+u*r,t[2]=u*o*a-s*r,t[3]=0,t[4]=o*s*a-u*r,t[5]=s*s*a+i,t[6]=u*s*a+o*r,t[7]=0,t[8]=o*u*a+s*r,t[9]=s*u*a-o*r,t[10]=u*u*a+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function H(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function j(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Y(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function W(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,u=i+i,l=a+a,c=r*s,h=r*u,f=r*l,d=i*u,v=i*l,p=a*l,y=o*s,g=o*u,m=o*l;return t[0]=1-(d+p),t[1]=h+m,t[2]=f-g,t[3]=0,t[4]=h-m,t[5]=1-(c+p),t[6]=v+y,t[7]=0,t[8]=f+g,t[9]=v-y,t[10]=1-(c+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function q(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function X(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],s=e[6],u=e[8],l=e[9],c=e[10];return t[0]=Math.sqrt(n*n+r*r+i*i),t[1]=Math.sqrt(a*a+o*o+s*s),t[2]=Math.sqrt(u*u+l*l+c*c),t}function Z(t,e){var n=new S(3);X(n,e);var r=1/n[0],i=1/n[1],a=1/n[2],o=e[0]*r,s=e[1]*i,u=e[2]*a,l=e[4]*r,c=e[5]*i,h=e[6]*a,f=e[8]*r,d=e[9]*i,v=e[10]*a,p=o+c+v,y=0;return p>0?(t[3]=.25*(y=2*Math.sqrt(p+1)),t[0]=(h-d)/y,t[1]=(f-u)/y,t[2]=(s-l)/y):o>c&&o>v?(t[3]=(h-d)/(y=2*Math.sqrt(1+o-c-v)),t[0]=.25*y,t[1]=(s+l)/y,t[2]=(f+u)/y):c>v?(t[3]=(f-u)/(y=2*Math.sqrt(1+c-o-v)),t[0]=(s+l)/y,t[1]=.25*y,t[2]=(h+d)/y):(t[3]=(s-l)/(y=2*Math.sqrt(1+v-o-c)),t[0]=(f+u)/y,t[1]=(h+d)/y,t[2]=.25*y),t}function $(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],u=e[3],l=a+a,c=o+o,h=s+s,f=a*l,d=a*c,v=a*h,p=o*c,y=o*h,g=s*h,m=u*l,k=u*c,E=u*h,x=r[0],b=r[1],T=r[2],M=i[0],w=i[1],S=i[2],N=(1-(p+g))*x,P=(d+E)*x,C=(v-k)*x,A=(d-E)*b,O=(1-(f+g))*b,R=(y+m)*b,L=(v+k)*T,I=(y-m)*T,D=(1-(f+p))*T;return t[0]=N,t[1]=P,t[2]=C,t[3]=0,t[4]=A,t[5]=O,t[6]=R,t[7]=0,t[8]=L,t[9]=I,t[10]=D,t[11]=0,t[12]=n[0]+M-(N*M+A*w+L*S),t[13]=n[1]+w-(P*M+O*w+I*S),t[14]=n[2]+S-(C*M+R*w+D*S),t[15]=1,t}function K(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,u=i+i,l=n*o,c=r*o,h=r*s,f=i*o,d=i*s,v=i*u,p=a*o,y=a*s,g=a*u;return t[0]=1-h-v,t[1]=c+g,t[2]=f-y,t[3]=0,t[4]=c-g,t[5]=1-l-v,t[6]=d+p,t[7]=0,t[8]=f+y,t[9]=d-p,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Q(t,e,n,r,i){var a=1/Math.tan(e/2);if(t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0){var o=1/(r-i);t[10]=(i+r)*o,t[14]=2*i*r*o}else t[10]=-1,t[14]=-2*r;return t}function J(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(o+a)*l,t[15]=1,t}var tt=J;function et(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=a*l,t[15]=1,t}function nt(t,e,n,r){var i,a,o,s,u,l,c,h,f,d,v=e[0],p=e[1],y=e[2],g=r[0],m=r[1],k=r[2],E=n[0],x=n[1],b=n[2];return w>Math.abs(v-E)&&w>Math.abs(p-x)&&w>Math.abs(y-b)?O(t):(f=y-b,(d=Math.sqrt((i=m*(f*=d=1/Math.sqrt((c=v-E)*c+(h=p-x)*h+f*f))-k*(h*=d))*i+(a=k*(c*=d)-g*f)*a+(o=g*h-m*c)*o))?(i*=d=1/d,a*=d,o*=d):(i=0,a=0,o=0),(d=Math.sqrt((s=h*o-f*a)*s+(u=f*i-c*o)*u+(l=c*a-h*i)*l))?(s*=d=1/d,u*=d,l*=d):(s=0,u=0,l=0),t[0]=i,t[1]=s,t[2]=c,t[3]=0,t[4]=a,t[5]=u,t[6]=h,t[7]=0,t[8]=o,t[9]=l,t[10]=f,t[11]=0,t[12]=-(i*v+a*p+o*y),t[13]=-(s*v+u*p+l*y),t[14]=-(c*v+h*p+f*y),t[15]=1,t)}function rt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var it=D,at=Object.freeze({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],y=e[14],g=e[15],m=n*s-r*o,k=n*u-i*o,E=n*l-a*o,x=r*u-i*s,b=r*l-a*s,T=i*l-a*u,M=c*p-h*v,w=c*y-f*v,S=c*g-d*v,N=h*y-f*p,P=h*g-d*p,C=f*g-d*y;return t[0]=s*C-u*P+l*N,t[1]=i*P-r*C-a*N,t[2]=p*T-y*b+g*x,t[3]=f*b-h*T-d*x,t[4]=u*S-o*C-l*w,t[5]=n*C-i*S+a*w,t[6]=y*E-v*T-g*k,t[7]=c*T-f*E+d*k,t[8]=o*P-s*S+l*M,t[9]=r*S-n*P-a*M,t[10]=v*b-p*E+g*m,t[11]=h*E-c*b-d*m,t[12]=s*w-o*N-u*M,t[13]=n*N-r*w+i*M,t[14]=p*k-v*x-y*m,t[15]=c*x-h*k+f*m,t},clone:function(t){var e=new S(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:C,create:P,decompose:function(t,e,n,r){e[0]=r[12],e[1]=r[13],e[2]=r[14];var i=r[0],a=r[1],o=r[2],s=r[4],u=r[5],l=r[6],c=r[8],h=r[9],f=r[10];n[0]=Math.sqrt(i*i+a*a+o*o),n[1]=Math.sqrt(s*s+u*u+l*l),n[2]=Math.sqrt(c*c+h*h+f*f);var d=1/n[0],v=1/n[1],p=1/n[2],y=i*d,g=a*v,m=o*p,k=s*d,E=u*v,x=l*p,b=c*d,T=h*v,M=f*p,w=y+E+M,S=0;return w>0?(t[3]=.25*(S=2*Math.sqrt(w+1)),t[0]=(x-T)/S,t[1]=(b-m)/S,t[2]=(g-k)/S):y>E&&y>M?(t[3]=(x-T)/(S=2*Math.sqrt(1+y-E-M)),t[0]=.25*S,t[1]=(g+k)/S,t[2]=(b+m)/S):E>M?(t[3]=(b-m)/(S=2*Math.sqrt(1+E-y-M)),t[0]=(g+k)/S,t[1]=.25*S,t[2]=(x+T)/S):(t[3]=(g-k)/(S=2*Math.sqrt(1+M-y-E)),t[0]=(b+m)/S,t[1]=(x+T)/S,t[2]=.25*S),t},determinant:I,equals:function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],c=t[8],h=t[9],f=t[10],d=t[11],v=t[12],p=t[13],y=t[14],g=t[15],m=e[0],k=e[1],E=e[2],x=e[3],b=e[4],T=e[5],M=e[6],S=e[7],N=e[8],P=e[9],C=e[10],A=e[11],O=e[12],R=e[13],L=e[14],I=e[15];return!(Math.abs(n-m)>w*Math.max(1,Math.abs(n),Math.abs(m))||Math.abs(r-k)>w*Math.max(1,Math.abs(r),Math.abs(k))||Math.abs(i-E)>w*Math.max(1,Math.abs(i),Math.abs(E))||Math.abs(a-x)>w*Math.max(1,Math.abs(a),Math.abs(x))||Math.abs(o-b)>w*Math.max(1,Math.abs(o),Math.abs(b))||Math.abs(s-T)>w*Math.max(1,Math.abs(s),Math.abs(T))||Math.abs(u-M)>w*Math.max(1,Math.abs(u),Math.abs(M))||Math.abs(l-S)>w*Math.max(1,Math.abs(l),Math.abs(S))||Math.abs(c-N)>w*Math.max(1,Math.abs(c),Math.abs(N))||Math.abs(h-P)>w*Math.max(1,Math.abs(h),Math.abs(P))||Math.abs(f-C)>w*Math.max(1,Math.abs(f),Math.abs(C))||Math.abs(d-A)>w*Math.max(1,Math.abs(d),Math.abs(A))||Math.abs(v-O)>w*Math.max(1,Math.abs(v),Math.abs(O))||Math.abs(p-R)>w*Math.max(1,Math.abs(p),Math.abs(R))||Math.abs(y-L)>w*Math.max(1,Math.abs(y),Math.abs(L))||Math.abs(g-I)>w*Math.max(1,Math.abs(g),Math.abs(I)))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},frob:function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])},fromQuat:K,fromQuat2:function(t,e){var n=new S(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=r*r+i*i+a*a+o*o;return h>0?(n[0]=2*(s*o+c*r+u*a-l*i)/h,n[1]=2*(u*o+c*i+l*r-s*a)/h,n[2]=2*(l*o+c*a+s*i-u*r)/h):(n[0]=2*(s*o+c*r+u*a-l*i),n[1]=2*(u*o+c*i+l*r-s*a),n[2]=2*(l*o+c*a+s*i-u*r)),W(t,e,n),t},fromRotation:z,fromRotationTranslation:W,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],u=i+i,l=a+a,c=o+o,h=i*u,f=i*l,d=i*c,v=a*l,p=a*c,y=o*c,g=s*u,m=s*l,k=s*c,E=r[0],x=r[1],b=r[2];return t[0]=(1-(v+y))*E,t[1]=(f+k)*E,t[2]=(d-m)*E,t[3]=0,t[4]=(f-k)*x,t[5]=(1-(h+y))*x,t[6]=(p+g)*x,t[7]=0,t[8]=(d+m)*b,t[9]=(p-g)*b,t[10]=(1-(h+v))*b,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:$,fromScaling:U,fromTranslation:V,fromValues:function(t,e,n,r,i,a,o,s,u,l,c,h,f,d,v,p){var y=new S(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=a,y[6]=o,y[7]=s,y[8]=u,y[9]=l,y[10]=c,y[11]=h,y[12]=f,y[13]=d,y[14]=v,y[15]=p,y},fromXRotation:H,fromYRotation:j,fromZRotation:Y,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),u=1/(i-r),l=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(o+a)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*l,t[15]=0,t},getRotation:Z,getScaling:X,getTranslation:q,identity:O,invert:L,lookAt:nt,mul:it,multiply:D,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(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[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},ortho:tt,orthoNO:J,orthoZO:et,perspective:Q,perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+s),l=2/(i+a);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-s)*u*.5,t[9]=(i-a)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},perspectiveNO:Q,perspectiveZO:function(t,e,n,r,i){var a=1/Math.tan(e/2);if(t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0){var o=1/(r-i);t[10]=i*o,t[14]=i*r*o}else t[10]=-1,t[14]=-r;return t},rotate:function(t,e,n,r){var i,a,o,s,u,l,c,h,f,d,v,p,y,g,m,k,E,x,b,T,M,S,N,P,C=r[0],A=r[1],O=r[2],R=Math.sqrt(C*C+A*A+O*O);return w>R?null:(C*=R=1/R,A*=R,O*=R,i=Math.sin(n),u=e[1],l=e[2],c=e[3],f=e[5],d=e[6],v=e[7],y=e[9],g=e[10],m=e[11],b=C*A*(o=1-(a=Math.cos(n)))-O*i,T=A*A*o+a,M=O*A*o+C*i,S=C*O*o+A*i,N=A*O*o-C*i,P=O*O*o+a,t[0]=(s=e[0])*(k=C*C*o+a)+(h=e[4])*(E=A*C*o+O*i)+(p=e[8])*(x=O*C*o-A*i),t[1]=u*k+f*E+y*x,t[2]=l*k+d*E+g*x,t[3]=c*k+v*E+m*x,t[4]=s*b+h*T+p*M,t[5]=u*b+f*T+y*M,t[6]=l*b+d*T+g*M,t[7]=c*b+v*T+m*M,t[8]=s*S+h*N+p*P,t[9]=u*S+f*N+y*P,t[10]=l*S+d*N+g*P,t[11]=c*S+v*N+m*P,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:F,rotateY:B,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+l*r,t[1]=o*i+c*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=l*i-a*r,t[5]=c*i-o*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},scale:G,set:A,str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},sub:rt,subtract:rt,targetTo:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=r[0],u=r[1],l=r[2],c=i-n[0],h=a-n[1],f=o-n[2],d=c*c+h*h+f*f;d>0&&(c*=d=1/Math.sqrt(d),h*=d,f*=d);var v=u*f-l*h,p=l*c-s*f,y=s*h-u*c;return(d=v*v+p*p+y*y)>0&&(v*=d=1/Math.sqrt(d),p*=d,y*=d),t[0]=v,t[1]=p,t[2]=y,t[3]=0,t[4]=h*y-f*p,t[5]=f*v-c*y,t[6]=c*p-h*v,t[7]=0,t[8]=c,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t},translate:_,transpose:R});function ot(){var t=new S(3);return S!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function st(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function ut(t,e,n){var r=new S(3);return r[0]=t,r[1]=e,r[2]=n,r}function lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ct(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function ht(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function ft(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function dt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function vt(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function pt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function yt(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],u=n[2];return t[0]=i*u-a*s,t[1]=a*o-r*u,t[2]=r*s-i*o,t}function gt(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/(o=o||1),t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t}function mt(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return w*Math.max(1,Math.abs(n),Math.abs(a))>=Math.abs(n-a)&&w*Math.max(1,Math.abs(r),Math.abs(o))>=Math.abs(r-o)&&w*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)}var kt=ft,Et=st;function xt(){var t=new S(4);return S!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function bt(t,e,n,r){var i=new S(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function Tt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,t}function Mt(){var t=new S(4);return S!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function wt(t,e,n){var r=Math.sin(n*=.5);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function St(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=r*c+o*s+i*l-a*u,t[1]=i*c+o*u+a*s-r*l,t[2]=a*c+o*l+r*u-i*s,t[3]=o*c-r*s-i*u-a*l,t}function Nt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=a*s,t}function Pt(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",a=Math.PI/360;r*=a,n*=a;var o=Math.sin(e*=a),s=Math.cos(e),u=Math.sin(n),l=Math.cos(n),c=Math.sin(r),h=Math.cos(r);switch(i){case"xyz":t[0]=o*l*h+s*u*c,t[1]=s*u*h-o*l*c,t[2]=s*l*c+o*u*h,t[3]=s*l*h-o*u*c;break;case"xzy":t[0]=o*l*h-s*u*c,t[1]=s*u*h-o*l*c,t[2]=s*l*c+o*u*h,t[3]=s*l*h+o*u*c;break;case"yxz":t[0]=o*l*h+s*u*c,t[1]=s*u*h-o*l*c,t[2]=s*l*c-o*u*h,t[3]=s*l*h+o*u*c;break;case"yzx":t[0]=o*l*h+s*u*c,t[1]=s*u*h+o*l*c,t[2]=s*l*c-o*u*h,t[3]=s*l*h-o*u*c;break;case"zxy":t[0]=o*l*h-s*u*c,t[1]=s*u*h+o*l*c,t[2]=s*l*c+o*u*h,t[3]=s*l*h-o*u*c;break;case"zyx":t[0]=o*l*h-s*u*c,t[1]=s*u*h+o*l*c,t[2]=s*l*c-o*u*h,t[3]=s*l*h+o*u*c;break;default:throw Error("Unknown angle order "+i)}return t}ot(),function(){var t=xt()}();var Ct=bt,At=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Ot=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},Rt=St,Lt=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=r*o,t[2]=i*o,t[3]=a*o,t};function It(){var t=new S(2);return S!=Float32Array&&(t[0]=0,t[1]=0),t}ot(),ut(1,0,0),ut(0,1,0),Mt(),Mt(),N(),function(){var t=It()}();var Dt=ht,_t=lt,Gt=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},Ft=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},Bt=dt,Vt=kt,Ut=function(){function t(){o(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return u(t,[{key:"update",value:function(t,e){_t(this.center,t),_t(this.halfExtents,e),Vt(this.min,this.center,this.halfExtents),Dt(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){Dt(this.center,e,t),Bt(this.center,this.center,.5),Vt(this.halfExtents,e,t),Bt(this.halfExtents,this.halfExtents,.5),_t(this.min,t),_t(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],a=n[2],o=this.halfExtents,s=o[0],u=o[1],l=o[2],c=r-s,h=r+s,f=i-u,d=i+u,v=a-l,p=a+l,y=e.center,g=y[0],m=y[1],k=y[2],E=e.halfExtents,x=E[0],b=E[1],T=E[2],M=g-x,w=g+x,S=m-b,N=m+b,P=k-T,C=k+T;c>M&&(c=M),w>h&&(h=w),f>S&&(f=S),N>d&&(d=N),v>P&&(v=P),C>p&&(p=C),n[0]=.5*(c+h),n[1]=.5*(f+d),n[2]=.5*(v+p),o[0]=.5*(h-c),o[1]=.5*(d-f),o[2]=.5*(p-v),this.min[0]=c,this.min[1]=f,this.min[2]=v,this.max[0]=h,this.max[1]=d,this.max[2]=p}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,r=this.halfExtents,i=t.center,a=t.halfExtents,o=e[0],s=e[4],u=e[8],l=e[1],c=e[5],h=e[9],f=e[2],d=e[6],v=e[10],p=Math.abs(o),y=Math.abs(s),g=Math.abs(u),m=Math.abs(l),k=Math.abs(c),E=Math.abs(h),x=Math.abs(f),b=Math.abs(d),T=Math.abs(v);n[0]=e[12]+o*i[0]+s*i[1]+u*i[2],n[1]=e[13]+l*i[0]+c*i[1]+h*i[2],n[2]=e[14]+f*i[0]+d*i[1]+v*i[2],r[0]=p*a[0]+y*a[1]+g*a[2],r[1]=m*a[0]+k*a[1]+E*a[2],r[2]=x*a[0]+b*a[1]+T*a[2],Vt(this.min,n,r),Dt(this.max,n,r)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,r=Gt([0,0,0],this.getMin(),e.getMin()),i=Ft([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?_t([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?_t([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),zt=function(){return u(function t(e,n){o(this,t),this.distance=e||0,this.normal=n||ut(0,1,0),this.updatePNVertexFlag()},[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return pt(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/Et(this.normal);dt(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),a=i>=0&&1>=i;return a&&n&&function(t,e,n,r){var i=e[0],a=e[1],o=e[2];t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o)}(n,t,e,i),a}}])}(),Ht=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),jt=function(){return u(function t(e){if(o(this,t),this.planes=[],e)this.planes=e;else for(var n=0;6>n;n++)this.planes.push(new zt)},[{key:"extractFromVPMatrix",value:function(t){var e=b(t,16),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],y=e[14],g=e[15];ct(this.planes[0].normal,a-n,l-o,d-c),this.planes[0].distance=g-v,ct(this.planes[1].normal,a+n,l+o,d+c),this.planes[1].distance=g+v,ct(this.planes[2].normal,a+r,l+s,d+h),this.planes[2].distance=g+p,ct(this.planes[3].normal,a-r,l-s,d-h),this.planes[3].distance=g-p,ct(this.planes[4].normal,a-i,l-u,d-f),this.planes[4].distance=g-y,ct(this.planes[5].normal,a+i,l+u,d+f),this.planes[5].distance=g+y,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})}}])}(),Yt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return u(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),Wt=function(){function t(e,n,r,i){o(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return u(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var r=bt(e.x,e.y,0,1),i=bt(e.x+e.width,e.y,0,1),a=bt(e.x,e.y+e.height,0,1),o=bt(e.x+e.width,e.y+e.height,0,1),s=xt(),u=xt(),l=xt(),c=xt();Tt(s,r,n),Tt(u,i,n),Tt(l,a,n),Tt(c,o,n);var h=Math.min(s[0],u[0],l[0],c[0]),f=Math.min(s[1],u[1],l[1],c[1]);return t.fromRect({x:h,y:f,width:Math.max(s[0],u[0],l[0],c[0])-h,height:Math.max(s[1],u[1],l[1],c[1])-f})}}])}(),qt="Method not implemented.",Xt="Use document.documentElement instead.";function Zt(t){return"function"==typeof t}function $t(t){return null==t}function Kt(t){return Array.isArray(t)}var Qt={}.toString,Jt=function(t,e){return Qt.call(t)==="[object "+e+"]"};function te(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],r=1;e>r;r++)n=Math.max(n,t[r]);return n}var ee=function(t){if(Kt(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])};function ne(t){return"string"==typeof t}var re=function(t,e,n){return e>t?e:t>n?n:t};function ie(t){return"number"==typeof t}function ae(t,e,n){return void 0===n&&(n=1e-5),t===e||n>Math.abs(t-e)}var oe=function(t,e){return(t%e+e)%e},se=function(t){return Jt(t,"Boolean")},ue=function(t){return void 0===t},le=function(){return le=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},le.apply(this,arguments)};function ce(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;a>i;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var he={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function fe(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var de={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function ve(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return de[e]===t.length-1&&"achlmqstvz".includes(e)})}function pe(t){return ve(t)&&t.every(function(t){var e=t[0];return e===e.toUpperCase()})}function ye(t){return pe(t)&&t.every(function(t){return"ACLMQZ".includes(t[0])})}function ge(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=de[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,de[n]))),de[n]););}function me(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function ke(t){return t>=48&&57>=t||43===t||45===t||46===t}function Ee(t){return t>=48&&57>=t}function xe(t){var e,n=t.max,r=t.pathValue,i=t.index,a=i,o=!1,s=!1,u=!1,l=!1;if(n>a)if(43!==(e=r.charCodeAt(a))&&45!==e||(e=r.charCodeAt(a+=1)),Ee(e)||46===e){if(46!==e){if(o=48===e,e=r.charCodeAt(a+=1),o&&n>a&&e&&Ee(e))return void(t.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(r[i],'" illegal number'));for(;n>a&&Ee(r.charCodeAt(a));)a+=1,s=!0;e=r.charCodeAt(a)}if(46===e){for(l=!0,a+=1;Ee(r.charCodeAt(a));)a+=1,u=!0;e=r.charCodeAt(a)}if(101===e||69===e){if(l&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" invalid float exponent'));if(43!==(e=r.charCodeAt(a+=1))&&45!==e||(a+=1),a>=n||!Ee(r.charCodeAt(a)))return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" invalid integer exponent'));for(;n>a&&Ee(r.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(i,a)}else t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" is not a number');else t.err="[path-util]: Invalid path value at index ".concat(a,', "pathValue" is missing param')}function be(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function Te(t){for(var e=t.pathValue,n=t.max;n>t.index&&be(e.charCodeAt(t.index));)t.index+=1}function Me(t){return 97==(32|t)}function we(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),a=de[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,Te(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(!Me(i)||3!==o&&4!==o?xe(t):me(t),t.err.length)return;t.data.push(t.param),Te(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,Te(t))}if(t.index>=t.max)break;if(!ke(n.charCodeAt(t.index)))break}ge(t)}else ge(t);else t.err='[path-util]: Invalid path value "'.concat(n[r],'" is not a path command')}var Se=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function Ne(t){if(pe(t))return[].concat(t);var e=function(t){if(ve(t))return[].concat(t);var e=new Se(t);for(Te(e);e.max>e.index&&!e.err.length;)we(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,a=0;return e.map(function(t){var e,o=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=o[0],a=r=o[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,o[0],o[1],o[2],o[3],o[4],o[5]+n,o[6]+r];break;case"V":e=[u,o[0]+r];break;case"H":e=[u,o[0]+n];break;default:var l=o.map(function(t,e){return t+(e%2?r:n)});e=[u].concat(l)}else e=[u].concat(o);var c=e.length;switch(u){case"Z":n=i,r=a;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[c-2],r=e[c-1],"M"===u&&(i=n,a=r)}return e})}function Pe(t,e){var n=t[0],r=e.x1,i=e.y1,a=e.x2,o=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var l=2*r-a,c=2*i-o;e.x1=l,e.y1=c,u=["C",l,c].concat(s)}else if("T"===n){var h=2*r-e.qx,f=2*i-e.qy;e.qx=h,e.qy=f,u=["Q",h,f].concat(s)}else if("Q"===n){var d=s[1];e.qx=s[0],e.qy=d}return u}function Ce(t){if(ye(t))return[].concat(t);for(var e=Ne(t),n=le({},he),r=0;e.length>r;r+=1){e[r]=Pe(e[r],n);var i=e[r],a=i.length;n.x1=+i[a-2],n.y1=+i[a-1],n.x2=+i[a-4]||n.x1,n.y2=+i[a-3]||n.y1}return e}function Ae(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Oe(t,e,n,r,i,a,o,s,u,l){var c,h,f,d,v,p=t,y=e,g=n,m=r,k=s,E=u,x=120*Math.PI/180,b=Math.PI/180*(+i||0),T=[];if(l)h=l[0],f=l[1],d=l[2],v=l[3];else{y=(c=Ae(p,y,-b)).y;var M=((p=c.x)-(k=(c=Ae(k,E,-b)).x))/2,w=(y-(E=c.y))/2,S=M*M/(g*g)+w*w/(m*m);S>1&&(g*=S=Math.sqrt(S),m*=S);var N=g*g,P=m*m,C=(a===o?-1:1)*Math.sqrt(Math.abs((N*P-N*w*w-P*M*M)/(N*w*w+P*M*M)));d=C*g*w/m+(p+k)/2,h=Math.asin(((y-(v=C*-m*M/g+(y+E)/2))/m*1e9|0)/1e9),f=Math.asin(((E-v)/m*1e9|0)/1e9),0>(h=d>p?Math.PI-h:h)&&(h=2*Math.PI+h),0>(f=d>k?Math.PI-f:f)&&(f=2*Math.PI+f),o&&h>f&&(h-=2*Math.PI),!o&&f>h&&(f-=2*Math.PI)}var A=f-h;if(Math.abs(A)>x){var O=f,R=k,L=E;T=Oe(k=d+g*Math.cos(f=h+x*(o&&f>h?1:-1)),E=v+m*Math.sin(f),g,m,i,0,o,R,L,[f,O,d,v])}A=f-h;var I=Math.cos(h),D=Math.sin(h),_=Math.cos(f),G=Math.sin(f),F=Math.tan(A/4),B=4/3*g*F,V=4/3*m*F,U=[p,y],z=[p+B*D,y-V*I],H=[k+B*G,E-V*_],j=[k,E];if(z[0]=2*U[0]-z[0],z[1]=2*U[1]-z[1],l)return z.concat(H,j,T);for(var Y=[],W=0,q=(T=z.concat(H,j,T)).length;q>W;W+=1)Y[W]=W%2?Ae(T[W-1],T[W],b).y:Ae(T[W],T[W+1],b).x;return Y}function Re(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var Le=function(t,e,n,r){return ce(ce([],Re([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function Ie(t,e){var n,r,i,a,o,s,u,l=t[0],c=t.slice(1).map(Number),h=c[0],f=c[1],d=e.x1,v=e.y1,p=e.x,y=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=h,e.y=f,t;case"A":return n=[d,v].concat(c),["C"].concat(Oe(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=f,n=[d,v].concat(c),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(a=n[4])+u*r,s*(o=n[5])+u*i,a,o]);case"L":return["C"].concat(Le(d,v,h,f));case"Z":return d===p&&v===y?["C",d,v,p,y,p,y]:["C"].concat(Le(d,v,p,y))}return t}function De(t,e){if(void 0===e&&(e=!1),function(t){return ye(t)&&t.every(function(t){return"MC".includes(t[0])})}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,a=Ce(t),o=le({},he),s=[],u="",l=a.length,c=[],h=0;l>h;h+=1){a[h]&&(u=a[h][0]),s[h]=u;var f=Ie(a[h],o);a[h]=f,fe(a,s,h),l=a.length,"Z"===u&&c.push(h),o.x1=+(r=a[h])[(i=r.length)-2],o.y1=+r[i-1],o.x2=+r[i-4]||o.x1,o.y2=+r[i-3]||o.y1}return e?[a,c]:a}function _e(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Ge(t,e,n,r,i){var a=_e([t,e],[n,r]),o={x:0,y:0};if("number"==typeof i)if(0<i)if(i<a){var s=Re([t,e],[n,r],i/a);o={x:s[0],y:s[1]}}else o={x:n,y:r};else o={x:t,y:e};return{length:a,point:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Fe(t,e){var n=t.x,r=t.y,i=e.x,a=e.y;return(0>n*a-r*i?-1:1)*Math.acos((n*i+r*a)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2))))}function Be(t,e,n,r,i,a,o,s,u,l){var c=Math.abs,h=Math.sin,f=Math.cos,d=Math.sqrt,v=Math.PI,p=c(n),y=c(r),g=(i%360+360)%360*(v/180);if(t===s&&e===u)return{x:t,y:e};if(0===p||0===y)return Ge(t,e,s,u,l).point;var m=(t-s)/2,k=(e-u)/2,E={x:f(g)*m+h(g)*k,y:-h(g)*m+f(g)*k},x=Math.pow(E.x,2)/Math.pow(p,2)+Math.pow(E.y,2)/Math.pow(y,2);x>1&&(p*=d(x),y*=d(x));var b=(Math.pow(p,2)*Math.pow(y,2)-Math.pow(p,2)*Math.pow(E.y,2)-Math.pow(y,2)*Math.pow(E.x,2))/(Math.pow(p,2)*Math.pow(E.y,2)+Math.pow(y,2)*Math.pow(E.x,2)),T=(a!==o?1:-1)*d(b=0>b?0:b),M=T*(p*E.y/y),w=T*(-y*E.x/p),S=f(g)*M-h(g)*w+(t+s)/2,N=h(g)*M+f(g)*w+(e+u)/2,P={x:(E.x-M)/p,y:(E.y-w)/y},C=Fe({x:1,y:0},P),A=Fe(P,{x:(-E.x-M)/p,y:(-E.y-w)/y});!o&&A>0?A-=2*v:o&&0>A&&(A+=2*v);var O=C+(A%=2*v)*l,R=p*f(O),L=y*h(O);return{x:f(g)*R-h(g)*L+S,y:h(g)*R+f(g)*L+N}}function Ve(t,e,n,r,i,a,o,s,u,l,c){var h,f=c.bbox,d=void 0===f||f,v=c.length,p=void 0===v||v,y=c.sampleSize,g=void 0===y?30:y,m="number"==typeof l,k=t,E=e,x=0,b=[k,E,x],T=[k,E],M={x:0,y:0},w=[{x:k,y:E}];m&&0>=l&&(M={x:k,y:E});for(var S=0;g>=S;S+=1){if(k=(h=Be(t,e,n,r,i,a,o,s,u,S/g)).x,E=h.y,d&&w.push({x:k,y:E}),p&&(x+=_e(T,[k,E])),T=[k,E],m&&x>=l&&l>b[2]){var N=(x-l)/(x-b[2]);M={x:T[0]*(1-N)+b[0]*N,y:T[1]*(1-N)+b[1]*N}}b=[k,E,x]}return m&&l>=x&&(M={x:s,y:u}),{length:x,point:M,min:{x:Math.min.apply(null,w.map(function(t){return t.x})),y:Math.min.apply(null,w.map(function(t){return t.y}))},max:{x:Math.max.apply(null,w.map(function(t){return t.x})),y:Math.max.apply(null,w.map(function(t){return t.y}))}}}function Ue(t,e,n,r,i,a,o,s,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*i+Math.pow(u,3)*o,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*a+Math.pow(u,3)*s}}function ze(t,e,n,r,i,a,o,s,u,l){var c,h=l.bbox,f=void 0===h||h,d=l.length,v=void 0===d||d,p=l.sampleSize,y=void 0===p?10:p,g="number"==typeof u,m=t,k=e,E=0,x=[m,k,E],b=[m,k],T={x:0,y:0},M=[{x:m,y:k}];g&&0>=u&&(T={x:m,y:k});for(var w=0;y>=w;w+=1){if(m=(c=Ue(t,e,n,r,i,a,o,s,w/y)).x,k=c.y,f&&M.push({x:m,y:k}),v&&(E+=_e(b,[m,k])),b=[m,k],g&&E>=u&&u>x[2]){var S=(E-u)/(E-x[2]);T={x:b[0]*(1-S)+x[0]*S,y:b[1]*(1-S)+x[1]*S}}x=[m,k,E]}return g&&u>=E&&(T={x:o,y:s}),{length:E,point:T,min:{x:Math.min.apply(null,M.map(function(t){return t.x})),y:Math.min.apply(null,M.map(function(t){return t.y}))},max:{x:Math.max.apply(null,M.map(function(t){return t.x})),y:Math.max.apply(null,M.map(function(t){return t.y}))}}}function He(t,e,n,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*i,y:Math.pow(s,2)*e+2*s*o*r+Math.pow(o,2)*a}}function je(t,e,n,r,i,a,o,s){var u,l=s.bbox,c=void 0===l||l,h=s.length,f=void 0===h||h,d=s.sampleSize,v=void 0===d?10:d,p="number"==typeof o,y=t,g=e,m=0,k=[y,g,m],E=[y,g],x={x:0,y:0},b=[{x:y,y:g}];p&&0>=o&&(x={x:y,y:g});for(var T=0;v>=T;T+=1){if(y=(u=He(t,e,n,r,i,a,T/v)).x,g=u.y,c&&b.push({x:y,y:g}),f&&(m+=_e(E,[y,g])),E=[y,g],p&&m>=o&&o>k[2]){var M=(m-o)/(m-k[2]);x={x:E[0]*(1-M)+k[0]*M,y:E[1]*(1-M)+k[1]*M}}k=[y,g,m]}return p&&o>=m&&(x={x:i,y:a}),{length:m,point:x,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,b.map(function(t){return t.x})),y:Math.max.apply(null,b.map(function(t){return t.y}))}}}function Ye(t,e,n){for(var r,i,a,o,s,u,l,c,h,f=Ce(t),d="number"==typeof e,v=[],p=0,y=0,g=0,m=0,k=[],E=[],x=0,b={x:0,y:0},T=b,M=b,w=b,S=0,N=0,P=f.length;P>N;N+=1)v=(l="M"===(c=(h=f[N])[0]))?v:[p,y].concat(h.slice(1)),l?(T=b={x:g=h[1],y:m=h[2]},x=0,d&&.001>e&&(w=b)):"L"===c?(x=(r=Ge(v[0],v[1],v[2],v[3],(e||0)-S)).length,b=r.min,T=r.max,M=r.point):"A"===c?(x=(i=Ve(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],(e||0)-S,n||{})).length,b=i.min,T=i.max,M=i.point):"C"===c?(x=(a=ze(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],(e||0)-S,n||{})).length,b=a.min,T=a.max,M=a.point):"Q"===c?(x=(o=je(v[0],v[1],v[2],v[3],v[4],v[5],(e||0)-S,n||{})).length,b=o.min,T=o.max,M=o.point):"Z"===c&&(x=(s=Ge((v=[p,y,g,m])[0],v[1],v[2],v[3],(e||0)-S)).length,b=s.min,T=s.max,M=s.point),d&&e>S&&S+x>=e&&(w=M),E.push(T),k.push(b),S+=x,p=(u="Z"!==c?h.slice(-2):[g,m])[0],y=u[1];return d&&e>=S&&(w={x:p,y:y}),{length:S,point:w,min:{x:Math.min.apply(null,k.map(function(t){return t.x})),y:Math.min.apply(null,k.map(function(t){return t.y}))},max:{x:Math.max.apply(null,E.map(function(t){return t.x})),y:Math.max.apply(null,E.map(function(t){return t.y}))}}}function We(t){return function(t){var e=0,n=0,r=0;return De(t).map(function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var a,o,s,u,l,c,h,f,d=t.slice(1);return r=3*(((f=d[5])-(o=n))*((s=d[0])+(l=d[2]))-((h=d[4])-(a=e))*((u=d[1])+(c=d[3]))+u*(a-l)-s*(o-c)+f*(l+a/3)-h*(c+o/3))/20,i=t.slice(-2),e=i[0],n=i[1],r}).reduce(function(t,e){return t+e},0)}(t)>=0}function qe(t){return t.map(function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?ze(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),a=t.slice(6,8),o=Re(n,r,e),s=Re(r,i,e),u=Re(i,a,e),l=Re(o,s,e),c=Re(s,u,e),h=Re(l,c,e);return[["C"].concat(o,l,h),["C"].concat(c,u,a)]}(r):[t,t]:[t],l:i}})}function Xe(t,e,n,r){if(void 0===r&&(r=0),r>50)return console.warn("Maximum recursion depth reached in equalizeSegments"),[t,e];var i=qe(t),a=qe(e),o=i.length,s=a.length,u=i.filter(function(t){return t.l}).length,l=a.filter(function(t){return t.l}).length,c=i.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/u||0,h=a.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/l||0,f=n||Math.max(o,s),d=[c,h],v=[f-o,f-s],p=0,y=[i,a].map(function(t,e){return t.l===f?t.map(function(t){return t.s}):t.map(function(t,n){return v[e]-=(p=n&&v[e]&&t.l>=d[e])?1:0,p?t.ss:[t.s]}).flat()});return y[0].length===y[1].length?y:Xe(y[0],y[1],f,r+1)}function Ze(t){return void 0===t?0:t>360||-360>t?t%360:t}var $e=ot();function Ke(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=3>=arguments.length||void 0===arguments[3]||arguments[3];return Array.isArray(t)&&3===t.length?a?(e=t,(n=new S(3))[0]=e[0],n[1]=e[1],n[2]=e[2],n):lt($e,t):ie(t)?a?ut(t,r,i):ct($e,t,r,i):a?ut(t[0],t[1]||r,t[2]||i):ct($e,t[0],t[1]||r,t[2]||i)}var Qe=Math.PI/180;function Je(t){return t*Qe}var tn=180/Math.PI;function en(t){return t*tn}function nn(t){return 360*t}var rn=Math.PI/2;function an(t,e){return 16===e.length?function(t,e){var n,r,i=b(X(ot(),e),3),a=i[0],o=i[1],s=i[2],u=Math.asin(-e[2]/a);return rn>u?u>-rn?(n=Math.atan2(e[6]/o,e[10]/s),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/o,e[5]/o)):(r=0,n=Math.atan2(e[4]/o,e[5]/o)),t[0]=n,t[1]=u,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=r*r,s=i*i,u=a*a,l=n*n+o+s+u,c=n*a-r*i;return c>.499995*l?(t[0]=rn,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*l>c?(t[0]=-rn,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-a*r)),t[1]=Math.atan2(2*(n*a+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*a),1-2*(o+s))),t}(t,e)}function on(t,e,n,r,i){var a,o,s,u,l,c,h,f,d,v,p=Math.cos(t),y=Math.sin(t);return a=r*p,o=i*y,s=0,u=-r*y,l=i*p,c=0,h=e,f=n,d=1,(v=new S(9))[0]=a,v[1]=o,v[2]=s,v[3]=u,v[4]=l,v[5]=c,v[6]=h,v[7]=f,v[8]=d,v}function sn(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);if(0>e*i-n*r&&(i>e?a=-a:o=-o),a){var s=1/a;e*=s,n*=s}if(o){var u=1/o;r*=u,i*=u}var l=en(Math.atan2(n,e));return[t[6],t[7],a,o,l]}var un=P(),ln=P(),cn=xt(),hn=[ot(),ot(),ot()],fn=ot();function dn(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var vn=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),pn=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),yn=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),gn={UPDATED:"updated"},mn=2e-4,kn=function(){return u(function t(){o(this,t),this.clipSpaceNearZ=c.NEGATIVE_ONE,this.eventEmitter=new M,this.matrix=P(),this.right=ut(1,0,0),this.up=ut(0,1,0),this.forward=ut(0,0,1),this.position=ut(0,0,1),this.focalPoint=ut(0,0,0),this.distanceVector=ut(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=P(),this.projectionMatrixInverse=P(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=vn.EXPLORING,this.trackingMode=pn.DEFAULT,this.projectionMode=yn.PERSPECTIVE,this.frustum=new jt,this.orthoMatrix=P()},[{key:"isOrtho",value:function(){return this.projectionMode===yn.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,e){return this.type=t,this.setWorldRotation(this.type===vn.EXPLORING),this._getAngles(),this.type===vn.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==vn.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return L(P(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=V(P(),[t,e,0]);this.jitteredProjectionMatrix=D(P(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===yn.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===yn.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.projectionMode===yn.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===yn.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===yn.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===yn.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,a);var o=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=ut(o.x-r,o.y-i,0),u=pt(s,this.right)/st(this.right),l=pt(s,this.up)/st(this.up),c=b(this.getPosition(),2),h=c[0],f=c[1],d=b(this.getFocalPoint(),2),v=d[0],p=d[1];return this.setPosition(h-u,f-l),this.setFocalPoint(v-u,p-l),this}},{key:"setPerspective",value:function(t,e,n,r){var i;this.projectionMode=yn.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var a=this.near*Math.tan(Je(.5*this.fov))/this.zoom,o=2*a,s=this.aspect*o,u=-.5*s;if(null!==(i=this.view)&&void 0!==i&&i.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;u+=this.view.offsetX*s/l,a-=this.view.offsetY*o/h,s*=this.view.width/l,o*=this.view.height/h}return function(t,e,n,r,i,a,o){var s,u,l=2*a,c=n-e,h=r-i,f=l/h,d=(n+e)/c,v=(r+i)/h,p=o-a,y=o*a;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(s=-o/p,u=-y/p):(s=-(o+a)/p,u=-2*y/p),t[0]=l/c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=d,t[9]=v,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0}(this.projectionMatrix,u,u+s,a-o,a,t,this.far,this.clipSpaceNearZ===c.ZERO),L(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,r,i,a){var o;this.projectionMode=yn.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var s=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,f=l-s,d=l+s,v=h+u,p=h-u;if(null!==(o=this.view)&&void 0!==o&&o.enabled){var y=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(f+=y*this.view.offsetX)+y*this.view.width,p=(v-=g*this.view.offsetY)-g*this.view.height}return this.clipSpaceNearZ===c.NEGATIVE_ONE?tt(this.projectionMatrix,f,d,v,p,i,a):et(this.projectionMatrix,f,d,v,p,i,a),L(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=Ke(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(e),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],r=ut(0,1,0);if(this.focalPoint=Ke(t,e,n),this.trackingMode===pn.CINEMATIC){var i=ft(ot(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var a=st(i),o=en(Math.asin(e/a)),s=90+en(Math.atan2(n,t)),u=P();B(u,u,Je(s)),F(u,u,Je(o)),r=gt(ot(),[0,1,0],u)}return L(this.matrix,nt(P(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||0>t)return this;this.distance=t,mn>this.distance&&(this.distance=mn),this.dollyingStep=this.distance/100;var e=ot(),n=this.forward,r=this.focalPoint;return e[0]=(t=this.distance)*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=Ze(t),this.computeMatrix(),this._getAxes(),this.type===vn.ORBITING||this.type===vn.EXPLORING?this._getPosition():this.type===vn.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=Ze(t),this.computeMatrix(),this._getAxes(),this.type===vn.ORBITING||this.type===vn.EXPLORING?this._getPosition():this.type===vn.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=Ze(t),this.computeMatrix(),this._getAxes(),this.type===vn.ORBITING||this.type===vn.EXPLORING?this._getPosition():this.type===vn.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=wt(Mt(),[0,0,1],Je(this.roll));O(this.matrix);var e=wt(Mt(),[1,0,0],Je((this.rotateWorld&&this.type!==vn.TRACKING||this.type===vn.TRACKING?1:-1)*this.elevation)),n=wt(Mt(),[0,1,0],Je((this.rotateWorld&&this.type!==vn.TRACKING||this.type===vn.TRACKING?1:-1)*this.azimuth)),r=St(Mt(),n,e);r=St(Mt(),r,t);var i=K(P(),r);this.type===vn.ORBITING||this.type===vn.EXPLORING?(_(this.matrix,this.matrix,this.focalPoint),D(this.matrix,this.matrix,i),_(this.matrix,this.matrix,[0,0,this.distance])):this.type===vn.TRACKING&&(_(this.matrix,this.matrix,this.position),D(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=Ke(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){lt(this.right,Ke(Tt(xt(),[1,0,0,0],this.matrix))),lt(this.up,Ke(Tt(xt(),[0,1,0,0],this.matrix))),lt(this.forward,Ke(Tt(xt(),[0,0,1,0],this.matrix))),vt(this.right,this.right),vt(this.up,this.up),vt(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=st(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===vn.TRACKING||this.rotateWorld?(this.elevation=en(Math.asin(e/r)),this.azimuth=en(Math.atan2(-t,-n))):(this.elevation=-en(Math.asin(e/r)),this.azimuth=-en(Math.atan2(-t,-n)))}},{key:"_getPosition",value:function(){lt(this.position,Ke(Tt(xt(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],a=e[2];t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8]}(this.distanceVector,[0,0,-this.distance],(t=N(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),ht(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=ft(ot(),this.focalPoint,this.position),this.distance=st(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===yn.ORTHOGRAPHIC){var t=this.position,e=wt(Mt(),[0,0,1],-this.roll*Math.PI/180);$(this.orthoMatrix,e,ut((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),ut(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=D(P(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(gn.UPDATED)}}},{key:"rotate",value:function(t,e,n){throw Error(qt)}},{key:"pan",value:function(t,e){throw Error(qt)}},{key:"dolly",value:function(t){throw Error(qt)}},{key:"createLandmark",value:function(t,e){throw Error(qt)}},{key:"gotoLandmark",value:function(t,e){throw Error(qt)}},{key:"cancelLandmarkAnimation",value:function(){throw Error(qt)}}])}();function En(){return En="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=y(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(3>arguments.length?t:n):i.value}},En.apply(null,arguments)}function xn(t,e,n,r){var i=En(y(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}var bn=function(t){return t[t.Standard=0]="Standard",t}({}),Tn=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),Mn=ot(),wn=P(),Sn=Mt();function Nn(t){if(t.localDirtyFlag){if(0!==t.localSkew[0]||0!==t.localSkew[1]){$(t.localTransform,t.localRotation,t.localPosition,ut(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(O(wn),wn[4]=Math.tan(t.localSkew[0]),wn[1]=Math.tan(t.localSkew[1]),D(t.localTransform,t.localTransform,wn));var e=$(wn,Ot(Sn,0,0,0,1),ct(Mn,1,1,1),t.localScale,t.origin);D(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,a=t.localScale,o=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2];1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2]||(1!==a[0]||1!==a[1]||1!==a[2])||(0!==o[0]||0!==o[1]||0!==o[2])?$(n,i,r,a,o):s?V(n,r):O(n)}t.localDirtyFlag=!1}}function Pn(t,e){t.dirtyFlag&&(e?D(t.worldTransform,e.worldTransform,t.localTransform):C(t.worldTransform,t.localTransform),t.dirtyFlag=!1)}var Cn={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Wt(0,0,0,0)},An=function(t){return t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>",t}({});function On(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Rn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ln(){}var In=.7,Dn=1/In,_n="\\s*([+-]?\\d+)\\s*",Gn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Bn=/^#([0-9a-f]{3,8})$/,Vn=RegExp(`^rgb\\(${_n},${_n},${_n}\\)$`),Un=RegExp(`^rgb\\(${Fn},${Fn},${Fn}\\)$`),zn=RegExp(`^rgba\\(${_n},${_n},${_n},${Gn}\\)$`),Hn=RegExp(`^rgba\\(${Fn},${Fn},${Fn},${Gn}\\)$`),jn=RegExp(`^hsl\\(${Gn},${Fn},${Fn}\\)$`),Yn=RegExp(`^hsla\\(${Gn},${Fn},${Fn},${Gn}\\)$`),Wn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function qn(){return this.rgb().formatHex()}function Xn(){return this.rgb().formatRgb()}function Zn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Bn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?$n(e):3===n?new Qn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Kn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Kn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Vn.exec(t))?new Qn(e[1],e[2],e[3],1):(e=Un.exec(t))?new Qn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=zn.exec(t))?Kn(e[1],e[2],e[3],e[4]):(e=Hn.exec(t))?Kn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=jn.exec(t))?ir(e[1],e[2]/100,e[3]/100,1):(e=Yn.exec(t))?ir(e[1],e[2]/100,e[3]/100,e[4]):Wn.hasOwnProperty(t)?$n(Wn[t]):"transparent"===t?new Qn(NaN,NaN,NaN,0):null}function $n(t){return new Qn(t>>16&255,t>>8&255,255&t,1)}function Kn(t,e,n,r){return r>0||(t=e=n=NaN),new Qn(t,e,n,r)}function Qn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Jn(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}`}function tr(){const t=er(this.opacity);return`${1===t?"rgb(":"rgba("}${nr(this.r)}, ${nr(this.g)}, ${nr(this.b)}${1===t?")":`, ${t})`}`}function er(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function nr(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function rr(t){return(16>(t=nr(t))?"0":"")+t.toString(16)}function ir(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new or(t,e,n,r)}function ar(t){if(t instanceof or)return new or(t.h,t.s,t.l,t.opacity);if(t instanceof Ln||(t=Zn(t)),!t)return new or;if(t instanceof or)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(r>n):n===a?(r-e)/s+2:(e-n)/s+4,s/=.5>u?a+i:2-a-i,o*=60):s=u>0&&1>u?0:o,new or(o,s,u,t.opacity)}function or(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function sr(t){return 0>(t=(t||0)%360)?t+360:t}function ur(t){return Math.max(0,Math.min(1,t||0))}function lr(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}function cr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];var o=e?e.apply(this,i):i[0],s=n.cache;if(s.has(o))return s.get(o);var u=t.apply(this,i);return n.cache=s.set(o,u)||s,u};return n.cache=new(cr.Cache||Map),cr.cacheList.push(n.cache),n}On(Ln,Zn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:qn,formatHex:qn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ar(this).formatHsl()},formatRgb:Xn,toString:Xn}),On(Qn,function(t,e,n,r){return 1===arguments.length?((i=t)instanceof Ln||(i=Zn(i)),i?new Qn((i=i.rgb()).r,i.g,i.b,i.opacity):new Qn):new Qn(t,e,n,null==r?1:r);var i},Rn(Ln,{brighter(t){return new Qn(this.r*(t=null==t?Dn:Math.pow(Dn,t)),this.g*t,this.b*t,this.opacity)},darker(t){return new Qn(this.r*(t=null==t?In:Math.pow(In,t)),this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Qn(nr(this.r),nr(this.g),nr(this.b),er(this.opacity))},displayable(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:Jn,formatHex:Jn,formatHex8:function(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}${rr(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:tr,toString:tr})),On(or,function(t,e,n,r){return 1===arguments.length?ar(t):new or(t,e,n,null==r?1:r)},Rn(Ln,{brighter(t){return new or(this.h,this.s,this.l*(t=null==t?Dn:Math.pow(Dn,t)),this.opacity)},darker(t){return new or(this.h,this.s,this.l*(t=null==t?In:Math.pow(In,t)),this.opacity)},rgb(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new Qn(lr(240>t?t+120:t-240,r,n),lr(t,r,n),lr(120>t?t+240:t-120,r,n),this.opacity)},clamp(){return new or(sr(this.h),ur(this.s),ur(this.l),er(this.opacity))},displayable(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl(){const t=er(this.opacity);return`${1===t?"hsl(":"hsla("}${sr(this.h)}, ${100*ur(this.s)}%, ${100*ur(this.l)}%${1===t?")":`, ${t})`}`}})),cr.Cache=Map,cr.cacheList=[],cr.clearCache=function(){cr.cacheList.forEach(function(t){return t.clear()})};var hr=function(t){return t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger",t}({}),fr=function(t){return t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther",t}({}),dr=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),vr=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),pr=[{name:"em",unit_type:hr.kEms},{name:"px",unit_type:hr.kPixels},{name:"deg",unit_type:hr.kDegrees},{name:"rad",unit_type:hr.kRadians},{name:"grad",unit_type:hr.kGradians},{name:"ms",unit_type:hr.kMilliseconds},{name:"s",unit_type:hr.kSeconds},{name:"rem",unit_type:hr.kRems},{name:"turn",unit_type:hr.kTurns}],yr=function(t){return t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType",t}({}),gr=function(t){return t?"number"===t?hr.kNumber:"percent"===t||"%"===t?hr.kPercentage:function(t){return pr.find(function(e){return e.name===t}).unit_type}(t):hr.kUnknown},mr=function(t){var e=1;switch(t){case hr.kPixels:case hr.kDegrees:case hr.kSeconds:break;case hr.kMilliseconds:e=.001;break;case hr.kRadians:e=180/Math.PI;break;case hr.kGradians:e=.9;break;case hr.kTurns:e=360}return e},kr=function(t){switch(t){case hr.kNumber:case hr.kInteger:return"";case hr.kPercentage:return"%";case hr.kEms:return"em";case hr.kRems:return"rem";case hr.kPixels:return"px";case hr.kDegrees:return"deg";case hr.kRadians:return"rad";case hr.kGradians:return"grad";case hr.kMilliseconds:return"ms";case hr.kSeconds:return"s";case hr.kTurns:return"turn"}return""},Er=function(){return u(function t(){o(this,t)},[{key:"toString",value:function(){return this.buildCSSText(dr.kNo,vr.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=yr.kUnitType&&this.getType()<=yr.kClampType}}],[{key:"isAngle",value:function(t){return t===hr.kDegrees||t===hr.kRadians||t===hr.kGradians||t===hr.kTurns}},{key:"isLength",value:function(t){return t>=hr.kEms&&hr.kDegrees>t}},{key:"isRelativeUnit",value:function(t){return t===hr.kPercentage||t===hr.kEms||t===hr.kRems}},{key:"isTime",value:function(t){return t===hr.kSeconds||t===hr.kMilliseconds}}])}(),xr=function(t){function e(t){var n;return o(this,e),(n=k(this,e)).colorSpace=t,n}return x(e,t),u(e,[{key:"getType",value:function(){return yr.kColorType}},{key:"to",value:function(t){return this}}])}(Er),br=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({}),Tr=function(t){function e(t,n){var r;return o(this,e),(r=k(this,e)).type=t,r.value=n,r}return x(e,t),u(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return yr.kColorType}}])}(Er),Mr=function(t){function e(t){var n;return o(this,e),(n=k(this,e)).value=t,n}return x(e,t),u(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return yr.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}])}(Er),wr=function(t){return function(t){switch(t){case fr.kUNumber:return hr.kNumber;case fr.kULength:return hr.kPixels;case fr.kUPercent:return hr.kPercentage;case fr.kUTime:return hr.kSeconds;case fr.kUAngle:return hr.kDegrees;default:return hr.kUnknown}}(function(t){switch(t){case hr.kNumber:case hr.kInteger:return fr.kUNumber;case hr.kPercentage:return fr.kUPercent;case hr.kPixels:return fr.kULength;case hr.kMilliseconds:case hr.kSeconds:return fr.kUTime;case hr.kDegrees:case hr.kRadians:case hr.kGradians:case hr.kTurns:return fr.kUAngle;default:return fr.kUOther}}(t))},Sr=function(t){function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hr.kNumber;return o(this,e),n=k(this,e),r="string"==typeof i?gr(i):i,n.unit=r,n.value=t,n}return x(e,t),u(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){return this.value===t.value&&this.unit===t.unit}},{key:"getType",value:function(){return yr.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=wr(this.unit);if(n!==wr(t)||n===hr.kUnknown)return null;var r=mr(this.unit)/mr(t);return new e(this.value*r,t)}},{key:"buildCSSText",value:function(t,e,n){var r;switch(this.unit){case hr.kUnknown:break;case hr.kInteger:r=Number(this.value).toFixed(0);break;case hr.kNumber:case hr.kPercentage:case hr.kEms:case hr.kRems:case hr.kPixels:case hr.kDegrees:case hr.kRadians:case hr.kGradians:case hr.kMilliseconds:case hr.kSeconds:case hr.kTurns:var i=this.value,a=kr(this.unit);if(-999999>i||i>999999){var o=kr(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(i,o):i+(o||"")}else r="".concat(i).concat(a)}return n+=r}}])}(Er),Nr=new Sr(0,"px");new Sr(1,"px");var Pr=new Sr(0,"deg"),Cr=function(t){function e(t,n,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return o(this,e),(i=k(this,e,["rgb"])).r=t,i.g=n,i.b=r,i.alpha=a,i.isNone=s,i}return x(e,t),u(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(xr),Ar=new Mr("unset"),Or={"":Ar,unset:Ar,initial:new Mr("initial"),inherit:new Mr("inherit")},Rr=new Cr(0,0,0,0,!0),Lr=new Cr(0,0,0,0),Ir=cr(function(t,e,n,r){return new Cr(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),Dr=function(t){return new Sr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:hr.kNumber)};function _r(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new Sr(50,"%");var Gr=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,a=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,o=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,f=/^\(/,d=/^\)/,v=/^,/,p=/^\#([0-9a-fA-F]+)/,y=/^([a-zA-Z]+)/,g=/^rgb/i,m=/^rgba/i,k=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,E="";function x(t){throw Error("".concat(E,": ").concat(t))}function b(){var t=R(T);return E.length>0&&x("Invalid input not EOF"),t}function T(){return M("linear-gradient",t,S)||M("repeating-linear-gradient",e,S)||M("radial-gradient",n,N)||M("repeating-radial-gradient",r,N)||M("conic-gradient",i,N)}function M(t,e,n){return w(e,function(e){var r=n();return r&&(F(v)||x("Missing comma before color stops")),{type:t,orientation:r,colorStops:R(L)}})}function w(t,e){var n=F(t);if(n){F(f)||x("Missing (");var r=e(n);return F(d)||x("Missing )"),r}}function S(){return G("directional",a,1)||G("angular",h,1)}function N(){var t,e,n=P();return n&&((t=[]).push(n),e=E,F(v)&&((n=P())?t.push(n):E=e)),t}function P(){var t=function(){var t=G("shape",/^(circle)/i,0);t&&(t.style=_()||C());return t}()||function(){var t=G("shape",/^(ellipse)/i,0);t&&(t.style=D()||C());return t}();if(t)t.at=A();else{var e=C();if(e){t=e;var n=A();n&&(t.at=n)}else{var r=O();r&&(t={type:"default-radial",at:r})}}return t}function C(){return G("extent-keyword",o,1)}function A(){if(G("position",/^at/,0)){var t=O();return t||x("Missing positioning value"),t}}function O(){var t={x:D(),y:D()};if(t.x||t.y)return{type:"position",value:t}}function R(t){var e=t(),n=[];if(e)for(n.push(e);F(v);)(e=t())?n.push(e):x("One extra comma");return n}function L(){var t=G("hex",p,1)||w(m,function(){return{type:"rgba",value:R(I)}})||w(g,function(){return{type:"rgb",value:R(I)}})||G("literal",y,0);return t||x("Expected color definition"),t.length=D(),t}function I(){return F(k)[1]}function D(){return G("%",l,1)||G("position-keyword",s,1)||_()}function _(){return G("px",u,1)||G("em",c,1)}function G(t,e,n){var r=F(e);if(r)return{type:t,value:r[n]}}function F(t){var e=/^[\n\r\t\s]+/.exec(E);e&&B(e[0].length);var n=t.exec(E);return n&&B(n[0].length),n}function B(t){E=E.substring(t)}return function(t){return E=t,b()}}();function Fr(t,e,n,r){var i=Je(r.value),a=0+e/2,o=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+a-Math.cos(i)*s/2,y1:t[1]+o-Math.sin(i)*s/2,x2:t[0]+a+Math.cos(i)*s/2,y2:t[1]+o+Math.sin(i)*s/2}}function Br(t,e,n,r,i,a){var o=r.value,s=i.value;r.unit===hr.kPercentage&&(o=r.value/100*e),i.unit===hr.kPercentage&&(s=i.value/100*n);var u=Math.max(_e([0,0],[o,s]),_e([0,n],[o,s]),_e([e,n],[o,s]),_e([e,0],[o,s]));return a&&(a instanceof Sr?u=a.value:a instanceof Mr&&("closest-side"===a.value?u=Math.min(o,e-o,s,n-s):"farthest-side"===a.value?u=Math.max(o,e-o,s,n-s):"closest-corner"===a.value&&(u=Math.min(_e([0,0],[o,s]),_e([0,n],[o,s]),_e([e,n],[o,s]),_e([e,0],[o,s]))))),{x:o+t[0],y:s+t[1],r:u}}var Vr=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Ur=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,zr=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Hr=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var jr={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},Yr=cr(function(t){return Dr("angular"===t.type?Number(t.value):jr[t.value]||0,"deg")}),Wr=cr(function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var a=t.value,o=a.x,s=a.y;"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?e=50:"right"===o.value?e=100:"top"===o.value?n=0:"bottom"===o.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(r=null==o?void 0:o.type,e=Number(o.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:Dr(e,r),cy:Dr(n,i)}}),qr=cr(function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Gr(t).map(function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,a=Number(t[0].length.value),o=1;r>o;o++){var s,u=null===(s=t[o].length)||void 0===s?void 0:s.value;if(!$t(u)&&!$t(a)){for(var l=1;o-i>l;l++)t[i+l].length={type:"%",value:"".concat(a+(Number(u)-a)*l/(o-i))};i=o,a=Number(u)}}}(r);var i,a=r.map(function(t){return{offset:Dr(Number(t.length.value),"%"),color:_r(t)}});if("linear-gradient"===e)return new Tr(br.LinearGradient,{angle:n?Yr(n):Pr,steps:a});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o,s=Wr(n[0].at),u=s.cx,l=s.cy;if(n[0].style){var c=n[0].style,h=c.type,f=c.value;"extent-keyword"===h?(Or[i=f]||(Or[i]=new Mr(i)),o=Or[i]):o=Dr(f,h)}return new Tr(br.RadialGradient,{cx:u,cy:l,size:o,steps:a})}});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=Vr.exec(t);if(n){var r,i=(null===(r=n[2].match(Hr))||void 0===r?void 0:r.map(function(t){return t.split(":")}))||[];return[new Tr(br.LinearGradient,{angle:Dr(parseFloat(n[1]),"deg"),steps:i.map(function(t){var e=b(t,2),n=e[1];return{offset:Dr(100*Number(e[0]),"%"),color:n}})})]}}else if("r"===e){var a=function(t){var e=Ur.exec(t);if(e){var n,r=(null===(n=e[4].match(Hr))||void 0===n?void 0:n.map(function(t){return t.split(":")}))||[];return{cx:Dr(50,"%"),cy:Dr(50,"%"),steps:r.map(function(t){var e=b(t,2),n=e[1];return{offset:Dr(100*Number(e[0]),"%"),color:n}})}}return null}(t);if(a){if(!ne(a))return[new Tr(br.RadialGradient,a)];t=a}}else if("p"===e)return function(t){var e=zr.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)});function Xr(t){return t&&!!t.image}function Zr(t){return t&&!$t(t.r)&&!$t(t.g)&&!$t(t.b)}var $r=cr(function(t){if(Xr(t))return a({repetition:"repeat"},t);if($t(t)&&(t=""),"transparent"===t)return Lr;if("currentColor"===t)t="black";else if("none"===t)return Rr;var e=qr(t);if(e)return e;var n=Zn(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Ir.apply(void 0,r)});function Kr(t,e){if(Zr(t)&&Zr(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(re(e[n],0,255));return e[3]=re(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Qr(t,e){if($t(e))return Dr(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Dr(Number(e),"px");if("deg".search(t)>=0)return Dr(Number(e),"deg")}var n=[];e=e.replace(t,function(t){return n.push(t),"U".concat(t)});var r="U(".concat(t.source,")");return n.map(function(t){return Dr(Number(e.replace(RegExp("U".concat(t),"g"),"").replace(RegExp(r,"g"),"*0")),t)})[0]}var Jr=function(t){return Qr(/px/g,t)},ti=cr(Jr);cr(function(t){return Qr(RegExp("%","g"),t)});var ei=function(t){return ie(t)||isFinite(Number(t))?Dr(Number(t)||0,"px"):Qr(RegExp("px|%|em|rem","g"),t)},ni=cr(ei),ri=function(t){return Qr(/deg|rad|grad|turn/g,t)},ii=cr(ri);function ai(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",o=t.value||0,s=e.value||0,u=wr(t.unit),l=t.convertTo(u),c=e.convertTo(u);return l&&c?(o=l.value,s=c.value,a=kr(t.unit)):(Sr.isLength(t.unit)||Sr.isLength(e.unit))&&(o=ui(t,i,n),s=ui(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function oi(t){var e=0;return t.unit===hr.kDegrees?e=t.value:t.unit===hr.kRadians?e=en(Number(t.value)):t.unit===hr.kTurns?e=nn(Number(t.value)):t.value&&(e=t.value),e}function si(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):ne(t)?n=t.split(" ").map(function(t){return Number(t)}):ie(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:4===e?1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]:"even"===e&&n.length%2==1?[].concat(p(n),p(n)):n}function ui(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===hr.kPixels)return Number(t.value);if(t.unit===hr.kPercentage&&n){var i=n.nodeName===l.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var li=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function ci(t){return""+t}var hi=function(t){return Dr("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)},fi=cr(hi);function di(t,e){return[t,e,ci]}function vi(t,e){return function(n,r){return[n,r,function(n){return ci(re(n,t,e))}]}}function pi(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}
|
|
9
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,function(t){"use strict";function e(t){return e="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},e(t)}function n(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r;if("undefined"!=typeof Symbol&&void 0!==(r=t[Symbol.toPrimitive])){var i=r.call(t,n||"default");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function r(t,e,r){return(e=n(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(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 a(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach(function(e){r(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var r=0;e.length>r;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,n(i.key),i)}}function u(t,e,n){return e&&s(t.prototype,e),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}var l=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),c=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),h=function(){return u(function t(){o(this,t),this.plugins=[]},[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach(function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)})}}])}(),f=function(){return u(function t(e){o(this,t),this.clipSpaceNearZ=c.NEGATIVE_ONE,this.plugins=[],this.config=a({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)},[{key:"registerPlugin",value:function(t){-1===this.plugins.findIndex(function(e){return e===t})&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex(function(e){return e===t});e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find(function(e){return e.name===t})}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}();function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function v(t,e){if(t){if("string"==typeof t)return d(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)?d(t,e):void 0}}function p(t){return function(t){if(Array.isArray(t))return d(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||v(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 y(t){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},y(t)}function g(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(g=function(){return!!t})()}function m(t,n){if(n&&("object"==e(n)||"function"==typeof n))return n;if(void 0!==n)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)}function k(t,e,n){return e=y(e),m(t,g()?Reflect.construct(e,n||[],y(t).constructor):e.apply(t,n))}function E(t,e){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},E(t,e)}function x(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 b(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,a,o,s=[],u=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||v(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.")}()}var T={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function a(t,e,r,a,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,a||t,o),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function o(t,e){0===--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,a=Array(i);i>r;r++)a[r]=e[r].fn;return a},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,a,o){var s=n?n+t:t;if(!this._events[s])return!1;var u,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,r),!0;case 4:return c.fn.call(c.context,e,r,i),!0;case 5:return c.fn.call(c.context,e,r,i,a),!0;case 6:return c.fn.call(c.context,e,r,i,a,o),!0}for(l=1,u=Array(h-1);h>l;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var f,d=c.length;for(l=0;d>l;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,r);break;case 4:c[l].fn.call(c[l].context,e,r,i);break;default:if(!u)for(f=1,u=Array(h-1);h>f;f++)u[f-1]=arguments[f];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var a=n?n+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||o(this,a);else{for(var u=0,l=[],c=s.length;c>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&l.push(s[u]);l.length?this._events[a]=1===l.length?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&o(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(T);var M=T.exports,w=1e-6,S="undefined"!=typeof Float32Array?Float32Array:Array;function N(){var t=new S(9);return S!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function P(){var t=new S(16);return S!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function C(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function A(t,e,n,r,i,a,o,s,u,l,c,h,f,d,v,p,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=h,t[11]=f,t[12]=d,t[13]=v,t[14]=p,t[15]=y,t}function O(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function R(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function L(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],y=e[14],g=e[15],m=n*s-r*o,k=n*u-i*o,E=n*l-a*o,x=r*u-i*s,b=r*l-a*s,T=i*l-a*u,M=c*p-h*v,w=c*y-f*v,S=c*g-d*v,N=h*y-f*p,P=h*g-d*p,C=f*g-d*y,A=m*C-k*P+E*N+x*S-b*w+T*M;return A?(t[0]=(s*C-u*P+l*N)*(A=1/A),t[1]=(i*P-r*C-a*N)*A,t[2]=(p*T-y*b+g*x)*A,t[3]=(f*b-h*T-d*x)*A,t[4]=(u*S-o*C-l*w)*A,t[5]=(n*C-i*S+a*w)*A,t[6]=(y*E-v*T-g*k)*A,t[7]=(c*T-f*E+d*k)*A,t[8]=(o*P-s*S+l*M)*A,t[9]=(r*S-n*P-a*M)*A,t[10]=(v*b-p*E+g*m)*A,t[11]=(h*E-c*b-d*m)*A,t[12]=(s*w-o*N-u*M)*A,t[13]=(n*N-r*w+i*M)*A,t[14]=(p*k-v*x-y*m)*A,t[15]=(c*x-h*k+f*m)*A,t):null}function I(t){var e=t[0],n=t[1],r=t[2],i=t[4],a=t[5],o=t[6],s=t[8],u=t[9],l=t[10],c=t[12],h=t[13],f=t[14],d=e*a-n*i,v=e*o-r*i,p=n*o-r*a,y=s*h-u*c,g=s*f-l*c,m=u*f-l*h;return t[7]*(e*m-n*g+r*y)-t[3]*(i*m-a*g+o*y)+t[15]*(s*p-u*v+l*d)-t[11]*(c*p-h*v+f*d)}function D(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],d=e[10],v=e[11],p=e[12],y=e[13],g=e[14],m=e[15],k=n[0],E=n[1],x=n[2],b=n[3];return t[0]=k*r+E*s+x*h+b*p,t[1]=k*i+E*u+x*f+b*y,t[2]=k*a+E*l+x*d+b*g,t[3]=k*o+E*c+x*v+b*m,t[4]=(k=n[4])*r+(E=n[5])*s+(x=n[6])*h+(b=n[7])*p,t[5]=k*i+E*u+x*f+b*y,t[6]=k*a+E*l+x*d+b*g,t[7]=k*o+E*c+x*v+b*m,t[8]=(k=n[8])*r+(E=n[9])*s+(x=n[10])*h+(b=n[11])*p,t[9]=k*i+E*u+x*f+b*y,t[10]=k*a+E*l+x*d+b*g,t[11]=k*o+E*c+x*v+b*m,t[12]=(k=n[12])*r+(E=n[13])*s+(x=n[14])*h+(b=n[15])*p,t[13]=k*i+E*u+x*f+b*y,t[14]=k*a+E*l+x*d+b*g,t[15]=k*o+E*c+x*v+b*m,t}function _(t,e,n){var r,i,a,o,s,u,l,c,h,f,d,v,p=n[0],y=n[1],g=n[2];return e===t?(t[12]=e[0]*p+e[4]*y+e[8]*g+e[12],t[13]=e[1]*p+e[5]*y+e[9]*g+e[13],t[14]=e[2]*p+e[6]*y+e[10]*g+e[14],t[15]=e[3]*p+e[7]*y+e[11]*g+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],d=e[10],v=e[11],t[0]=r=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=f,t[10]=d,t[11]=v,t[12]=r*p+s*y+h*g+e[12],t[13]=i*p+u*y+f*g+e[13],t[14]=a*p+l*y+d*g+e[14],t[15]=o*p+c*y+v*g+e[15]),t}function G(t,e,n){var r=n[0],i=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function F(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+l*r,t[5]=o*i+c*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=l*i-a*r,t[9]=c*i-o*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function B(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[8],c=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-l*r,t[1]=o*i-c*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=a*r+l*i,t[9]=o*r+c*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function V(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function U(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function z(t,e,n){var r,i,a,o=n[0],s=n[1],u=n[2],l=Math.sqrt(o*o+s*s+u*u);return w>l?null:(o*=l=1/l,s*=l,u*=l,r=Math.sin(e),t[0]=o*o*(a=1-(i=Math.cos(e)))+i,t[1]=s*o*a+u*r,t[2]=u*o*a-s*r,t[3]=0,t[4]=o*s*a-u*r,t[5]=s*s*a+i,t[6]=u*s*a+o*r,t[7]=0,t[8]=o*u*a+s*r,t[9]=s*u*a-o*r,t[10]=u*u*a+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function H(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function j(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Y(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function W(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,u=i+i,l=a+a,c=r*s,h=r*u,f=r*l,d=i*u,v=i*l,p=a*l,y=o*s,g=o*u,m=o*l;return t[0]=1-(d+p),t[1]=h+m,t[2]=f-g,t[3]=0,t[4]=h-m,t[5]=1-(c+p),t[6]=v+y,t[7]=0,t[8]=f+g,t[9]=v-y,t[10]=1-(c+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function q(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function X(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],s=e[6],u=e[8],l=e[9],c=e[10];return t[0]=Math.sqrt(n*n+r*r+i*i),t[1]=Math.sqrt(a*a+o*o+s*s),t[2]=Math.sqrt(u*u+l*l+c*c),t}function Z(t,e){var n=new S(3);X(n,e);var r=1/n[0],i=1/n[1],a=1/n[2],o=e[0]*r,s=e[1]*i,u=e[2]*a,l=e[4]*r,c=e[5]*i,h=e[6]*a,f=e[8]*r,d=e[9]*i,v=e[10]*a,p=o+c+v,y=0;return p>0?(t[3]=.25*(y=2*Math.sqrt(p+1)),t[0]=(h-d)/y,t[1]=(f-u)/y,t[2]=(s-l)/y):o>c&&o>v?(t[3]=(h-d)/(y=2*Math.sqrt(1+o-c-v)),t[0]=.25*y,t[1]=(s+l)/y,t[2]=(f+u)/y):c>v?(t[3]=(f-u)/(y=2*Math.sqrt(1+c-o-v)),t[0]=(s+l)/y,t[1]=.25*y,t[2]=(h+d)/y):(t[3]=(s-l)/(y=2*Math.sqrt(1+v-o-c)),t[0]=(f+u)/y,t[1]=(h+d)/y,t[2]=.25*y),t}function $(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],u=e[3],l=a+a,c=o+o,h=s+s,f=a*l,d=a*c,v=a*h,p=o*c,y=o*h,g=s*h,m=u*l,k=u*c,E=u*h,x=r[0],b=r[1],T=r[2],M=i[0],w=i[1],S=i[2],N=(1-(p+g))*x,P=(d+E)*x,C=(v-k)*x,A=(d-E)*b,O=(1-(f+g))*b,R=(y+m)*b,L=(v+k)*T,I=(y-m)*T,D=(1-(f+p))*T;return t[0]=N,t[1]=P,t[2]=C,t[3]=0,t[4]=A,t[5]=O,t[6]=R,t[7]=0,t[8]=L,t[9]=I,t[10]=D,t[11]=0,t[12]=n[0]+M-(N*M+A*w+L*S),t[13]=n[1]+w-(P*M+O*w+I*S),t[14]=n[2]+S-(C*M+R*w+D*S),t[15]=1,t}function K(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,u=i+i,l=n*o,c=r*o,h=r*s,f=i*o,d=i*s,v=i*u,p=a*o,y=a*s,g=a*u;return t[0]=1-h-v,t[1]=c+g,t[2]=f-y,t[3]=0,t[4]=c-g,t[5]=1-l-v,t[6]=d+p,t[7]=0,t[8]=f+y,t[9]=d-p,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Q(t,e,n,r,i){var a=1/Math.tan(e/2);if(t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0){var o=1/(r-i);t[10]=(i+r)*o,t[14]=2*i*r*o}else t[10]=-1,t[14]=-2*r;return t}function J(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(o+a)*l,t[15]=1,t}var tt=J;function et(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=a*l,t[15]=1,t}function nt(t,e,n,r){var i,a,o,s,u,l,c,h,f,d,v=e[0],p=e[1],y=e[2],g=r[0],m=r[1],k=r[2],E=n[0],x=n[1],b=n[2];return w>Math.abs(v-E)&&w>Math.abs(p-x)&&w>Math.abs(y-b)?O(t):(f=y-b,(d=Math.sqrt((i=m*(f*=d=1/Math.sqrt((c=v-E)*c+(h=p-x)*h+f*f))-k*(h*=d))*i+(a=k*(c*=d)-g*f)*a+(o=g*h-m*c)*o))?(i*=d=1/d,a*=d,o*=d):(i=0,a=0,o=0),(d=Math.sqrt((s=h*o-f*a)*s+(u=f*i-c*o)*u+(l=c*a-h*i)*l))?(s*=d=1/d,u*=d,l*=d):(s=0,u=0,l=0),t[0]=i,t[1]=s,t[2]=c,t[3]=0,t[4]=a,t[5]=u,t[6]=h,t[7]=0,t[8]=o,t[9]=l,t[10]=f,t[11]=0,t[12]=-(i*v+a*p+o*y),t[13]=-(s*v+u*p+l*y),t[14]=-(c*v+h*p+f*y),t[15]=1,t)}function rt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var it=D,at=Object.freeze({__proto__:null,add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],y=e[14],g=e[15],m=n*s-r*o,k=n*u-i*o,E=n*l-a*o,x=r*u-i*s,b=r*l-a*s,T=i*l-a*u,M=c*p-h*v,w=c*y-f*v,S=c*g-d*v,N=h*y-f*p,P=h*g-d*p,C=f*g-d*y;return t[0]=s*C-u*P+l*N,t[1]=i*P-r*C-a*N,t[2]=p*T-y*b+g*x,t[3]=f*b-h*T-d*x,t[4]=u*S-o*C-l*w,t[5]=n*C-i*S+a*w,t[6]=y*E-v*T-g*k,t[7]=c*T-f*E+d*k,t[8]=o*P-s*S+l*M,t[9]=r*S-n*P-a*M,t[10]=v*b-p*E+g*m,t[11]=h*E-c*b-d*m,t[12]=s*w-o*N-u*M,t[13]=n*N-r*w+i*M,t[14]=p*k-v*x-y*m,t[15]=c*x-h*k+f*m,t},clone:function(t){var e=new S(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:C,create:P,decompose:function(t,e,n,r){e[0]=r[12],e[1]=r[13],e[2]=r[14];var i=r[0],a=r[1],o=r[2],s=r[4],u=r[5],l=r[6],c=r[8],h=r[9],f=r[10];n[0]=Math.sqrt(i*i+a*a+o*o),n[1]=Math.sqrt(s*s+u*u+l*l),n[2]=Math.sqrt(c*c+h*h+f*f);var d=1/n[0],v=1/n[1],p=1/n[2],y=i*d,g=a*v,m=o*p,k=s*d,E=u*v,x=l*p,b=c*d,T=h*v,M=f*p,w=y+E+M,S=0;return w>0?(t[3]=.25*(S=2*Math.sqrt(w+1)),t[0]=(x-T)/S,t[1]=(b-m)/S,t[2]=(g-k)/S):y>E&&y>M?(t[3]=(x-T)/(S=2*Math.sqrt(1+y-E-M)),t[0]=.25*S,t[1]=(g+k)/S,t[2]=(b+m)/S):E>M?(t[3]=(b-m)/(S=2*Math.sqrt(1+E-y-M)),t[0]=(g+k)/S,t[1]=.25*S,t[2]=(x+T)/S):(t[3]=(g-k)/(S=2*Math.sqrt(1+M-y-E)),t[0]=(b+m)/S,t[1]=(x+T)/S,t[2]=.25*S),t},determinant:I,equals:function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],l=t[7],c=t[8],h=t[9],f=t[10],d=t[11],v=t[12],p=t[13],y=t[14],g=t[15],m=e[0],k=e[1],E=e[2],x=e[3],b=e[4],T=e[5],M=e[6],S=e[7],N=e[8],P=e[9],C=e[10],A=e[11],O=e[12],R=e[13],L=e[14],I=e[15];return!(Math.abs(n-m)>w*Math.max(1,Math.abs(n),Math.abs(m))||Math.abs(r-k)>w*Math.max(1,Math.abs(r),Math.abs(k))||Math.abs(i-E)>w*Math.max(1,Math.abs(i),Math.abs(E))||Math.abs(a-x)>w*Math.max(1,Math.abs(a),Math.abs(x))||Math.abs(o-b)>w*Math.max(1,Math.abs(o),Math.abs(b))||Math.abs(s-T)>w*Math.max(1,Math.abs(s),Math.abs(T))||Math.abs(u-M)>w*Math.max(1,Math.abs(u),Math.abs(M))||Math.abs(l-S)>w*Math.max(1,Math.abs(l),Math.abs(S))||Math.abs(c-N)>w*Math.max(1,Math.abs(c),Math.abs(N))||Math.abs(h-P)>w*Math.max(1,Math.abs(h),Math.abs(P))||Math.abs(f-C)>w*Math.max(1,Math.abs(f),Math.abs(C))||Math.abs(d-A)>w*Math.max(1,Math.abs(d),Math.abs(A))||Math.abs(v-O)>w*Math.max(1,Math.abs(v),Math.abs(O))||Math.abs(p-R)>w*Math.max(1,Math.abs(p),Math.abs(R))||Math.abs(y-L)>w*Math.max(1,Math.abs(y),Math.abs(L))||Math.abs(g-I)>w*Math.max(1,Math.abs(g),Math.abs(I)))},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},frob:function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])},fromQuat:K,fromQuat2:function(t,e){var n=new S(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=r*r+i*i+a*a+o*o;return h>0?(n[0]=2*(s*o+c*r+u*a-l*i)/h,n[1]=2*(u*o+c*i+l*r-s*a)/h,n[2]=2*(l*o+c*a+s*i-u*r)/h):(n[0]=2*(s*o+c*r+u*a-l*i),n[1]=2*(u*o+c*i+l*r-s*a),n[2]=2*(l*o+c*a+s*i-u*r)),W(t,e,n),t},fromRotation:z,fromRotationTranslation:W,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],u=i+i,l=a+a,c=o+o,h=i*u,f=i*l,d=i*c,v=a*l,p=a*c,y=o*c,g=s*u,m=s*l,k=s*c,E=r[0],x=r[1],b=r[2];return t[0]=(1-(v+y))*E,t[1]=(f+k)*E,t[2]=(d-m)*E,t[3]=0,t[4]=(f-k)*x,t[5]=(1-(h+y))*x,t[6]=(p+g)*x,t[7]=0,t[8]=(d+m)*b,t[9]=(p-g)*b,t[10]=(1-(h+v))*b,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:$,fromScaling:U,fromTranslation:V,fromValues:function(t,e,n,r,i,a,o,s,u,l,c,h,f,d,v,p){var y=new S(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=a,y[6]=o,y[7]=s,y[8]=u,y[9]=l,y[10]=c,y[11]=h,y[12]=f,y[13]=d,y[14]=v,y[15]=p,y},fromXRotation:H,fromYRotation:j,fromZRotation:Y,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),u=1/(i-r),l=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(o+a)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*l,t[15]=0,t},getRotation:Z,getScaling:X,getTranslation:q,identity:O,invert:L,lookAt:nt,mul:it,multiply:D,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(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[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},ortho:tt,orthoNO:J,orthoZO:et,perspective:Q,perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+s),l=2/(i+a);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-s)*u*.5,t[9]=(i-a)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},perspectiveNO:Q,perspectiveZO:function(t,e,n,r,i){var a=1/Math.tan(e/2);if(t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0){var o=1/(r-i);t[10]=i*o,t[14]=i*r*o}else t[10]=-1,t[14]=-r;return t},rotate:function(t,e,n,r){var i,a,o,s,u,l,c,h,f,d,v,p,y,g,m,k,E,x,b,T,M,S,N,P,C=r[0],A=r[1],O=r[2],R=Math.sqrt(C*C+A*A+O*O);return w>R?null:(C*=R=1/R,A*=R,O*=R,i=Math.sin(n),u=e[1],l=e[2],c=e[3],f=e[5],d=e[6],v=e[7],y=e[9],g=e[10],m=e[11],b=C*A*(o=1-(a=Math.cos(n)))-O*i,T=A*A*o+a,M=O*A*o+C*i,S=C*O*o+A*i,N=A*O*o-C*i,P=O*O*o+a,t[0]=(s=e[0])*(k=C*C*o+a)+(h=e[4])*(E=A*C*o+O*i)+(p=e[8])*(x=O*C*o-A*i),t[1]=u*k+f*E+y*x,t[2]=l*k+d*E+g*x,t[3]=c*k+v*E+m*x,t[4]=s*b+h*T+p*M,t[5]=u*b+f*T+y*M,t[6]=l*b+d*T+g*M,t[7]=c*b+v*T+m*M,t[8]=s*S+h*N+p*P,t[9]=u*S+f*N+y*P,t[10]=l*S+d*N+g*P,t[11]=c*S+v*N+m*P,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:F,rotateY:B,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+l*r,t[1]=o*i+c*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=l*i-a*r,t[5]=c*i-o*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},scale:G,set:A,str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},sub:rt,subtract:rt,targetTo:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=r[0],u=r[1],l=r[2],c=i-n[0],h=a-n[1],f=o-n[2],d=c*c+h*h+f*f;d>0&&(c*=d=1/Math.sqrt(d),h*=d,f*=d);var v=u*f-l*h,p=l*c-s*f,y=s*h-u*c;return(d=v*v+p*p+y*y)>0&&(v*=d=1/Math.sqrt(d),p*=d,y*=d),t[0]=v,t[1]=p,t[2]=y,t[3]=0,t[4]=h*y-f*p,t[5]=f*v-c*y,t[6]=c*p-h*v,t[7]=0,t[8]=c,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=a,t[14]=o,t[15]=1,t},translate:_,transpose:R});function ot(){var t=new S(3);return S!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function st(t){var e=t[0],n=t[1],r=t[2];return Math.sqrt(e*e+n*n+r*r)}function ut(t,e,n){var r=new S(3);return r[0]=t,r[1]=e,r[2]=n,r}function lt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ct(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function ht(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function ft(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function dt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function vt(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function pt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function yt(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],u=n[2];return t[0]=i*u-a*s,t[1]=a*o-r*u,t[2]=r*s-i*o,t}function gt(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/(o=o||1),t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t}function mt(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return w*Math.max(1,Math.abs(n),Math.abs(a))>=Math.abs(n-a)&&w*Math.max(1,Math.abs(r),Math.abs(o))>=Math.abs(r-o)&&w*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)}var kt=ft,Et=st;function xt(){var t=new S(4);return S!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function bt(t,e,n,r){var i=new S(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function Tt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,t}function Mt(){var t=new S(4);return S!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function wt(t,e,n){var r=Math.sin(n*=.5);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function St(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=r*c+o*s+i*l-a*u,t[1]=i*c+o*u+a*s-r*l,t[2]=a*c+o*l+r*u-i*s,t[3]=o*c-r*s-i*u-a*l,t}function Nt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=a*s,t}function Pt(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",a=Math.PI/360;r*=a,n*=a;var o=Math.sin(e*=a),s=Math.cos(e),u=Math.sin(n),l=Math.cos(n),c=Math.sin(r),h=Math.cos(r);switch(i){case"xyz":t[0]=o*l*h+s*u*c,t[1]=s*u*h-o*l*c,t[2]=s*l*c+o*u*h,t[3]=s*l*h-o*u*c;break;case"xzy":t[0]=o*l*h-s*u*c,t[1]=s*u*h-o*l*c,t[2]=s*l*c+o*u*h,t[3]=s*l*h+o*u*c;break;case"yxz":t[0]=o*l*h+s*u*c,t[1]=s*u*h-o*l*c,t[2]=s*l*c-o*u*h,t[3]=s*l*h+o*u*c;break;case"yzx":t[0]=o*l*h+s*u*c,t[1]=s*u*h+o*l*c,t[2]=s*l*c-o*u*h,t[3]=s*l*h-o*u*c;break;case"zxy":t[0]=o*l*h-s*u*c,t[1]=s*u*h+o*l*c,t[2]=s*l*c+o*u*h,t[3]=s*l*h-o*u*c;break;case"zyx":t[0]=o*l*h-s*u*c,t[1]=s*u*h+o*l*c,t[2]=s*l*c-o*u*h,t[3]=s*l*h+o*u*c;break;default:throw Error("Unknown angle order "+i)}return t}ot(),function(){var t=xt()}();var Ct=bt,At=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Ot=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},Rt=St,Lt=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=r*o,t[2]=i*o,t[3]=a*o,t};function It(){var t=new S(2);return S!=Float32Array&&(t[0]=0,t[1]=0),t}ot(),ut(1,0,0),ut(0,1,0),Mt(),Mt(),N(),function(){var t=It()}();var Dt=ht,_t=lt,Gt=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},Ft=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},Bt=dt,Vt=kt,Ut=function(){function t(){o(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return u(t,[{key:"update",value:function(t,e){_t(this.center,t),_t(this.halfExtents,e),Vt(this.min,this.center,this.halfExtents),Dt(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){Dt(this.center,e,t),Bt(this.center,this.center,.5),Vt(this.halfExtents,e,t),Bt(this.halfExtents,this.halfExtents,.5),_t(this.min,t),_t(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],a=n[2],o=this.halfExtents,s=o[0],u=o[1],l=o[2],c=r-s,h=r+s,f=i-u,d=i+u,v=a-l,p=a+l,y=e.center,g=y[0],m=y[1],k=y[2],E=e.halfExtents,x=E[0],b=E[1],T=E[2],M=g-x,w=g+x,S=m-b,N=m+b,P=k-T,C=k+T;c>M&&(c=M),w>h&&(h=w),f>S&&(f=S),N>d&&(d=N),v>P&&(v=P),C>p&&(p=C),n[0]=.5*(c+h),n[1]=.5*(f+d),n[2]=.5*(v+p),o[0]=.5*(h-c),o[1]=.5*(d-f),o[2]=.5*(p-v),this.min[0]=c,this.min[1]=f,this.min[2]=v,this.max[0]=h,this.max[1]=d,this.max[2]=p}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,r=this.halfExtents,i=t.center,a=t.halfExtents,o=e[0],s=e[4],u=e[8],l=e[1],c=e[5],h=e[9],f=e[2],d=e[6],v=e[10],p=Math.abs(o),y=Math.abs(s),g=Math.abs(u),m=Math.abs(l),k=Math.abs(c),E=Math.abs(h),x=Math.abs(f),b=Math.abs(d),T=Math.abs(v);n[0]=e[12]+o*i[0]+s*i[1]+u*i[2],n[1]=e[13]+l*i[0]+c*i[1]+h*i[2],n[2]=e[14]+f*i[0]+d*i[1]+v*i[2],r[0]=p*a[0]+y*a[1]+g*a[2],r[1]=m*a[0]+k*a[1]+E*a[2],r[2]=x*a[0]+b*a[1]+T*a[2],Vt(this.min,n,r),Dt(this.max,n,r)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,r=Gt([0,0,0],this.getMin(),e.getMin()),i=Ft([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?_t([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?_t([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),zt=function(){return u(function t(e,n){o(this,t),this.distance=e||0,this.normal=n||ut(0,1,0),this.updatePNVertexFlag()},[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return pt(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/Et(this.normal);dt(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),a=i>=0&&1>=i;return a&&n&&function(t,e,n,r){var i=e[0],a=e[1],o=e[2];t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o)}(n,t,e,i),a}}])}(),Ht=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),jt=function(){return u(function t(e){if(o(this,t),this.planes=[],e)this.planes=e;else for(var n=0;6>n;n++)this.planes.push(new zt)},[{key:"extractFromVPMatrix",value:function(t){var e=b(t,16),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],y=e[14],g=e[15];ct(this.planes[0].normal,a-n,l-o,d-c),this.planes[0].distance=g-v,ct(this.planes[1].normal,a+n,l+o,d+c),this.planes[1].distance=g+v,ct(this.planes[2].normal,a+r,l+s,d+h),this.planes[2].distance=g+p,ct(this.planes[3].normal,a-r,l-s,d-h),this.planes[3].distance=g-p,ct(this.planes[4].normal,a-i,l-u,d-f),this.planes[4].distance=g-y,ct(this.planes[5].normal,a+i,l+u,d+f),this.planes[5].distance=g+y,this.planes.forEach(function(t){t.normalize(),t.updatePNVertexFlag()})}}])}(),Yt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return u(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),Wt=function(){function t(e,n,r,i){o(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return u(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var r=bt(e.x,e.y,0,1),i=bt(e.x+e.width,e.y,0,1),a=bt(e.x,e.y+e.height,0,1),o=bt(e.x+e.width,e.y+e.height,0,1),s=xt(),u=xt(),l=xt(),c=xt();Tt(s,r,n),Tt(u,i,n),Tt(l,a,n),Tt(c,o,n);var h=Math.min(s[0],u[0],l[0],c[0]),f=Math.min(s[1],u[1],l[1],c[1]);return t.fromRect({x:h,y:f,width:Math.max(s[0],u[0],l[0],c[0])-h,height:Math.max(s[1],u[1],l[1],c[1])-f})}}])}(),qt="Method not implemented.",Xt="Use document.documentElement instead.";function Zt(t){return"function"==typeof t}function $t(t){return null==t}function Kt(t){return Array.isArray(t)}var Qt={}.toString,Jt=function(t,e){return Qt.call(t)==="[object "+e+"]"};function te(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],r=1;e>r;r++)n=Math.max(n,t[r]);return n}var ee=function(t){if(Kt(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])};function ne(t){return"string"==typeof t}var re=function(t,e,n){return e>t?e:t>n?n:t};function ie(t){return"number"==typeof t}function ae(t,e,n){return void 0===n&&(n=1e-5),t===e||n>Math.abs(t-e)}var oe=function(t,e){return(t%e+e)%e},se=function(t){return Jt(t,"Boolean")},ue=function(t){return void 0===t},le=function(){return le=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},le.apply(this,arguments)};function ce(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;a>i;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var he={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function fe(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var de={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function ve(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return de[e]===t.length-1&&"achlmqstvz".includes(e)})}function pe(t){return ve(t)&&t.every(function(t){var e=t[0];return e===e.toUpperCase()})}function ye(t){return pe(t)&&t.every(function(t){return"ACLMQZ".includes(t[0])})}function ge(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=de[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,de[n]))),de[n]););}function me(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function ke(t){return t>=48&&57>=t||43===t||45===t||46===t}function Ee(t){return t>=48&&57>=t}function xe(t){var e,n=t.max,r=t.pathValue,i=t.index,a=i,o=!1,s=!1,u=!1,l=!1;if(n>a)if(43!==(e=r.charCodeAt(a))&&45!==e||(e=r.charCodeAt(a+=1)),Ee(e)||46===e){if(46!==e){if(o=48===e,e=r.charCodeAt(a+=1),o&&n>a&&e&&Ee(e))return void(t.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(r[i],'" illegal number'));for(;n>a&&Ee(r.charCodeAt(a));)a+=1,s=!0;e=r.charCodeAt(a)}if(46===e){for(l=!0,a+=1;Ee(r.charCodeAt(a));)a+=1,u=!0;e=r.charCodeAt(a)}if(101===e||69===e){if(l&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" invalid float exponent'));if(43!==(e=r.charCodeAt(a+=1))&&45!==e||(a+=1),a>=n||!Ee(r.charCodeAt(a)))return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" invalid integer exponent'));for(;n>a&&Ee(r.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(i,a)}else t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" is not a number');else t.err="[path-util]: Invalid path value at index ".concat(a,', "pathValue" is missing param')}function be(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function Te(t){for(var e=t.pathValue,n=t.max;n>t.index&&be(e.charCodeAt(t.index));)t.index+=1}function Me(t){return 97==(32|t)}function we(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),a=de[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,Te(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(!Me(i)||3!==o&&4!==o?xe(t):me(t),t.err.length)return;t.data.push(t.param),Te(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,Te(t))}if(t.index>=t.max)break;if(!ke(n.charCodeAt(t.index)))break}ge(t)}else ge(t);else t.err='[path-util]: Invalid path value "'.concat(n[r],'" is not a path command')}var Se=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function Ne(t){if(pe(t))return[].concat(t);var e=function(t){if(ve(t))return[].concat(t);var e=new Se(t);for(Te(e);e.max>e.index&&!e.err.length;)we(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,a=0;return e.map(function(t){var e,o=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=o[0],a=r=o[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,o[0],o[1],o[2],o[3],o[4],o[5]+n,o[6]+r];break;case"V":e=[u,o[0]+r];break;case"H":e=[u,o[0]+n];break;default:var l=o.map(function(t,e){return t+(e%2?r:n)});e=[u].concat(l)}else e=[u].concat(o);var c=e.length;switch(u){case"Z":n=i,r=a;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[c-2],r=e[c-1],"M"===u&&(i=n,a=r)}return e})}function Pe(t,e){var n=t[0],r=e.x1,i=e.y1,a=e.x2,o=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var l=2*r-a,c=2*i-o;e.x1=l,e.y1=c,u=["C",l,c].concat(s)}else if("T"===n){var h=2*r-e.qx,f=2*i-e.qy;e.qx=h,e.qy=f,u=["Q",h,f].concat(s)}else if("Q"===n){var d=s[1];e.qx=s[0],e.qy=d}return u}function Ce(t){if(ye(t))return[].concat(t);for(var e=Ne(t),n=le({},he),r=0;e.length>r;r+=1){e[r]=Pe(e[r],n);var i=e[r],a=i.length;n.x1=+i[a-2],n.y1=+i[a-1],n.x2=+i[a-4]||n.x1,n.y2=+i[a-3]||n.y1}return e}function Ae(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Oe(t,e,n,r,i,a,o,s,u,l){var c,h,f,d,v,p=t,y=e,g=n,m=r,k=s,E=u,x=120*Math.PI/180,b=Math.PI/180*(+i||0),T=[];if(l)h=l[0],f=l[1],d=l[2],v=l[3];else{y=(c=Ae(p,y,-b)).y;var M=((p=c.x)-(k=(c=Ae(k,E,-b)).x))/2,w=(y-(E=c.y))/2,S=M*M/(g*g)+w*w/(m*m);S>1&&(g*=S=Math.sqrt(S),m*=S);var N=g*g,P=m*m,C=(a===o?-1:1)*Math.sqrt(Math.abs((N*P-N*w*w-P*M*M)/(N*w*w+P*M*M)));d=C*g*w/m+(p+k)/2,h=Math.asin(((y-(v=C*-m*M/g+(y+E)/2))/m*1e9|0)/1e9),f=Math.asin(((E-v)/m*1e9|0)/1e9),0>(h=d>p?Math.PI-h:h)&&(h=2*Math.PI+h),0>(f=d>k?Math.PI-f:f)&&(f=2*Math.PI+f),o&&h>f&&(h-=2*Math.PI),!o&&f>h&&(f-=2*Math.PI)}var A=f-h;if(Math.abs(A)>x){var O=f,R=k,L=E;T=Oe(k=d+g*Math.cos(f=h+x*(o&&f>h?1:-1)),E=v+m*Math.sin(f),g,m,i,0,o,R,L,[f,O,d,v])}A=f-h;var I=Math.cos(h),D=Math.sin(h),_=Math.cos(f),G=Math.sin(f),F=Math.tan(A/4),B=4/3*g*F,V=4/3*m*F,U=[p,y],z=[p+B*D,y-V*I],H=[k+B*G,E-V*_],j=[k,E];if(z[0]=2*U[0]-z[0],z[1]=2*U[1]-z[1],l)return z.concat(H,j,T);for(var Y=[],W=0,q=(T=z.concat(H,j,T)).length;q>W;W+=1)Y[W]=W%2?Ae(T[W-1],T[W],b).y:Ae(T[W],T[W+1],b).x;return Y}function Re(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var Le=function(t,e,n,r){return ce(ce([],Re([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function Ie(t,e){var n,r,i,a,o,s,u,l=t[0],c=t.slice(1).map(Number),h=c[0],f=c[1],d=e.x1,v=e.y1,p=e.x,y=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=h,e.y=f,t;case"A":return n=[d,v].concat(c),["C"].concat(Oe(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=f,n=[d,v].concat(c),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(a=n[4])+u*r,s*(o=n[5])+u*i,a,o]);case"L":return["C"].concat(Le(d,v,h,f));case"Z":return d===p&&v===y?["C",d,v,p,y,p,y]:["C"].concat(Le(d,v,p,y))}return t}function De(t,e){if(void 0===e&&(e=!1),function(t){return ye(t)&&t.every(function(t){return"MC".includes(t[0])})}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,a=Ce(t),o=le({},he),s=[],u="",l=a.length,c=[],h=0;l>h;h+=1){a[h]&&(u=a[h][0]),s[h]=u;var f=Ie(a[h],o);a[h]=f,fe(a,s,h),l=a.length,"Z"===u&&c.push(h),o.x1=+(r=a[h])[(i=r.length)-2],o.y1=+r[i-1],o.x2=+r[i-4]||o.x1,o.y2=+r[i-3]||o.y1}return e?[a,c]:a}function _e(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Ge(t,e,n,r,i){var a=_e([t,e],[n,r]),o={x:0,y:0};if("number"==typeof i)if(0<i)if(i<a){var s=Re([t,e],[n,r],i/a);o={x:s[0],y:s[1]}}else o={x:n,y:r};else o={x:t,y:e};return{length:a,point:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Fe(t,e){var n=t.x,r=t.y,i=e.x,a=e.y;return(0>n*a-r*i?-1:1)*Math.acos((n*i+r*a)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2))))}function Be(t,e,n,r,i,a,o,s,u,l){var c=Math.abs,h=Math.sin,f=Math.cos,d=Math.sqrt,v=Math.PI,p=c(n),y=c(r),g=(i%360+360)%360*(v/180);if(t===s&&e===u)return{x:t,y:e};if(0===p||0===y)return Ge(t,e,s,u,l).point;var m=(t-s)/2,k=(e-u)/2,E={x:f(g)*m+h(g)*k,y:-h(g)*m+f(g)*k},x=Math.pow(E.x,2)/Math.pow(p,2)+Math.pow(E.y,2)/Math.pow(y,2);x>1&&(p*=d(x),y*=d(x));var b=(Math.pow(p,2)*Math.pow(y,2)-Math.pow(p,2)*Math.pow(E.y,2)-Math.pow(y,2)*Math.pow(E.x,2))/(Math.pow(p,2)*Math.pow(E.y,2)+Math.pow(y,2)*Math.pow(E.x,2)),T=(a!==o?1:-1)*d(b=0>b?0:b),M=T*(p*E.y/y),w=T*(-y*E.x/p),S=f(g)*M-h(g)*w+(t+s)/2,N=h(g)*M+f(g)*w+(e+u)/2,P={x:(E.x-M)/p,y:(E.y-w)/y},C=Fe({x:1,y:0},P),A=Fe(P,{x:(-E.x-M)/p,y:(-E.y-w)/y});!o&&A>0?A-=2*v:o&&0>A&&(A+=2*v);var O=C+(A%=2*v)*l,R=p*f(O),L=y*h(O);return{x:f(g)*R-h(g)*L+S,y:h(g)*R+f(g)*L+N}}function Ve(t,e,n,r,i,a,o,s,u,l,c){var h,f=c.bbox,d=void 0===f||f,v=c.length,p=void 0===v||v,y=c.sampleSize,g=void 0===y?30:y,m="number"==typeof l,k=t,E=e,x=0,b=[k,E,x],T=[k,E],M={x:0,y:0},w=[{x:k,y:E}];m&&0>=l&&(M={x:k,y:E});for(var S=0;g>=S;S+=1){if(k=(h=Be(t,e,n,r,i,a,o,s,u,S/g)).x,E=h.y,d&&w.push({x:k,y:E}),p&&(x+=_e(T,[k,E])),T=[k,E],m&&x>=l&&l>b[2]){var N=(x-l)/(x-b[2]);M={x:T[0]*(1-N)+b[0]*N,y:T[1]*(1-N)+b[1]*N}}b=[k,E,x]}return m&&l>=x&&(M={x:s,y:u}),{length:x,point:M,min:{x:Math.min.apply(null,w.map(function(t){return t.x})),y:Math.min.apply(null,w.map(function(t){return t.y}))},max:{x:Math.max.apply(null,w.map(function(t){return t.x})),y:Math.max.apply(null,w.map(function(t){return t.y}))}}}function Ue(t,e,n,r,i,a,o,s,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*i+Math.pow(u,3)*o,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*a+Math.pow(u,3)*s}}function ze(t,e,n,r,i,a,o,s,u,l){var c,h=l.bbox,f=void 0===h||h,d=l.length,v=void 0===d||d,p=l.sampleSize,y=void 0===p?10:p,g="number"==typeof u,m=t,k=e,E=0,x=[m,k,E],b=[m,k],T={x:0,y:0},M=[{x:m,y:k}];g&&0>=u&&(T={x:m,y:k});for(var w=0;y>=w;w+=1){if(m=(c=Ue(t,e,n,r,i,a,o,s,w/y)).x,k=c.y,f&&M.push({x:m,y:k}),v&&(E+=_e(b,[m,k])),b=[m,k],g&&E>=u&&u>x[2]){var S=(E-u)/(E-x[2]);T={x:b[0]*(1-S)+x[0]*S,y:b[1]*(1-S)+x[1]*S}}x=[m,k,E]}return g&&u>=E&&(T={x:o,y:s}),{length:E,point:T,min:{x:Math.min.apply(null,M.map(function(t){return t.x})),y:Math.min.apply(null,M.map(function(t){return t.y}))},max:{x:Math.max.apply(null,M.map(function(t){return t.x})),y:Math.max.apply(null,M.map(function(t){return t.y}))}}}function He(t,e,n,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*i,y:Math.pow(s,2)*e+2*s*o*r+Math.pow(o,2)*a}}function je(t,e,n,r,i,a,o,s){var u,l=s.bbox,c=void 0===l||l,h=s.length,f=void 0===h||h,d=s.sampleSize,v=void 0===d?10:d,p="number"==typeof o,y=t,g=e,m=0,k=[y,g,m],E=[y,g],x={x:0,y:0},b=[{x:y,y:g}];p&&0>=o&&(x={x:y,y:g});for(var T=0;v>=T;T+=1){if(y=(u=He(t,e,n,r,i,a,T/v)).x,g=u.y,c&&b.push({x:y,y:g}),f&&(m+=_e(E,[y,g])),E=[y,g],p&&m>=o&&o>k[2]){var M=(m-o)/(m-k[2]);x={x:E[0]*(1-M)+k[0]*M,y:E[1]*(1-M)+k[1]*M}}k=[y,g,m]}return p&&o>=m&&(x={x:i,y:a}),{length:m,point:x,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,b.map(function(t){return t.x})),y:Math.max.apply(null,b.map(function(t){return t.y}))}}}function Ye(t,e,n){for(var r,i,a,o,s,u,l,c,h,f=Ce(t),d="number"==typeof e,v=[],p=0,y=0,g=0,m=0,k=[],E=[],x=0,b={x:0,y:0},T=b,M=b,w=b,S=0,N=0,P=f.length;P>N;N+=1)v=(l="M"===(c=(h=f[N])[0]))?v:[p,y].concat(h.slice(1)),l?(T=b={x:g=h[1],y:m=h[2]},x=0,d&&.001>e&&(w=b)):"L"===c?(x=(r=Ge(v[0],v[1],v[2],v[3],(e||0)-S)).length,b=r.min,T=r.max,M=r.point):"A"===c?(x=(i=Ve(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],(e||0)-S,n||{})).length,b=i.min,T=i.max,M=i.point):"C"===c?(x=(a=ze(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],(e||0)-S,n||{})).length,b=a.min,T=a.max,M=a.point):"Q"===c?(x=(o=je(v[0],v[1],v[2],v[3],v[4],v[5],(e||0)-S,n||{})).length,b=o.min,T=o.max,M=o.point):"Z"===c&&(x=(s=Ge((v=[p,y,g,m])[0],v[1],v[2],v[3],(e||0)-S)).length,b=s.min,T=s.max,M=s.point),d&&e>S&&S+x>=e&&(w=M),E.push(T),k.push(b),S+=x,p=(u="Z"!==c?h.slice(-2):[g,m])[0],y=u[1];return d&&e>=S&&(w={x:p,y:y}),{length:S,point:w,min:{x:Math.min.apply(null,k.map(function(t){return t.x})),y:Math.min.apply(null,k.map(function(t){return t.y}))},max:{x:Math.max.apply(null,E.map(function(t){return t.x})),y:Math.max.apply(null,E.map(function(t){return t.y}))}}}function We(t){return function(t){var e=0,n=0,r=0;return De(t).map(function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var a,o,s,u,l,c,h,f,d=t.slice(1);return r=3*(((f=d[5])-(o=n))*((s=d[0])+(l=d[2]))-((h=d[4])-(a=e))*((u=d[1])+(c=d[3]))+u*(a-l)-s*(o-c)+f*(l+a/3)-h*(c+o/3))/20,i=t.slice(-2),e=i[0],n=i[1],r}).reduce(function(t,e){return t+e},0)}(t)>=0}function qe(t){return t.map(function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?ze(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),a=t.slice(6,8),o=Re(n,r,e),s=Re(r,i,e),u=Re(i,a,e),l=Re(o,s,e),c=Re(s,u,e),h=Re(l,c,e);return[["C"].concat(o,l,h),["C"].concat(c,u,a)]}(r):[t,t]:[t],l:i}})}function Xe(t,e,n,r){if(void 0===r&&(r=0),r>50)return console.warn("Maximum recursion depth reached in equalizeSegments"),[t,e];var i=qe(t),a=qe(e),o=i.length,s=a.length,u=i.filter(function(t){return t.l}).length,l=a.filter(function(t){return t.l}).length,c=i.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/u||0,h=a.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/l||0,f=n||Math.max(o,s),d=[c,h],v=[f-o,f-s],p=0,y=[i,a].map(function(t,e){return t.l===f?t.map(function(t){return t.s}):t.map(function(t,n){return v[e]-=(p=n&&v[e]&&t.l>=d[e])?1:0,p?t.ss:[t.s]}).flat()});return y[0].length===y[1].length?y:Xe(y[0],y[1],f,r+1)}function Ze(t){return void 0===t?0:t>360||-360>t?t%360:t}var $e=ot();function Ke(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=3>=arguments.length||void 0===arguments[3]||arguments[3];return Array.isArray(t)&&3===t.length?a?(e=t,(n=new S(3))[0]=e[0],n[1]=e[1],n[2]=e[2],n):lt($e,t):ie(t)?a?ut(t,r,i):ct($e,t,r,i):a?ut(t[0],t[1]||r,t[2]||i):ct($e,t[0],t[1]||r,t[2]||i)}var Qe=Math.PI/180;function Je(t){return t*Qe}var tn=180/Math.PI;function en(t){return t*tn}function nn(t){return 360*t}var rn=Math.PI/2;function an(t,e){return 16===e.length?function(t,e){var n,r,i=b(X(ot(),e),3),a=i[0],o=i[1],s=i[2],u=Math.asin(-e[2]/a);return rn>u?u>-rn?(n=Math.atan2(e[6]/o,e[10]/s),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/o,e[5]/o)):(r=0,n=Math.atan2(e[4]/o,e[5]/o)),t[0]=n,t[1]=u,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=r*r,s=i*i,u=a*a,l=n*n+o+s+u,c=n*a-r*i;return c>.499995*l?(t[0]=rn,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*l>c?(t[0]=-rn,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-a*r)),t[1]=Math.atan2(2*(n*a+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*a),1-2*(o+s))),t}(t,e)}function on(t,e,n,r,i){var a,o,s,u,l,c,h,f,d,v,p=Math.cos(t),y=Math.sin(t);return a=r*p,o=i*y,s=0,u=-r*y,l=i*p,c=0,h=e,f=n,d=1,(v=new S(9))[0]=a,v[1]=o,v[2]=s,v[3]=u,v[4]=l,v[5]=c,v[6]=h,v[7]=f,v[8]=d,v}function sn(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);if(0>e*i-n*r&&(i>e?a=-a:o=-o),a){var s=1/a;e*=s,n*=s}if(o){var u=1/o;r*=u,i*=u}var l=en(Math.atan2(n,e));return[t[6],t[7],a,o,l]}var un=P(),ln=P(),cn=xt(),hn=[ot(),ot(),ot()],fn=ot();function dn(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var vn=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),pn=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),yn=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),gn={UPDATED:"updated"},mn=2e-4,kn=function(){return u(function t(){o(this,t),this.clipSpaceNearZ=c.NEGATIVE_ONE,this.eventEmitter=new M,this.matrix=P(),this.right=ut(1,0,0),this.up=ut(0,1,0),this.forward=ut(0,0,1),this.position=ut(0,0,1),this.focalPoint=ut(0,0,0),this.distanceVector=ut(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=P(),this.projectionMatrixInverse=P(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=vn.EXPLORING,this.trackingMode=pn.DEFAULT,this.projectionMode=yn.PERSPECTIVE,this.frustum=new jt,this.orthoMatrix=P()},[{key:"isOrtho",value:function(){return this.projectionMode===yn.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,e){return this.type=t,this.setWorldRotation(this.type===vn.EXPLORING),this._getAngles(),this.type===vn.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==vn.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return L(P(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=V(P(),[t,e,0]);this.jitteredProjectionMatrix=D(P(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===yn.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===yn.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value:function(t,e,n,r,i,a){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=a,this.projectionMode===yn.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===yn.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===yn.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===yn.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value:function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,a);var o=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=ut(o.x-r,o.y-i,0),u=pt(s,this.right)/st(this.right),l=pt(s,this.up)/st(this.up),c=b(this.getPosition(),2),h=c[0],f=c[1],d=b(this.getFocalPoint(),2),v=d[0],p=d[1];return this.setPosition(h-u,f-l),this.setFocalPoint(v-u,p-l),this}},{key:"setPerspective",value:function(t,e,n,r){var i;this.projectionMode=yn.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var a=this.near*Math.tan(Je(.5*this.fov))/this.zoom,o=2*a,s=this.aspect*o,u=-.5*s;if(null!==(i=this.view)&&void 0!==i&&i.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;u+=this.view.offsetX*s/l,a-=this.view.offsetY*o/h,s*=this.view.width/l,o*=this.view.height/h}return function(t,e,n,r,i,a,o){var s,u,l=2*a,c=n-e,h=r-i,f=l/h,d=(n+e)/c,v=(r+i)/h,p=o-a,y=o*a;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(s=-o/p,u=-y/p):(s=-(o+a)/p,u=-2*y/p),t[0]=l/c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=d,t[9]=v,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=u,t[15]=0}(this.projectionMatrix,u,u+s,a-o,a,t,this.far,this.clipSpaceNearZ===c.ZERO),L(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,r,i,a){var o;this.projectionMode=yn.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=a;var s=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,f=l-s,d=l+s,v=h+u,p=h-u;if(null!==(o=this.view)&&void 0!==o&&o.enabled){var y=(this.rright-this.left)/this.view.fullWidth/this.zoom,g=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(f+=y*this.view.offsetX)+y*this.view.width,p=(v-=g*this.view.offsetY)-g*this.view.height}return this.clipSpaceNearZ===c.NEGATIVE_ONE?tt(this.projectionMatrix,f,d,v,p,i,a):et(this.projectionMatrix,f,d,v,p,i,a),L(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=Ke(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(e),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],r=ut(0,1,0);if(this.focalPoint=Ke(t,e,n),this.trackingMode===pn.CINEMATIC){var i=ft(ot(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var a=st(i),o=en(Math.asin(e/a)),s=90+en(Math.atan2(n,t)),u=P();B(u,u,Je(s)),F(u,u,Je(o)),r=gt(ot(),[0,1,0],u)}return L(this.matrix,nt(P(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||0>t)return this;this.distance=t,mn>this.distance&&(this.distance=mn),this.dollyingStep=this.distance/100;var e=ot(),n=this.forward,r=this.focalPoint;return e[0]=(t=this.distance)*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=Ze(t),this.computeMatrix(),this._getAxes(),this.type===vn.ORBITING||this.type===vn.EXPLORING?this._getPosition():this.type===vn.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=Ze(t),this.computeMatrix(),this._getAxes(),this.type===vn.ORBITING||this.type===vn.EXPLORING?this._getPosition():this.type===vn.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=Ze(t),this.computeMatrix(),this._getAxes(),this.type===vn.ORBITING||this.type===vn.EXPLORING?this._getPosition():this.type===vn.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=wt(Mt(),[0,0,1],Je(this.roll));O(this.matrix);var e=wt(Mt(),[1,0,0],Je((this.rotateWorld&&this.type!==vn.TRACKING||this.type===vn.TRACKING?1:-1)*this.elevation)),n=wt(Mt(),[0,1,0],Je((this.rotateWorld&&this.type!==vn.TRACKING||this.type===vn.TRACKING?1:-1)*this.azimuth)),r=St(Mt(),n,e);r=St(Mt(),r,t);var i=K(P(),r);this.type===vn.ORBITING||this.type===vn.EXPLORING?(_(this.matrix,this.matrix,this.focalPoint),D(this.matrix,this.matrix,i),_(this.matrix,this.matrix,[0,0,this.distance])):this.type===vn.TRACKING&&(_(this.matrix,this.matrix,this.position),D(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=Ke(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()}},{key:"_getAxes",value:function(){lt(this.right,Ke(Tt(xt(),[1,0,0,0],this.matrix))),lt(this.up,Ke(Tt(xt(),[0,1,0,0],this.matrix))),lt(this.forward,Ke(Tt(xt(),[0,0,1,0],this.matrix))),vt(this.right,this.right),vt(this.up,this.up),vt(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=st(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===vn.TRACKING||this.rotateWorld?(this.elevation=en(Math.asin(e/r)),this.azimuth=en(Math.atan2(-t,-n))):(this.elevation=-en(Math.asin(e/r)),this.azimuth=-en(Math.atan2(-t,-n)))}},{key:"_getPosition",value:function(){lt(this.position,Ke(Tt(xt(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],a=e[2];t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8]}(this.distanceVector,[0,0,-this.distance],(t=N(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),ht(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=ft(ot(),this.focalPoint,this.position),this.distance=st(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===yn.ORTHOGRAPHIC){var t=this.position,e=wt(Mt(),[0,0,1],-this.roll*Math.PI/180);$(this.orthoMatrix,e,ut((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),ut(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=D(P(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(gn.UPDATED)}}},{key:"rotate",value:function(t,e,n){throw Error(qt)}},{key:"pan",value:function(t,e){throw Error(qt)}},{key:"dolly",value:function(t){throw Error(qt)}},{key:"createLandmark",value:function(t,e){throw Error(qt)}},{key:"gotoLandmark",value:function(t,e){throw Error(qt)}},{key:"cancelLandmarkAnimation",value:function(){throw Error(qt)}}])}();function En(){return En="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=y(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(3>arguments.length?t:n):i.value}},En.apply(null,arguments)}function xn(t,e,n,r){var i=En(y(1&r?t.prototype:t),e,n);return 2&r&&"function"==typeof i?function(t){return i.apply(n,t)}:i}var bn=function(t){return t[t.Standard=0]="Standard",t}({}),Tn=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),Mn=ot(),wn=P(),Sn=Mt();function Nn(t){if(t.localDirtyFlag){if(0!==t.localSkew[0]||0!==t.localSkew[1]){$(t.localTransform,t.localRotation,t.localPosition,ut(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(O(wn),wn[4]=Math.tan(t.localSkew[0]),wn[1]=Math.tan(t.localSkew[1]),D(t.localTransform,t.localTransform,wn));var e=$(wn,Ot(Sn,0,0,0,1),ct(Mn,1,1,1),t.localScale,t.origin);D(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,a=t.localScale,o=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2];1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2]||(1!==a[0]||1!==a[1]||1!==a[2])||(0!==o[0]||0!==o[1]||0!==o[2])?$(n,i,r,a,o):s?V(n,r):O(n)}t.localDirtyFlag=!1}}function Pn(t,e){t.dirtyFlag&&(e?D(t.worldTransform,e.worldTransform,t.localTransform):C(t.worldTransform,t.localTransform),t.dirtyFlag=!1)}var Cn={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Wt(0,0,0,0)},An=function(t){return t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>",t}({});function On(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Rn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Ln(){}var In=.7,Dn=1/In,_n="\\s*([+-]?\\d+)\\s*",Gn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Bn=/^#([0-9a-f]{3,8})$/,Vn=RegExp(`^rgb\\(${_n},${_n},${_n}\\)$`),Un=RegExp(`^rgb\\(${Fn},${Fn},${Fn}\\)$`),zn=RegExp(`^rgba\\(${_n},${_n},${_n},${Gn}\\)$`),Hn=RegExp(`^rgba\\(${Fn},${Fn},${Fn},${Gn}\\)$`),jn=RegExp(`^hsl\\(${Gn},${Fn},${Fn}\\)$`),Yn=RegExp(`^hsla\\(${Gn},${Fn},${Fn},${Gn}\\)$`),Wn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function qn(){return this.rgb().formatHex()}function Xn(){return this.rgb().formatRgb()}function Zn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Bn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?$n(e):3===n?new Qn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Kn(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Kn(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Vn.exec(t))?new Qn(e[1],e[2],e[3],1):(e=Un.exec(t))?new Qn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=zn.exec(t))?Kn(e[1],e[2],e[3],e[4]):(e=Hn.exec(t))?Kn(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=jn.exec(t))?ir(e[1],e[2]/100,e[3]/100,1):(e=Yn.exec(t))?ir(e[1],e[2]/100,e[3]/100,e[4]):Wn.hasOwnProperty(t)?$n(Wn[t]):"transparent"===t?new Qn(NaN,NaN,NaN,0):null}function $n(t){return new Qn(t>>16&255,t>>8&255,255&t,1)}function Kn(t,e,n,r){return r>0||(t=e=n=NaN),new Qn(t,e,n,r)}function Qn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Jn(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}`}function tr(){const t=er(this.opacity);return`${1===t?"rgb(":"rgba("}${nr(this.r)}, ${nr(this.g)}, ${nr(this.b)}${1===t?")":`, ${t})`}`}function er(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function nr(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function rr(t){return(16>(t=nr(t))?"0":"")+t.toString(16)}function ir(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new or(t,e,n,r)}function ar(t){if(t instanceof or)return new or(t.h,t.s,t.l,t.opacity);if(t instanceof Ln||(t=Zn(t)),!t)return new or;if(t instanceof or)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(r>n):n===a?(r-e)/s+2:(e-n)/s+4,s/=.5>u?a+i:2-a-i,o*=60):s=u>0&&1>u?0:o,new or(o,s,u,t.opacity)}function or(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function sr(t){return 0>(t=(t||0)%360)?t+360:t}function ur(t){return Math.max(0,Math.min(1,t||0))}function lr(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}function cr(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];var o=e?e.apply(this,i):i[0],s=n.cache;if(s.has(o))return s.get(o);var u=t.apply(this,i);return n.cache=s.set(o,u)||s,u};return n.cache=new(cr.Cache||Map),cr.cacheList.push(n.cache),n}On(Ln,Zn,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:qn,formatHex:qn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return ar(this).formatHsl()},formatRgb:Xn,toString:Xn}),On(Qn,function(t,e,n,r){return 1===arguments.length?((i=t)instanceof Ln||(i=Zn(i)),i?new Qn((i=i.rgb()).r,i.g,i.b,i.opacity):new Qn):new Qn(t,e,n,null==r?1:r);var i},Rn(Ln,{brighter(t){return new Qn(this.r*(t=null==t?Dn:Math.pow(Dn,t)),this.g*t,this.b*t,this.opacity)},darker(t){return new Qn(this.r*(t=null==t?In:Math.pow(In,t)),this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Qn(nr(this.r),nr(this.g),nr(this.b),er(this.opacity))},displayable(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:Jn,formatHex:Jn,formatHex8:function(){return`#${rr(this.r)}${rr(this.g)}${rr(this.b)}${rr(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:tr,toString:tr})),On(or,function(t,e,n,r){return 1===arguments.length?ar(t):new or(t,e,n,null==r?1:r)},Rn(Ln,{brighter(t){return new or(this.h,this.s,this.l*(t=null==t?Dn:Math.pow(Dn,t)),this.opacity)},darker(t){return new or(this.h,this.s,this.l*(t=null==t?In:Math.pow(In,t)),this.opacity)},rgb(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new Qn(lr(240>t?t+120:t-240,r,n),lr(t,r,n),lr(120>t?t+240:t-120,r,n),this.opacity)},clamp(){return new or(sr(this.h),ur(this.s),ur(this.l),er(this.opacity))},displayable(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl(){const t=er(this.opacity);return`${1===t?"hsl(":"hsla("}${sr(this.h)}, ${100*ur(this.s)}%, ${100*ur(this.l)}%${1===t?")":`, ${t})`}`}})),cr.Cache=Map,cr.cacheList=[],cr.clearCache=function(){cr.cacheList.forEach(function(t){return t.clear()})};var hr=function(t){return t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger",t}({}),fr=function(t){return t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther",t}({}),dr=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),vr=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),pr=[{name:"em",unit_type:hr.kEms},{name:"px",unit_type:hr.kPixels},{name:"deg",unit_type:hr.kDegrees},{name:"rad",unit_type:hr.kRadians},{name:"grad",unit_type:hr.kGradians},{name:"ms",unit_type:hr.kMilliseconds},{name:"s",unit_type:hr.kSeconds},{name:"rem",unit_type:hr.kRems},{name:"turn",unit_type:hr.kTurns}],yr=function(t){return t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType",t}({}),gr=function(t){return t?"number"===t?hr.kNumber:"percent"===t||"%"===t?hr.kPercentage:function(t){return pr.find(function(e){return e.name===t}).unit_type}(t):hr.kUnknown},mr=function(t){var e=1;switch(t){case hr.kPixels:case hr.kDegrees:case hr.kSeconds:break;case hr.kMilliseconds:e=.001;break;case hr.kRadians:e=180/Math.PI;break;case hr.kGradians:e=.9;break;case hr.kTurns:e=360}return e},kr=function(t){switch(t){case hr.kNumber:case hr.kInteger:return"";case hr.kPercentage:return"%";case hr.kEms:return"em";case hr.kRems:return"rem";case hr.kPixels:return"px";case hr.kDegrees:return"deg";case hr.kRadians:return"rad";case hr.kGradians:return"grad";case hr.kMilliseconds:return"ms";case hr.kSeconds:return"s";case hr.kTurns:return"turn"}return""},Er=function(){return u(function t(){o(this,t)},[{key:"toString",value:function(){return this.buildCSSText(dr.kNo,vr.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=yr.kUnitType&&this.getType()<=yr.kClampType}}],[{key:"isAngle",value:function(t){return t===hr.kDegrees||t===hr.kRadians||t===hr.kGradians||t===hr.kTurns}},{key:"isLength",value:function(t){return t>=hr.kEms&&hr.kDegrees>t}},{key:"isRelativeUnit",value:function(t){return t===hr.kPercentage||t===hr.kEms||t===hr.kRems}},{key:"isTime",value:function(t){return t===hr.kSeconds||t===hr.kMilliseconds}}])}(),xr=function(t){function e(t){var n;return o(this,e),(n=k(this,e)).colorSpace=t,n}return x(e,t),u(e,[{key:"getType",value:function(){return yr.kColorType}},{key:"to",value:function(t){return this}}])}(Er),br=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({}),Tr=function(t){function e(t,n){var r;return o(this,e),(r=k(this,e)).type=t,r.value=n,r}return x(e,t),u(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return yr.kColorType}}])}(Er),Mr=function(t){function e(t){var n;return o(this,e),(n=k(this,e)).value=t,n}return x(e,t),u(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return yr.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}])}(Er),wr=function(t){return function(t){switch(t){case fr.kUNumber:return hr.kNumber;case fr.kULength:return hr.kPixels;case fr.kUPercent:return hr.kPercentage;case fr.kUTime:return hr.kSeconds;case fr.kUAngle:return hr.kDegrees;default:return hr.kUnknown}}(function(t){switch(t){case hr.kNumber:case hr.kInteger:return fr.kUNumber;case hr.kPercentage:return fr.kUPercent;case hr.kPixels:return fr.kULength;case hr.kMilliseconds:case hr.kSeconds:return fr.kUTime;case hr.kDegrees:case hr.kRadians:case hr.kGradians:case hr.kTurns:return fr.kUAngle;default:return fr.kUOther}}(t))},Sr=function(t){function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:hr.kNumber;return o(this,e),n=k(this,e),r="string"==typeof i?gr(i):i,n.unit=r,n.value=t,n}return x(e,t),u(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){return this.value===t.value&&this.unit===t.unit}},{key:"getType",value:function(){return yr.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=wr(this.unit);if(n!==wr(t)||n===hr.kUnknown)return null;var r=mr(this.unit)/mr(t);return new e(this.value*r,t)}},{key:"buildCSSText",value:function(t,e,n){var r;switch(this.unit){case hr.kUnknown:break;case hr.kInteger:r=Number(this.value).toFixed(0);break;case hr.kNumber:case hr.kPercentage:case hr.kEms:case hr.kRems:case hr.kPixels:case hr.kDegrees:case hr.kRadians:case hr.kGradians:case hr.kMilliseconds:case hr.kSeconds:case hr.kTurns:var i=this.value,a=kr(this.unit);if(-999999>i||i>999999){var o=kr(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(i,o):i+(o||"")}else r="".concat(i).concat(a)}return n+=r}}])}(Er),Nr=new Sr(0,"px");new Sr(1,"px");var Pr=new Sr(0,"deg"),Cr=function(t){function e(t,n,r){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return o(this,e),(i=k(this,e,["rgb"])).r=t,i.g=n,i.b=r,i.alpha=a,i.isNone=s,i}return x(e,t),u(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(xr),Ar=new Mr("unset"),Or={"":Ar,unset:Ar,initial:new Mr("initial"),inherit:new Mr("inherit")},Rr=new Cr(0,0,0,0,!0),Lr=new Cr(0,0,0,0),Ir=cr(function(t,e,n,r){return new Cr(t,e,n,r)},function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")}),Dr=function(t){return new Sr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:hr.kNumber)};function _r(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new Sr(50,"%");var Gr=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,a=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,o=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,f=/^\(/,d=/^\)/,v=/^,/,p=/^\#([0-9a-fA-F]+)/,y=/^([a-zA-Z]+)/,g=/^rgb/i,m=/^rgba/i,k=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,E="";function x(t){throw Error("".concat(E,": ").concat(t))}function b(){var t=R(T);return E.length>0&&x("Invalid input not EOF"),t}function T(){return M("linear-gradient",t,S)||M("repeating-linear-gradient",e,S)||M("radial-gradient",n,N)||M("repeating-radial-gradient",r,N)||M("conic-gradient",i,N)}function M(t,e,n){return w(e,function(e){var r=n();return r&&(F(v)||x("Missing comma before color stops")),{type:t,orientation:r,colorStops:R(L)}})}function w(t,e){var n=F(t);if(n){F(f)||x("Missing (");var r=e(n);return F(d)||x("Missing )"),r}}function S(){return G("directional",a,1)||G("angular",h,1)}function N(){var t,e,n=P();return n&&((t=[]).push(n),e=E,F(v)&&((n=P())?t.push(n):E=e)),t}function P(){var t=function(){var t=G("shape",/^(circle)/i,0);t&&(t.style=_()||C());return t}()||function(){var t=G("shape",/^(ellipse)/i,0);t&&(t.style=D()||C());return t}();if(t)t.at=A();else{var e=C();if(e){t=e;var n=A();n&&(t.at=n)}else{var r=O();r&&(t={type:"default-radial",at:r})}}return t}function C(){return G("extent-keyword",o,1)}function A(){if(G("position",/^at/,0)){var t=O();return t||x("Missing positioning value"),t}}function O(){var t={x:D(),y:D()};if(t.x||t.y)return{type:"position",value:t}}function R(t){var e=t(),n=[];if(e)for(n.push(e);F(v);)(e=t())?n.push(e):x("One extra comma");return n}function L(){var t=G("hex",p,1)||w(m,function(){return{type:"rgba",value:R(I)}})||w(g,function(){return{type:"rgb",value:R(I)}})||G("literal",y,0);return t||x("Expected color definition"),t.length=D(),t}function I(){return F(k)[1]}function D(){return G("%",l,1)||G("position-keyword",s,1)||_()}function _(){return G("px",u,1)||G("em",c,1)}function G(t,e,n){var r=F(e);if(r)return{type:t,value:r[n]}}function F(t){var e=/^[\n\r\t\s]+/.exec(E);e&&B(e[0].length);var n=t.exec(E);return n&&B(n[0].length),n}function B(t){E=E.substring(t)}return function(t){return E=t,b()}}();function Fr(t,e,n,r){var i=Je(r.value),a=0+e/2,o=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+a-Math.cos(i)*s/2,y1:t[1]+o-Math.sin(i)*s/2,x2:t[0]+a+Math.cos(i)*s/2,y2:t[1]+o+Math.sin(i)*s/2}}function Br(t,e,n,r,i,a){var o=r.value,s=i.value;r.unit===hr.kPercentage&&(o=r.value/100*e),i.unit===hr.kPercentage&&(s=i.value/100*n);var u=Math.max(_e([0,0],[o,s]),_e([0,n],[o,s]),_e([e,n],[o,s]),_e([e,0],[o,s]));return a&&(a instanceof Sr?u=a.value:a instanceof Mr&&("closest-side"===a.value?u=Math.min(o,e-o,s,n-s):"farthest-side"===a.value?u=Math.max(o,e-o,s,n-s):"closest-corner"===a.value&&(u=Math.min(_e([0,0],[o,s]),_e([0,n],[o,s]),_e([e,n],[o,s]),_e([e,0],[o,s]))))),{x:o+t[0],y:s+t[1],r:u}}var Vr=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Ur=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,zr=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Hr=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var jr={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},Yr=cr(function(t){return Dr("angular"===t.type?Number(t.value):jr[t.value]||0,"deg")}),Wr=cr(function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var a=t.value,o=a.x,s=a.y;"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?e=50:"right"===o.value?e=100:"top"===o.value?n=0:"bottom"===o.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(r=null==o?void 0:o.type,e=Number(o.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:Dr(e,r),cy:Dr(n,i)}}),qr=cr(function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Gr(t).map(function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,a=Number(t[0].length.value),o=1;r>o;o++){var s,u=null===(s=t[o].length)||void 0===s?void 0:s.value;if(!$t(u)&&!$t(a)){for(var l=1;o-i>l;l++)t[i+l].length={type:"%",value:"".concat(a+(Number(u)-a)*l/(o-i))};i=o,a=Number(u)}}}(r);var i,a=r.map(function(t){return{offset:Dr(Number(t.length.value),"%"),color:_r(t)}});if("linear-gradient"===e)return new Tr(br.LinearGradient,{angle:n?Yr(n):Pr,steps:a});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o,s=Wr(n[0].at),u=s.cx,l=s.cy;if(n[0].style){var c=n[0].style,h=c.type,f=c.value;"extent-keyword"===h?(Or[i=f]||(Or[i]=new Mr(i)),o=Or[i]):o=Dr(f,h)}return new Tr(br.RadialGradient,{cx:u,cy:l,size:o,steps:a})}});var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=Vr.exec(t);if(n){var r,i=(null===(r=n[2].match(Hr))||void 0===r?void 0:r.map(function(t){return t.split(":")}))||[];return[new Tr(br.LinearGradient,{angle:Dr(parseFloat(n[1]),"deg"),steps:i.map(function(t){var e=b(t,2),n=e[1];return{offset:Dr(100*Number(e[0]),"%"),color:n}})})]}}else if("r"===e){var a=function(t){var e=Ur.exec(t);if(e){var n,r=(null===(n=e[4].match(Hr))||void 0===n?void 0:n.map(function(t){return t.split(":")}))||[];return{cx:Dr(50,"%"),cy:Dr(50,"%"),steps:r.map(function(t){var e=b(t,2),n=e[1];return{offset:Dr(100*Number(e[0]),"%"),color:n}})}}return null}(t);if(a){if(!ne(a))return[new Tr(br.RadialGradient,a)];t=a}}else if("p"===e)return function(t){var e=zr.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)});function Xr(t){return t&&!!t.image}function Zr(t){return t&&!$t(t.r)&&!$t(t.g)&&!$t(t.b)}var $r=cr(function(t){if(Xr(t))return a({repetition:"repeat"},t);if($t(t)&&(t=""),"transparent"===t)return Lr;if("currentColor"===t)t="black";else if("none"===t)return Rr;var e=qr(t);if(e)return e;var n=Zn(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Ir.apply(void 0,r)});function Kr(t,e){if(Zr(t)&&Zr(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(re(e[n],0,255));return e[3]=re(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Qr(t,e){if($t(e))return Dr(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Dr(Number(e),"px");if("deg".search(t)>=0)return Dr(Number(e),"deg")}var n=[];e=e.replace(t,function(t){return n.push(t),"U".concat(t)});var r="U(".concat(t.source,")");return n.map(function(t){return Dr(Number(e.replace(RegExp("U".concat(t),"g"),"").replace(RegExp(r,"g"),"*0")),t)})[0]}var Jr=function(t){return Qr(/px/g,t)},ti=cr(Jr);cr(function(t){return Qr(RegExp("%","g"),t)});var ei=function(t){return ie(t)||isFinite(Number(t))?Dr(Number(t)||0,"px"):Qr(RegExp("px|%|em|rem","g"),t)},ni=cr(ei),ri=function(t){return Qr(/deg|rad|grad|turn/g,t)},ii=cr(ri);function ai(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",o=t.value||0,s=e.value||0,u=wr(t.unit),l=t.convertTo(u),c=e.convertTo(u);return l&&c?(o=l.value,s=c.value,a=kr(t.unit)):(Sr.isLength(t.unit)||Sr.isLength(e.unit))&&(o=ui(t,i,n),s=ui(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function oi(t){var e=0;return t.unit===hr.kDegrees?e=t.value:t.unit===hr.kRadians?e=en(Number(t.value)):t.unit===hr.kTurns?e=nn(Number(t.value)):t.value&&(e=t.value),e}function si(t,e){var n;return Array.isArray(t)?n=t.map(function(t){return Number(t)}):ne(t)?n=t.split(" ").map(function(t){return Number(t)}):ie(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:4===e?1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]:"even"===e&&n.length%2==1?[].concat(p(n),p(n)):n}function ui(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===hr.kPixels)return Number(t.value);if(t.unit===hr.kPercentage&&n){var i=n.nodeName===l.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var li=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function ci(t){return""+t}var hi=function(t){return Dr("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)},fi=cr(hi);function di(t,e){return[t,e,ci]}function vi(t,e){return function(n,r){return[n,r,function(n){return ci(re(n,t,e))}]}}function pi(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}
|
|
10
10
|
/*!
|
|
11
11
|
* @antv/g-math
|
|
12
12
|
* @description Geometry util
|
|
13
13
|
* @version 3.1.0
|
|
14
|
-
* @date
|
|
14
|
+
* @date 10/10/2026, 9:45:31 AM
|
|
15
15
|
* @author AntVis
|
|
16
16
|
* @docs https://g.antv.antgroup.com/
|
|
17
17
|
*/function yi(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function gi(t,e){var n=Math.min.apply(Math,p(t)),r=Math.min.apply(Math,p(e));return{x:n,y:r,width:Math.max.apply(Math,p(t))-n,height:Math.max.apply(Math,p(e))-r}}function mi(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function ki(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}function Ei(t,e,n,r,i,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,l=-1/0,c=[a,o],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var f=s+h;o>a?f>a&&o>f&&c.push(f):f>o&&a>f&&c.push(f)}for(var d=0;c.length>d;d++){var v=mi(t,0,n,r,i,c[d]);u>v&&(u=v),v>l&&(l=v)}for(var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),y=1/0,g=-1/0,m=[a,o],k=2*-Math.PI;2*Math.PI>=k;k+=Math.PI){var E=p+k;o>a?E>a&&o>E&&m.push(E):E>o&&a>E&&m.push(E)}for(var x=0;m.length>x;x++){var b=ki(0,e,n,r,i,m[x]);y>b&&(y=b),b>g&&(g=b)}return{x:u,y:y,width:l-u,height:g-y}}function xi(t,e,n,r){return yi(t,e,n,r)}function bi(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Ti(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function Mi(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,l=3*e-3*t,c=[];if(ae(s,0))ae(u,0)||0>(i=-l/u)||i>1||c.push(i);else{var h=u*u-4*s*l;ae(h,0)?c.push(-u/(2*s)):h>0&&(a=(-u-(o=Math.sqrt(h)))/(2*s),0>(i=(-u+o)/(2*s))||i>1||c.push(i),0>a||a>1||c.push(a))}return c}function wi(t,e,n,r,i,a,o,s){for(var u=[t,o],l=[e,s],c=Mi(t,n,i,o),h=Mi(e,r,a,s),f=0;c.length>f;f++)u.push(Ti(t,n,i,o,c[f]));for(var d=0;h.length>d;d++)l.push(Ti(e,r,a,s,h[d]));return gi(u,l)}function Si(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=yi(r[0],r[1],i[0],i[1])}return e}(t)}function Ni(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Pi(t,e,n){var r=t+n-2*e;if(ae(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function Ci(t,e,n,r,i,a){var o=Pi(t,n,i)[0],s=Pi(e,r,a)[0],u=[t,i],l=[e,a];return void 0!==o&&u.push(Ni(t,n,i,o)),void 0!==s&&l.push(Ni(e,r,a,s)),gi(u,l)}function Ai(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=Ye(t.parsedStyle.d.absolutePath,void 0,le(le({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Oi(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ri(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,a=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),o=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.acos((a+o-(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)))/(2*Math.sqrt(a)*Math.sqrt(o)));if(!s||0===Math.sin(s)||ae(s,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),l=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(s/2-(u=u>Math.PI/2?Math.PI-u:u))*(e/2*(1/Math.sin(s/2)))-e/2||0,yExtra:Math.cos(l-s/2)*(e/2*(1/Math.sin(s/2)))-e/2||0}}function Li(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}cr(function(t){return ne(t)?t.split(" ").map(fi):t.map(fi)});var Ii=function(t,e){return(0>t.x*e.y-t.y*e.x?-1:1)*Math.acos((t.x*e.x+t.y*e.y)/Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))))},Di=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var u=Je(r=oe(r,360));if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-o.x)/2,c=(t.y-o.y)/2,h={x:Math.cos(u)*l+Math.sin(u)*c,y:-Math.sin(u)*l+Math.cos(u)*c},f=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);f>1&&(e*=Math.sqrt(f),n*=Math.sqrt(f));var d=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2)),v=(i!==a?1:-1)*Math.sqrt(d=0>d?0:d),p=v*(e*h.y/n),y=v*(-n*h.x/e),g={x:Math.cos(u)*p-Math.sin(u)*y+(t.x+o.x)/2,y:Math.sin(u)*p+Math.cos(u)*y+(t.y+o.y)/2},m={x:(h.x-p)/e,y:(h.y-y)/n},k=Ii({x:1,y:0},m),E=Ii(m,{x:(-h.x-p)/e,y:(-h.y-y)/n});!a&&E>0?E-=2*Math.PI:a&&0>E&&(E+=2*Math.PI);var x=k+(E%=2*Math.PI)*s,b=e*Math.cos(x),T=n*Math.sin(x);return{x:Math.cos(u)*b-Math.sin(u)*T+g.x,y:Math.sin(u)*b+Math.cos(u)*T+g.y,ellipticalArcStartAngle:k,ellipticalArcEndAngle:k+E,ellipticalArcAngle:x,ellipticalArcCenter:g,resultantRx:e,resultantRy:n}};function _i(t,e){var n=2>=arguments.length||void 0===arguments[2]||arguments[2],r=t.arcParams,i=r.rx,a=void 0===i?0:i,o=r.ry,s=void 0===o?0:o,u=r.xRotation,l=r.arcFlag,c=r.sweepFlag,h=Di({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=Di({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=f.x-h.x,v=f.y-h.y,p=Math.sqrt(d*d+v*v);return{x:-d/p,y:-v/p}}function Gi(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Fi(t,e){return Gi(t)*Gi(e)?(t[0]*e[0]+t[1]*e[1])/(Gi(t)*Gi(e)):1}function Bi(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(Fi(t,e))}function Vi(t,e){var n=e[1],r=e[2],i=oe(Je(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],u=t[1],l=e[6],c=e[7],h=Math.cos(i)*(s-l)/2+Math.sin(i)*(u-c)/2,f=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(u-c)/2,d=h*h/(n*n)+f*f/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var v=n*n*(f*f)+r*r*(h*h),p=v?Math.sqrt((n*n*(r*r)-v)/v):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var y=r?p*n*f/r:0,g=n?p*-r*h/n:0,m=(s+l)/2+Math.cos(i)*y-Math.sin(i)*g,k=(u+c)/2+Math.sin(i)*y+Math.cos(i)*g,E=[(h-y)/n,(f-g)/r],x=[(-1*h-y)/n,(-1*f-g)/r],b=Bi([1,0],E),T=Bi(E,x);return Fi(E,x)>-1||(T=Math.PI),1>Fi(E,x)||(T=0),0===o&&T>0&&(T-=2*Math.PI),1===o&&0>T&&(T+=2*Math.PI),{cx:m,cy:k,rx:Oi(t,[l,c])?0:n,ry:Oi(t,[l,c])?0:r,startAngle:b,endAngle:b+T,xRotation:i,arcFlag:a,sweepFlag:o}}function Ui(t,e,n,r){var i=.5522847498307936,a=t*i,o=e*i,s=n-t,u=n+t,l=r-e,c=r+e;return[["M",s,r],["C",s,r-o,n-a,l,n,l],["C",n+a,l,u,r-o,u,r],["C",u,r+o,n+a,c,n,c],["C",n-a,c,s,r+o,s,r],["Z"]]}var zi=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=Ce(t)}catch(n){e=Ce(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;t.length>e;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],a=void 0;"L"===i||"M"===i?a=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(a=[n[n.length-2],n[n.length-1]]),a&&Oi([r[1],r[2]],a)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,a=r.polylines,o=function(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;o>s;s++){var u=t[s];r=t[s+1];var l=u[0],c={command:l,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[u[1],u[2]],a=s;break;case"A":var h=Vi(n,u);c.arcParams=h}if("Z"===l)n=i,r=t[a+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[a],e[a]&&(e[a].prePoint=n)),c.currentPoint=n,e[a]&&Oi(n,e[a].currentPoint)&&(e[a].prePoint=c.prePoint),c.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var d=c.prePoint;if(["L","H","V"].includes(l))c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]];else if("Q"===l){var v=[u[1],u[2]];c.startTangent=[d[0]-v[0],d[1]-v[1]],c.endTangent=[n[0]-v[0],n[1]-v[1]]}else if("T"===l){var p=e[s-1],y=Li(p.currentPoint,d);"Q"===p.command?(c.command="Q",c.startTangent=[d[0]-y[0],d[1]-y[1]],c.endTangent=[n[0]-y[0],n[1]-y[1]]):(c.command="TL",c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]])}else if("C"===l){var g=[u[1],u[2]],m=[u[3],u[4]];c.startTangent=[d[0]-g[0],d[1]-g[1]],c.endTangent=[n[0]-m[0],n[1]-m[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[g[0]-m[0],g[1]-m[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[m[0]-g[0],m[1]-g[1]])}else if("S"===l){var k=e[s-1],E=Li(k.currentPoint,d),x=[u[1],u[2]];"C"===k.command?(c.command="C",c.startTangent=[d[0]-E[0],d[1]-E[1]],c.endTangent=[n[0]-x[0],n[1]-x[1]]):(c.command="SQ",c.startTangent=[d[0]-x[0],d[1]-x[1]],c.endTangent=[n[0]-x[0],n[1]-x[1]])}else if("A"===l){var b=_i(c,0),T=b.x,M=b.y,w=_i(c,1,!1),S=w.x,N=w.y;c.startTangent=[T,M],c.endTangent=[S,N]}e.push(c)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],a=0;t.length>a;a++){var o=t[a],s=o.currentPoint,u=o.params,l=o.prePoint,c=void 0;switch(o.command){case"Q":c=Ci(l[0],l[1],u[1],u[2],u[3],u[4]);break;case"C":c=wi(l[0],l[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=o.arcParams;c=Ei(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}c&&(o.box=c,n.push(c.x,c.x+c.width),r.push(c.y,c.y+c.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}n=n.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}),r=r.filter(function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0});var f=ee(n),d=ee(r),v=te(n),p=te(r);if(0===i.length)return{x:f,y:d,width:v-f,height:p-d};for(var y=0;i.length>y;y++){var g=i[y],m=g.currentPoint;m[0]===f?f-=Ri(g,e).xExtra:m[0]===v&&(v+=Ri(g,e).xExtra),m[1]===d?d-=Ri(g,e).yExtra:m[1]===p&&(p+=Ri(g,e).yExtra)}return{x:f,y:d,width:v-f,height:p-d}}(o,0),u=s.x,l=s.y,c=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:o,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(h)?h:0}}},Hi=cr(zi);function ji(t){return ne(t)?Hi(t):zi(t)}function Yi(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=De(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=De(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=Xe(r,i));var o,s,u,l,c,h,f,d,v=We(a[0])!==We(a[1])?(s=(o=a[0]).slice(1).map(function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):o[0].slice(1).concat(t.slice(1))}).map(function(t){return t.map(function(e,n){return t[t.length-n-2*(1-n%2)]})}).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map(function(t){return["C"].concat(t.slice(2))}))):a[0].map(function(t){return Array.isArray(t)?[].concat(t):t});return[v,(u=a[1],l=v,c=u.length-1,h=[],f=0,d=function(t){var e=t.length,n=e-1;return t.map(function(r,i){return t.map(function(r,a){var o=i+a;return 0===a||t[o]&&"M"===t[o][0]?["M"].concat(t[o].slice(-2)):(e>o||(o-=n),t[o])})})}(u),d.forEach(function(t,e){u.slice(1).forEach(function(t,n){f+=_e(u[(e+n)%c].slice(-2),l[n%c].slice(-2))}),h[e]=f,f=0}),d[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function Wi(t,e){return[t.points,e.points,function(t){return t}]}var qi=null,Xi=/\s*(\w+)\(([^)]*)\)/g;function Zi(t){return function(e){var n=0;return t.map(function(t){return t===qi?e[n++]:t})}}function $i(t){return t}var Ki={matrix:["NNNNNN",[qi,qi,0,0,qi,qi,0,0,0,0,1,0,qi,qi,0,1],$i],matrix3d:["NNNNNNNNNNNNNNNN",$i],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Zi([qi,qi,new Sr(1)]),$i],scaleX:["N",Zi([qi,new Sr(1),new Sr(1)]),Zi([qi,new Sr(1)])],scaleY:["N",Zi([new Sr(1),qi,new Sr(1)]),Zi([new Sr(1),qi])],scaleZ:["N",Zi([new Sr(1),new Sr(1),qi])],scale3d:["NNN",$i],skew:["Aa",null,$i],skewX:["A",null,Zi([qi,Pr])],skewY:["A",null,Zi([Pr,qi])],translate:["Tt",Zi([qi,qi,Nr]),$i],translateX:["T",Zi([qi,Nr,Nr]),Zi([qi,Nr])],translateY:["T",Zi([Nr,qi,Nr]),Zi([Nr,qi])],translateZ:["L",Zi([Nr,Nr,qi])],translate3d:["TTL",$i]};function Qi(t){for(var e=[],n=t.length,r=0;n>r;r++){var i=t[r],a=i[0],o=i.slice(1);if("translate"===a||"skew"===a?1===o.length&&o.push(0):"scale"===a&&1===o.length&&o.push(o[0]),!Ki[a])return[];var s=o.map(function(t){return Dr(t)});e.push({t:a,d:s})}return e}function Ji(t){if(Array.isArray(t))return Qi(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Xi.lastIndex=0;e=Xi.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=Ki[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(o.length>s.length)return[];for(var u=[],l=0;s.length>l;l++){var c=o[l],h=s[l],f=void 0;if(void 0===(f=c?{A:function(t){return"0"===t.trim()?Pr:ii(t)},N:fi,T:ni,L:ti}[h.toUpperCase()](c):{a:Pr,n:u[0],t:Nr}[h]))return[];u.push(f)}if(n.push({t:i,d:u}),Xi.lastIndex===t.length)return n}return[]}function ta(t){if(Array.isArray(t))return Qi(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Xi.lastIndex=0;e=Xi.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],a=Ki[i];if(!a)return[];var o=e[2].split(","),s=a[0];if(o.length>s.length)return[];for(var u=[],l=0;s.length>l;l++){var c=o[l],h=s[l],f=void 0;if(void 0===(f=c?{A:function(t){return"0"===t.trim()?Pr:ri(t)},N:hi,T:ei,L:Jr}[h.toUpperCase()](c):{a:Pr,n:u[0],t:Nr}[h]))return[];u.push(f)}if(n.push({t:i,d:u}),Xi.lastIndex===t.length)return n}return[]}function ea(t){var e,n,r,i;switch(t.t){case"rotateX":return i=Je(oi(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotateY":return i=Je(oi(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotateZ":return i=Je(oi(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=Je(oi(t.d[3]));var a=e*e+n*n+r*r;if(0===a)e=1,n=0,r=0;else if(1!==a){var o=Math.sqrt(a);e/=o,n/=o,r/=o}var s=Math.sin(i/2),u=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*u),2*(e*r*l-n*u),0,2*(e*n*l-r*u),1-2*(e*e+r*r)*l,2*(n*r*l+e*u),0,2*(e*r*l+n*u),2*(n*r*l-e*u),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scaleX":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaleY":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scaleZ":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var c=Je(oi(t.d[0])),h=Je(oi(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewX":return i=Je(oi(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewY":return i=Je(oi(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ui(t.d[0],0,null)||0,n=ui(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ui(t.d[0],0,null)||0,0,0,1];case"translateY":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=ui(t.d[0],0,null)||0,0,1];case"translateZ":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=ui(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ui(t.d[0],0,null)||0,n=ui(t.d[1],0,null)||0,r=ui(t.d[2],0,null)||0,1];case"perspective":var f=ui(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,f?-1/f:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map(function(t){return t.value})}}function na(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function ra(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(un,t))return!1;if(C(ln,un),ln[3]=0,ln[7]=0,ln[11]=0,ln[15]=1,1e-8>Math.abs(I(ln)))return!1;var o,s,u=un[3],l=un[7],c=un[11],h=un[12],f=un[13],d=un[14],v=un[15];if(0!==u||0!==l||0!==c){if(cn[0]=u,cn[1]=l,cn[2]=c,cn[3]=v,!L(ln,ln))return!1;R(ln,ln),Tt(i,cn,ln)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=f,e[2]=d,(o=hn)[0][0]=(s=un)[0],o[0][1]=s[1],o[0][2]=s[2],o[1][0]=s[4],o[1][1]=s[5],o[1][2]=s[6],o[2][0]=s[8],o[2][1]=s[9],o[2][2]=s[10],n[0]=st(hn[0]),vt(hn[0],hn[0]),r[0]=pt(hn[0],hn[1]),dn(hn[1],hn[1],hn[0],1,-r[0]),n[1]=st(hn[1]),vt(hn[1],hn[1]),r[0]/=n[1],r[1]=pt(hn[0],hn[2]),dn(hn[2],hn[2],hn[0],1,-r[1]),r[2]=pt(hn[1],hn[2]),dn(hn[2],hn[2],hn[1],1,-r[2]),n[2]=st(hn[2]),vt(hn[2],hn[2]),r[1]/=n[2],r[2]/=n[2],yt(fn,hn[1],hn[2]),0>pt(hn[0],fn))for(var p=0;3>p;p++)n[p]*=-1,hn[p][0]*=-1,hn[p][1]*=-1,hn[p][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+hn[0][0]-hn[1][1]-hn[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-hn[0][0]+hn[1][1]-hn[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-hn[0][0]-hn[1][1]+hn[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+hn[0][0]+hn[1][1]+hn[2][2],0)),hn[2][1]>hn[1][2]&&(a[0]=-a[0]),hn[0][2]>hn[2][0]&&(a[1]=-a[1]),hn[1][0]>hn[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(ea).reduce(na)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var ia=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var a=0;4>a;a++)n[r][i]+=e[r][a]*t[a][i];return n}return function(e,n,r,i,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)o[s][3]=a[s];for(var u=0;3>u;u++)for(var l=0;3>l;l++)o[3][u]+=e[l]*o[l][u];var c=i[0],h=i[1],f=i[2],d=i[3],v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];v[0][0]=1-2*(h*h+f*f),v[0][1]=2*(c*h-f*d),v[0][2]=2*(c*f+h*d),v[1][0]=2*(c*h+f*d),v[1][1]=1-2*(c*c+f*f),v[1][2]=2*(h*f-c*d),v[2][0]=2*(c*f-h*d),v[2][1]=2*(h*f+c*d),v[2][2]=1-2*(c*c+h*h),o=t(o,v);var p,y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(y[2][1]=r[2],o=t(o,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],o=t(o,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],o=t(o,y));for(var g=0;3>g;g++)for(var m=0;3>m;m++)o[g][m]*=n[g];return 0===(p=o)[0][2]&&0===p[0][3]&&0===p[1][2]&&0===p[1][3]&&0===p[2][0]&&0===p[2][1]&&1===p[2][2]&&0===p[2][3]&&0===p[3][2]&&1===p[3][3]?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[3])}}();function aa(t){return t.toFixed(6).replace(".000000","")}function oa(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=ra(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=ra(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;t.length>r;r++)n+=t[r]*e[r];return n}(t,e);r=re(r,-1,1);var i=[];if(1===r)i=t;else for(var a=Math.acos(r),o=1*Math.sin(n*a)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(n[0][3],r[0][3],t[5]);return ia(t[0],t[1],t[2],e,t[4]).map(aa).join(",")}])}function sa(t){return t.replace(/[XY]/,"")}function ua(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}var la=function(t,e){return"perspective"===t&&"perspective"===e||("matrix"===t||"matrix3d"===t)&&("matrix"===e||"matrix3d"===e)};function ca(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[a],r=n.t,i=n.d,o="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map(function(t){return"number"==typeof t?Dr(o):Dr(o,t.unit)})})},a=0;t.length>a;a++)i()}var o=[],s=[],u=[];if(t.length!==e.length){var l=oa(t,e);o=[l[0]],s=[l[1]],u=[["matrix",[l[2]]]]}else for(var c=0;t.length>c;c++){var h=t[c].t,f=e[c].t,d=t[c].d,v=e[c].d,p=Ki[h],y=Ki[f],g=void 0;if(la(h,f)){var m=oa([t[c]],[e[c]]);o.push(m[0]),s.push(m[1]),u.push(["matrix",[m[2]]])}else{if(h===f)g=h;else if(p[2]&&y[2]&&sa(h)===sa(f))g=sa(h),d=p[2](d),v=y[2](v);else{if(!p[1]||!y[1]||ua(h)!==ua(f)){var k=oa(t,e);o=[k[0]],s=[k[1]],u=[["matrix",[k[2]]]];break}g=ua(h),d=p[1](d),v=y[1](v)}for(var E=[],x=[],b=[],T=0;d.length>T;T++){var M=ai(d[T],v[T],n,!1,T);E[T]=M[0],x[T]=M[1],b.push(M[2])}o.push(E),s.push(x),u.push([g,b])}}if(r){var w=o;o=s,s=w}return[o,s,function(t){return t.map(function(t,e){var n=t.map(function(t,n){return u[e][1][n](t)}).join(",");return"matrix"===u[e][0]&&16===n.split(",").length&&(u[e][0]="matrix3d"),"matrix3d"===u[e][0]&&6===n.split(",").length&&(u[e][0]="matrix"),"".concat(u[e][0],"(").concat(n,")")}).join(" ")}]}var ha=cr(function(t){if(ne(t)){if("text-anchor"===t)return[Dr(0,"px"),Dr(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[ni(fa(e[0])),ni(fa(e[1]))]}return[Dr(t[0]||0,"px"),Dr(t[1]||0,"px")]});function fa(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var da=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:An.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:An.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:An.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:An.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:An.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:An.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:An.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:An.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:An.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:An.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:An.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:An.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:An.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:An.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:An.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:An.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:An.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:An.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:An.FILTER},{n:"clipPath",syntax:An.DEFINED_PATH},{n:"textPath",syntax:An.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:An.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:An.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:An.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:An.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:An.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:An.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:An.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:An.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:An.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:An.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:An.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:An.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:An.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:An.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:An.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:An.COORDINATE},{n:"y1",int:!0,l:!0,syntax:An.COORDINATE},{n:"z1",int:!0,l:!0,syntax:An.COORDINATE},{n:"x2",int:!0,l:!0,syntax:An.COORDINATE},{n:"y2",int:!0,l:!0,syntax:An.COORDINATE},{n:"z2",int:!0,l:!0,syntax:An.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:An.PATH,p:50},{n:"points",int:!0,l:!0,syntax:An.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:An.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:An.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:An.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:An.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:An.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:An.NUMBER,d:function(t){return t===l.PATH||t===l.POLYGON||t===l.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:An.MARKER},{n:"markerEnd",syntax:An.MARKER},{n:"markerMid",syntax:An.MARKER},{n:"markerStartOffset",syntax:An.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:An.LENGTH,l:!0,int:!0,d:"0"}],va=new Set(da.filter(function(t){return!!t.l}).map(function(t){return t.n})),pa={},ya=function(){return u(function t(e){var n=this;o(this,t),this.runtime=e,da.forEach(function(t){n.registerMetadata(t)})},[{key:"registerMetadata",value:function(t){[t.n].concat(p(t.a||[])).forEach(function(e){pa[e]=t})}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var r=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;!function(t,e){var n=ga(t);for(var r in e)n.has(r)&&(t.parsedStyle[r]=e[r])}(t,e);var o=!!n.forceUpdateGeometry;if(!o)for(var s in e)if(va.has(s)){o=!0;break}var u,l=ga(t);l.has("fill")&&e.fill&&(t.parsedStyle.fill=$r(e.fill)),l.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=$r(e.stroke)),l.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=$r(e.shadowColor)),l.has("filter")&&e.filter&&(t.parsedStyle.filter=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,li.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map(function(t){return Qr(/deg|rad|grad|turn|px|%/g,t)||$r(t)})}),n.lastIndex===t.length)return r}return[]}(e.filter)),l.has("radius")&&!$t(e.radius)&&(t.parsedStyle.radius=si(e.radius,4)),l.has("lineDash")&&!$t(e.lineDash)&&(t.parsedStyle.lineDash=si(e.lineDash,"even")),l.has("points")&&e.points&&(t.parsedStyle.points={points:ne(u=e.points)?u.split(" ").map(function(t){var e=b(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]}):u,totalLength:0,segments:[]}),l.has("d")&&""===e.d&&(t.parsedStyle.d=a({},Cn)),l.has("d")&&e.d&&(t.parsedStyle.d=ji(e.d)),l.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[An.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),l.has("clipPath")&&!ue(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[An.DEFINED_PATH].calculator("clipPath",r,e.clipPath,t,this.runtime),l.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[An.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),l.has("transform")&&e.transform&&(t.parsedStyle.transform=Ji(e.transform)),l.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=ha(e.transformOrigin)),l.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[An.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),l.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[An.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),l.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[An.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),l.has("zIndex")&&!$t(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[An.Z_INDEX].postProcessor(t),l.has("offsetDistance")&&!$t(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[An.OFFSET_DISTANCE].postProcessor(t),l.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[An.TRANSFORM].postProcessor(t),l.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[An.TRANSFORM_ORIGIN].postProcessor(t),o&&(t.dirty(!0,!0),n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new Ut),r.renderBounds||(r.renderBounds=new Ut);var i=t.parsedStyle,a=n.update(i,t),o=a.cx,s=void 0===o?0:o,u=a.cy,c=void 0===u?0:u,h=a.cz,f=void 0===h?0:h,d=a.hwidth,v=void 0===d?0:d,p=a.hheight,y=void 0===p?0:p,g=a.hdepth,m=void 0===g?0:g,k=[Math.abs(v),Math.abs(y),m],E=i.stroke,x=i.lineWidth,b=void 0===x?1:x,T=i.increasedLineWidthForHitTesting,M=void 0===T?0:T,w=i.shadowType,S=void 0===w?"outer":w,N=i.shadowColor,P=i.filter,C=void 0===P?[]:P,A=i.transformOrigin,O=[s,c,f];if(r.contentBounds.update(O,k),E&&!E.isNone){var R=((b||0)+(M||0))*(e===l.POLYLINE||e===l.POLYGON||e===l.PATH?Math.SQRT2:.5);k[0]+=R,k[1]+=R}if(r.renderBounds.update(O,k),N&&S&&"inner"!==S){var L=r.renderBounds,I=L.min,D=L.max,_=i.shadowBlur||0,G=i.shadowOffsetX||0,F=i.shadowOffsetY||0,B=D[0]+_+G,V=I[1]-_+F,U=D[1]+_+F;I[0]=Math.min(I[0],I[0]-_+G),D[0]=Math.max(D[0],B),I[1]=Math.min(I[1],V),D[1]=Math.max(D[1],U),r.renderBounds.setMinMax(I,D)}C.forEach(function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,ht(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,u=r.renderBounds,l=u.min,c=u.max,h=c[0]+s+a,f=l[1]-s+o,d=c[1]+s+o;l[0]=Math.min(l[0],l[0]-s+a),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],f),c[1]=Math.max(c[1],d),r.renderBounds.setMinMax(l,c)}}),t.geometry.dirty=!1;var z=0>y,H=(0>v?-1:1)*(A?ui(A[0],0,t,!0):0),j=(z?-1:1)*(A?ui(A[1],1,t,!0):0);(H||j)&&t.setOrigin(H,j)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===l.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===l.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function ga(t){return t.constructor.PARSED_STYLE_LIST}var ma=function(){return u(function t(){o(this,t),this.mixer=di},[{key:"calculator",value:function(t,e,n,r){return oi(n)}}])}(),ka=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,r,i){return n instanceof Mr&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach(function(t){0===t.childNodes.length&&i.sceneGraphService.dirtyToRoot(t)}),n}}])}(),Ea=function(){return u(function t(){o(this,t),this.parser=$r,this.mixer=Kr},[{key:"calculator",value:function(t,e,n,r){return n instanceof Mr?"none"===n.value?Rr:Lr:n}}])}(),xa=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n){return n instanceof Mr?[]:n}}])}();function ba(t){var e=t.parsedStyle.fontSize;return $t(e)?null:e}var Ta=function(){return u(function t(){o(this,t),this.mixer=di},[{key:"calculator",value:function(t,e,n,r,i){if(ie(n))return n;if(!Sr.isRelativeUnit(n.unit))return n.value;if(n.unit===hr.kPercentage)return 0;if(n.unit===hr.kEms){if(r.parentNode){var a=ba(r.parentNode);if(a)return a*=n.value}return 0}if(n.unit===hr.kRems){var o;if(null!=r&&null!==(o=r.ownerDocument)&&void 0!==o&&o.documentElement){var s=ba(r.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),Ma=function(){return u(function t(){o(this,t),this.mixer=pi},[{key:"calculator",value:function(t,e,n){return n.map(function(t){return t.value})}}])}(),wa=function(){return u(function t(){o(this,t),this.mixer=pi},[{key:"calculator",value:function(t,e,n){return n.map(function(t){return t.value})}}])}(),Sa=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,r){var i;n instanceof Mr&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}])}(),Na=function(){return u(function t(){o(this,t),this.mixer=di},[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Pa=function(){return u(function t(){o(this,t),this.mixer=vi(0,1)},[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath;if(n){var r=n.nodeName;if(r===l.LINE||r===l.PATH||r===l.POLYLINE){var i=n.getPoint(e.offsetDistance);i&&t.setLocalPosition(i.x,i.y)}}}}])}(),Ca=function(){return u(function t(){o(this,t),this.mixer=vi(0,1)},[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Aa=function(){return u(function t(){o(this,t),this.parser=ji,this.mixer=Yi},[{key:"calculator",value:function(t,e,n){return n instanceof Mr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Wt(0,0,0,0)}:n}}])}(),Oa=u(function t(){o(this,t),this.mixer=Wi}),Ra=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).mixer=vi(0,1/0),t}return x(e,t),u(e)}(Ta),La=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,r){return n instanceof Mr?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),Ia=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,r){var i=r.getAttribute("text");if(i){var a=i;"capitalize"===n.value?a=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?a=i.toLowerCase():"uppercase"===n.value&&(a=i.toUpperCase()),r.parsedStyle.text=a}return n.value}}])}(),Da=new WeakMap;var _a="undefined"!=typeof window&&void 0!==window.document;function Ga(t){return!!t.getAttribute}function Fa(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function Ba(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function Va(t,e){if(_a)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Ua={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},za="object"==typeof performance&&performance.now?performance:Date;function Ha(t){return t.nodeName===l.FRAGMENT||t.getRootNode().nodeName===l.FRAGMENT}var ja=1,Ya="object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:{},Wa=Date.now(),qa={},Xa=Date.now(),Za=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Xa,r=n>16?0:16-n,i=ja++;return qa[i]=t,Object.keys(qa).length>1||setTimeout(function(){Xa=e;var t=qa;qa={},Object.keys(t).forEach(function(e){return t[e](Ya.performance&&"function"==typeof Ya.performance.now?Ya.performance.now():Date.now()-Wa)})},r),i},$a=function(t){delete qa[t]},Ka=function(t){return"string"!=typeof t?Za:""===t?Ya.requestAnimationFrame:Ya["".concat(t,"RequestAnimationFrame")]},Qa=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],function(t){return!!Ka(t)}),Ja=Ka(Qa),to=function(t){return"string"!=typeof t?$a:""===t?Ya.cancelAnimationFrame:Ya["".concat(t,"CancelAnimationFrame")]||Ya["".concat(t,"CancelRequestAnimationFrame")]}(Qa);Ya.requestAnimationFrame=Ja,Ya.cancelAnimationFrame=to;var eo=function(){return u(function t(){o(this,t),this.callbacks=[]},[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map(function(t){return t.apply(void 0,e)}))}}])}();function no(t,e){this.v=t,this.k=e}function ro(t,e,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}ro=function(t,e,n,r){function a(e,n){ro(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r}):t[e]=n:(a("next",0),a("throw",1),a("return",2))},ro(t,e,n,r)}function io(){
|
|
18
18
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
19
|
-
var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function a(n,r,i,a){var u=Object.create((r&&r.prototype instanceof s?r:s).prototype);return ro(u,"_invoke",function(n,r,i){var a,s,u,l=0,c=i||[],h=!1,f={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return a=e,s=0,u=t,f.n=n,o}};function d(n,r){for(s=n,u=r,e=0;!h&&l&&!i&&c.length>e;e++){var i,a=c[e],d=f.p,v=a[2];n>3?(i=v===r)&&(u=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=t):d>=a[0]&&((i=2>n&&a[1]>d)?(s=0,f.v=r,f.n=a[1]):v>d&&(i=3>n||a[0]>r||r>v)&&(a[4]=n,a[5]=r,f.n=v,s=0))}if(i||n>1)return o;throw h=!0,r}return function(i,c,v){if(l>1)throw TypeError("Generator is already running");for(h&&1===c&&d(c,v),s=c,u=v;(e=2>s?t:u)||!h;){a||(s?3>s?(s>1&&(f.n=-1),d(s,u)):f.n=u:f.v=u);try{if(l=2,a){if(s||(i="next"),e=a[i]){if(!(e=e.call(a,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,2>s&&(s=0)}else 1===s&&(e=a.return)&&e.call(a),2>s&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=t}else if((e=(h=0>f.n)?u:n.call(r,f))!==o)break}catch(e){a=t,s=1,u=e}finally{l=1}}return{value:e,done:h}}}(n,i,a),!0),u}var o={};function s(){}function u(){}function l(){}e=Object.getPrototypeOf;var c=[][r]?e(e([][r]())):(ro(e={},r,function(){return this}),e),h=l.prototype=s.prototype=Object.create(c);function f(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,ro(t,i,"GeneratorFunction")),t.prototype=Object.create(h),t}return u.prototype=l,ro(h,"constructor",l),ro(l,"constructor",u),u.displayName="GeneratorFunction",ro(l,i,"GeneratorFunction"),ro(h),ro(h,i,"Generator"),ro(h,r,function(){return this}),ro(h,"toString",function(){return"[object Generator]"}),(io=function(){return{w:a,m:f}})()}function ao(t,e){function n(r,i,a,o){try{var s=t[r](i),u=s.value;return u instanceof no?e.resolve(u.v).then(function(t){n("next",t,a,o)},function(t){n("throw",t,a,o)}):e.resolve(u).then(function(t){s.value=t,a(s)},function(t){return n("throw",t,a,o)})}catch(t){o(t)}}var r;this.next||(ro(ao.prototype),ro(ao.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),ro(this,"_invoke",function(t,i,a){function o(){return new e(function(e,r){n(t,a,e,r)})}return r=r?r.then(o,o):o()},!0)}function oo(t,e,n,r,i){return new ao(io().w(t,e,n,r),i||Promise)}function so(t,e,n,r,i){var a=oo(t,e,n,r,i);return a.next().then(function(t){return t.done?t.value:a.next()})}function uo(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function t(){for(;n.length;)if((r=n.pop())in e)return t.value=r,t.done=!1,t;return t.done=!0,t}}function lo(t){if(null!=t){var n=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}throw new TypeError(e(t)+" is not iterable")}function co(){var t=io(),e=t.m(co),n=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function r(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===n||"GeneratorFunction"===(e.displayName||e.name))}var i={throw:1,return:2,break:3,continue:3};function a(t){var e,n;return function(r){e||(e={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(t,e){return n(r.a,i[t],e)},delegateYield:function(t,i,a){return e.resultName=i,n(r.d,lo(t),a)},finish:function(t){return n(r.f,t)}},n=function(t,n,i){r.p=e.prev,r.n=e.next;try{return t(n,i)}finally{e.next=r.n}}),e.resultName&&(e[e.resultName]=r.v,e.resultName=void 0),e.sent=r.v,e.next=r.n;try{return t.call(this,e)}finally{r.p=e.prev,r.n=e.next}}}return(co=function(){return{wrap:function(e,n,r,i){return t.w(a(e),n,r,i&&i.reverse())},isGeneratorFunction:r,mark:t.m,awrap:function(t,e){return new no(t,e)},AsyncIterator:ao,async:function(t,e,n,i,o){return(r(e)?oo:so)(a(t),e,n,i,o)},keys:uo,values:lo}})()}function ho(t,e,n,r,i,a,o){try{var s=t[a](o),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function fo(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function o(t){ho(a,r,i,o,s,"next",t)}function s(t){ho(a,r,i,o,s,"throw",t)}o(void 0)})}}var vo=function(){return u(function t(){o(this,t),this.callbacks=[]},[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=fo(co().mark(function t(){var e,n,r,i,a=arguments;return co().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=6;break}return t.next=1,(e=this.callbacks)[0].apply(e,a);case 1:n=t.sent,r=1;case 2:if(r>=this.callbacks.length){t.next=5;break}return i=this.callbacks[r],t.next=3,i(n);case 3:n=t.sent;case 4:r++,t.next=2;break;case 5:return t.abrupt("return",n);case 6:return t.abrupt("return",null);case 7:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})}]);var t}(),po=function(){return u(function t(){o(this,t),this.callbacks=[]},[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=arguments;this.callbacks.forEach(function(t){t.apply(void 0,r)})}}])}(),yo=function(){return u(function t(){o(this,t),this.callbacks=[]},[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];if(this.callbacks.length){for(var r=this.callbacks[0].apply(void 0,arguments),i=1;this.callbacks.length>i;i++){r=(0,this.callbacks[i])(r)}return r}return null}}])}(),go=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],mo=/([\"\'])[^\'\"]+\1/;function ko(t){var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,a=t.fontWeight;return{fontSize:void 0===e?16:e,fontFamily:void 0===n?"sans-serif":n,fontStyle:void 0===r?"normal":r,fontVariant:void 0===i?"normal":i,fontWeight:void 0===a?"normal":a}}var Eo=cr(function(t){for(var e=ko(t),n=e.fontSize,r=e.fontFamily,i=e.fontStyle,a=e.fontVariant,o=e.fontWeight,s=ie(n)&&"".concat(n,"px")||"16px",u=r.split(","),l=u.length-1;l>=0;l--){var c=u[l].trim();!mo.test(c)&&0>go.indexOf(c)&&(c='"'.concat(c,'"')),u[l]=c}return"".concat(i," ").concat(a," ").concat(o," ").concat(s," ").concat(u.join(","))},function(t){var e=ko(t),n=e.fontSize,r=e.fontFamily,i=e.fontVariant,a=e.fontWeight;return"".concat(e.fontStyle,"_").concat(i,"_").concat(a,"_").concat(n,"_").concat(r)}),xo=function(t){return Math.max(t,1e-6)};function bo(t,e,n){return O(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var To=P(),Mo=P(),wo={scale:function(t){U(To,[t[0].value,t[1].value,1].map(function(t){return xo(t)}))},scaleX:function(t){U(To,[t[0].value,1,1].map(function(t){return xo(t)}))},scaleY:function(t){U(To,[1,t[0].value,1].map(function(t){return xo(t)}))},scaleZ:function(t){U(To,[1,1,t[0].value].map(function(t){return xo(t)}))},scale3d:function(t){U(To,[t[0].value,t[1].value,t[2].value].map(function(t){return xo(t)}))},translate:function(t){V(To,[t[0].value,t[1].value,0])},translateX:function(t){V(To,[t[0].value,0,0])},translateY:function(t){V(To,[0,t[0].value,0])},translateZ:function(t){V(To,[0,0,t[0].value])},translate3d:function(t){V(To,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Y(To,Je(oi(t[0])))},rotateX:function(t){H(To,Je(oi(t[0])))},rotateY:function(t){j(To,Je(oi(t[0])))},rotateZ:function(t){Y(To,Je(oi(t[0])))},rotate3d:function(t){z(To,Je(oi(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){bo(To,Je(t[0].value),Je(t[1].value))},skewX:function(t){bo(To,Je(t[0].value),0)},skewY:function(t){bo(To,0,Je(t[0].value))},matrix:function(t){A(To,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){A.apply(at,[To].concat(p(t.map(function(t){return t.value}))))}},So=ut(1,1,1),No=ot(),Po={translate:function(t,e){Rs.sceneGraphService.setLocalScale(t,So,!1),Rs.sceneGraphService.setLocalEulerAngles(t,No,void 0,void 0,!1),Rs.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),Rs.sceneGraphService.dirtyLocalTransform(t,t.transformable)}};function Co(t,e){if(t.length){if(1===t.length&&Po[t[0].t])return void Po[t[0].t](e,t[0].d);for(var n=O(Mo),r=0;t.length>r;r++){var i=t[r],a=wo[i.t];a&&(a(i.d),it(n,n,To))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var Ao=function(){return u(function t(){o(this,t),this.parser=ta,this.mixer=ca},[{key:"calculator",value:function(t,e,n,r){return n instanceof Mr?[]:n}},{key:"postProcessor",value:function(t){Co(t.parsedStyle.transform,t)}}])}(),Oo=function(){return u(function t(){o(this,t)},[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===hr.kPixels&&e[1].unit===hr.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),Ro=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,r){return n.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,n=e.sortable;e.renderable&&e.dirty(),n&&(n.dirty=!0,n.dirtyReason=Tn.Z_INDEX_CHANGED)}}}])}(),Lo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.cx,r=t.cy,i=t.r,a=void 0===i?0:i;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:a,hheight:a}}}])}(),Io=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.cx,r=t.cy,i=t.rx,a=t.ry;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:void 0===i?0:i,hheight:void 0===a?0:a}}}])}(),Do=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,a=Math.min(e,r),o=Math.max(e,r),s=Math.min(n,i),u=(o-a)/2,l=(Math.max(n,i)-s)/2;return{cx:a+u,cy:s+l,hwidth:u,hheight:l}}}])}(),_o=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t){var e=t.d.rect,n=e.width/2,r=e.height/2;return{cx:e.x+n,cy:e.y+r,hwidth:n,hheight:r}}}])}(),Go=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t){if(t.points&&Kt(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,p(e.map(function(t){return t[0]}))),r=Math.max.apply(Math,p(e.map(function(t){return t[0]}))),i=Math.min.apply(Math,p(e.map(function(t){return t[1]}))),a=(r-n)/2,o=(Math.max.apply(Math,p(e.map(function(t){return t[1]})))-i)/2;return{cx:n+a,cy:i+o,hwidth:a,hheight:o}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Fo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.src,s=t.width,u=t.height,l=void 0===s?0:s,c=void 0===u?0:u;return o&&!ne(o)&&(l||(t.width=l=o.width),c||(t.height=c=o.height)),{cx:r+l/2,cy:a+c/2,hwidth:l/2,hheight:c/2}}}])}(),Bo=function(){return u(function t(e){o(this,t),this.globalRuntime=e},[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,r=t.text,i=t.textAlign,a=void 0===i?"start":i,o=t.lineWidth,s=void 0===o?1:o,u=t.textBaseline,l=void 0===u?"alphabetic":u,c=t.dx,h=void 0===c?0:c,f=t.dy,d=void 0===f?0:f,v=t.x,p=void 0===v?0:v,y=t.y,g=void 0===y?0:y;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var m=(null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{},k=this.globalRuntime.textService.measureText(r,t,m.offscreenCanvas);t.metrics=k;var E=k.width/2,x=k.height/2,b=p+E;"center"===a||"middle"===a?b+=s/2-E:"right"!==a&&"end"!==a||(b+=s-2*E);var T=g-x;return"middle"===l?T+=x:"top"===l||"hanging"===l?T+=2*x:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(T+=0),h&&(b+=h),d&&(T+=d),{cx:b,cy:T,hwidth:E,hheight:x}}}])}(),Vo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Uo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.x,r=t.y,i=t.width,a=void 0===i?0:i,o=t.height,s=void 0===o?0:o;return{cx:(void 0===n?0:n)+a/2,cy:(void 0===r?0:r)+s/2,hwidth:a/2,hheight:s/2}}}])}();var zo=function(){return u(function t(e){o(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Yt,this.page=new Yt,this.canvas=new Yt,this.viewport=new Yt,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e},[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw Error(qt)}}])}(),Ho=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).client=new Yt,t.movement=new Yt,t.offset=new Yt,t.global=new Yt,t.screen=new Yt,t}return x(e,t),u(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw Error(qt)}}])}(zo),jo=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).width=0,t.height=0,t.isPrimary=!1,t}return x(e,t),u(e,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Ho),Yo=function(t){function e(){return o(this,e),k(this,e,arguments)}return x(e,t),u(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Ho);function Wo(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=v(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}},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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}var qo=function(t){function e(t,n){var r;return o(this,e),(r=k(this,e,[null])).type=t,r.detail=null==n?void 0:n.detail,n&&!("detail"in n)&&(r.detail=n),Object.assign(r,n),r}return x(e,t),u(e)}(zo),Xo=function(){return u(function t(){o(this,t),this.emitter=new M},[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=!1,i=!1;if(se(n))r=n;else if(n){var a=n.capture;r=void 0!==a&&a;var o=n.once;i=void 0!==o&&o}r&&(t+="capture"),e=Zt(e)?e:e.handleEvent;var s=Zt(e)?void 0:e;return i?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r;if(!this.emitter)return this;(se(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=Zt(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent;var i=Zt(e)?void 0:e;return this.emitter.off(t,e,i),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new qo(t,e))}},{key:"dispatchEventToSelf",value:function(t){t.target||(t.target=this),t.currentTarget=this,this.emitter.emit(t.type,t)}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(arguments.length>2?arguments[2]:void 0)return this.dispatchEventToSelf(t),!0;if(this.document)e=this;else if(this.defaultView)e=this.defaultView;else{var r;e=null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView}if(e){if(t.manager=e.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.dispatchEventToSelf(t);return!t.defaultPrevented}}])}(),Zo=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.mutations=void 0,t.parentNode=null,t.destroyed=!1,t}return x(e,t),u(e,[{key:"textContent",get:function(){var t="";this.nodeName===l.TEXT&&(t+=this.style.text);var e,n=Wo(this.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;t+=r.nodeName===l.TEXT?r.nodeValue:r.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)}),this.nodeName===l.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw Error(qt)}},{key:"lookupNamespaceURI",value:function(t){throw Error(qt)}},{key:"lookupPrefix",value:function(t){throw Error(qt)}},{key:"normalize",value:function(){throw Error(qt)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!==(o=n.parentNode)&&void 0!==o?o:r.parentNode;){var o;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>a.length?i:a,u=s===i?a:i;if(s[s.length-u.length]===u[0])return s===i?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-u.length,c=u.length-1;c>=0;c--){var h=u[c],f=s[l+c];if(f!==h){var d=h.parentNode.childNodes;return d.indexOf(h)<d.indexOf(f)?u===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(Xo);Zo.DOCUMENT_POSITION_DISCONNECTED=1,Zo.DOCUMENT_POSITION_PRECEDING=2,Zo.DOCUMENT_POSITION_FOLLOWING=4,Zo.DOCUMENT_POSITION_CONTAINS=8,Zo.DOCUMENT_POSITION_CONTAINED_BY=16,Zo.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var $o=function(){return u(function t(e,n){var r=this;o(this,t),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=P(),this.tmpVec3=ot(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){r.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=za.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){r.dispatchEvent(n,2===n.button?"rightup":"mouseup")}var i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.pressTargetsByButton[t.button]),o=a;if(a&&!n.composedPath().includes(a)){for(var s=a;s&&!n.composedPath().includes(s);){if(n.currentTarget=s,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){r.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside")}Zo.isNode(s)&&(s=s.parentNode)}delete i.pressTargetsByButton[t.button],o=s}if(o){var u,l=r.clonePointerEvent(n,"click");l.target=o,l.path=[],i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:l.target,timeStamp:e});var c=i.clicksByButton[t.button];c.target===l.target&&e-c.timeStamp<r.context.renderingContext.root.ownerDocument.defaultView.getConfig().dblClickSpeed?++c.clickCount:c.clickCount=1,c.target=l.target,c.timeStamp=e,l.detail=c.clickCount,null!==(u=n.detail)&&void 0!==u&&u.preventClick||(r.context.config.useNativeClickEvent||"mouse"!==l.pointerType&&"touch"!==l.pointerType||r.dispatchEvent(l,"click"),r.dispatchEvent(l,"pointertap")),r.freeEvent(l)}r.freeEvent(n)},this.onPointerMove=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.overTargets);if(i.overTargets&&a!==e.target){var o=r.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",a||void 0);if(r.dispatchEvent(o,"pointerout"),n&&r.dispatchEvent(o,"mouseout"),!e.composedPath().includes(a)){var s=r.createPointerEvent(t,"pointerleave",a||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,r.notifyTarget(s),n&&r.notifyTarget(s,"mouseleave"),Zo.isNode(s.target)&&(s.target=s.target.parentNode);r.freeEvent(s)}r.freeEvent(o)}if(a!==e.target){var u=r.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");r.dispatchEvent(u,"pointerover"),n&&r.dispatchEvent(u,"mouseover");for(var l=a&&Zo.isNode(a)&&a.parentNode;l&&l!==(Zo.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(Zo.isNode(r.rootTarget)&&r.rootTarget.parentNode)){var c=r.clonePointerEvent(e,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==a&&c.target!==(Zo.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),n&&r.notifyTarget(c,"mouseenter"),Zo.isNode(c.target)&&(c.target=c.target.parentNode);r.freeEvent(c)}r.freeEvent(u)}r.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&r.dispatchEvent(e,"touchmove"),n&&(r.dispatchEvent(e,"mousemove"),r.cursor=r.getCursor(e.target)),i.overTargets=e.composedPath(),r.freeEvent(e)},this.onPointerOut=function(t){var e=r.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,i=r.findMountedTarget(e.overTargets),a=r.createPointerEvent(t,"pointerout",i||void 0);r.dispatchEvent(a),n&&r.dispatchEvent(a,"mouseout");var o=r.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Zo.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),n&&r.notifyTarget(o,"mouseleave"),Zo.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,r.freeEvent(a),r.freeEvent(o)}r.cursor=null},this.onPointerOver=function(t){var e=r.trackingData(t.pointerId),n=r.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;r.dispatchEvent(n,"pointerover"),i&&r.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(r.cursor=r.getCursor(n.target));var a=r.clonePointerEvent(n,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Zo.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),i&&r.notifyTarget(a,"mouseenter"),Zo.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=n.composedPath(),r.freeEvent(n),r.freeEvent(a)},this.onPointerUpOutside=function(t){var e=r.trackingData(t.pointerId),n=r.findMountedTarget(e.pressTargetsByButton[t.button]),i=r.createPointerEvent(t);if(n){for(var a=n;a;)i.currentTarget=a,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Zo.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}r.freeEvent(i)},this.onWheel=function(t){var e=r.createWheelEvent(t);r.dispatchEvent(e),r.freeEvent(e)},this.onClick=function(t){if(r.context.config.useNativeClickEvent){var e=r.createPointerEvent(t);r.dispatchEvent(e),r.freeEvent(e)}},this.onPointerCancel=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(e),r.freeEvent(e)},this.globalRuntime=e,this.context=n},[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,a=r.offsetHeight;i&&a&&(e=t.width/i,n=t.height/a)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.bbox;return new Yt((t.x-((null==n?void 0:n.left)||0))/e.scaleX,(t.y-((null==n?void 0:n.top)||0))/e.scaleY)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.bbox;return new Yt((t.x+((null==n?void 0:n.left)||0))*e.scaleX,(t.y+((null==n?void 0:n.top)||0))*e.scaleY)}},{key:"viewport2Canvas",value:function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,a=i.width,o=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),l=D(this.tmpMatrix,u,s),c=ct(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return gt(c,c,l),new Yt(c[0],c[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=D(this.tmpMatrix,n,r),a=ct(this.tmpVec3,t.x,t.y,0);gt(this.tmpVec3,this.tmpVec3,i);var o=this.context.config;return new Yt((a[0]+1)/2*o.width,(1-(a[1]+1)/2)*o.height)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(function(t,e){return t.priority-e.priority})}},{key:"mapEvent",value:function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e))}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=i+1;n.length>a;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)Zo.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config;return 0>e||0>n||e>r.width||n>r.height?null:!r.disableHitTesting&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,r=null==e?void 0:e.target;if(null!==(n=r)&&void 0!==n&&n.shadowRoot&&(r=e.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();n.length>e;e++){var r=this.nativeHTMLMap.get(n[e]);if(r)return r}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,r){var i=this.allocateEvent(jo);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i),o=this.context.contextService.getDomElement();return i.target=null!=n?n:a||this.isNativeEventFromCanvas(o,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(Yo);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(Yo);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(jo);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyPointerData",value:function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist}},{key:"copyMouseData",value:function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=za.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}},{key:"notifyTarget",value:function(t,e){e=null!=e?e:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Zo.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=Ga(e)&&e.getAttribute("cursor");if(n)return n;e=Zo.isNode(e)&&e.parentNode}}}])}(),Ko=function(){return u(function t(){o(this,t)},[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||Rs.offscreenCanvas)this.canvas=t||Rs.offscreenCanvas,this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),Qo=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),Jo=function(){return u(function t(e,n){o(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new po,initAsync:new eo,dirtycheck:new yo,cull:new yo,beginFrame:new po,beforeRender:new po,render:new po,afterRender:new po,endFrame:new po,destroy:new po,pick:new vo,pickSync:new yo,pointerDown:new po,pointerUp:new po,pointerMove:new po,pointerOut:new po,pointerOver:new po,pointerWheel:new po,pointerCancel:new po,click:new po},this.globalRuntime=e,this.context=n},[{key:"init",value:function(t){var e=this,n=a(a({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(t){t.apply(n,e.globalRuntime)}),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then(function(){e.inited=!0,t()}).catch(function(t){})}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Qo.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var r=this,i=t.getConfig(),a=this.context.renderingContext;if(this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.globalRuntime.sceneGraphService.syncHierarchy(a.root),this.globalRuntime.sceneGraphService.notifyMutationObservers(t),a.renderReasons.size&&this.inited){a.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var o=1===a.renderReasons.size&&a.renderReasons.has(Qo.CAMERA_CHANGED),s=!i.disableRenderHooks||!o;s&&this.renderDisplayObject(a.root,i,a),this.hooks.beginFrame.call(e),s&&a.renderListCurrentFrame.forEach(function(t){r.hooks.beforeRender.call(t),r.hooks.render.call(t),r.hooks.afterRender.call(t)}),this.hooks.endFrame.call(e),a.renderListCurrentFrame=[],a.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;function s(t){var e=t.sortable,i=a?t.renderable.dirty||n.dirtyRectangleRenderingDisabled?t:null:t,s=null;i&&(s=o?r.hooks.cull.call(i,r.context.camera):i)&&(r.stats.rendered+=1,n.renderListCurrentFrame.push(s)),t.dirty(!1),e.renderOrder=r.zIndexCounter,r.zIndexCounter+=1,r.stats.total+=1,e.dirty&&(r.sort(t,e),e.dirty=!1,e.dirtyChildren=[],e.dirtyReason=void 0)}for(var u=[t];u.length>0;){var l,c=u.pop();s(c);for(var h=(null===(l=c.sortable)||void 0===l||null===(l=l.sorted)||void 0===l?void 0:l.length)>0?c.sortable.sorted:c.childNodes,f=h.length-1;f>=0;f--)u.push(h[f])}}},{key:"sort",value:function(t,e){var n,r;(null==e||null===(n=e.sorted)||void 0===n?void 0:n.length)>0&&e.dirtyReason!==Tn.Z_INDEX_CHANGED?e.dirtyChildren.forEach(function(n){var r=e.sorted.indexOf(n);if(r>-1&&e.sorted.splice(r,1),t.childNodes.indexOf(n)>-1)if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;r>n;){var i=n+r>>>1;0>Fa(t[i],e)?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}}):e.sorted=t.childNodes.slice().sort(Fa),(null===(r=e.sorted)||void 0===r?void 0:r.length)>0&&0===t.childNodes.filter(function(t){return t.parsedStyle.zIndex}).length&&(e.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call()}},{key:"dirty",value:function(){this.context.renderingContext.renderReasons.add(Qo.DISPLAY_OBJECT_CHANGED)}}])}(),ts=/\[\s*(.*)=(.*)\s*\]/,es=function(){return u(function t(){o(this,t)},[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find(function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1});if(t.startsWith("#"))return e.find(function(e){return e.id===n.getIdOrClassname(t)});if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.find(function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)}):null}return e.find(function(n){return e!==n&&n.nodeName===t})}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll(function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1});if(t.startsWith("#"))return e.findAll(function(r){return e!==r&&r.id===n.getIdOrClassname(t)});if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.findAll(function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)}):[]}return e.findAll(function(n){return e!==n&&n.nodeName===t})}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(ts),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return $t(n)?"":n.toString?""+n:""}}])}(),ns=function(t){return t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.MOUNTED="DOMNodeInsertedIntoDocument",t.REMOVED="removed",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.REPARENT="reparent",t.DESTROY="destroy",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),rs=function(t){function e(t,n,r,i,a,s,u,l){var c;return o(this,e),(c=k(this,e,[null])).relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=a,c.attrChange=s,c.prevParsedValue=u,c.newParsedValue=l,c.type=t,c}return x(e,t),u(e)}(zo);rs.ADDITION=2,rs.MODIFICATION=1,rs.REMOVAL=3;var is,as,os,ss=new rs(ns.REPARENT,null,"","","",0,"",""),us=It(),ls=ot(),cs=ut(1,1,1),hs=P(),fs=It(),ds=ot(),vs=P(),ps=Mt(),ys=ot(),gs=Mt(),ms=ot(),ks=ot(),Es=ot(),xs=P(),bs=Mt(),Ts=Mt(),Ms=Mt(),ws=function(){return u(function t(e){o(this,t),this.displayObjectDependencyMap=new WeakMap,this.runtime=e},[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var a=t.nodeName===l.FRAGMENT,o=Ha(e);t.parentNode=e;var s=a?t.childNodes:[t];ie(n)?s.forEach(function(t){e.childNodes.splice(n,0,t),t.parentNode=e}):s.forEach(function(t){e.childNodes.push(t),t.parentNode=e});var u=e.sortable;if((null!=u&&null!==(r=u.sorted)&&void 0!==r&&r.length||u.dirty||t.parsedStyle.zIndex)&&(-1===u.dirtyChildren.indexOf(t)&&u.dirtyChildren.push(t),u.dirty=!0,u.dirtyReason=Tn.ADDED),!o){if(a)this.dirtyFragment(t);else{var c=t.transformable;c&&this.dirtyWorldTransform(t,c)}if(i){var h,f=!0===(null===(h=e.ownerDocument)||void 0===h||null===(h=h.defaultView)||void 0===h||null===(h=h.getConfig())||void 0===h||null===(h=h.future)||void 0===h?void 0:h.experimentalCancelEventPropagation);t.dispatchEvent(ss,f,f)}}}},{key:"detach",value:function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=Tn.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),r&&this.dirtyWorldTransform(t,r),t.parentNode=null}}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return Nn(e),e.localTransform}},{key:"setLocalPosition",value:function(t,e){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;ks[0]=e[0],ks[1]=e[1],ks[2]=null!==(n=e[2])&&void 0!==n?n:0,mt(i.localPosition,ks)||(lt(i.localPosition,ks),r&&this.dirtyLocalTransform(t,i))}},{key:"translateLocal",value:function(t,e){"number"==typeof e&&(e=ut(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n,r,i,a,o,s,u,l,c,h,f,d,v,p=t.transformable;mt(e,ls)||(f=(o=(i=p.localRotation)[1])*(h=(r=e)[2])-(s=i[2])*(c=r[1]),d=s*(l=r[0])-(a=i[0])*h,v=a*c-o*l,(n=e)[0]=l+(u=i[3])*(f+=f)+o*(v+=v)-s*(d+=d),n[1]=c+u*d+s*f-a*v,n[2]=h+u*v+a*d-o*f,ht(p.localPosition,p.localPosition,e),this.dirtyLocalTransform(t,p))}},{key:"setLocalRotation",value:function(t,e,n,r,i){var a=5>=arguments.length||void 0===arguments[5]||arguments[5];"number"==typeof e&&(e=Ot(ps,e,n,r,i));var o=t.transformable;At(o.localRotation,e),a&&this.dirtyLocalTransform(t,o)}},{key:"rotateLocal",value:function(t,e){"number"==typeof e&&(e=ut(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;Pt(Ts,e[0],e[1],e[2]),Rt(n.localRotation,n.localRotation,Ts),this.dirtyLocalTransform(t,n)}},{key:"setLocalScale",value:function(t,e){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;ct(ds,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),mt(ds,i.localScale)||(lt(i.localScale,ds),r&&this.dirtyLocalTransform(t,i))}},{key:"scaleLocal",value:function(t,e){var n,r,i,a,o=t.transformable;r=o.localScale,i=o.localScale,a=ct(ds,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1),r[0]=i[0]*a[0],r[1]=i[1]*a[1],r[2]=i[2]*a[2],this.dirtyLocalTransform(t,o)}},{key:"setLocalSkew",value:function(t,e,n){var r=3>=arguments.length||void 0===arguments[3]||arguments[3];"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(fs,e,n));var i,a,o=t.transformable;(i=o.localSkew)[0]=(a=e)[0],i[1]=a[1],r&&this.dirtyLocalTransform(t,o)}},{key:"setLocalEulerAngles",value:function(t,e){var n=4>=arguments.length||void 0===arguments[4]||arguments[4];"number"==typeof e&&(e=ut(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;Pt(r.localRotation,e[0],e[1],e[2]),n&&this.dirtyLocalTransform(t,r)}},{key:"setLocalTransform",value:function(t,e){var n=q(ys,e),r=Z(gs,e),i=X(ms,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,cs,!1),this.setLocalPosition(t,ls,!1),this.setLocalEulerAngles(t,ls,void 0,void 0,!1),this.setLocalSkew(t,us,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"getPosition",value:function(t){var e=t.transformable;return q(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return Z(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return X(e.scaling,this.getWorldTransform(t,e))}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.internalUpdateTransform(t),e.worldTransform):e.worldTransform}},{key:"setPosition",value:function(t,e){var n,r=t.transformable;if(Es[0]=e[0],Es[1]=e[1],Es[2]=null!==(n=e[2])&&void 0!==n?n:0,!mt(this.getPosition(t),Es)){if(lt(r.position,Es),null!==t.parentNode&&t.parentNode.transformable)C(xs,t.parentNode.transformable.worldTransform),L(xs,xs),gt(r.localPosition,Es,xs);else lt(r.localPosition,Es);this.dirtyLocalTransform(t,r)}}},{key:"translate",value:function(t,e){"number"==typeof e&&(e=ct(ds,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),mt(e,ls)||(ht(ds,this.getPosition(t),e),this.setPosition(t,ds))}},{key:"setRotation",value:function(t,e,n,r,i){var a=t.transformable;if("number"==typeof e&&(e=Ct(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var o=this.getRotation(t.parentNode);At(ps,o),Nt(ps,ps),St(a.localRotation,ps,e),Lt(a.localRotation,a.localRotation),this.dirtyLocalTransform(t,a)}else this.setLocalRotation(t,e)}},{key:"rotate",value:function(t,e){"number"==typeof e&&(e=ut(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var r=ps;Pt(r,e[0],e[1],e[2]);var i=this.getRotation(t),a=this.getRotation(t.parentNode);At(Ms,a),Nt(Ms,Ms),St(r,Ms,r),St(n.localRotation,r,i),Lt(n.localRotation,n.localRotation),this.dirtyLocalTransform(t,n)}else this.rotateLocal(t,e)}},{key:"setOrigin",value:function(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var n=t.transformable;if(e[0]!==n.origin[0]||e[1]!==n.origin[1]||e[2]!==n.origin[2]){var r=n.origin;r[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtyLocalTransform(t,n)}}},{key:"setEulerAngles",value:function(t,e){"number"==typeof e&&(e=ut(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Pt(n.localRotation,e[0],e[1],e[2]);var r=this.getRotation(t.parentNode);At(bs,Nt(ps,r)),Rt(n.localRotation,n.localRotation,bs),this.dirtyLocalTransform(t,n)}else this.setLocalEulerAngles(t,e)}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry;return n.dirty&&Rs.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new Ut}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>2?arguments[2]:void 0,n=this.getGeometryBounds(t,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);if(!Ut.isEmpty(n)){var r=e||new Ut;return r.setFromTransformedAABB(n,this.getWorldTransform(t)),r}return null}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=n?r.renderBounds:r.bounds,a=this.getTransformedGeometryBounds(t,n,i);if(t.childNodes.forEach(function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=i||new Ut).update(r.center,r.halfExtents))}),a||(a=new Ut),n){var o=Ba(t);if(o){var s=o.parsedStyle.clipPath.getBounds(n);a?s&&(a=s.intersection(a)):a.update(s.center,s.halfExtents)}}return n?(r.renderBounds=a,r.renderBoundsDirty=!1):(r.bounds=a,r.boundsDirty=!1),a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=hs;t.parentNode.transformable&&(e=L(vs,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Ut.isEmpty(n)){var r=new Ut;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);Ut.isEmpty(r)||(n=new Ut).setFromTransformedAABB(r,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var a=b(n.getMin(),2),o=a[0],s=a[1],u=b(n.getMax(),2);return new Wt(o+((null==i?void 0:i.left)||0),s+((null==i?void 0:i.top)||0),u[0]-o,u[1]-s)}return new Wt((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"internalUpdateTransform",value:function(t){var e,n=null===(e=t.parentNode)||void 0===e?void 0:e.transformable;Nn(t.transformable),Pn(t.transformable,n)}},{key:"internalUpdateElement",value:function(t,e){var n,r,i,a,o,s,u=!0===(null===(n=t.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n||null===(n=n.getConfig())||void 0===n||null===(n=n.future)||void 0===n?void 0:n.experimentalAttributeUpdateOptimization),l=e[e.length-1],c=(null==l?void 0:l.transformDirty)||(null===(r=t.transformable)||void 0===r?void 0:r.localDirtyFlag);t.transformable&&((o=t.transformable).dirtyFlag||(o.dirtyFlag=c));(this.internalUpdateTransform(t),c)&&(null===(s=t.dirty)||void 0===s||s.call(t,!0,!0));var h=(null===(i=t.renderable)||void 0===i?void 0:i.boundsDirty)||(null===(a=t.renderable)||void 0===a?void 0:a.renderBoundsDirty);if((c||h)&&!1===(null==l?void 0:l.shapeUpdated)&&u)for(var f=e.length-1;f>=0;){var d,v,p=e[f];if(p.shapeUpdated)break;null===(d=(v=p.node).dirty)||void 0===d||d.call(v,!0,!0),p.shapeUpdated=!0,f-=1}return c}},{key:"syncHierarchy",value:function(t){for(var e,n,r=[t],i=t.parentNode?[{node:t.parentNode,transformDirty:(null===(e=t.parentNode.transformable)||void 0===e?void 0:e.localDirtyFlag)||(null===(n=t.parentNode.transformable)||void 0===n?void 0:n.dirtyFlag),shapeUpdated:!1}]:[];r.length>0;){for(var a=r.pop(),o=i[i.length-1];i.length>0&&a.parentNode!==o.node;)o=i.pop();var s=this.internalUpdateElement(a,i);if(a.childNodes.length>0){for(var u=a.childNodes.length-1;u>=0;u--)r.push(a.childNodes[u]);i.push({node:a,transformDirty:s,shapeUpdated:!1})}}}},{key:"dirtyLocalTransform",value:function(t,e){Ha(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtyWorldTransform(t,e))}},{key:"dirtyWorldTransform",value:function(t,e){this.dirtyWorldInternal(t,e),this.dirtyToRoot(t,!0)}},{key:"dirtyWorldInternal",value:function(t,e){var n,r=this,i=!0===(null===(n=t.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n||null===(n=n.getConfig())||void 0===n||null===(n=n.future)||void 0===n?void 0:n.experimentalAttributeUpdateOptimization);e.dirtyFlag||(e.dirtyFlag=!0,t.dirty(!0,!0),i||t.childNodes.forEach(function(t){r.dirtyWorldInternal(t,t.transformable)}))}},{key:"dirtyToRoot",value:function(t){for(var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t,i=!0===(null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalAttributeUpdateOptimization);r;){var a,o;if(null===(a=(o=r).dirty)||void 0===a||a.call(o,!0,!0),i)break;r=r.parentNode}n&&t.forEach(function(t){var e;null===(e=t.dirty)||void 0===e||e.call(t,!0,!0)}),this.informDependentDisplayObjects(t);var s=t.mutations||[],u=s.find(function(t){return"attributes"===t.type&&t._boundsChangeData});u?u._boundsChangeData={affectChildren:u._boundsChangeData.affectChildren||n}:s.push(u={type:"attributes",target:t,_boundsChangeData:{affectChildren:n}}),t.mutations=s}},{key:"dirtyFragment",value:function(t){var e,n,r=t.transformable;r&&(r.dirtyFlag=!0,r.localDirtyFlag=!0),null===(e=(n=t).dirty)||void 0===e||e.call(n,!0,!0);for(var i=t.childNodes.length,a=0;i>a;a++)this.dirtyFragment(t.childNodes[a])}},{key:"notifyMutationObservers",value:function(t){var e=new Set;if(t.getRoot().forEach(function(t){(t.mutations||[]).forEach(function(n){"attributes"===n.type&&n._boundsChangeData&&(n._boundsChangeData.affectChildren?t.forEach(function(t){var r=a({},n);r.target=t,e.add(r)}):e.add(n))}),t.mutations=void 0}),e.size>0){var n=new qo(ns.BOUNDS_CHANGED,{detail:Array.from(e)});t.dispatchEvent(n,!0,!0)}}},{key:"updateDisplayObjectDependency",value:function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var a=i[t].indexOf(r);i[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[t].push(r)}}},{key:"informDependentDisplayObjects",value:function(t){var e,n=this,r=this.displayObjectDependencyMap.get(t);if(r){var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalCancelEventPropagation;Object.keys(r).forEach(function(t){r[t].forEach(function(e){n.dirtyToRoot(e,!0),e.dispatchEvent(new rs(ns.ATTR_MODIFIED,e,n,n,t,rs.MODIFICATION,n,n),i,i),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback(t,n,n)})})}}}])}(),Ss=function(){return u(function t(e){if(o(this,t),0>=e)throw Error("LRU capacity must be a positive number.");this.capacity=e,this.cache=new Map},[{key:"get",value:function(t){if(this.cache.has(t)){var e=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,e),e}}},{key:"put",value:function(t,e){if(this.cache.has(t)&&this.cache.delete(t),this.cache.set(t,e),this.cache.size>this.capacity){var n=this.cache.keys().next().value;this.cache.delete(n)}}},{key:"len",value:function(){return this.cache.size}},{key:"clear",value:function(){this.cache.clear()}}])}(),Ns={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},Ps=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Cs=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),As=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Os=function(){return u(function t(e){var n=this;o(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!As.exec(e)&&!Cs.exec(t))},this.trimByKinsokuShorui=function(t){var e=p(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e},this.runtime=e,this.charWidthCache=new Ss(100)},[{key:"measureFont",value:function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var a=Ns.MetricsString+Ns.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(Ns.BaselineSymbol).width),u=Ns.HeightMultiplier*s;s=s*Ns.BaselineMultiplier|0,r.width=o,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,o,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,s);var l=i.getImageData(0,0,o||1,u||1).data,c=l.length,h=4*o,f=0,d=0,v=!1;for(f=0;s>f;++f){for(var p=0;h>p;p+=4)if(255!==l[d+p]){v=!0;break}if(v)break;d+=h}for(n.ascent=s-f,d=c-h,v=!1,f=u;f>s;--f){for(var y=0;h>y;y+=4)if(255!==l[d+y]){v=!0;break}if(v)break;d-=h}return n.descent=f-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value:function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,a=e.wordWrap,o=void 0!==a&&a,s=e.lineHeight,u=e.lineWidth,l=void 0===u?1:u,c=e.textBaseline,h=void 0===c?"alphabetic":c,f=e.textAlign,d=void 0===f?"start":f,v=e.letterSpacing,p=void 0===v?0:v,y=e.textPath,g=e.leading,m=void 0===g?0:g,k=Eo(e),E=this.measureFont(k,n);0===E.fontSize&&(E.fontSize=i,E.ascent=i);var x=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);x.font=k,e.isOverflowing=!1;var b=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),T=Array(b.length),M=0;if(!y){for(var w=0;b.length>w;w++){var S=x.measureText(b[w]).width+(b[w].length-1)*p;T[w]=S,M=Math.max(M,S)}var N=M+l,P=s||E.fontSize+l,C=Math.max(P,E.fontSize+l)+(b.length-1)*(P+m),A=0;return"middle"===h?A=-C/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?A=-C:"top"!==h&&"hanging"!==h||(A=0),{font:k,width:N,height:C,lines:b,lineWidths:T,lineHeight:P+=m,maxLineWidth:M,fontProperties:E,lineMetrics:T.map(function(t,e){var n=0;return"center"===d||"middle"===d?n-=t/2:"right"!==d&&"end"!==d||(n-=t),new Wt(n-l/2,A+e*P,t+l,P)})}}y.getTotalLength();for(var O=0;b.length>O;O++)x.measureText(b[O])}},{key:"wordWrap",value:function(t,e,n){var r=this,i=Array.from(t);if(0===i.length)return"";var a=this,o=e.wordWrapWidth,s=void 0===o?0:o,u=e.letterSpacing,l=void 0===u?0:u,c=e.maxLines,h=void 0===c?1/0:c,f=e.textOverflow,d=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),v=s+l,p="";"ellipsis"===f?p="...":f&&"clip"!==f&&(p=f);var y=[""],g=0,m=0,k=-1,E=Eo(e),x=this.charWidthCache.get(E);x||(x=new Ss(500),this.charWidthCache.put(E,x));var b=function(t){return r.getFromCache(t,l,x,d)},T=b(p);function M(t,e,n,r){for(;b(t)<r&&i.length-1>e&&!a.isNewline(i[e+1]);)t+=i[e+=1];for(;b(t)>r&&e>=n;)e-=1,t=t.slice(0,-1);return{lineTxt:t,txtLastCharIndex:e}}function w(t,e){if(T>0&&v>=T)if(y[t]){var n=M(y[t],e,k+1,v-T);y[t]=n.lineTxt+p}else y[t]=p}for(var S=0;i.length>S;S++){var N=i[S],P=i[S-1],C=i[S+1],A=b(N);if(this.isNewline(N)){if(g+1>=h){i.length-1>S&&w(g,S-1),e.isOverflowing=!0;break}k=S-1,m=0,y[g+=1]=""}else{if(A>v){w(g,S-1),e.isOverflowing=!0;break}if(m>0&&m+A>v){var O=M(y[g],S-1,k+1,v);if(O.txtLastCharIndex!==S-1){if(y[g]=O.lineTxt,O.txtLastCharIndex===i.length-1)break;P=i[(S=O.txtLastCharIndex+1)-1],C=i[S+1],A=b(N=i[S])}if(g+1>=h){w(g,S-1),e.isOverflowing=!0;break}if(k=S-1,m=0,y[g+=1]="",this.isBreakingSpace(N))continue;this.canBreakInLastChar(N)||(y=this.trimToBreakable(y),m=this.sumTextWidthByCache(y[g]||"",b)),this.shouldBreakByKinsokuShorui(N,C)&&(y=this.trimByKinsokuShorui(y),m+=b(P||""))}m+=A,y[g]+=N}}return y.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&Ns.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&Ns.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=p(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,a),e}},{key:"canBreakInLastChar",value:function(t){return!t||!Ps.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce(function(t,n){return t+e(n)},0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!Ps.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,r){var i=n.get(t);if("number"!=typeof i){var a=t.length*e,o=r.measureText(t);n.put(t,i=o.width+a)}return i}},{key:"clearCache",value:function(){this.fontMetricsCache={},this.charWidthCache.clear()}}])}(),Rs={},Ls=(as=new Fo,os=new Go,r(r(r(r(r(r(r(r(r(r(is={},l.FRAGMENT,null),l.CIRCLE,new Lo),l.ELLIPSE,new Io),l.RECT,as),l.IMAGE,as),l.GROUP,new Vo),l.LINE,new Do),l.TEXT,new Bo(Rs)),l.POLYLINE,os),l.POLYGON,os),r(r(r(is,l.PATH,new _o),l.HTML,new Uo),l.MESH,null)),Is=function(t){var e=new Ea,n=new Ta;return r(r(r(r(r(r(r(r(r(r(t={},An.PERCENTAGE,null),An.NUMBER,new Na),An.ANGLE,new ma),An.DEFINED_PATH,new ka),An.PAINT,e),An.COLOR,e),An.FILTER,new xa),An.LENGTH,n),An.LENGTH_PERCENTAGE,n),An.LENGTH_PERCENTAGE_12,new Ma),r(r(r(r(r(r(r(r(r(r(t,An.LENGTH_PERCENTAGE_14,new wa),An.COORDINATE,new Ta),An.OFFSET_DISTANCE,new Pa),An.OPACITY_VALUE,new Ca),An.PATH,new Aa),An.LIST_OF_POINTS,new Oa),An.SHADOW_BLUR,new Ra),An.TEXT,new La),An.TEXT_TRANSFORM,new Ia),An.TRANSFORM,new Ao),r(r(r(t,An.TRANSFORM_ORIGIN,new Oo),An.Z_INDEX,new Ro),An.MARKER,new Sa)}();Rs.CameraContribution=kn,Rs.AnimationTimeline=null,Rs.EasingFunction=null,Rs.offscreenCanvasCreator=new Ko,Rs.sceneGraphSelector=new es,Rs.sceneGraphService=new ws(Rs),Rs.textService=new Os(Rs),Rs.geometryUpdaterFactory=Ls,Rs.CSSPropertySyntaxFactory=Is,Rs.styleValueRegistry=new ya(Rs),Rs.layoutRegistry=null,Rs.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Rs.enableStyleSyntax=!0,Rs.enableSizeAttenuation=!1;var Ds=0;var _s=new rs(ns.INSERTED,null,"","","",0,"",""),Gs=new rs(ns.REMOVED,null,"","","",0,"",""),Fs=new qo(ns.DESTROY),Bs=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).entity=Ds++,t.transformable={dirtyFlag:!1,localDirtyFlag:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.cullable={strategy:bn.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return x(e,t),u(e,[{key:"dirty",value:function(){var t=arguments.length>1?arguments[1]:void 0;this.renderable.dirty=0>=arguments.length||void 0===arguments[0]||arguments[0],void 0!==t&&(this.renderable.boundsDirty=t,this.renderable.renderBoundsDirty=t,this.geometry.dirty=t)}},{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(t){return""!==t})}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw Error(qt)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return Rs.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(Ha(this)||t.nodeName!==l.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(_s.relatedNode=this,t.dispatchEvent(_s)),t}},{key:"insertBefore",value:function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e,n,r=!0===(null===(e=this.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig().future)||void 0===e?void 0:e.experimentalCancelEventPropagation);return Gs.relatedNode=this,t.dispatchEvent(Gs,r,r),null!==(n=t.ownerDocument)&&void 0!==n&&n.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),Rs.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return Rs.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return Rs.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return Rs.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return Rs.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return Rs.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return Rs.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return Rs.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(Rs.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach(function(r){return r===e||!t(r)||(n=r,!1)}),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach(function(r){r!==e&&t(r)&&n.push(r)}),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];r.forEach(function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];var a=r[0],o=d(r).slice(1);this.parentNode.appendChild(a,e),(t=a).after.apply(t,p(o))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach(function(e){return t.appendChild(e)})}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach(function(e,n){return t.appendChild(e,n)})}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){var t,e=!0===(null===(t=this.ownerDocument)||void 0===t||null===(t=t.defaultView)||void 0===t||null===(t=t.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);this.destroyChildren(),this.dispatchEvent(Fs,e,e),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return Rs.sceneGraphService.getGeometryBounds(this,arguments.length>0&&void 0!==arguments[0]&&arguments[0])}},{key:"getTransformedGeometryBounds",value:function(){return Rs.sceneGraphService.getTransformedGeometryBounds(this,arguments.length>0&&void 0!==arguments[0]&&arguments[0])}},{key:"getBounds",value:function(){return Rs.sceneGraphService.getBounds(this)}},{key:"getRenderBounds",value:function(){return Rs.sceneGraphService.getBounds(this,!0)}},{key:"getLocalBounds",value:function(){return Rs.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return Rs.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw Error(qt)}},{key:"getAttributeNode",value:function(t){throw Error(qt)}},{key:"getAttributeNodeNS",value:function(t,e){throw Error(qt)}},{key:"hasAttributeNS",value:function(t,e){throw Error(qt)}},{key:"removeAttributeNS",value:function(t,e){throw Error(qt)}},{key:"removeAttributeNode",value:function(t){throw Error(qt)}},{key:"setAttributeNS",value:function(t,e,n){throw Error(qt)}},{key:"setAttributeNode",value:function(t){throw Error(qt)}},{key:"setAttributeNodeNS",value:function(t){throw Error(qt)}},{key:"toggleAttribute",value:function(t,e){throw Error(qt)}}])}(Zo);function Vs(t){return!(null==t||!t.nodeName)}var Us=Rs.globalThis.Proxy?Rs.globalThis.Proxy:function(){},zs=new rs(ns.ATTR_MODIFIED,null,null,null,null,rs.MODIFICATION,null,null),Hs=ot(),js=Mt(),Ys=function(t){function e(t){var n;return o(this,e),(n=k(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||l.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),Rs.enableStyleSyntax&&(n.style=new Us({setProperty:function(t,e){n.setAttribute(t,e)},getPropertyValue:function(t){return n.getAttribute(t)},removeProperty:function(t){n.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:n.getAttribute(e)},set:function(t,e,r){return n.setAttribute(e,r),!0}})),n}return x(e,t),u(e,[{key:"destroy",value:function(){xn(e,"destroy",this,3)([]),this.getAnimations().forEach(function(t){t.cancel()})}},{key:"cloneNode",value:function(t,e){var n=a({},this.attributes);for(var r in n){var i=n[r];Vs(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor(a(a({},this.config),{},{style:n}));return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach(function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}}),o}},{key:"initAttributes",value:function(){Rs.styleValueRegistry.processProperties(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{forceUpdateGeometry:!0}),this.dirty()}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=3>=arguments.length||void 0===arguments[3]||arguments[3];ue(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),xn(e,"setAttribute",this,3)([t,n]))}},{key:"setAttributes",value:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.skipDispatchAttrModifiedEvent,o=void 0!==i&&i;if(o||(e=a({},this.attributes),n=a({},this.parsedStyle)),Rs.styleValueRegistry.processProperties(this,t,r),this.dirty(),!o)for(var s in t)this.dispatchAttrModifiedEvent(s,e[s],t[s],n[s])}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.attributes[t],a=this.parsedStyle[t];Rs.styleValueRegistry.processProperties(this,r({},t,e),n),this.dirty(),this.dispatchAttrModifiedEvent(t,i,e,a)}},{key:"dispatchAttrModifiedEvent",value:function(t,e,n,r){var i,a=this.parsedStyle[t];if(this.isConnected)if(zs.relatedNode=this,zs.prevValue=e,zs.newValue=n,zs.attrName=t,zs.prevParsedValue=r,zs.newParsedValue=a,this.isMutationObserved)this.dispatchEvent(zs);else{var o,s=!0===(null===(o=this.ownerDocument.defaultView.getConfig().future)||void 0===o?void 0:o.experimentalCancelEventPropagation);zs.target=this,this.ownerDocument.defaultView.dispatchEvent(zs,!0,s)}(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(i=this.attributeChangedCallback)||void 0===i||i.call(this,t,e,n,r,a))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=b(t.getMin(),2),n=e[0],r=e[1],i=b(t.getMax(),2);return new Wt(n,r,i[0]-n,i[1]-r)}},{key:"setOrigin",value:function(t){return Rs.sceneGraphService.setOrigin(this,Ke(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getOrigin",value:function(){return Rs.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){return Rs.sceneGraphService.setPosition(this,Ke(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"setLocalPosition",value:function(t){return Rs.sceneGraphService.setLocalPosition(this,Ke(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translate",value:function(t){return Rs.sceneGraphService.translate(this,Ke(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translateLocal",value:function(t){return Rs.sceneGraphService.translateLocal(this,Ke(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getPosition",value:function(){return Rs.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return Rs.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=Ke(t,e=e||t,n=n||t,!1)),Rs.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=Ke(t,e=e||t,n=n||t,!1)),Rs.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return Rs.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return Rs.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return en(b(an(Hs,Rs.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return en(b(an(Hs,Rs.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return Rs.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return Rs.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return $t(e)&&$t(n)?Rs.sceneGraphService.rotateLocal(this,0,0,t):Rs.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return $t(e)&&$t(n)?Rs.sceneGraphService.rotate(this,0,0,t):Rs.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return Rs.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return Rs.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return Rs.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return Rs.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return Rs.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return Rs.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return Rs.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return Rs.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return Rs.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){Rs.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,p(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,p(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(i)?(Object.keys(i).forEach(function(e){t.setAttribute(e,i[e])}),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=b(q(Hs,e),2),r=n[0],i=n[1],a=b(X(Hs,e),2),o=a[0],s=a[1],u=Z(js,e),l=b(an(Hs,u),3);return on(l[0]||l[2],r,i,o,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=b(sn(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,a)}},{key:"setLocalMatrix",value:function(t){var e=b(sn(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,a)}},{key:"show",value:function(){this.forEach(function(t){t.style.visibility="visible"})}},{key:"hide",value:function(){this.forEach(function(t){t.style.visibility="hidden"})}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"move",value:function(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(Bs);Ys.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var Ws=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),k(this,e,[a({type:l.CIRCLE},t)])}return x(e,t),u(e)}(Ys);function qs(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;a.length>r;r++)-1===e.indexOf(n=a[r])&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}Ws.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var Xs=["style"],Zs=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=qs(n,Xs);return o(this,e),(t=k(this,e,[a({style:r},i)])).isCustomElement=!0,t}return x(e,t),u(e)}(Ys);Zs.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var $s=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),k(this,e,[a({type:l.ELLIPSE},t)])}return x(e,t),u(e)}(Ys);$s.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var Ks=function(t){function e(){return o(this,e),k(this,e,[{type:l.FRAGMENT}])}return x(e,t),u(e)}(Ys);Ks.PARSED_STYLE_LIST=new Set(["class","className"]);var Qs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),k(this,e,[a({type:l.GROUP},t)])}return x(e,t),u(e)}(Ys);Qs.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Js=["style"],tu=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=qs(n,Js);return o(this,e),(t=k(this,e,[a({type:l.HTML,style:r},i)])).cullable.enable=!1,t}return x(e,t),u(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=L(P(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Ut.isEmpty(e)){var n=new Ut;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(Ys);tu.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var eu=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),k(this,e,[a({type:l.IMAGE},t)])}return x(e,t),u(e)}(Ys);eu.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var nu=["style"],ru=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=qs(n,nu);o(this,e),(t=k(this,e,[a({type:l.LINE,style:a({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var s=t.parsedStyle,u=s.markerStart,c=s.markerEnd;return u&&Vs(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),c&&Vs(c)&&(t.markerEndAngle=c.getLocalEulerAngles(),t.appendChild(c)),t.transformMarker(!0),t.transformMarker(!1),t}return x(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Vs(r)&&(this.markerStartAngle=0,r.remove()),i&&Vs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Vs(r)&&(this.markerEndAngle=0,r.remove()),i&&Vs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,a=e.x2,o=e.y1,s=e.y2,u=t?e.markerStart:e.markerEnd;if(u&&Vs(u)){var l,c,h,f,d,v,p;t?(f=i,d=o,c=a-i,h=s-o,v=n||0,p=this.markerStartAngle):(f=a,d=s,c=i-a,h=o-s,v=r||0,p=this.markerEndAngle),u.setLocalEulerAngles(180*(l=Math.atan2(h,c))/Math.PI+p),u.setLocalPosition(f+Math.cos(l)*v,d+Math.sin(l)*v)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=bi(n.x1,n.y1,n.x2,n.y2,t),i=r.x,a=r.y,o=gt(ot(),ut(i,a,0),e?this.getWorldTransform():this.getLocalTransform());return new Yt(o[0],o[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return xi(t.x1,t.y1,t.x2,t.y2)}}])}(Ys);ru.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var iu=["style"],au=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=qs(n,iu);o(this,e),(t=k(this,e,[a({type:l.PATH,style:r,initialParsedStyle:{miterLimit:4,d:a({},Cn)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,u=s.markerStart,c=s.markerEnd,h=s.markerMid;return u&&Vs(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),h&&Vs(h)&&t.placeMarkerMid(h),c&&Vs(c)&&(t.markerEndAngle=c.getLocalEulerAngles(),t.appendChild(c)),t.transformMarker(!0),t.transformMarker(!1),t}return x(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Vs(r)&&(this.markerStartAngle=0,r.remove()),i&&Vs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Vs(r)&&(this.markerEndAngle=0,r.remove()),i&&Vs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=t?e.markerStart:e.markerEnd;if(i&&Vs(i)){var a,o,s,u,l,c,h;if(t){var f=b(this.getStartTangent(),2),d=f[0],v=f[1];u=v[0],l=v[1],o=d[0]-v[0],s=d[1]-v[1],c=n||0,h=this.markerStartAngle}else{var p=b(this.getEndTangent(),2),y=p[0],g=p[1];u=g[0],l=g[1],o=y[0]-g[0],s=y[1]-g[1],c=r||0,h=this.markerEndAngle}i.setLocalEulerAngles(180*(a=Math.atan2(s,o))/Math.PI+h),i.setLocalPosition(u+Math.cos(a)*c,l+Math.sin(a)*c)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(t){t.remove()}),t&&Vs(t))for(var n=1;e.length-1>n;n++){var r=b(e[n].currentPoint,2),i=r[0],a=r[1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(i,a)}}},{key:"getTotalLength",value:function(){return Ai(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e,n){return Ye(t,e,le(le({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,a=gt(ot(),ut(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new Yt(a[0],a[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*Ai(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,a=t[e-1].endTangent;n=[],a?(n.push([i[0]-a[0],i[1]-a[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}])}(Ys);au.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var ou=["style"],su=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=qs(n,ou);o(this,e),(t=k(this,e,[a({type:l.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,u=s.markerStart,c=s.markerEnd,h=s.markerMid;return u&&Vs(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),h&&Vs(h)&&t.placeMarkerMid(h),c&&Vs(c)&&(t.markerEndAngle=c.getLocalEulerAngles(),t.appendChild(c)),t.transformMarker(!0),t.transformMarker(!1),t}return x(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Vs(r)&&(this.markerStartAngle=0,r.remove()),i&&Vs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Vs(r)&&(this.markerEndAngle=0,r.remove()),i&&Vs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=(e.points||{}).points,a=t?e.markerStart:e.markerEnd;if(a&&Vs(a)&&i){var o,s,u,l,c,h,f;if(l=i[0][0],c=i[0][1],t)s=i[1][0]-i[0][0],u=i[1][1]-i[0][1],h=n||0,f=this.markerStartAngle;else{var d=i.length;this.parsedStyle.isClosed?(s=i[d-1][0]-i[0][0],u=i[d-1][1]-i[0][1]):(l=i[d-1][0],c=i[d-1][1],s=i[d-2][0]-i[d-1][0],u=i[d-2][1]-i[d-1][1]),h=r||0,f=this.markerEndAngle}a.setLocalEulerAngles(180*(o=Math.atan2(u,s))/Math.PI+f),a.setLocalPosition(l+Math.cos(o)*h,c+Math.sin(o)*h)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach(function(t){t.remove()}),this.markerMidList=[],t&&Vs(t)&&e)for(var n=1;(this.parsedStyle.isClosed?e.length:e.length-1)>n;n++){var r=e[n][0],i=e[n][1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(r,i)}}}])}(Ys);su.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var uu=["style"],lu=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=qs(t,uu);return o(this,e),k(this,e,[a({type:l.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return x(e,t),u(e,[{key:"getTotalLength",value:function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=Si(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,a=[],o=0,s=this.getTotalLength();n.forEach(function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=xi(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(o+=i)/s,a.push(r))}),this.parsedStyle.points.segments=a}var u=0,l=0;this.parsedStyle.points.segments.forEach(function(e,n){e[0]>t||t>e[1]||(u=(t-e[0])/(e[1]-e[0]),l=n)});var c=bi(n[l][0],n[l][1],n[l+1][0],n[l+1][1],u),h=c.x,f=c.y,d=gt(ot(),ut(h,f,0),e?this.getWorldTransform():this.getLocalTransform());return new Yt(d[0],d[1])}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n}}])}(su);lu.PARSED_STYLE_LIST=new Set([].concat(p(su.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var cu=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),k(this,e,[a({type:l.RECT},t)])}return x(e,t),u(e)}(Ys);cu.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var hu=["style"],fu=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=qs(t,hu);return o(this,e),k(this,e,[a({type:l.TEXT,style:a({fill:"black"},n)},r)])}return x(e,t),u(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(Ys);fu.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textDecorationThickness","textPathSide","textPathStartOffset","metrics","dx","dy"]));var du=function(){return u(function t(){o(this,t),this.registry={},this.define(l.CIRCLE,Ws),this.define(l.ELLIPSE,$s),this.define(l.RECT,cu),this.define(l.IMAGE,eu),this.define(l.LINE,ru),this.define(l.GROUP,Qs),this.define(l.PATH,au),this.define(l.POLYGON,su),this.define(l.POLYLINE,lu),this.define(l.TEXT,fu),this.define(l.HTML,tu)},[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),vu={number:function(t){return new Sr(t)},percent:function(t){return new Sr(t,"%")},px:function(t){return new Sr(t,"px")},em:function(t){return new Sr(t,"em")},rem:function(t){return new Sr(t,"rem")},deg:function(t){return new Sr(t,"deg")},grad:function(t){return new Sr(t,"grad")},rad:function(t){return new Sr(t,"rad")},turn:function(t){return new Sr(t,"turn")},s:function(t){return new Sr(t,"s")},ms:function(t){return new Sr(t,"ms")},registerProperty:function(t){Rs.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){Rs.layoutRegistry.registerLayout(t,e)}},pu=function(t){function e(){var t;o(this,e),(t=k(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new Rs.AnimationTimeline(t)}catch(t){}var n={};return da.forEach(function(t){var e=t.d;t.inh&&e&&(n[t.n]=Zt(e)?e(l.GROUP):e)}),t.documentElement=new Qs({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return x(e,t),u(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?fu:Qs);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw Error(qt)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,r){var i=[],a=function(o){if(o.isInteractive()&&!o.isCulled()){var s=o.parsedStyle.pointerEvents;if(!["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===s?"auto":s)||o.isVisible()){var u=o.getTransformedGeometryBounds(!0);u&&!Ut.isEmpty(u)&&(t>u.max[0]||u.min[0]>n||e>u.max[1]||u.min[1]>r||i.push(o))}o.childNodes&&o.childNodes.forEach(function(t){t instanceof Ys&&a(t)})}};return a(this.documentElement),i.sort(function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder}),i}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return null;var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l&&l[0]||this.documentElement}},{key:"elementFromPoint",value:(r=fo(co().mark(function t(e,n){var r,i,a,o,s,u,l,c,h,f;return co().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=1;break}return t.abrupt("return",null);case 1:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,clientY:h},picked:[]});case 2:return t.abrupt("return",(f=t.sent.picked)&&f[0]||this.documentElement);case 3:case"end":return t.stop()}},t,this)})),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return[];var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l[l.length-1]!==this.documentElement&&l.push(this.documentElement),l}},{key:"elementsFromPoint",value:(n=fo(co().mark(function t(e,n){var r,i,a,o,s,u,l,c,h,f;return co().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=1;break}return t.abrupt("return",[]);case 1:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,clientY:h},picked:[]});case 2:return(f=t.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 3:case"end":return t.stop()}},t,this)})),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw Error(Xt)}},{key:"insertBefore",value:function(t,e){throw Error(Xt)}},{key:"removeChild",value:function(t,e){throw Error(Xt)}},{key:"replaceChild",value:function(t,e,n){throw Error(Xt)}},{key:"append",value:function(){throw Error(Xt)}},{key:"prepend",value:function(){throw Error(Xt)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,r}(Zo),yu=function(){function t(e){o(this,t),this.strategies=e}return u(t,[{key:"apply",value:function(e){var n=e.config,r=e.camera,i=e.renderingService,a=e.renderingContext,o=this.strategies;i.hooks.cull.tap(t.tag,function(t){if(t){var e,i=t.cullable;if(i.visible=0===o.length?a.unculledEntities.indexOf(t.entity)>-1:o.every(function(e){return e.isVisible(r,t)}),!t.isCulled()&&t.isVisible())return t;var s=!0===(null===(e=n.future)||void 0===e?void 0:e.experimentalCancelEventPropagation);return t.dispatchEvent(new qo(ns.CULLED),s,s),null}return t}),i.hooks.afterRender.tap(t.tag,function(t){t.cullable.visibilityPlaneMask=-1})}}])}();yu.tag="Culling";var gu=function(){function t(){var e=this;o(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new jo(null),this.rootWheelEvent=new Yo(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,a=Wo(e.normalizeToPointerEvent(t,r));try{for(a.s();!(i=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,i.value,r,t);e.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,a=Wo(e.normalizeToPointerEvent(t,i));try{for(a.s();!(r=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,r.value,i,t);e.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return u(t,[{key:"apply",value:function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null}),r.hooks.pointerWheel.tap(t.tag,function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)}),r.hooks.pointerDown.tap(t.tag,function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,a=Wo(e);try{for(a.s();!(r=a.n()).done;){var o=n.bootstrapEvent(n.rootPointerEvent,r.value,i,t);n.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerUp.tap(t.tag,function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",o=Wo(n.normalizeToPointerEvent(t,i));try{for(o.s();!(e=o.n()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);s.type+=a,n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,function(t){var e,r=Wo(n.normalizeToPointerEvent(t,i));try{for(r.s();!(e=r.n()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);n.context.eventService.mapEvent(a)}}catch(t){r.e(t)}finally{r.f()}n.setCursor(n.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.y;t.viewport.x=i.x,t.viewport.y=a;var o=this.context.eventService.viewport2Canvas(t.viewport),s=o.y;return t.canvas.x=o.x,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Ua[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),a=i.y;return e.canvas.x=i.x,e.canvas.y=a,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=za.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];ue(i.button)&&(i.button=0),ue(i.buttons)&&(i.buttons=1),ue(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),ue(i.width)&&(i.width=i.radiusX||1),ue(i.height)&&(i.height=i.radiusY||1),ue(i.tiltX)&&(i.tiltX=0),ue(i.tiltY)&&(i.tiltY=0),ue(i.pointerType)&&(i.pointerType="touch"),ue(i.pointerId)&&(i.pointerId=i.identifier||0),ue(i.pressure)&&(i.pressure=i.force||.5),ue(i.twist)&&(i.twist=0),ue(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;ue(a.isPrimary)&&(a.isPrimary=!0),ue(a.width)&&(a.width=1),ue(a.height)&&(a.height=1),ue(a.tiltX)&&(a.tiltX=0),ue(a.tiltY)&&(a.tiltY=0),ue(a.pointerType)&&(a.pointerType="mouse"),ue(a.pointerId)&&(a.pointerId=1),ue(a.pressure)&&(a.pressure=.5),ue(a.twist)&&(a.twist=0),ue(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}])}();gu.tag="Event";var mu=[l.CIRCLE,l.ELLIPSE,l.IMAGE,l.RECT,l.LINE,l.POLYLINE,l.POLYGON,l.TEXT,l.PATH,l.HTML],ku=function(){return u(function t(){o(this,t)},[{key:"isVisible",value:function(t,e){var n,r=e.cullable;if(!r.enable)return!0;var i=e.getRenderBounds();if(Ut.isEmpty(i))return!1;var a=t.getFrustum(),o=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return r.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,i,o||Ht.INDETERMINATE,a.planes),r.visible=r.visibilityPlaneMask!==Ht.OUTSIDE,r.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,r){if(n===Ht.OUTSIDE||n===Ht.INSIDE)return n;for(var i=Ht.INSIDE,a=mu.indexOf(t.nodeName)>-1,o=0,s=r.length;s>o;++o){var u=1<<o;if(0!==(n&u)&&(!a||4!==o&&5!==o)){var l=r[o],c=l.normal,h=l.distance;if(0>pt(c,e.getPositiveFarPoint(r[o]))+h)return Ht.OUTSIDE;0>pt(c,e.getNegativeFarPoint(r[o]))+h&&(i|=u)}}return i}}])}(),Eu=function(){function t(){o(this,t),this.mutationRecords=[],this.isFirstTimeRendering=!0,this.isFirstTimeRenderingFinished=!1}return u(t,[{key:"apply",value:function(e){var n,r=this,i=e.renderingService,a=e.renderingContext.root.ownerDocument.defaultView,o=function(t){i.dirty()},s=function(t){var e;(e=r.mutationRecords).push.apply(e,p(t.detail)),i.dirty()},u=function(t){Rs.enableSizeAttenuation&&Rs.styleValueRegistry.updateSizeAttenuation(t.target,a.getCamera().getZoom())},l=function(t){Rs.sceneGraphService.dirtyToRoot(t.target),i.dirty()};i.hooks.init.tap(t.tag,function(){a.addEventListener(ns.MOUNTED,u),a.addEventListener(ns.UNMOUNTED,l),a.addEventListener(ns.ATTR_MODIFIED,o),a.addEventListener(ns.BOUNDS_CHANGED,s)}),i.hooks.destroy.tap(t.tag,function(){a.removeEventListener(ns.MOUNTED,u),a.removeEventListener(ns.UNMOUNTED,l),a.removeEventListener(ns.ATTR_MODIFIED,o),a.removeEventListener(ns.BOUNDS_CHANGED,s),r.mutationRecords=[]});var c=null!==(n=Rs.globalThis.requestIdleCallback)&&void 0!==n?n:Ja.bind(Rs.globalThis);i.hooks.endFrame.tap(t.tag,function(){r.isFirstTimeRendering&&(r.isFirstTimeRendering=!1,c(function(){r.isFirstTimeRenderingFinished=!0})),r.mutationRecords=[]})}}])}();Eu.tag="Prepare";var xu,bu,Tu=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),Mu=new qo(ns.MOUNTED),wu=new qo(ns.UNMOUNTED),Su=new qo(Tu.BEFORE_RENDER),Nu=new qo(Tu.RERENDER),Pu=new qo(Tu.AFTER_RENDER),Cu=function(t){function e(t){var n;o(this,e),(n=k(this,e)).Element=Ys,n.inited=!1,n.context={};var r=t.container,i=t.canvas,s=t.renderer,u=t.width,l=t.height,c=t.background,h=t.cursor,f=t.supportsMutipleCanvasesInOneContainer,d=t.cleanUpOnDestroy,v=void 0===d||d,p=t.offscreenCanvas,y=t.requestAnimationFrame,g=t.cancelAnimationFrame,m=t.createImage,E=t.supportsTouchEvents,x=t.supportsPointerEvents,b=t.isTouchEvent,T=t.isMouseEvent,M=t.dblClickSpeed,w=u,S=l,N=t.devicePixelRatio||_a&&window.devicePixelRatio||1;return N=1>N?1:Math.ceil(N),i&&(w=u||function(t){var e=Va(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/N,S=l||function(t){var e=Va(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/N),n.customElements=new du,n.devicePixelRatio=N,n.requestAnimationFrame=null!=y?y:Ja.bind(Rs.globalThis),n.cancelAnimationFrame=null!=g?g:to.bind(Rs.globalThis),n.createImage=null!=m?m:function(){return new window.Image},n.supportsTouchEvents=null!=E?E:"ontouchstart"in Rs.globalThis,n.supportsPointerEvents=null!=x?x:!!Rs.globalThis.PointerEvent,n.isTouchEvent=null!=b?b:function(t){return n.supportsTouchEvents&&t instanceof Rs.globalThis.TouchEvent},n.isMouseEvent=null!=T?T:function(t){return!Rs.globalThis.MouseEvent||t instanceof Rs.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Rs.globalThis.PointerEvent))},p&&(Rs.offscreenCanvas=p),n.document=new pu,n.document.defaultView=n,f||function(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;Da.has(r)&&Da.get(r).destroy(n),Da.set(r,e)}}(r,n,v),n.initRenderingContext(a(a({},t),{},{width:w,height:S,background:null!=c?c:"transparent",cursor:null!=h?h:"default",cleanUpOnDestroy:v,devicePixelRatio:N,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,createImage:n.createImage,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:null!=M?M:200})),n.initDefaultCamera(w,S,s.clipSpaceNearZ),n.initRenderer(s,!0),n}return x(e,t),u(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,unculledEntities:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var r=this,i=new Rs.CameraContribution;i.clipSpaceNearZ=n,i.setType(vn.EXPLORING,pn.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(gn.UPDATED,function(){r.context.renderingContext.renderReasons.add(Qo.CAMERA_CHANGED),Rs.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()}),this.context.camera=i}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach(function(e){Rs.styleValueRegistry.updateSizeAttenuation(e,t)})}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise(function(e){t.resolveReadyPromise=function(){e(t)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t,e=0>=arguments.length||void 0===arguments[0]||arguments[0],n=arguments.length>1?arguments[1]:void 0;cr.clearCache();var r=!0===(null===(t=this.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);n||this.dispatchEvent(new qo(Tu.BEFORE_DESTROY),r,r),this.frameId&&this.cancelAnimationFrame(this.frameId);var i=this.getRoot();e&&(this.unmountChildren(i),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),n||this.dispatchEvent(new qo(Tu.AFTER_DESTROY),r,r);var a=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};a(Mu),a(wu),a(Su),a(Nu),a(Pu),a(zs),a(_s),a(Gs),a(Fs),Rs.textService.clearCache()}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n,r=this.context.config;r.width=t,r.height=e,this.getContextService().resize(t,e);var i=this.context.camera,a=i.getProjectionMode();i.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),a===yn.ORTHOGRAPHIC?i.setOrthographic(t/-2,t/2,e/2,e/-2,i.getNear(),i.getFar()):i.setAspect(t/e);var o=!0===(null===(n=r.future)||void 0===n?void 0:n.experimentalCancelEventPropagation);this.dispatchEvent(new qo(Tu.RESIZE,{width:t,height:e}),o,o)}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e,n=this;t&&(Su.detail=t,Pu.detail=t);var r=!0===(null===(e=this.getConfig().future)||void 0===e?void 0:e.experimentalCancelEventPropagation);this.dispatchEvent(Su,r,r),this.getRenderingService().render(this,t,function(){n.dispatchEvent(Nu,r,r)}),this.dispatchEvent(Pu,r,r)}},{key:"run",value:function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new gu,new Eu,new yu([new ku])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(a(a({},Rs),this.context)),this.context.renderingService=new Jo(Rs,this.context),this.context.eventService=new $o(Rs,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then(function(){e.initRenderingService(t,n)}).catch(function(t){console.error(t)})}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init(function(){var i;e.inited=!0;var a=!0===(null===(i=e.getConfig().future)||void 0===i?void 0:i.experimentalCancelEventPropagation);n?r?e.requestAnimationFrame(function(){e.dispatchEvent(new qo(Tu.READY),a,a)}):e.dispatchEvent(new qo(Tu.READY),a,a):e.dispatchEvent(new qo(Tu.RENDERER_CHANGED),a,a),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach(function(t){var e,n;null===(e=(n=t).dirty)||void 0===e||e.call(n,!0,!0)}),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()})}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(Rs)})}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),p((null==n?void 0:n.getPlugins())||[]).reverse().forEach(function(t){t.destroy(Rs)}),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;if(t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited){if(t.isMutationObserved)t.dispatchEvent(wu);else{var n,r=!0===(null===(n=this.getConfig().future)||void 0===n?void 0:n.experimentalCancelEventPropagation);wu.target=t,this.dispatchEvent(wu,!0,r)}t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1}t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ha(t);if(this.inited){if(!t.isConnected&&(t.ownerDocument=this.document,t.isConnected=!0,!n))if(t.isMutationObserved)t.dispatchEvent(Mu);else{var r,i=!0===(null===(r=this.getConfig().future)||void 0===r?void 0:r.experimentalCancelEventPropagation);Mu.target=t,this.dispatchEvent(Mu,!0,i)}}else console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName);t.childNodes.forEach(function(t){e.mountChildren(t,n)}),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(Xo),Au=0,Ou=new WeakMap,Ru=function(){function t(e,n){o(this,t),this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=e,this.target=n}return u(t,null,[{key:"copy",value:function(e){var n=new t(e.type,e.target);return n.addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,n}}])}(),Lu=function(){return u(function t(e,n,r){o(this,t),this.transientObservedNodes=[],this.observer=e,this.target=n,this.options=r},[{key:"enqueue",value:function(t){var e=this.observer.records,n=e.length;if(e.length>0){var r=function(t,e){return t===e?t:bu&&function(t){return t===bu||t===xu}(t)?bu:null}(e[n-1],t);if(r)return void(e[n-1]=r)}else Fu.push(this.observer),Gu||(Gu=!0,void 0!==Rs.globalThis?Rs.globalThis.setTimeout(Bu):Bu());e[n]=t}},{key:"addListeners",value:function(){this.addListeners_(this.target)}},{key:"addListeners_",value:function(t){var e=this.options;e.attributes&&t.addEventListener(ns.ATTR_MODIFIED,this,!0),e.childList&&t.addEventListener(ns.INSERTED,this,!0),(e.childList||e.subtree)&&t.addEventListener(ns.REMOVED,this,!0)}},{key:"removeListeners",value:function(){this.removeListeners_(this.target)}},{key:"removeListeners_",value:function(t){var e=this.options;e.attributes&&t.removeEventListener(ns.ATTR_MODIFIED,this,!0),e.childList&&t.removeEventListener(ns.INSERTED,this,!0),(e.childList||e.subtree)&&t.removeEventListener(ns.REMOVED,this,!0)}},{key:"removeTransientObservers",value:function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach(function(t){this.removeListeners_(t);for(var e=Ou.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}},this)}},{key:"handleEvent",value:function(t){var e,n;switch(t.stopImmediatePropagation(),t.type){case ns.ATTR_MODIFIED:var r=t.attrName,i=t.relatedNode.namespaceURI;(e=Du("attributes",n=t.target)).attributeName=r,e.attributeNamespace=i;var a=t.attrChange===rs.ADDITION?null:t.prevValue;_u(n,function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(r)||-1!==t.attributeFilter.indexOf(i)))return t.attributeOldValue?function(t){return bu||((bu=Ru.copy(xu)).oldValue=t,bu)}(a):e});break;case ns.REMOVED:case ns.INSERTED:var o,s,u=t.target;t.type===ns.INSERTED?(o=[u],s=[]):(o=[],s=[u]);var l=u.previousSibling,c=u.nextSibling;(e=Du("childList",n=t.relatedNode)).addedNodes=o,e.removedNodes=s,e.previousSibling=l,e.nextSibling=c,_u(n,function(t){if(t.childList)return e})}xu=bu=void 0}}])}(),Iu=function(){return u(function t(e){o(this,t),this.nodes=[],this.records=[],this.uid=Au++,this.callback=e},[{key:"observe",value:function(t,e){if(!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,r=Ou.get(t);r||Ou.set(t,r=[]);for(var i=0;r.length>i;i++)if(r[i].observer===this){(n=r[i]).removeListeners(),n.options=e;break}n||(n=new Lu(this,t,e),r.push(n),this.nodes.push(t)),n.addListeners()}},{key:"disconnect",value:function(){var t=this;this.nodes.forEach(function(e){for(var n=Ou.get(e),r=0;n.length>r;r++){var i=n[r];if(i.observer===t){i.removeListeners(),n.splice(r,1);break}}},this),this.records=[]}},{key:"takeRecords",value:function(){var t=this.records;return this.records=[],t}}])}();function Du(t,e){return xu=new Ru(t,e)}function _u(t,e){for(var n=t;n;n=n.parentNode){var r=Ou.get(n);if(r)for(var i=0;r.length>i;i++){var a=r[i],o=a.options;if(n===t||o.subtree){var s=e(o);s&&a.enqueue(s)}}}}var Gu=!1,Fu=[];function Bu(){Gu=!1;var t=Fu;Fu=[],t.sort(function(t,e){return t.uid-e.uid});var e=!1;t.forEach(function(t){var n=t.takeRecords();!function(t){t.nodes.forEach(function(e){var n=Ou.get(e);n&&n.forEach(function(e){e.observer===t&&e.removeTransientObservers()})})}(t),n.length&&(t.callback(n,t),e=!0)}),e&&Bu()}var Vu=function(){return u(function t(){o(this,t),this.cacheStore=new Map},[{key:"onRefAdded",value:function(t){}},{key:"has",value:function(t){return this.cacheStore.has(t)}},{key:"put",value:function(t,e,n){return!this.cacheStore.has(t)&&(this.cacheStore.set(t,{value:e,counter:new Set([n.entity])}),this.onRefAdded(n),!0)}},{key:"get",value:function(t,e){var n=this.cacheStore.get(t);return n?(n.counter.has(e.entity)||(n.counter.add(e.entity),this.onRefAdded(e)),n.value):null}},{key:"update",value:function(t,e,n){var r=this.cacheStore.get(t);return!!r&&(r.value=a(a({},r.value),e),r.counter.has(n.entity)||(r.counter.add(n.entity),this.onRefAdded(n)),!0)}},{key:"release",value:function(t,e){var n=this.cacheStore.get(t);return!!n&&(n.counter.delete(e.entity),n.counter.size>0||this.cacheStore.delete(t),!0)}},{key:"releaseRef",value:function(t){var e=this;Array.from(this.cacheStore.keys()).forEach(function(n){e.release(n,t)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),Uu=[],zu=[],Hu=function(){function t(){o(this,t)}return u(t,null,[{key:"stop",value:function(){t.rafId&&((arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api).cancelAnimationFrame(t.rafId),t.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;(Uu.length>0||zu.length>0)&&(zu.forEach(function(t){return t()}),zu=Uu.splice(0,t.TASK_NUM_PER_FRAME),t.rafId=e.requestAnimationFrame(function(){t.executeTask(e)}))}},{key:"sliceImage",value:function(e,n,r,i){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.api,s=e.naturalWidth||e.width,u=e.naturalHeight||e.height,l=n-a,c=r-a,h=Math.ceil(s/l),f=Math.ceil(u/c),d={tileSize:[n,r],gridSize:[f,h],tiles:Array(f).fill(null).map(function(){return Array(h).fill(null)})},v=function(t){for(var a=function(a){Uu.push(function(){var h=a*l,f=t*c,v=[Math.min(n,s-h),Math.min(r,u-f)],p=v[0],y=v[1],g=o.createCanvas();g.width=n,g.height=r,g.getContext("2d").drawImage(e,h,f,p,y,0,0,p,y),d.tiles[t][a]={x:h,y:f,tileX:a,tileY:t,data:g},i()})},f=0;h>f;f++)a(f)},p=0;f>p;p++)v(p);return t.stop(),t.executeTask(),d}}])}();Hu.TASK_NUM_PER_FRAME=10;var ju=new Vu;ju.onRefAdded=function(t){var e=this;t.addEventListener(ns.DESTROY,function(){e.releaseRef(t)},{once:!0})};var Yu=function(){return u(function t(e,n){o(this,t),this.gradientCache={},this.patternCache={},this.context=e,this.runtime=n},[{key:"getImageSync",value:function(t,e,n){var r=ne(t)?t:t.src;if(ju.has(r)){var i=ju.get(r,e);if(i.img.complete)return null==n||n(i),i}return this.getOrCreateImage(t,e).then(function(t){null==n||n(t)}).catch(function(t){console.error(t)}),null}},{key:"getOrCreateImage",value:function(t,e){var n=this,r=ne(t)?t:t.src;if(!ne(t)&&!ju.has(r)){var i={img:t,size:[t.naturalWidth||t.width,t.naturalHeight||t.height],tileSize:Wu(t)};ju.put(r,i,e)}if(ju.has(r)){var a=ju.get(r,e);return a.img.complete?Promise.resolve(a):new Promise(function(t,e){a.img.addEventListener("load",function(){a.size=[a.img.naturalWidth||a.img.width,a.img.naturalHeight||a.img.height],a.tileSize=Wu(a.img),t(a)}),a.img.addEventListener("error",function(t){e(t)})})}return new Promise(function(t,i){var a=n.context.config.createImage();if(a){var o={img:a,size:[0,0],tileSize:Wu(a)};ju.put(r,o,e),a.onload=function(){o.size=[a.naturalWidth||a.width,a.naturalHeight||a.height],o.tileSize=Wu(o.img),t(o)},a.onerror=function(t){i(t)},a.crossOrigin="Anonymous",a.src=r}})}},{key:"createDownSampledImage",value:(e=fo(co().mark(function t(e,n){var r,i,o,s,u,l,c,h,f,d,v,p,y,g;return co().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,n);case 1:if(void 0===(r=t.sent).downSamplingRate){t.next=2;break}return t.abrupt("return",r);case 2:if(u=void 0===(s=(o="boolean"==typeof(i=this.context.config.enableLargeImageOptimization)?{}:i).maxDownSampledImageSize)?2048:s,c=void 0===(l=o.downSamplingRateThreshold)?.5:l,h=this.runtime.globalThis.createImageBitmap,f=b(r.size,2),p=r.img,y=Math.min((u+u)/((d=f[0])+(v=f[1])),Math.max(.01,Math.min(c,.5))),g=a(a({},r),{},{downSamplingRate:y}),ju.update(r.img.src,g,n),!h){t.next=7;break}return t.prev=3,t.next=4,h(r.img,{resizeWidth:d*y,resizeHeight:v*y});case 4:p=t.sent,t.next=6;break;case 5:t.prev=5,t.catch(3),y=1;case 6:t.next=8;break;case 7:y=1;case 8:return g=a(a({},this.getImageSync(e,n)),{},{downSampled:p,downSamplingRate:y}),ju.update(r.img.src,g,n),t.abrupt("return",g);case 9:case"end":return t.stop()}},t,this,[[3,5]])})),function(t,n){return e.apply(this,arguments)})},{key:"createImageTiles",value:(t=fo(co().mark(function t(e,n,r,i){var o,s,u;return co().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,i);case 1:return o=t.sent,Hu.api={requestAnimationFrame:(s=i.ownerDocument.defaultView).requestAnimationFrame,cancelAnimationFrame:s.cancelAnimationFrame,createCanvas:function(){return Ko.createCanvas()}},u=a(a({},o),Hu.sliceImage(o.img,o.tileSize[0],o.tileSize[0],r)),ju.update(o.img.src,u,i),t.abrupt("return",u);case 2:case"end":return t.stop()}},t,this)})),function(e,n,r,i){return t.apply(this,arguments)})},{key:"releaseImage",value:function(t,e){ju.release(ne(t)?t:t.src,e)}},{key:"releaseImageRef",value:function(t){ju.releaseRef(t)}},{key:"getOrCreatePatternSync",value:function(t,e,n,r,i,a,o){var s=this.generatePatternKey(e);if(s&&this.patternCache[s])return this.patternCache[s];var u,l=e.image,c=e.repetition,h=e.transform,f=!1;if(ne(l)){var d=this.getImageSync(l,t,o);u=null==d?void 0:d.img}else r?(u=r,f=!0):u=l;var v,p=u&&n.createPattern(u,c);p&&(v=h?Co(Ji(h),new Ys({})):O(P()),f&&G(v,v,[1/i,1/i,1]),p.setTransform({a:v[0],b:v[1],c:v[4],d:v[5],e:v[12]+a[0],f:v[13]+a[1]}));return s&&p&&(this.patternCache[s]=p),p}},{key:"getOrCreateGradient",value:function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,a=t.min,o=t.width,s=t.height,u=t.cx,l=t.cy,c=t.size;if(this.gradientCache[n])return this.gradientCache[n];var h=null;if(r===br.LinearGradient){var f=Fr(a,o,s,t.angle);h=e.createLinearGradient(f.x1,f.y1,f.x2,f.y2)}else if(r===br.RadialGradient){var d=Br(a,o,s,u,l,c),v=d.x,p=d.y;h=e.createRadialGradient(v,p,0,v,p,d.r)}return h&&(i.forEach(function(t){var e,n=t.offset;n.unit===hr.kPercentage&&(null===(e=h)||void 0===e||e.addColorStop(n.value/100,""+t.color))}),this.gradientCache[n]=h),this.gradientCache[n]}},{key:"generateGradientKey",value:function(t){var e=t.min,n=t.width,r=t.height,i=t.steps,a=t.angle,o=t.cx,s=t.cy,u=t.size;return"gradient-".concat(t.type,"-").concat((null==a?void 0:""+a)||0,"-").concat((null==o?void 0:""+o)||0,"-").concat((null==s?void 0:""+s)||0,"-").concat((null==u?void 0:""+u)||0,"-").concat(e[0],"-").concat(e[1],"-").concat(n,"-").concat(r,"-").concat(i.map(function(t){var e=t.color;return"".concat(t.offset).concat(e)}).join("-"))}},{key:"generatePatternKey",value:function(t){var e=t.image,n=t.repetition;return ne(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0}}]);var t,e}();function Wu(t){if(!t.complete)return[0,0];var e=t.naturalWidth||t.width,n=t.naturalHeight||t.height,r=256;return[256,512].forEach(function(t){1e3>Math.ceil(n/t)*Math.ceil(e/t)&&(r=t)}),[r,r]}Yu.isSupportTile=!!Ko.createCanvas();var qu=function(){function t(){o(this,t)}return u(t,[{key:"apply",value:function(e){var n=e.renderingService,r=e.imagePool,i=e.renderingContext.root.ownerDocument.defaultView,a=function(t,e,n){var r=t.parsedStyle,i=r.width,a=r.height;i&&!a?t.setAttribute("height",n/e*i):!i&&a&&t.setAttribute("width",e/n*a)},o=function(t){var e=t.target,i=e.attributes;if(e.nodeName===l.IMAGE){var o=i.keepAspectRatio;r.getImageSync(i.src,e,function(t){var r=t.img;o&&a(e,r.width,r.height),e.dirty(),n.dirty()})}},s=function(t){var e=t.target,i=t.prevValue,o=t.newValue;e.nodeName===l.IMAGE&&"src"===t.attrName&&(i!==o&&r.releaseImage(i,e),ne(o)&&r.getOrCreateImage(o,e).then(function(t){var r=t.img;e.attributes.keepAspectRatio&&a(e,r.width,r.height),e.dirty(),n.dirty()}).catch(function(){}))};n.hooks.init.tap(t.tag,function(){i.addEventListener(ns.MOUNTED,o),i.addEventListener(ns.ATTR_MODIFIED,s)}),n.hooks.destroy.tap(t.tag,function(){i.removeEventListener(ns.MOUNTED,o),i.removeEventListener(ns.ATTR_MODIFIED,s)})}}])}();qu.tag="LoadImage";var Xu=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).name="image-loader",t}return x(e,t),u(e,[{key:"init",value:function(t){this.context.imagePool=new Yu(this.context,t),this.addRenderingPlugin(new qu)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(h),Zu=Object.freeze({__proto__:null,ImagePool:Yu,Plugin:Xu}),$u=function(){function t(){o(this,t),this.displayObjectHTMLElementMap=new WeakMap}return u(t,[{key:"joinTransformMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+e[0],t[13]+e[1]].join(","),")")}},{key:"apply",value:function(e,n){var r=this,i=e.camera,a=e.renderingContext,o=e.renderingService;this.context=e;var s=a.root.ownerDocument.defaultView,u=s.context.eventService.nativeHTMLMap,c=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())},h=function(t){var e=t.target;if(e.nodeName===l.HTML){r.$camera||(r.$camera=r.createCamera(i));var n=r.getOrCreateEl(e);r.$camera.appendChild(n),Object.keys(e.attributes).forEach(function(t){r.updateAttribute(t,e)}),c(e,n),u.set(n,e)}},f=function(t){var e=t.target;if(e.nodeName===l.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),u.delete(n))}},d=function(t){var e=t.target;e.nodeName===l.HTML&&r.updateAttribute(t.attrName,e)},v=function(t){for(var e=t.detail,n=0;e.length>n;n++){var i=e[n].target;(i.nodeName===l.FRAGMENT?i.childNodes:[i]).forEach(function(t){if(t.nodeName===l.HTML){var e=r.getOrCreateEl(t);c(t,e)}})}},p=function(){if(r.$camera){var t=r.context.config,e=t.height;r.$camera.parentElement.style.width="".concat(t.width||0,"px"),r.$camera.parentElement.style.height="".concat(e||0,"px")}};o.hooks.init.tap(t.tag,function(){s.addEventListener(Tu.RESIZE,p),s.addEventListener(ns.MOUNTED,h),s.addEventListener(ns.UNMOUNTED,f),s.addEventListener(ns.ATTR_MODIFIED,d),s.addEventListener(ns.BOUNDS_CHANGED,v)}),o.hooks.endFrame.tap(t.tag,function(){r.$camera&&a.renderReasons.has(Qo.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))}),o.hooks.destroy.tap(t.tag,function(){r.$camera&&r.$camera.remove(),s.removeEventListener(Tu.RESIZE,p),s.removeEventListener(ns.MOUNTED,h),s.removeEventListener(ns.UNMOUNTED,f),s.removeEventListener(ns.ATTR_MODIFIED,d),s.removeEventListener(ns.BOUNDS_CHANGED,v)})}},{key:"createCamera",value:function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,a=this.context.contextService.getDomElement(),o=a.parentNode;if(o){var s="g-canvas-camera",u=o.querySelector("#".concat(s));if(!u){var l=(n||document).createElement("div");l.style.overflow="hidden",l.style.pointerEvents="none",l.style.position="absolute",l.style.left="0px",l.style.top="0px",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px");var c=(n||document).createElement("div");u=c,c.id=s,c.style.position="absolute",c.style.left="".concat(a.offsetLeft||0,"px"),c.style.top="".concat(a.offsetTop||0,"px"),c.style.transformOrigin="left top",c.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),c.style.pointerEvents="none",c.style.width="100%",c.style.height="100%",l.appendChild(c),o.appendChild(l)}return u}return null}},{key:"getOrCreateEl",value:function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),n}},{key:"updateAttribute",value:function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;ne(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"x":n.style.left="".concat(e.parsedStyle.x,"px");break;case"y":n.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].buildCSSText(null,null,"")," ").concat(i[1].buildCSSText(null,null,""));break;case"width":var a=e.parsedStyle.width;n.style.width=ie(a)?"".concat(a,"px"):""+a;break;case"height":var o=e.parsedStyle.height;n.style.height=ie(o)?"".concat(o,"px"):""+o;break;case"zIndex":n.style["z-index"]="".concat(e.parsedStyle.zIndex);break;case"visibility":n.style.visibility=e.parsedStyle.visibility;break;case"pointerEvents":var s=e.parsedStyle.pointerEvents;n.style.pointerEvents=void 0===s?"auto":s;break;case"opacity":n.style.opacity="".concat(e.parsedStyle.opacity);break;case"fill":var u=e.parsedStyle.fill,l="";Zr(u)?l=u.isNone?"transparent":e.getAttribute("fill"):Array.isArray(u)?l=e.getAttribute("fill"):Xr(u),n.style.background=l;break;case"stroke":var c=e.parsedStyle.stroke,h="";Zr(c)?h=c.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(c)?h=e.getAttribute("stroke"):Xr(c),n.style["border-color"]=h,n.style["border-style"]="solid";break;case"lineWidth":n.style["border-width"]="".concat(e.parsedStyle.lineWidth||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":n.style.filter=e.style.filter;break;default:$t(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}}}])}();$u.tag="HTMLRendering";var Ku=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).name="html-renderer",t}return x(e,t),u(e,[{key:"init",value:function(){this.addRenderingPlugin(new $u)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(h),Qu=Object.freeze({__proto__:null,Plugin:Ku}),Ju=function(){function t(){o(this,t)}return u(t,[{key:"apply",value:function(e,n){var r=this,i=e.renderingService,a=e.renderingContext,o=e.config;this.context=e;var s=a.root.ownerDocument.defaultView,u=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},c=function(t){i.hooks.pointerDown.call(t)},h=function(t){i.hooks.pointerOver.call(t)},f=function(t){i.hooks.pointerOut.call(t)},d=function(t){i.hooks.pointerCancel.call(t)},v=function(t){i.hooks.pointerWheel.call(t)},p=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",u,!0),t.addEventListener("pointerdown",c,!0),t.addEventListener("pointerleave",f,!0),t.addEventListener("pointerover",h,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",u,!0),t.addEventListener("mousedown",c,!0),t.addEventListener("mouseout",f,!0),t.addEventListener("mouseover",h,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",c,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",u,!0),t.addEventListener("touchcancel",d,!0)}(t),o.useNativeClickEvent&&t.addEventListener("click",p,!0),t.addEventListener("wheel",v,{passive:!0,capture:!0})}),i.hooks.destroy.tap(t.tag,function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",u,!0),t.removeEventListener("pointerdown",c,!0),t.removeEventListener("pointerleave",f,!0),t.removeEventListener("pointerover",h,!0),n.globalThis.removeEventListener("pointerup",l,!0),n.globalThis.removeEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",u,!0),t.removeEventListener("mousedown",c,!0),t.removeEventListener("mouseout",f,!0),t.removeEventListener("mouseover",h,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",c,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",u,!0),t.removeEventListener("touchcancel",d,!0)}(t),o.useNativeClickEvent&&t.removeEventListener("click",p,!0),t.removeEventListener("wheel",v,!0)})}}])}();Ju.tag="DOMInteraction";var tl=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).name="dom-interaction",t}return x(e,t),u(e,[{key:"init",value:function(){this.addRenderingPlugin(new Ju)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(h),el=Object.freeze({__proto__:null,Plugin:tl}),nl=function(){function t(){o(this,t)}return u(t,[{key:"apply",value:function(e){var n=e.renderingService,r=e.config,i=e.contextService.getDomElement(),a=function(t){n.hooks.pointerDown.call(t)},o=function(t){n.hooks.pointerUp.call(t)},s=function(t){n.hooks.pointerMove.call(t)},u=function(t){n.hooks.pointerOver.call(t)},l=function(t){n.hooks.pointerOut.call(t)},c=function(t){n.hooks.click.call(t)},h=function(t){n.hooks.pointerCancel.call(t)};n.hooks.init.tap(t.tag,function(){i.addEventListener("touchstart",a,!0),i.addEventListener("touchend",o,!0),i.addEventListener("touchmove",s,!0),i.addEventListener("touchcancel",h,!0),i.addEventListener("mouseout",l,!0),i.addEventListener("mouseover",u,!0),r.useNativeClickEvent&&i.addEventListener("click",c,!0)}),n.hooks.destroy.tap(t.tag,function(){i.removeEventListener("touchstart",a,!0),i.removeEventListener("touchend",o,!0),i.removeEventListener("touchmove",s,!0),i.removeEventListener("touchcancel",h,!0),i.removeEventListener("mouseout",l,!0),i.removeEventListener("mouseover",u,!0),r.useNativeClickEvent&&i.removeEventListener("click",c,!0)})}}])}();nl.tag="MobileInteraction";var rl=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).name="mobile-interaction",t}return x(e,t),u(e,[{key:"init",value:function(){this.addRenderingPlugin(new nl)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(h),il=Object.freeze({__proto__:null,Plugin:rl});t.AABB=Ut,t.AbstractRenderer=f,t.AbstractRendererPlugin=h,t.BUILT_IN_PROPERTIES=da,t.CSS=vu,t.CSSGradientValue=Tr,t.CSSKeywordValue=Mr,t.CSSRGB=Cr,t.CSSStyleValue=Er,t.CSSUnitValue=Sr,t.Camera=kn,t.CameraEvent=gn,t.CameraProjectionMode=yn,t.CameraTrackingMode=pn,t.CameraType=vn,t.Canvas=Cu,t.CanvasEvent=Tu,t.Circle=Ws,t.CircleUpdater=Lo,t.ClipSpaceNearZ=c,t.CustomElement=Zs,t.CustomElementRegistry=du,t.CustomEvent=qo,t.DefaultSceneGraphSelector=es,t.DefaultSceneGraphService=ws,t.DisplayObject=Ys,t.Document=pu,t.DomInteraction=el,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=qt,t.Element=Bs,t.ElementEvent=ns,t.Ellipse=$s,t.EllipseUpdater=Io,t.EventService=$o,t.EventTarget=Xo,t.FederatedEvent=zo,t.FederatedMouseEvent=Ho,t.FederatedPointerEvent=jo,t.FederatedWheelEvent=Yo,t.Fragment=Ks,t.Frustum=jt,t.GradientType=br,t.Group=Qs,t.GroupUpdater=Vo,t.HTML=tu,t.HTMLRenderer=Qu,t.HTMLUpdater=Uo,t.Image=eu,t.ImageLoader=Zu,t.ImagePool=Yu,t.Line=ru,t.LineUpdater=Do,t.Mask=Ht,t.MobileInteraction=il,t.MutationEvent=rs,t.MutationObserver=Iu,t.MutationRecord=Ru,t.Node=Zo,t.OffscreenCanvasCreator=Ko,t.Path=au,t.PathUpdater=_o,t.Plane=zt,t.Point=Yt,t.Polygon=su,t.Polyline=lu,t.PolylineUpdater=Go,t.PropertySyntax=An,t.Rect=cu,t.RectUpdater=Fo,t.Rectangle=Wt,t.Registration=Lu,t.RenderReason=Qo,t.RenderingService=Jo,t.Shape=l,t.SortReason=Tn,t.Strategy=bn,t.Text=fu,t.TextService=Os,t.TextUpdater=Bo,t.UnitType=hr,t.attrModifiedEvent=zs,t.computeLinearGradient=Fr,t.computeRadialGradient=Br,t.convertToPath=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),n=[];switch(t.nodeName){case l.LINE:var r=t.parsedStyle,i=r.x1,a=r.y1,o=r.x2,s=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(void 0===i?0:i,void 0===a?0:a,void 0===o?0:o,void 0===s?0:s);break;case l.CIRCLE:var u=t.parsedStyle,c=u.r,h=void 0===c?0:c,f=u.cx,d=u.cy;n=Ui(h,h,void 0===f?0:f,void 0===d?0:d);break;case l.ELLIPSE:var v=t.parsedStyle,y=v.rx,g=v.ry,m=v.cx,k=v.cy;n=Ui(void 0===y?0:y,void 0===g?0:g,void 0===m?0:m,void 0===k?0:k);break;case l.POLYLINE:case l.POLYGON:n=function(t,e){var n=t.map(function(t,e){return[0===e?"M":"L",t[0],t[1]]});return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===l.POLYGON);break;case l.RECT:var E=t.parsedStyle,x=E.width,T=void 0===x?0:x,M=E.height,w=void 0===M?0:M,S=E.x,N=void 0===S?0:S,P=E.y,C=void 0===P?0:P,A=E.radius,O=A&&A.some(function(t){return 0!==t});n=function(t,e,n,r,i){if(i){var a=b(i,4),o=a[0],s=a[1],u=a[2],l=a[3],c=t>0?1:-1,h=e>0?1:-1,f=c+h!==0?1:0;return[["M",c*o+n,r],["L",t-c*s+n,r],s?["A",s,s,0,0,f,t+n,h*s+r]:null,["L",t+n,e-h*u+r],u?["A",u,u,0,0,f,t+n-c*u,e+r]:null,["L",n+c*l,e+r],l?["A",l,l,0,0,f,n,e+r-h*l]:null,["L",n,h*o+r],o?["A",o,o,0,0,f,c*o+n,r]:null,["Z"]].filter(function(t){return t})}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(T,w,N,C,O&&A.map(function(t){return re(t,0,Math.min(Math.abs(T)/2,Math.abs(w)/2))}));break;case l.PATH:n=p(t.parsedStyle.d.absolutePath)}if(n.length)return function(t,e,n){return t.reduce(function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=ut(e[1],e[2],0);n&>(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=ut(e[1],e[2],0),o=ut(e[3],e[4],0),s=ut(e[5],e[6],0);n&&(gt(a,a,n),gt(o,o,n),gt(s,s,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(o[0],",").concat(o[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var u=ut(e[6],e[7],0);n&>(u,u,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(u[0],",").concat(u[1])}else if("Q"===e[0]){var l=ut(e[1],e[2],0),c=ut(e[3],e[4],0);n&&(gt(l,l,n),gt(c,c,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r},"")}(n,0,e)},t.createVec3=Ke,t.decompose=sn,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter(function(t){return void 0!==b(t,2)[1]}))},t.deg2rad=Je,t.deg2turn=function(t){return t/360},t.destroyEvent=Fs,t.findClosestClipPathTarget=Ba,t.fromRotationTranslationScale=on,t.getAngle=Ze,t.getEuler=an,t.getOrCalculatePathTotalLength=Ai,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),.9*t},t.insertedEvent=_s,t.isBrowser=_a,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=Zr,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=Vs,t.isFederatedEvent=function(t){return!!t.type},t.isFillOrStrokeAffected=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=Xr,t.mergeColors=Kr,t.parseColor=$r,t.parseLength=ti,t.parsePath=ji,t.parseTransform=Ji,t.parsedTransformToMat4=Co,t.propertyMetadataCache=pa,t.rad2deg=en,t.removedEvent=Gs,t.resetEntityCounter=function(){Ds=0},t.runtime=Rs,t.setDOMSize=function(t,e,n){_a&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=t.map(function(a,o){var s=a[0],u=t[o+1],l=(o===t.length-1||u&&("M"===u[0]||"Z"===u[0]))&&0!==r&&0!==i,c=b(0===o&&(0!==e||0!==n)?[e,n]:[0,0],2),h=c[0],f=c[1],d=b(l?[r,i]:[0,0],2),v=d[0],p=d[1];switch(s){case"M":return"M ".concat(a[1]+h,",").concat(a[2]+f);case"L":return"L ".concat(a[1]+v,",").concat(a[2]+p);case"Q":return"Q ".concat(a[1]," ").concat(a[2],",").concat(a[3]+v," ").concat(a[4]+p);case"C":return"C ".concat(a[1]," ").concat(a[2],",").concat(a[3]," ").concat(a[4],",").concat(a[5]+v," ").concat(a[6]+p);case"A":return"A ".concat(a[1]," ").concat(a[2]," ").concat(a[3]," ").concat(a[4]," ").concat(a[5]," ").concat(a[6]," ").concat(a[7]).concat(l?" L ".concat(a[6]+r,",").concat(a[7]+i):"");case"Z":return"Z";default:return null}}).filter(function(t){return null!==t}).join(" ");return~a.indexOf("NaN")?"":a},t.turn2deg=nn,t.updateLocalTransform=Nn,t.updateWorldTransform=Pn});
|
|
19
|
+
var t,e,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function a(n,r,i,a){var u=Object.create((r&&r.prototype instanceof s?r:s).prototype);return ro(u,"_invoke",function(n,r,i){var a,s,u,l=0,c=i||[],h=!1,f={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,n){return a=e,s=0,u=t,f.n=n,o}};function d(n,r){for(s=n,u=r,e=0;!h&&l&&!i&&c.length>e;e++){var i,a=c[e],d=f.p,v=a[2];n>3?(i=v===r)&&(u=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=t):d>=a[0]&&((i=2>n&&a[1]>d)?(s=0,f.v=r,f.n=a[1]):v>d&&(i=3>n||a[0]>r||r>v)&&(a[4]=n,a[5]=r,f.n=v,s=0))}if(i||n>1)return o;throw h=!0,r}return function(i,c,v){if(l>1)throw TypeError("Generator is already running");for(h&&1===c&&d(c,v),s=c,u=v;(e=2>s?t:u)||!h;){a||(s?3>s?(s>1&&(f.n=-1),d(s,u)):f.n=u:f.v=u);try{if(l=2,a){if(s||(i="next"),e=a[i]){if(!(e=e.call(a,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,2>s&&(s=0)}else 1===s&&(e=a.return)&&e.call(a),2>s&&(u=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=t}else if((e=(h=0>f.n)?u:n.call(r,f))!==o)break}catch(e){a=t,s=1,u=e}finally{l=1}}return{value:e,done:h}}}(n,i,a),!0),u}var o={};function s(){}function u(){}function l(){}e=Object.getPrototypeOf;var c=[][r]?e(e([][r]())):(ro(e={},r,function(){return this}),e),h=l.prototype=s.prototype=Object.create(c);function f(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,ro(t,i,"GeneratorFunction")),t.prototype=Object.create(h),t}return u.prototype=l,ro(h,"constructor",l),ro(l,"constructor",u),u.displayName="GeneratorFunction",ro(l,i,"GeneratorFunction"),ro(h),ro(h,i,"Generator"),ro(h,r,function(){return this}),ro(h,"toString",function(){return"[object Generator]"}),(io=function(){return{w:a,m:f}})()}function ao(t,e){function n(r,i,a,o){try{var s=t[r](i),u=s.value;return u instanceof no?e.resolve(u.v).then(function(t){n("next",t,a,o)},function(t){n("throw",t,a,o)}):e.resolve(u).then(function(t){s.value=t,a(s)},function(t){return n("throw",t,a,o)})}catch(t){o(t)}}var r;this.next||(ro(ao.prototype),ro(ao.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),ro(this,"_invoke",function(t,i,a){function o(){return new e(function(e,r){n(t,a,e,r)})}return r=r?r.then(o,o):o()},!0)}function oo(t,e,n,r,i){return new ao(io().w(t,e,n,r),i||Promise)}function so(t,e,n,r,i){var a=oo(t,e,n,r,i);return a.next().then(function(t){return t.done?t.value:a.next()})}function uo(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function t(){for(;n.length;)if((r=n.pop())in e)return t.value=r,t.done=!1,t;return t.done=!0,t}}function lo(t){if(null!=t){var n=t["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}throw new TypeError(e(t)+" is not iterable")}function co(){var t=io(),e=t.m(co),n=(Object.getPrototypeOf?Object.getPrototypeOf(e):e.__proto__).constructor;function r(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===n||"GeneratorFunction"===(e.displayName||e.name))}var i={throw:1,return:2,break:3,continue:3};function a(t){var e,n;return function(r){e||(e={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(t,e){return n(r.a,i[t],e)},delegateYield:function(t,i,a){return e.resultName=i,n(r.d,lo(t),a)},finish:function(t){return n(r.f,t)}},n=function(t,n,i){r.p=e.prev,r.n=e.next;try{return t(n,i)}finally{e.next=r.n}}),e.resultName&&(e[e.resultName]=r.v,e.resultName=void 0),e.sent=r.v,e.next=r.n;try{return t.call(this,e)}finally{r.p=e.prev,r.n=e.next}}}return(co=function(){return{wrap:function(e,n,r,i){return t.w(a(e),n,r,i&&i.reverse())},isGeneratorFunction:r,mark:t.m,awrap:function(t,e){return new no(t,e)},AsyncIterator:ao,async:function(t,e,n,i,o){return(r(e)?oo:so)(a(t),e,n,i,o)},keys:uo,values:lo}})()}function ho(t,e,n,r,i,a,o){try{var s=t[a](o),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function fo(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var a=t.apply(e,n);function o(t){ho(a,r,i,o,s,"next",t)}function s(t){ho(a,r,i,o,s,"throw",t)}o(void 0)})}}var vo=function(){return u(function t(){o(this,t),this.callbacks=[]},[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=fo(co().mark(function t(){var e,n,r,i,a=arguments;return co().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=6;break}return t.next=1,(e=this.callbacks)[0].apply(e,a);case 1:n=t.sent,r=1;case 2:if(r>=this.callbacks.length){t.next=5;break}return i=this.callbacks[r],t.next=3,i(n);case 3:n=t.sent;case 4:r++,t.next=2;break;case 5:return t.abrupt("return",n);case 6:return t.abrupt("return",null);case 7:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})}]);var t}(),po=function(){return u(function t(){o(this,t),this.callbacks=[]},[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=arguments;this.callbacks.forEach(function(t){t.apply(void 0,r)})}}])}(),yo=function(){return u(function t(){o(this,t),this.callbacks=[]},[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];if(this.callbacks.length){for(var r=this.callbacks[0].apply(void 0,arguments),i=1;this.callbacks.length>i;i++){r=(0,this.callbacks[i])(r)}return r}return null}}])}(),go=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],mo=/([\"\'])[^\'\"]+\1/;function ko(t){var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,a=t.fontWeight;return{fontSize:void 0===e?16:e,fontFamily:void 0===n?"sans-serif":n,fontStyle:void 0===r?"normal":r,fontVariant:void 0===i?"normal":i,fontWeight:void 0===a?"normal":a}}var Eo=cr(function(t){for(var e=ko(t),n=e.fontSize,r=e.fontFamily,i=e.fontStyle,a=e.fontVariant,o=e.fontWeight,s=ie(n)&&"".concat(n,"px")||"16px",u=r.split(","),l=u.length-1;l>=0;l--){var c=u[l].trim();!mo.test(c)&&0>go.indexOf(c)&&(c='"'.concat(c,'"')),u[l]=c}return"".concat(i," ").concat(a," ").concat(o," ").concat(s," ").concat(u.join(","))},function(t){var e=ko(t),n=e.fontSize,r=e.fontFamily,i=e.fontVariant,a=e.fontWeight;return"".concat(e.fontStyle,"_").concat(i,"_").concat(a,"_").concat(n,"_").concat(r)}),xo=function(t){return Math.max(t,1e-6)};function bo(t,e,n){return O(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var To=P(),Mo=P(),wo={scale:function(t){U(To,[t[0].value,t[1].value,1].map(function(t){return xo(t)}))},scaleX:function(t){U(To,[t[0].value,1,1].map(function(t){return xo(t)}))},scaleY:function(t){U(To,[1,t[0].value,1].map(function(t){return xo(t)}))},scaleZ:function(t){U(To,[1,1,t[0].value].map(function(t){return xo(t)}))},scale3d:function(t){U(To,[t[0].value,t[1].value,t[2].value].map(function(t){return xo(t)}))},translate:function(t){V(To,[t[0].value,t[1].value,0])},translateX:function(t){V(To,[t[0].value,0,0])},translateY:function(t){V(To,[0,t[0].value,0])},translateZ:function(t){V(To,[0,0,t[0].value])},translate3d:function(t){V(To,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Y(To,Je(oi(t[0])))},rotateX:function(t){H(To,Je(oi(t[0])))},rotateY:function(t){j(To,Je(oi(t[0])))},rotateZ:function(t){Y(To,Je(oi(t[0])))},rotate3d:function(t){z(To,Je(oi(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){bo(To,Je(t[0].value),Je(t[1].value))},skewX:function(t){bo(To,Je(t[0].value),0)},skewY:function(t){bo(To,0,Je(t[0].value))},matrix:function(t){A(To,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){A.apply(at,[To].concat(p(t.map(function(t){return t.value}))))}},So=ut(1,1,1),No=ot(),Po={translate:function(t,e){Rs.sceneGraphService.setLocalScale(t,So,!1),Rs.sceneGraphService.setLocalEulerAngles(t,No,void 0,void 0,!1),Rs.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),Rs.sceneGraphService.dirtyLocalTransform(t,t.transformable)}};function Co(t,e){if(t.length){if(1===t.length&&Po[t[0].t])return void Po[t[0].t](e,t[0].d);for(var n=O(Mo),r=0;t.length>r;r++){var i=t[r],a=wo[i.t];a&&(a(i.d),it(n,n,To))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var Ao=function(){return u(function t(){o(this,t),this.parser=ta,this.mixer=ca},[{key:"calculator",value:function(t,e,n,r){return n instanceof Mr?[]:n}},{key:"postProcessor",value:function(t){Co(t.parsedStyle.transform,t)}}])}(),Oo=function(){return u(function t(){o(this,t)},[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===hr.kPixels&&e[1].unit===hr.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),Ro=function(){return u(function t(){o(this,t)},[{key:"calculator",value:function(t,e,n,r){return n.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,n=e.sortable;e.renderable&&e.dirty(),n&&(n.dirty=!0,n.dirtyReason=Tn.Z_INDEX_CHANGED)}}}])}(),Lo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.cx,r=t.cy,i=t.r,a=void 0===i?0:i;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:a,hheight:a}}}])}(),Io=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.cx,r=t.cy,i=t.rx,a=t.ry;return{cx:void 0===n?0:n,cy:void 0===r?0:r,hwidth:void 0===i?0:i,hheight:void 0===a?0:a}}}])}(),Do=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,a=Math.min(e,r),o=Math.max(e,r),s=Math.min(n,i),u=(o-a)/2,l=(Math.max(n,i)-s)/2;return{cx:a+u,cy:s+l,hwidth:u,hheight:l}}}])}(),_o=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t){var e=t.d.rect,n=e.width/2,r=e.height/2;return{cx:e.x+n,cy:e.y+r,hwidth:n,hheight:r}}}])}(),Go=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t){if(t.points&&Kt(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,p(e.map(function(t){return t[0]}))),r=Math.max.apply(Math,p(e.map(function(t){return t[0]}))),i=Math.min.apply(Math,p(e.map(function(t){return t[1]}))),a=(r-n)/2,o=(Math.max.apply(Math,p(e.map(function(t){return t[1]})))-i)/2;return{cx:n+a,cy:i+o,hwidth:a,hheight:o}}return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Fo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,a=void 0===i?0:i,o=t.src,s=t.width,u=t.height,l=void 0===s?0:s,c=void 0===u?0:u;return o&&!ne(o)&&(l||(t.width=l=o.width),c||(t.height=c=o.height)),{cx:r+l/2,cy:a+c/2,hwidth:l/2,hheight:c/2}}}])}(),Bo=function(){return u(function t(e){o(this,t),this.globalRuntime=e},[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,r=t.text,i=t.textAlign,a=void 0===i?"start":i,o=t.lineWidth,s=void 0===o?1:o,u=t.textBaseline,l=void 0===u?"alphabetic":u,c=t.dx,h=void 0===c?0:c,f=t.dy,d=void 0===f?0:f,v=t.x,p=void 0===v?0:v,y=t.y,g=void 0===y?0:y;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var m=(null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{},k=this.globalRuntime.textService.measureText(r,t,m.offscreenCanvas);t.metrics=k;var E=k.width/2,x=k.height/2,b=p+E;"center"===a||"middle"===a?b+=s/2-E:"right"!==a&&"end"!==a||(b+=s-2*E);var T=g-x;return"middle"===l?T+=x:"top"===l||"hanging"===l?T+=2*x:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(T+=0),h&&(b+=h),d&&(T+=d),{cx:b,cy:T,hwidth:E,hheight:x}}}])}(),Vo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),Uo=function(){return u(function t(){o(this,t)},[{key:"update",value:function(t,e){var n=t.x,r=t.y,i=t.width,a=void 0===i?0:i,o=t.height,s=void 0===o?0:o;return{cx:(void 0===n?0:n)+a/2,cy:(void 0===r?0:r)+s/2,hwidth:a/2,hheight:s/2}}}])}();var zo=function(){return u(function t(e){o(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Yt,this.page=new Yt,this.canvas=new Yt,this.viewport=new Yt,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e},[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw Error(qt)}}])}(),Ho=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).client=new Yt,t.movement=new Yt,t.offset=new Yt,t.global=new Yt,t.screen=new Yt,t}return x(e,t),u(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw Error(qt)}}])}(zo),jo=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).width=0,t.height=0,t.isPrimary=!1,t}return x(e,t),u(e,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Ho),Yo=function(t){function e(){return o(this,e),k(this,e,arguments)}return x(e,t),u(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Ho);function Wo(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=v(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}},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 a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}var qo=function(t){function e(t,n){var r;return o(this,e),(r=k(this,e,[null])).type=t,r.detail=null==n?void 0:n.detail,n&&!("detail"in n)&&(r.detail=n),Object.assign(r,n),r}return x(e,t),u(e)}(zo),Xo=function(){return u(function t(){o(this,t),this.emitter=new M},[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=!1,i=!1;if(se(n))r=n;else if(n){var a=n.capture;r=void 0!==a&&a;var o=n.once;i=void 0!==o&&o}r&&(t+="capture"),e=Zt(e)?e:e.handleEvent;var s=Zt(e)?void 0:e;return i?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r;if(!this.emitter)return this;(se(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=Zt(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent;var i=Zt(e)?void 0:e;return this.emitter.off(t,e,i),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new qo(t,e))}},{key:"dispatchEventToSelf",value:function(t){t.target||(t.target=this),t.currentTarget=this,this.emitter.emit(t.type,t)}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(arguments.length>2?arguments[2]:void 0)return this.dispatchEventToSelf(t),!0;if(this.document)e=this;else if(this.defaultView)e=this.defaultView;else{var r;e=null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView}if(e){if(t.manager=e.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.dispatchEventToSelf(t);return!t.defaultPrevented}}])}(),Zo=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.mutations=void 0,t.parentNode=null,t.destroyed=!1,t}return x(e,t),u(e,[{key:"textContent",get:function(){var t="";this.nodeName===l.TEXT&&(t+=this.style.text);var e,n=Wo(this.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;t+=r.nodeName===l.TEXT?r.nodeValue:r.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach(function(t){e.removeChild(t)}),this.nodeName===l.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw Error(qt)}},{key:"lookupNamespaceURI",value:function(t){throw Error(qt)}},{key:"lookupPrefix",value:function(t){throw Error(qt)}},{key:"normalize",value:function(){throw Error(qt)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,r=this,i=[n],a=[r];null!==(o=n.parentNode)&&void 0!==o?o:r.parentNode;){var o;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(a.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>a.length?i:a,u=s===i?a:i;if(s[s.length-u.length]===u[0])return s===i?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-u.length,c=u.length-1;c>=0;c--){var h=u[c],f=s[l+c];if(f!==h){var d=h.parentNode.childNodes;return d.indexOf(h)<d.indexOf(f)?u===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(Xo);Zo.DOCUMENT_POSITION_DISCONNECTED=1,Zo.DOCUMENT_POSITION_PRECEDING=2,Zo.DOCUMENT_POSITION_FOLLOWING=4,Zo.DOCUMENT_POSITION_CONTAINS=8,Zo.DOCUMENT_POSITION_CONTAINED_BY=16,Zo.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var $o=function(){return u(function t(e,n){var r=this;o(this,t),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=P(),this.tmpVec3=ot(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){r.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=za.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){r.dispatchEvent(n,2===n.button?"rightup":"mouseup")}var i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.pressTargetsByButton[t.button]),o=a;if(a&&!n.composedPath().includes(a)){for(var s=a;s&&!n.composedPath().includes(s);){if(n.currentTarget=s,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){r.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside")}Zo.isNode(s)&&(s=s.parentNode)}delete i.pressTargetsByButton[t.button],o=s}if(o){var u,l=r.clonePointerEvent(n,"click");l.target=o,l.path=[],i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:l.target,timeStamp:e});var c=i.clicksByButton[t.button];c.target===l.target&&e-c.timeStamp<r.context.renderingContext.root.ownerDocument.defaultView.getConfig().dblClickSpeed?++c.clickCount:c.clickCount=1,c.target=l.target,c.timeStamp=e,l.detail=c.clickCount,null!==(u=n.detail)&&void 0!==u&&u.preventClick||(r.context.config.useNativeClickEvent||"mouse"!==l.pointerType&&"touch"!==l.pointerType||r.dispatchEvent(l,"click"),r.dispatchEvent(l,"pointertap")),r.freeEvent(l)}r.freeEvent(n)},this.onPointerMove=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.overTargets);if(i.overTargets&&a!==e.target){var o=r.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",a||void 0);if(r.dispatchEvent(o,"pointerout"),n&&r.dispatchEvent(o,"mouseout"),!e.composedPath().includes(a)){var s=r.createPointerEvent(t,"pointerleave",a||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,r.notifyTarget(s),n&&r.notifyTarget(s,"mouseleave"),Zo.isNode(s.target)&&(s.target=s.target.parentNode);r.freeEvent(s)}r.freeEvent(o)}if(a!==e.target){var u=r.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");r.dispatchEvent(u,"pointerover"),n&&r.dispatchEvent(u,"mouseover");for(var l=a&&Zo.isNode(a)&&a.parentNode;l&&l!==(Zo.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(Zo.isNode(r.rootTarget)&&r.rootTarget.parentNode)){var c=r.clonePointerEvent(e,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==a&&c.target!==(Zo.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),n&&r.notifyTarget(c,"mouseenter"),Zo.isNode(c.target)&&(c.target=c.target.parentNode);r.freeEvent(c)}r.freeEvent(u)}r.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&r.dispatchEvent(e,"touchmove"),n&&(r.dispatchEvent(e,"mousemove"),r.cursor=r.getCursor(e.target)),i.overTargets=e.composedPath(),r.freeEvent(e)},this.onPointerOut=function(t){var e=r.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,i=r.findMountedTarget(e.overTargets),a=r.createPointerEvent(t,"pointerout",i||void 0);r.dispatchEvent(a),n&&r.dispatchEvent(a,"mouseout");var o=r.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Zo.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),n&&r.notifyTarget(o,"mouseleave"),Zo.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,r.freeEvent(a),r.freeEvent(o)}r.cursor=null},this.onPointerOver=function(t){var e=r.trackingData(t.pointerId),n=r.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;r.dispatchEvent(n,"pointerover"),i&&r.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(r.cursor=r.getCursor(n.target));var a=r.clonePointerEvent(n,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Zo.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),i&&r.notifyTarget(a,"mouseenter"),Zo.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=n.composedPath(),r.freeEvent(n),r.freeEvent(a)},this.onPointerUpOutside=function(t){var e=r.trackingData(t.pointerId),n=r.findMountedTarget(e.pressTargetsByButton[t.button]),i=r.createPointerEvent(t);if(n){for(var a=n;a;)i.currentTarget=a,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Zo.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}r.freeEvent(i)},this.onWheel=function(t){var e=r.createWheelEvent(t);r.dispatchEvent(e),r.freeEvent(e)},this.onClick=function(t){if(r.context.config.useNativeClickEvent){var e=r.createPointerEvent(t);r.dispatchEvent(e),r.freeEvent(e)}},this.onPointerCancel=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(e),r.freeEvent(e)},this.globalRuntime=e,this.context=n},[{key:"init",value:function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,a=r.offsetHeight;i&&a&&(e=t.width/i,n=t.height/a)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.bbox;return new Yt((t.x-((null==n?void 0:n.left)||0))/e.scaleX,(t.y-((null==n?void 0:n.top)||0))/e.scaleY)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.bbox;return new Yt((t.x+((null==n?void 0:n.left)||0))*e.scaleX,(t.y+((null==n?void 0:n.top)||0))*e.scaleY)}},{key:"viewport2Canvas",value:function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,a=i.width,o=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),l=D(this.tmpMatrix,u,s),c=ct(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return gt(c,c,l),new Yt(c[0],c[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=D(this.tmpMatrix,n,r),a=ct(this.tmpVec3,t.x,t.y,0);gt(this.tmpVec3,this.tmpVec3,i);var o=this.context.config;return new Yt((a[0]+1)/2*o.width,(1-(a[1]+1)/2)*o.height)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value:function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(function(t,e){return t.priority-e.priority})}},{key:"mapEvent",value:function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}}},{key:"dispatchEvent",value:function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e))}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=i+1;n.length>a;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value:function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)Zo.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config;return 0>e||0>n||e>r.width||n>r.height?null:!r.disableHitTesting&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,r=null==e?void 0:e.target;if(null!==(n=r)&&void 0!==n&&n.shadowRoot&&(r=e.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();n.length>e;e++){var r=this.nativeHTMLMap.get(n[e]);if(r)return r}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,r){var i=this.allocateEvent(jo);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i),o=this.context.contextService.getDomElement();return i.target=null!=n?n:a||this.isNativeEventFromCanvas(o,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(Yo);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(Yo);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(jo);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n}},{key:"copyPointerData",value:function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist}},{key:"copyMouseData",value:function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=za.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value:function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)}},{key:"notifyTarget",value:function(t,e){e=null!=e?e:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"notifyListeners",value:function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)}},{key:"findMountedTarget",value:function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Zo.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=Ga(e)&&e.getAttribute("cursor");if(n)return n;e=Zo.isNode(e)&&e.parentNode}}}])}(),Ko=function(){return u(function t(){o(this,t)},[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||Rs.offscreenCanvas)this.canvas=t||Rs.offscreenCanvas,this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",a({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),Qo=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),Jo=function(){return u(function t(e,n){o(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new po,initAsync:new eo,dirtycheck:new yo,cull:new yo,beginFrame:new po,beforeRender:new po,render:new po,afterRender:new po,endFrame:new po,destroy:new po,pick:new vo,pickSync:new yo,pointerDown:new po,pointerUp:new po,pointerMove:new po,pointerOut:new po,pointerOver:new po,pointerWheel:new po,pointerCancel:new po,click:new po},this.globalRuntime=e,this.context=n},[{key:"init",value:function(t){var e=this,n=a(a({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(t){t.apply(n,e.globalRuntime)}),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then(function(){e.inited=!0,t()}).catch(function(t){})}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Qo.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var r=this,i=t.getConfig(),a=this.context.renderingContext;if(this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0,this.globalRuntime.sceneGraphService.syncHierarchy(a.root),this.globalRuntime.sceneGraphService.notifyMutationObservers(t),a.renderReasons.size&&this.inited){a.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var o=1===a.renderReasons.size&&a.renderReasons.has(Qo.CAMERA_CHANGED),s=!i.disableRenderHooks||!o;s&&this.renderDisplayObject(a.root,i,a),this.hooks.beginFrame.call(e),s&&a.renderListCurrentFrame.forEach(function(t){r.hooks.beforeRender.call(t),r.hooks.render.call(t),r.hooks.afterRender.call(t)}),this.hooks.endFrame.call(e),a.renderListCurrentFrame=[],a.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;function s(t){var e=t.sortable,i=a?t.renderable.dirty||n.dirtyRectangleRenderingDisabled?t:null:t,s=null;i&&(s=o?r.hooks.cull.call(i,r.context.camera):i)&&(r.stats.rendered+=1,n.renderListCurrentFrame.push(s)),t.dirty(!1),e.renderOrder=r.zIndexCounter,r.zIndexCounter+=1,r.stats.total+=1,e.dirty&&(r.sort(t,e),e.dirty=!1,e.dirtyChildren=[],e.dirtyReason=void 0)}for(var u=[t];u.length>0;){var l,c=u.pop();s(c);for(var h=(null===(l=c.sortable)||void 0===l||null===(l=l.sorted)||void 0===l?void 0:l.length)>0?c.sortable.sorted:c.childNodes,f=h.length-1;f>=0;f--)u.push(h[f])}}},{key:"sort",value:function(t,e){var n,r;(null==e||null===(n=e.sorted)||void 0===n?void 0:n.length)>0&&e.dirtyReason!==Tn.Z_INDEX_CHANGED?e.dirtyChildren.forEach(function(n){var r=e.sorted.indexOf(n);if(r>-1&&e.sorted.splice(r,1),t.childNodes.indexOf(n)>-1)if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;r>n;){var i=n+r>>>1;0>Fa(t[i],e)?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}}):e.sorted=t.childNodes.slice().sort(Fa),(null===(r=e.sorted)||void 0===r?void 0:r.length)>0&&0===t.childNodes.filter(function(t){return t.parsedStyle.zIndex}).length&&(e.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call()}},{key:"dirty",value:function(){this.context.renderingContext.renderReasons.add(Qo.DISPLAY_OBJECT_CHANGED)}}])}(),ts=/\[\s*(.*)=(.*)\s*\]/,es=function(){return u(function t(){o(this,t)},[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find(function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1});if(t.startsWith("#"))return e.find(function(e){return e.id===n.getIdOrClassname(t)});if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.find(function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)}):null}return e.find(function(n){return e!==n&&n.nodeName===t})}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll(function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1});if(t.startsWith("#"))return e.findAll(function(r){return e!==r&&r.id===n.getIdOrClassname(t)});if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,a=r.value;return i?e.findAll(function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)}):[]}return e.findAll(function(n){return e!==n&&n.nodeName===t})}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(ts),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return $t(n)?"":n.toString?""+n:""}}])}(),ns=function(t){return t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.MOUNTED="DOMNodeInsertedIntoDocument",t.REMOVED="removed",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.REPARENT="reparent",t.DESTROY="destroy",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),rs=function(t){function e(t,n,r,i,a,s,u,l){var c;return o(this,e),(c=k(this,e,[null])).relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=a,c.attrChange=s,c.prevParsedValue=u,c.newParsedValue=l,c.type=t,c}return x(e,t),u(e)}(zo);rs.ADDITION=2,rs.MODIFICATION=1,rs.REMOVAL=3;var is,as,os,ss=new rs(ns.REPARENT,null,"","","",0,"",""),us=It(),ls=ot(),cs=ut(1,1,1),hs=P(),fs=It(),ds=ot(),vs=P(),ps=Mt(),ys=ot(),gs=Mt(),ms=ot(),ks=ot(),Es=ot(),xs=P(),bs=Mt(),Ts=Mt(),Ms=Mt(),ws=function(){return u(function t(e){o(this,t),this.displayObjectDependencyMap=new WeakMap,this.runtime=e},[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var a=t.nodeName===l.FRAGMENT,o=Ha(e);t.parentNode=e;var s=a?t.childNodes:[t];ie(n)?s.forEach(function(t){e.childNodes.splice(n,0,t),t.parentNode=e}):s.forEach(function(t){e.childNodes.push(t),t.parentNode=e});var u=e.sortable;if((null!=u&&null!==(r=u.sorted)&&void 0!==r&&r.length||u.dirty||t.parsedStyle.zIndex)&&(-1===u.dirtyChildren.indexOf(t)&&u.dirtyChildren.push(t),u.dirty=!0,u.dirtyReason=Tn.ADDED),!o){if(a)this.dirtyFragment(t);else{var c=t.transformable;c&&this.dirtyWorldTransform(t,c)}if(i){var h,f=!0===(null===(h=e.ownerDocument)||void 0===h||null===(h=h.defaultView)||void 0===h||null===(h=h.getConfig())||void 0===h||null===(h=h.future)||void 0===h?void 0:h.experimentalCancelEventPropagation);t.dispatchEvent(ss,f,f)}}}},{key:"detach",value:function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=Tn.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),r&&this.dirtyWorldTransform(t,r),t.parentNode=null}}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return Nn(e),e.localTransform}},{key:"setLocalPosition",value:function(t,e){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;ks[0]=e[0],ks[1]=e[1],ks[2]=null!==(n=e[2])&&void 0!==n?n:0,mt(i.localPosition,ks)||(lt(i.localPosition,ks),r&&this.dirtyLocalTransform(t,i))}},{key:"translateLocal",value:function(t,e){"number"==typeof e&&(e=ut(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n,r,i,a,o,s,u,l,c,h,f,d,v,p=t.transformable;mt(e,ls)||(f=(o=(i=p.localRotation)[1])*(h=(r=e)[2])-(s=i[2])*(c=r[1]),d=s*(l=r[0])-(a=i[0])*h,v=a*c-o*l,(n=e)[0]=l+(u=i[3])*(f+=f)+o*(v+=v)-s*(d+=d),n[1]=c+u*d+s*f-a*v,n[2]=h+u*v+a*d-o*f,ht(p.localPosition,p.localPosition,e),this.dirtyLocalTransform(t,p))}},{key:"setLocalRotation",value:function(t,e,n,r,i){var a=5>=arguments.length||void 0===arguments[5]||arguments[5];"number"==typeof e&&(e=Ot(ps,e,n,r,i));var o=t.transformable;At(o.localRotation,e),a&&this.dirtyLocalTransform(t,o)}},{key:"rotateLocal",value:function(t,e){"number"==typeof e&&(e=ut(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;Pt(Ts,e[0],e[1],e[2]),Rt(n.localRotation,n.localRotation,Ts),this.dirtyLocalTransform(t,n)}},{key:"setLocalScale",value:function(t,e){var n,r=2>=arguments.length||void 0===arguments[2]||arguments[2],i=t.transformable;ct(ds,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),mt(ds,i.localScale)||(lt(i.localScale,ds),r&&this.dirtyLocalTransform(t,i))}},{key:"scaleLocal",value:function(t,e){var n,r,i,a,o=t.transformable;r=o.localScale,i=o.localScale,a=ct(ds,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1),r[0]=i[0]*a[0],r[1]=i[1]*a[1],r[2]=i[2]*a[2],this.dirtyLocalTransform(t,o)}},{key:"setLocalSkew",value:function(t,e,n){var r=3>=arguments.length||void 0===arguments[3]||arguments[3];"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(fs,e,n));var i,a,o=t.transformable;(i=o.localSkew)[0]=(a=e)[0],i[1]=a[1],r&&this.dirtyLocalTransform(t,o)}},{key:"setLocalEulerAngles",value:function(t,e){var n=4>=arguments.length||void 0===arguments[4]||arguments[4];"number"==typeof e&&(e=ut(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;Pt(r.localRotation,e[0],e[1],e[2]),n&&this.dirtyLocalTransform(t,r)}},{key:"setLocalTransform",value:function(t,e){var n=q(ys,e),r=Z(gs,e),i=X(ms,e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,cs,!1),this.setLocalPosition(t,ls,!1),this.setLocalEulerAngles(t,ls,void 0,void 0,!1),this.setLocalSkew(t,us,void 0,!1),this.dirtyLocalTransform(t,t.transformable)}},{key:"getPosition",value:function(t){var e=t.transformable;return q(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return Z(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return X(e.scaling,this.getWorldTransform(t,e))}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.internalUpdateTransform(t),e.worldTransform):e.worldTransform}},{key:"setPosition",value:function(t,e){var n,r=t.transformable;if(Es[0]=e[0],Es[1]=e[1],Es[2]=null!==(n=e[2])&&void 0!==n?n:0,!mt(this.getPosition(t),Es)){if(lt(r.position,Es),null!==t.parentNode&&t.parentNode.transformable)C(xs,t.parentNode.transformable.worldTransform),L(xs,xs),gt(r.localPosition,Es,xs);else lt(r.localPosition,Es);this.dirtyLocalTransform(t,r)}}},{key:"translate",value:function(t,e){"number"==typeof e&&(e=ct(ds,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),mt(e,ls)||(ht(ds,this.getPosition(t),e),this.setPosition(t,ds))}},{key:"setRotation",value:function(t,e,n,r,i){var a=t.transformable;if("number"==typeof e&&(e=Ct(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var o=this.getRotation(t.parentNode);At(ps,o),Nt(ps,ps),St(a.localRotation,ps,e),Lt(a.localRotation,a.localRotation),this.dirtyLocalTransform(t,a)}else this.setLocalRotation(t,e)}},{key:"rotate",value:function(t,e){"number"==typeof e&&(e=ut(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var r=ps;Pt(r,e[0],e[1],e[2]);var i=this.getRotation(t),a=this.getRotation(t.parentNode);At(Ms,a),Nt(Ms,Ms),St(r,Ms,r),St(n.localRotation,r,i),Lt(n.localRotation,n.localRotation),this.dirtyLocalTransform(t,n)}else this.rotateLocal(t,e)}},{key:"setOrigin",value:function(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var n=t.transformable;if(e[0]!==n.origin[0]||e[1]!==n.origin[1]||e[2]!==n.origin[2]){var r=n.origin;r[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtyLocalTransform(t,n)}}},{key:"setEulerAngles",value:function(t,e){"number"==typeof e&&(e=ut(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Pt(n.localRotation,e[0],e[1],e[2]);var r=this.getRotation(t.parentNode);At(bs,Nt(ps,r)),Rt(n.localRotation,n.localRotation,bs),this.dirtyLocalTransform(t,n)}else this.setLocalEulerAngles(t,e)}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry;return n.dirty&&Rs.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new Ut}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>2?arguments[2]:void 0,n=this.getGeometryBounds(t,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);if(!Ut.isEmpty(n)){var r=e||new Ut;return r.setFromTransformedAABB(n,this.getWorldTransform(t)),r}return null}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=n?r.renderBounds:r.bounds,a=this.getTransformedGeometryBounds(t,n,i);if(t.childNodes.forEach(function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=i||new Ut).update(r.center,r.halfExtents))}),a||(a=new Ut),n){var o=Ba(t);if(o){var s=o.parsedStyle.clipPath.getBounds(n);a?s&&(a=s.intersection(a)):a.update(s.center,s.halfExtents)}}return n?(r.renderBounds=a,r.renderBoundsDirty=!1):(r.bounds=a,r.boundsDirty=!1),a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=hs;t.parentNode.transformable&&(e=L(vs,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Ut.isEmpty(n)){var r=new Ut;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);Ut.isEmpty(r)||(n=new Ut).setFromTransformedAABB(r,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var a=b(n.getMin(),2),o=a[0],s=a[1],u=b(n.getMax(),2);return new Wt(o+((null==i?void 0:i.left)||0),s+((null==i?void 0:i.top)||0),u[0]-o,u[1]-s)}return new Wt((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"internalUpdateTransform",value:function(t){var e,n=null===(e=t.parentNode)||void 0===e?void 0:e.transformable;Nn(t.transformable),Pn(t.transformable,n)}},{key:"internalUpdateElement",value:function(t,e){var n,r,i,a,o,s,u=!0===(null===(n=t.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n||null===(n=n.getConfig())||void 0===n||null===(n=n.future)||void 0===n?void 0:n.experimentalAttributeUpdateOptimization),l=e[e.length-1],c=(null==l?void 0:l.transformDirty)||(null===(r=t.transformable)||void 0===r?void 0:r.localDirtyFlag);t.transformable&&((o=t.transformable).dirtyFlag||(o.dirtyFlag=c));(this.internalUpdateTransform(t),c)&&(null===(s=t.dirty)||void 0===s||s.call(t,!0,!0));var h=(null===(i=t.renderable)||void 0===i?void 0:i.boundsDirty)||(null===(a=t.renderable)||void 0===a?void 0:a.renderBoundsDirty);if((c||h)&&!1===(null==l?void 0:l.shapeUpdated)&&u)for(var f=e.length-1;f>=0;){var d,v,p=e[f];if(p.shapeUpdated)break;null===(d=(v=p.node).dirty)||void 0===d||d.call(v,!0,!0),p.shapeUpdated=!0,f-=1}return c}},{key:"syncHierarchy",value:function(t){for(var e,n,r=[t],i=t.parentNode?[{node:t.parentNode,transformDirty:(null===(e=t.parentNode.transformable)||void 0===e?void 0:e.localDirtyFlag)||(null===(n=t.parentNode.transformable)||void 0===n?void 0:n.dirtyFlag),shapeUpdated:!1}]:[];r.length>0;){for(var a=r.pop(),o=i[i.length-1];i.length>0&&a.parentNode!==o.node;)o=i.pop();var s=this.internalUpdateElement(a,i);if(a.childNodes.length>0){for(var u=a.childNodes.length-1;u>=0;u--)r.push(a.childNodes[u]);i.push({node:a,transformDirty:s,shapeUpdated:!1})}}}},{key:"dirtyLocalTransform",value:function(t,e){Ha(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtyWorldTransform(t,e))}},{key:"dirtyWorldTransform",value:function(t,e){this.dirtyWorldInternal(t,e),this.dirtyToRoot(t,!0)}},{key:"dirtyWorldInternal",value:function(t,e){var n,r=this,i=!0===(null===(n=t.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n||null===(n=n.getConfig())||void 0===n||null===(n=n.future)||void 0===n?void 0:n.experimentalAttributeUpdateOptimization);e.dirtyFlag||(e.dirtyFlag=!0,t.dirty(!0,!0),i||t.childNodes.forEach(function(t){r.dirtyWorldInternal(t,t.transformable)}))}},{key:"dirtyToRoot",value:function(t){for(var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t,i=!0===(null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalAttributeUpdateOptimization);r;){var a,o;if(null===(a=(o=r).dirty)||void 0===a||a.call(o,!0,!0),i)break;r=r.parentNode}n&&t.forEach(function(t){var e;null===(e=t.dirty)||void 0===e||e.call(t,!0,!0)}),this.informDependentDisplayObjects(t);var s=t.mutations||[],u=s.find(function(t){return"attributes"===t.type&&t._boundsChangeData});u?u._boundsChangeData={affectChildren:u._boundsChangeData.affectChildren||n}:s.push(u={type:"attributes",target:t,_boundsChangeData:{affectChildren:n}}),t.mutations=s}},{key:"dirtyFragment",value:function(t){var e,n,r=t.transformable;r&&(r.dirtyFlag=!0,r.localDirtyFlag=!0),null===(e=(n=t).dirty)||void 0===e||e.call(n,!0,!0);for(var i=t.childNodes.length,a=0;i>a;a++)this.dirtyFragment(t.childNodes[a])}},{key:"notifyMutationObservers",value:function(t){var e=new Set;if(t.getRoot().forEach(function(t){(t.mutations||[]).forEach(function(n){"attributes"===n.type&&n._boundsChangeData&&(n._boundsChangeData.affectChildren?t.forEach(function(t){var r=a({},n);r.target=t,e.add(r)}):e.add(n))}),t.mutations=void 0}),e.size>0){var n=new qo(ns.BOUNDS_CHANGED,{detail:Array.from(e)});t.dispatchEvent(n,!0,!0)}}},{key:"updateDisplayObjectDependency",value:function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var a=i[t].indexOf(r);i[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[t].push(r)}}},{key:"informDependentDisplayObjects",value:function(t){var e,n=this,r=this.displayObjectDependencyMap.get(t);if(r){var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig())||void 0===e||null===(e=e.future)||void 0===e?void 0:e.experimentalCancelEventPropagation;Object.keys(r).forEach(function(t){r[t].forEach(function(e){n.dirtyToRoot(e,!0),e.dispatchEvent(new rs(ns.ATTR_MODIFIED,e,n,n,t,rs.MODIFICATION,n,n),i,i),e.isCustomElement&&e.isConnected&&e.attributeChangedCallback&&e.attributeChangedCallback(t,n,n)})})}}}])}(),Ss=function(){return u(function t(e){if(o(this,t),0>=e)throw Error("LRU capacity must be a positive number.");this.capacity=e,this.cache=new Map},[{key:"get",value:function(t){if(this.cache.has(t)){var e=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,e),e}}},{key:"put",value:function(t,e){if(this.cache.has(t)&&this.cache.delete(t),this.cache.set(t,e),this.cache.size>this.capacity){var n=this.cache.keys().next().value;this.cache.delete(n)}}},{key:"len",value:function(){return this.cache.size}},{key:"clear",value:function(){this.cache.clear()}}])}(),Ns={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},Ps=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Cs=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),As=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Os=function(){return u(function t(e){var n=this;o(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!As.exec(e)&&!Cs.exec(t))},this.trimByKinsokuShorui=function(t){var e=p(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e},this.runtime=e,this.charWidthCache=new Ss(100)},[{key:"measureFont",value:function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var a=Ns.MetricsString+Ns.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(Ns.BaselineSymbol).width),u=Ns.HeightMultiplier*s;s=s*Ns.BaselineMultiplier|0,r.width=o,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,o,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,s);var l=i.getImageData(0,0,o||1,u||1).data,c=l.length,h=4*o,f=0,d=0,v=!1;for(f=0;s>f;++f){for(var p=0;h>p;p+=4)if(255!==l[d+p]){v=!0;break}if(v)break;d+=h}for(n.ascent=s-f,d=c-h,v=!1,f=u;f>s;--f){for(var y=0;h>y;y+=4)if(255!==l[d+y]){v=!0;break}if(v)break;d-=h}return n.descent=f-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value:function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,a=e.wordWrap,o=void 0!==a&&a,s=e.lineHeight,u=e.lineWidth,l=void 0===u?1:u,c=e.textBaseline,h=void 0===c?"alphabetic":c,f=e.textAlign,d=void 0===f?"start":f,v=e.letterSpacing,p=void 0===v?0:v,y=e.textPath,g=e.leading,m=void 0===g?0:g,k=Eo(e),E=this.measureFont(k,n);0===E.fontSize&&(E.fontSize=i,E.ascent=i);var x=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);x.font=k,e.isOverflowing=!1;var b=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),T=Array(b.length),M=0;if(!y){for(var w=0;b.length>w;w++){var S=x.measureText(b[w]).width+(b[w].length-1)*p;T[w]=S,M=Math.max(M,S)}var N=M+l,P=s||E.fontSize+l,C=Math.max(P,E.fontSize+l)+(b.length-1)*(P+m),A=0;return"middle"===h?A=-C/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?A=-C:"top"!==h&&"hanging"!==h||(A=0),{font:k,width:N,height:C,lines:b,lineWidths:T,lineHeight:P+=m,maxLineWidth:M,fontProperties:E,lineMetrics:T.map(function(t,e){var n=0;return"center"===d||"middle"===d?n-=t/2:"right"!==d&&"end"!==d||(n-=t),new Wt(n-l/2,A+e*P,t+l,P)})}}y.getTotalLength();for(var O=0;b.length>O;O++)x.measureText(b[O])}},{key:"wordWrap",value:function(t,e,n){var r=this,i=Array.from(t);if(0===i.length)return"";var a=this,o=e.wordWrapWidth,s=void 0===o?0:o,u=e.letterSpacing,l=void 0===u?0:u,c=e.maxLines,h=void 0===c?1/0:c,f=e.textOverflow,d=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),v=s+l,p="";"ellipsis"===f?p="...":f&&"clip"!==f&&(p=f);var y=[""],g=0,m=0,k=-1,E=Eo(e),x=this.charWidthCache.get(E);x||(x=new Ss(500),this.charWidthCache.put(E,x));var b=function(t){return r.getFromCache(t,l,x,d)},T=b(p);function M(t,e,n,r){for(;b(t)<r&&i.length-1>e&&!a.isNewline(i[e+1]);)t+=i[e+=1];for(;b(t)>r&&e>=n;)e-=1,t=t.slice(0,-1);return{lineTxt:t,txtLastCharIndex:e}}function w(t,e){if(T>0&&v>=T)if(y[t]){var n=M(y[t],e,k+1,v-T);y[t]=n.lineTxt+p}else y[t]=p}for(var S=0;i.length>S;S++){var N=i[S],P=i[S-1],C=i[S+1],A=b(N);if(this.isNewline(N)){if(g+1>=h){i.length-1>S&&w(g,S-1),e.isOverflowing=!0;break}k=S-1,m=0,y[g+=1]=""}else{if(A>v){w(g,S-1),e.isOverflowing=!0;break}if(m>0&&m+A>v){var O=M(y[g],S-1,k+1,v);if(O.txtLastCharIndex!==S-1){if(y[g]=O.lineTxt,O.txtLastCharIndex===i.length-1)break;P=i[(S=O.txtLastCharIndex+1)-1],C=i[S+1],A=b(N=i[S])}if(g+1>=h){w(g,S-1),e.isOverflowing=!0;break}if(k=S-1,m=0,y[g+=1]="",this.isBreakingSpace(N))continue;this.canBreakInLastChar(N)||(y=this.trimToBreakable(y),m=this.sumTextWidthByCache(y[g]||"",b)),this.shouldBreakByKinsokuShorui(N,C)&&(y=this.trimByKinsokuShorui(y),m+=b(P||""))}m+=A,y[g]+=N}}return y.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&Ns.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&Ns.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=p(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,a),e}},{key:"canBreakInLastChar",value:function(t){return!t||!Ps.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce(function(t,n){return t+e(n)},0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!Ps.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,r){var i=n.get(t);if("number"!=typeof i){var a=t.length*e,o=r.measureText(t);n.put(t,i=o.width+a)}return i}},{key:"clearCache",value:function(){this.fontMetricsCache={},this.charWidthCache.clear()}}])}(),Rs={},Ls=(as=new Fo,os=new Go,r(r(r(r(r(r(r(r(r(r(is={},l.FRAGMENT,null),l.CIRCLE,new Lo),l.ELLIPSE,new Io),l.RECT,as),l.IMAGE,as),l.GROUP,new Vo),l.LINE,new Do),l.TEXT,new Bo(Rs)),l.POLYLINE,os),l.POLYGON,os),r(r(r(is,l.PATH,new _o),l.HTML,new Uo),l.MESH,null)),Is=function(t){var e=new Ea,n=new Ta;return r(r(r(r(r(r(r(r(r(r(t={},An.PERCENTAGE,null),An.NUMBER,new Na),An.ANGLE,new ma),An.DEFINED_PATH,new ka),An.PAINT,e),An.COLOR,e),An.FILTER,new xa),An.LENGTH,n),An.LENGTH_PERCENTAGE,n),An.LENGTH_PERCENTAGE_12,new Ma),r(r(r(r(r(r(r(r(r(r(t,An.LENGTH_PERCENTAGE_14,new wa),An.COORDINATE,new Ta),An.OFFSET_DISTANCE,new Pa),An.OPACITY_VALUE,new Ca),An.PATH,new Aa),An.LIST_OF_POINTS,new Oa),An.SHADOW_BLUR,new Ra),An.TEXT,new La),An.TEXT_TRANSFORM,new Ia),An.TRANSFORM,new Ao),r(r(r(t,An.TRANSFORM_ORIGIN,new Oo),An.Z_INDEX,new Ro),An.MARKER,new Sa)}();Rs.CameraContribution=kn,Rs.AnimationTimeline=null,Rs.EasingFunction=null,Rs.offscreenCanvasCreator=new Ko,Rs.sceneGraphSelector=new es,Rs.sceneGraphService=new ws(Rs),Rs.textService=new Os(Rs),Rs.geometryUpdaterFactory=Ls,Rs.CSSPropertySyntaxFactory=Is,Rs.styleValueRegistry=new ya(Rs),Rs.layoutRegistry=null,Rs.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Rs.enableStyleSyntax=!0,Rs.enableSizeAttenuation=!1;var Ds=0;var _s=new rs(ns.INSERTED,null,"","","",0,"",""),Gs=new rs(ns.REMOVED,null,"","","",0,"",""),Fs=new qo(ns.DESTROY),Bs=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).entity=Ds++,t.transformable={dirtyFlag:!1,localDirtyFlag:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.cullable={strategy:bn.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return x(e,t),u(e,[{key:"dirty",value:function(){var t=arguments.length>1?arguments[1]:void 0;this.renderable.dirty=0>=arguments.length||void 0===arguments[0]||arguments[0],void 0!==t&&(this.renderable.boundsDirty=t,this.renderable.renderBoundsDirty=t,this.geometry.dirty=t)}},{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter(function(t){return""!==t})}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw Error(qt)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return Rs.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(Ha(this)||t.nodeName!==l.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(_s.relatedNode=this,t.dispatchEvent(_s)),t}},{key:"insertBefore",value:function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e,n,r=!0===(null===(e=this.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e||null===(e=e.getConfig().future)||void 0===e?void 0:e.experimentalCancelEventPropagation);return Gs.relatedNode=this,t.dispatchEvent(Gs,r,r),null!==(n=t.ownerDocument)&&void 0!==n&&n.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),Rs.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return Rs.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return Rs.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return Rs.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return Rs.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return Rs.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return Rs.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return Rs.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(Rs.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach(function(r){return r===e||!t(r)||(n=r,!1)}),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach(function(r){r!==e&&t(r)&&n.push(r)}),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];r.forEach(function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)})}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];var a=r[0],o=d(r).slice(1);this.parentNode.appendChild(a,e),(t=a).after.apply(t,p(o))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach(function(e){return t.appendChild(e)})}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach(function(e,n){return t.appendChild(e,n)})}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){var t,e=!0===(null===(t=this.ownerDocument)||void 0===t||null===(t=t.defaultView)||void 0===t||null===(t=t.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);this.destroyChildren(),this.dispatchEvent(Fs,e,e),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return Rs.sceneGraphService.getGeometryBounds(this,arguments.length>0&&void 0!==arguments[0]&&arguments[0])}},{key:"getTransformedGeometryBounds",value:function(){return Rs.sceneGraphService.getTransformedGeometryBounds(this,arguments.length>0&&void 0!==arguments[0]&&arguments[0])}},{key:"getBounds",value:function(){return Rs.sceneGraphService.getBounds(this)}},{key:"getRenderBounds",value:function(){return Rs.sceneGraphService.getBounds(this,!0)}},{key:"getLocalBounds",value:function(){return Rs.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return Rs.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw Error(qt)}},{key:"getAttributeNode",value:function(t){throw Error(qt)}},{key:"getAttributeNodeNS",value:function(t,e){throw Error(qt)}},{key:"hasAttributeNS",value:function(t,e){throw Error(qt)}},{key:"removeAttributeNS",value:function(t,e){throw Error(qt)}},{key:"removeAttributeNode",value:function(t){throw Error(qt)}},{key:"setAttributeNS",value:function(t,e,n){throw Error(qt)}},{key:"setAttributeNode",value:function(t){throw Error(qt)}},{key:"setAttributeNodeNS",value:function(t){throw Error(qt)}},{key:"toggleAttribute",value:function(t,e){throw Error(qt)}}])}(Zo);function Vs(t){return!(null==t||!t.nodeName)}var Us=Rs.globalThis.Proxy?Rs.globalThis.Proxy:function(){},zs=new rs(ns.ATTR_MODIFIED,null,null,null,null,rs.MODIFICATION,null,null),Hs=ot(),js=Mt(),Ys=function(t){function e(t){var n;return o(this,e),(n=k(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||l.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),Rs.enableStyleSyntax&&(n.style=new Us({setProperty:function(t,e){n.setAttribute(t,e)},getPropertyValue:function(t){return n.getAttribute(t)},removeProperty:function(t){n.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:n.getAttribute(e)},set:function(t,e,r){return n.setAttribute(e,r),!0}})),n}return x(e,t),u(e,[{key:"destroy",value:function(){xn(e,"destroy",this,3)([]),this.getAnimations().forEach(function(t){t.cancel()})}},{key:"cloneNode",value:function(t,e){var n=a({},this.attributes);for(var r in n){var i=n[r];Vs(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor(a(a({},this.config),{},{style:n}));return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach(function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}}),o}},{key:"initAttributes",value:function(){Rs.styleValueRegistry.processProperties(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{forceUpdateGeometry:!0}),this.dirty()}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=3>=arguments.length||void 0===arguments[3]||arguments[3];ue(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),xn(e,"setAttribute",this,3)([t,n]))}},{key:"setAttributes",value:function(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=r.skipDispatchAttrModifiedEvent,o=void 0!==i&&i;if(o||(e=a({},this.attributes),n=a({},this.parsedStyle)),Rs.styleValueRegistry.processProperties(this,t,r),this.dirty(),!o)for(var s in t)this.dispatchAttrModifiedEvent(s,e[s],t[s],n[s])}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.attributes[t],a=this.parsedStyle[t];Rs.styleValueRegistry.processProperties(this,r({},t,e),n),this.dirty(),this.dispatchAttrModifiedEvent(t,i,e,a)}},{key:"dispatchAttrModifiedEvent",value:function(t,e,n,r){var i,a=this.parsedStyle[t];if(this.isConnected)if(zs.relatedNode=this,zs.prevValue=e,zs.newValue=n,zs.attrName=t,zs.prevParsedValue=r,zs.newParsedValue=a,this.isMutationObserved)this.dispatchEvent(zs);else{var o,s=!0===(null===(o=this.ownerDocument.defaultView.getConfig().future)||void 0===o?void 0:o.experimentalCancelEventPropagation);zs.target=this,this.ownerDocument.defaultView.dispatchEvent(zs,!0,s)}(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(i=this.attributeChangedCallback)||void 0===i||i.call(this,t,e,n,r,a))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=b(t.getMin(),2),n=e[0],r=e[1],i=b(t.getMax(),2);return new Wt(n,r,i[0]-n,i[1]-r)}},{key:"setOrigin",value:function(t){return Rs.sceneGraphService.setOrigin(this,Ke(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getOrigin",value:function(){return Rs.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){return Rs.sceneGraphService.setPosition(this,Ke(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"setLocalPosition",value:function(t){return Rs.sceneGraphService.setLocalPosition(this,Ke(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translate",value:function(t){return Rs.sceneGraphService.translate(this,Ke(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"translateLocal",value:function(t){return Rs.sceneGraphService.translateLocal(this,Ke(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,!1)),this}},{key:"getPosition",value:function(){return Rs.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return Rs.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=Ke(t,e=e||t,n=n||t,!1)),Rs.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=Ke(t,e=e||t,n=n||t,!1)),Rs.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return Rs.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return Rs.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return en(b(an(Hs,Rs.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return en(b(an(Hs,Rs.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return Rs.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return Rs.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return $t(e)&&$t(n)?Rs.sceneGraphService.rotateLocal(this,0,0,t):Rs.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return $t(e)&&$t(n)?Rs.sceneGraphService.rotate(this,0,0,t):Rs.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return Rs.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return Rs.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return Rs.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return Rs.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return Rs.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return Rs.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return Rs.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return Rs.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return Rs.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){Rs.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,p(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,p(this.parentNode.children.map(function(t){return Number(t.style.zIndex)})))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(i)?(Object.keys(i).forEach(function(e){t.setAttribute(e,i[e])}),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=b(q(Hs,e),2),r=n[0],i=n[1],a=b(X(Hs,e),2),o=a[0],s=a[1],u=Z(js,e),l=b(an(Hs,u),3);return on(l[0]||l[2],r,i,o,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=b(sn(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,a)}},{key:"setLocalMatrix",value:function(t){var e=b(sn(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,a)}},{key:"show",value:function(){this.forEach(function(t){t.style.visibility="visible"})}},{key:"hide",value:function(){this.forEach(function(t){t.style.visibility="hidden"})}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"move",value:function(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(Bs);Ys.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var Ws=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),k(this,e,[a({type:l.CIRCLE},t)])}return x(e,t),u(e)}(Ys);function qs(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;a.length>r;r++)-1===e.indexOf(n=a[r])&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}Ws.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var Xs=["style"],Zs=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=qs(n,Xs);return o(this,e),(t=k(this,e,[a({style:r},i)])).isCustomElement=!0,t}return x(e,t),u(e)}(Ys);Zs.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var $s=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),k(this,e,[a({type:l.ELLIPSE},t)])}return x(e,t),u(e)}(Ys);$s.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var Ks=function(t){function e(){return o(this,e),k(this,e,[{type:l.FRAGMENT}])}return x(e,t),u(e)}(Ys);Ks.PARSED_STYLE_LIST=new Set(["class","className"]);var Qs=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),k(this,e,[a({type:l.GROUP},t)])}return x(e,t),u(e)}(Ys);Qs.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Js=["style"],tu=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=qs(n,Js);return o(this,e),(t=k(this,e,[a({type:l.HTML,style:r},i)])).cullable.enable=!1,t}return x(e,t),u(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=L(P(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Ut.isEmpty(e)){var n=new Ut;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(Ys);tu.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var eu=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),k(this,e,[a({type:l.IMAGE},t)])}return x(e,t),u(e)}(Ys);eu.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var nu=["style"],ru=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=qs(n,nu);o(this,e),(t=k(this,e,[a({type:l.LINE,style:a({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var s=t.parsedStyle,u=s.markerStart,c=s.markerEnd;return u&&Vs(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),c&&Vs(c)&&(t.markerEndAngle=c.getLocalEulerAngles(),t.appendChild(c)),t.transformMarker(!0),t.transformMarker(!1),t}return x(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Vs(r)&&(this.markerStartAngle=0,r.remove()),i&&Vs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Vs(r)&&(this.markerEndAngle=0,r.remove()),i&&Vs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,a=e.x2,o=e.y1,s=e.y2,u=t?e.markerStart:e.markerEnd;if(u&&Vs(u)){var l,c,h,f,d,v,p;t?(f=i,d=o,c=a-i,h=s-o,v=n||0,p=this.markerStartAngle):(f=a,d=s,c=i-a,h=o-s,v=r||0,p=this.markerEndAngle),u.setLocalEulerAngles(180*(l=Math.atan2(h,c))/Math.PI+p),u.setLocalPosition(f+Math.cos(l)*v,d+Math.sin(l)*v)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=bi(n.x1,n.y1,n.x2,n.y2,t),i=r.x,a=r.y,o=gt(ot(),ut(i,a,0),e?this.getWorldTransform():this.getLocalTransform());return new Yt(o[0],o[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return xi(t.x1,t.y1,t.x2,t.y2)}}])}(Ys);ru.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var iu=["style"],au=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=qs(n,iu);o(this,e),(t=k(this,e,[a({type:l.PATH,style:r,initialParsedStyle:{miterLimit:4,d:a({},Cn)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,u=s.markerStart,c=s.markerEnd,h=s.markerMid;return u&&Vs(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),h&&Vs(h)&&t.placeMarkerMid(h),c&&Vs(c)&&(t.markerEndAngle=c.getLocalEulerAngles(),t.appendChild(c)),t.transformMarker(!0),t.transformMarker(!1),t}return x(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Vs(r)&&(this.markerStartAngle=0,r.remove()),i&&Vs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Vs(r)&&(this.markerEndAngle=0,r.remove()),i&&Vs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=t?e.markerStart:e.markerEnd;if(i&&Vs(i)){var a,o,s,u,l,c,h;if(t){var f=b(this.getStartTangent(),2),d=f[0],v=f[1];u=v[0],l=v[1],o=d[0]-v[0],s=d[1]-v[1],c=n||0,h=this.markerStartAngle}else{var p=b(this.getEndTangent(),2),y=p[0],g=p[1];u=g[0],l=g[1],o=y[0]-g[0],s=y[1]-g[1],c=r||0,h=this.markerEndAngle}i.setLocalEulerAngles(180*(a=Math.atan2(s,o))/Math.PI+h),i.setLocalPosition(u+Math.cos(a)*c,l+Math.sin(a)*c)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(t){t.remove()}),t&&Vs(t))for(var n=1;e.length-1>n;n++){var r=b(e[n].currentPoint,2),i=r[0],a=r[1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(i,a)}}},{key:"getTotalLength",value:function(){return Ai(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e,n){return Ye(t,e,le(le({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,a=gt(ot(),ut(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new Yt(a[0],a[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*Ai(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,a=t[e-1].endTangent;n=[],a?(n.push([i[0]-a[0],i[1]-a[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}])}(Ys);au.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var ou=["style"],su=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=qs(n,ou);o(this,e),(t=k(this,e,[a({type:l.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,u=s.markerStart,c=s.markerEnd,h=s.markerMid;return u&&Vs(u)&&(t.markerStartAngle=u.getLocalEulerAngles(),t.appendChild(u)),h&&Vs(h)&&t.placeMarkerMid(h),c&&Vs(c)&&(t.markerEndAngle=c.getLocalEulerAngles(),t.appendChild(c)),t.transformMarker(!0),t.transformMarker(!1),t}return x(e,t),u(e,[{key:"attributeChangedCallback",value:function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Vs(r)&&(this.markerStartAngle=0,r.remove()),i&&Vs(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Vs(r)&&(this.markerEndAngle=0,r.remove()),i&&Vs(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=(e.points||{}).points,a=t?e.markerStart:e.markerEnd;if(a&&Vs(a)&&i){var o,s,u,l,c,h,f;if(l=i[0][0],c=i[0][1],t)s=i[1][0]-i[0][0],u=i[1][1]-i[0][1],h=n||0,f=this.markerStartAngle;else{var d=i.length;this.parsedStyle.isClosed?(s=i[d-1][0]-i[0][0],u=i[d-1][1]-i[0][1]):(l=i[d-1][0],c=i[d-1][1],s=i[d-2][0]-i[d-1][0],u=i[d-2][1]-i[d-1][1]),h=r||0,f=this.markerEndAngle}a.setLocalEulerAngles(180*(o=Math.atan2(u,s))/Math.PI+f),a.setLocalPosition(l+Math.cos(o)*h,c+Math.sin(o)*h)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach(function(t){t.remove()}),this.markerMidList=[],t&&Vs(t)&&e)for(var n=1;(this.parsedStyle.isClosed?e.length:e.length-1)>n;n++){var r=e[n][0],i=e[n][1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(r,i)}}}])}(Ys);su.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var uu=["style"],lu=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=qs(t,uu);return o(this,e),k(this,e,[a({type:l.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return x(e,t),u(e,[{key:"getTotalLength",value:function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=Si(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,a=[],o=0,s=this.getTotalLength();n.forEach(function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=xi(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(o+=i)/s,a.push(r))}),this.parsedStyle.points.segments=a}var u=0,l=0;this.parsedStyle.points.segments.forEach(function(e,n){e[0]>t||t>e[1]||(u=(t-e[0])/(e[1]-e[0]),l=n)});var c=bi(n[l][0],n[l][1],n[l+1][0],n[l+1][1],u),h=c.x,f=c.y,d=gt(ot(),ut(h,f,0),e?this.getWorldTransform():this.getLocalTransform());return new Yt(d[0],d[1])}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n}}])}(su);lu.PARSED_STYLE_LIST=new Set([].concat(p(su.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var cu=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return o(this,e),k(this,e,[a({type:l.RECT},t)])}return x(e,t),u(e)}(Ys);cu.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var hu=["style"],fu=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=qs(t,hu);return o(this,e),k(this,e,[a({type:l.TEXT,style:a({fill:"black"},n)},r)])}return x(e,t),u(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(Ys);fu.PARSED_STYLE_LIST=new Set([].concat(p(Ys.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textDecorationThickness","textPathSide","textPathStartOffset","metrics","dx","dy"]));var du=function(){return u(function t(){o(this,t),this.registry={},this.define(l.CIRCLE,Ws),this.define(l.ELLIPSE,$s),this.define(l.RECT,cu),this.define(l.IMAGE,eu),this.define(l.LINE,ru),this.define(l.GROUP,Qs),this.define(l.PATH,au),this.define(l.POLYGON,su),this.define(l.POLYLINE,lu),this.define(l.TEXT,fu),this.define(l.HTML,tu)},[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),vu={number:function(t){return new Sr(t)},percent:function(t){return new Sr(t,"%")},px:function(t){return new Sr(t,"px")},em:function(t){return new Sr(t,"em")},rem:function(t){return new Sr(t,"rem")},deg:function(t){return new Sr(t,"deg")},grad:function(t){return new Sr(t,"grad")},rad:function(t){return new Sr(t,"rad")},turn:function(t){return new Sr(t,"turn")},s:function(t){return new Sr(t,"s")},ms:function(t){return new Sr(t,"ms")},registerProperty:function(t){Rs.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){Rs.layoutRegistry.registerLayout(t,e)}},pu=function(t){function e(){var t;o(this,e),(t=k(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new Rs.AnimationTimeline(t)}catch(t){}var n={};return da.forEach(function(t){var e=t.d;t.inh&&e&&(n[t.n]=Zt(e)?e(l.GROUP):e)}),t.documentElement=new Qs({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return x(e,t),u(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value:function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?fu:Qs);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw Error(qt)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,r){var i=[],a=function(o){if(o.isInteractive()&&!o.isCulled()){var s=o.parsedStyle.pointerEvents;if(!["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===s?"auto":s)||o.isVisible()){var u=o.getTransformedGeometryBounds(!0);u&&!Ut.isEmpty(u)&&(t>u.max[0]||u.min[0]>n||e>u.max[1]||u.min[1]>r||i.push(o))}o.childNodes&&o.childNodes.forEach(function(t){t instanceof Ys&&a(t)})}};return a(this.documentElement),i.sort(function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder}),i}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return null;var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l&&l[0]||this.documentElement}},{key:"elementFromPoint",value:(r=fo(co().mark(function t(e,n){var r,i,a,o,s,u,l,c,h,f;return co().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=1;break}return t.abrupt("return",null);case 1:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,clientY:h},picked:[]});case 2:return t.abrupt("return",(f=t.sent.picked)&&f[0]||this.documentElement);case 3:case"end":return t.stop()}},t,this)})),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return[];var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l[l.length-1]!==this.documentElement&&l.push(this.documentElement),l}},{key:"elementsFromPoint",value:(n=fo(co().mark(function t(e,n){var r,i,a,o,s,u,l,c,h,f;return co().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=1;break}return t.abrupt("return",[]);case 1:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=2,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,clientY:h},picked:[]});case 2:return(f=t.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 3:case"end":return t.stop()}},t,this)})),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw Error(Xt)}},{key:"insertBefore",value:function(t,e){throw Error(Xt)}},{key:"removeChild",value:function(t,e){throw Error(Xt)}},{key:"replaceChild",value:function(t,e,n){throw Error(Xt)}},{key:"append",value:function(){throw Error(Xt)}},{key:"prepend",value:function(){throw Error(Xt)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,r}(Zo),yu=function(){function t(e){o(this,t),this.strategies=e}return u(t,[{key:"apply",value:function(e){var n=e.config,r=e.camera,i=e.renderingService,a=e.renderingContext,o=this.strategies;i.hooks.cull.tap(t.tag,function(t){if(t){var e,i=t.cullable;if(i.visible=0===o.length?a.unculledEntities.indexOf(t.entity)>-1:o.every(function(e){return e.isVisible(r,t)}),!t.isCulled()&&t.isVisible())return t;var s=!0===(null===(e=n.future)||void 0===e?void 0:e.experimentalCancelEventPropagation);return t.dispatchEvent(new qo(ns.CULLED),s,s),null}return t}),i.hooks.afterRender.tap(t.tag,function(t){t.cullable.visibilityPlaneMask=-1})}}])}();yu.tag="Culling";var gu=function(){function t(){var e=this;o(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new jo(null),this.rootWheelEvent=new Yo(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,a=Wo(e.normalizeToPointerEvent(t,r));try{for(a.s();!(i=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,i.value,r,t);e.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,a=Wo(e.normalizeToPointerEvent(t,i));try{for(a.s();!(r=a.n()).done;){var o=e.bootstrapEvent(e.rootPointerEvent,r.value,i,t);e.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return u(t,[{key:"apply",value:function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null}),r.hooks.pointerWheel.tap(t.tag,function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)}),r.hooks.pointerDown.tap(t.tag,function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,a=Wo(e);try{for(a.s();!(r=a.n()).done;){var o=n.bootstrapEvent(n.rootPointerEvent,r.value,i,t);n.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerUp.tap(t.tag,function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",o=Wo(n.normalizeToPointerEvent(t,i));try{for(o.s();!(e=o.n()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);s.type+=a,n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,function(t){var e,r=Wo(n.normalizeToPointerEvent(t,i));try{for(r.s();!(e=r.n()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);n.context.eventService.mapEvent(a)}}catch(t){r.e(t)}finally{r.f()}n.setCursor(n.context.eventService.cursor)})}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=i.y;t.viewport.x=i.x,t.viewport.y=a;var o=this.context.eventService.viewport2Canvas(t.viewport),s=o.y;return t.canvas.x=o.x,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Ua[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),a=i.y;return e.canvas.x=i.x,e.canvas.y=a,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=za.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];ue(i.button)&&(i.button=0),ue(i.buttons)&&(i.buttons=1),ue(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),ue(i.width)&&(i.width=i.radiusX||1),ue(i.height)&&(i.height=i.radiusY||1),ue(i.tiltX)&&(i.tiltX=0),ue(i.tiltY)&&(i.tiltY=0),ue(i.pointerType)&&(i.pointerType="touch"),ue(i.pointerId)&&(i.pointerId=i.identifier||0),ue(i.pressure)&&(i.pressure=i.force||.5),ue(i.twist)&&(i.twist=0),ue(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;ue(a.isPrimary)&&(a.isPrimary=!0),ue(a.width)&&(a.width=1),ue(a.height)&&(a.height=1),ue(a.tiltX)&&(a.tiltX=0),ue(a.tiltY)&&(a.tiltY=0),ue(a.pointerType)&&(a.pointerType="mouse"),ue(a.pointerId)&&(a.pointerId=1),ue(a.pressure)&&(a.pressure=.5),ue(a.twist)&&(a.twist=0),ue(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}])}();gu.tag="Event";var mu=[l.CIRCLE,l.ELLIPSE,l.IMAGE,l.RECT,l.LINE,l.POLYLINE,l.POLYGON,l.TEXT,l.PATH,l.HTML],ku=function(){return u(function t(){o(this,t)},[{key:"isVisible",value:function(t,e){var n,r=e.cullable;if(!r.enable)return!0;var i=e.getRenderBounds();if(Ut.isEmpty(i))return!1;var a=t.getFrustum(),o=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return r.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,i,o||Ht.INDETERMINATE,a.planes),r.visible=r.visibilityPlaneMask!==Ht.OUTSIDE,r.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,r){if(n===Ht.OUTSIDE||n===Ht.INSIDE)return n;for(var i=Ht.INSIDE,a=mu.indexOf(t.nodeName)>-1,o=0,s=r.length;s>o;++o){var u=1<<o;if(0!==(n&u)&&(!a||4!==o&&5!==o)){var l=r[o],c=l.normal,h=l.distance;if(0>pt(c,e.getPositiveFarPoint(r[o]))+h)return Ht.OUTSIDE;0>pt(c,e.getNegativeFarPoint(r[o]))+h&&(i|=u)}}return i}}])}(),Eu=function(){function t(){o(this,t),this.mutationRecords=[],this.isFirstTimeRendering=!0,this.isFirstTimeRenderingFinished=!1}return u(t,[{key:"apply",value:function(e){var n,r=this,i=e.renderingService,a=e.renderingContext.root.ownerDocument.defaultView,o=function(t){i.dirty()},s=function(t){var e,n=Wo(t.detail);try{for(n.s();!(e=n.n()).done;){r.mutationRecords.push(e.value)}}catch(t){n.e(t)}finally{n.f()}i.dirty()},u=function(t){Rs.enableSizeAttenuation&&Rs.styleValueRegistry.updateSizeAttenuation(t.target,a.getCamera().getZoom())},l=function(t){Rs.sceneGraphService.dirtyToRoot(t.target),i.dirty()};i.hooks.init.tap(t.tag,function(){a.addEventListener(ns.MOUNTED,u),a.addEventListener(ns.UNMOUNTED,l),a.addEventListener(ns.ATTR_MODIFIED,o),a.addEventListener(ns.BOUNDS_CHANGED,s)}),i.hooks.destroy.tap(t.tag,function(){a.removeEventListener(ns.MOUNTED,u),a.removeEventListener(ns.UNMOUNTED,l),a.removeEventListener(ns.ATTR_MODIFIED,o),a.removeEventListener(ns.BOUNDS_CHANGED,s),r.mutationRecords=[]});var c=null!==(n=Rs.globalThis.requestIdleCallback)&&void 0!==n?n:Ja.bind(Rs.globalThis);i.hooks.endFrame.tap(t.tag,function(){r.isFirstTimeRendering&&(r.isFirstTimeRendering=!1,c(function(){r.isFirstTimeRenderingFinished=!0})),r.mutationRecords=[]})}}])}();Eu.tag="Prepare";var xu,bu,Tu=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),Mu=new qo(ns.MOUNTED),wu=new qo(ns.UNMOUNTED),Su=new qo(Tu.BEFORE_RENDER),Nu=new qo(Tu.RERENDER),Pu=new qo(Tu.AFTER_RENDER),Cu=function(t){function e(t){var n;o(this,e),(n=k(this,e)).Element=Ys,n.inited=!1,n.context={};var r=t.container,i=t.canvas,s=t.renderer,u=t.width,l=t.height,c=t.background,h=t.cursor,f=t.supportsMutipleCanvasesInOneContainer,d=t.cleanUpOnDestroy,v=void 0===d||d,p=t.offscreenCanvas,y=t.requestAnimationFrame,g=t.cancelAnimationFrame,m=t.createImage,E=t.supportsTouchEvents,x=t.supportsPointerEvents,b=t.isTouchEvent,T=t.isMouseEvent,M=t.dblClickSpeed,w=u,S=l,N=t.devicePixelRatio||_a&&window.devicePixelRatio||1;return N=1>N?1:Math.ceil(N),i&&(w=u||function(t){var e=Va(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/N,S=l||function(t){var e=Va(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/N),n.customElements=new du,n.devicePixelRatio=N,n.requestAnimationFrame=null!=y?y:Ja.bind(Rs.globalThis),n.cancelAnimationFrame=null!=g?g:to.bind(Rs.globalThis),n.createImage=null!=m?m:function(){return new window.Image},n.supportsTouchEvents=null!=E?E:"ontouchstart"in Rs.globalThis,n.supportsPointerEvents=null!=x?x:!!Rs.globalThis.PointerEvent,n.isTouchEvent=null!=b?b:function(t){return n.supportsTouchEvents&&t instanceof Rs.globalThis.TouchEvent},n.isMouseEvent=null!=T?T:function(t){return!Rs.globalThis.MouseEvent||t instanceof Rs.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Rs.globalThis.PointerEvent))},p&&(Rs.offscreenCanvas=p),n.document=new pu,n.document.defaultView=n,f||function(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;Da.has(r)&&Da.get(r).destroy(n),Da.set(r,e)}}(r,n,v),n.initRenderingContext(a(a({},t),{},{width:w,height:S,background:null!=c?c:"transparent",cursor:null!=h?h:"default",cleanUpOnDestroy:v,devicePixelRatio:N,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,createImage:n.createImage,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:null!=M?M:200})),n.initDefaultCamera(w,S,s.clipSpaceNearZ),n.initRenderer(s,!0),n}return x(e,t),u(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,unculledEntities:[],renderListCurrentFrame:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var r=this,i=new Rs.CameraContribution;i.clipSpaceNearZ=n,i.setType(vn.EXPLORING,pn.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(gn.UPDATED,function(){r.context.renderingContext.renderReasons.add(Qo.CAMERA_CHANGED),Rs.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()}),this.context.camera=i}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach(function(e){Rs.styleValueRegistry.updateSizeAttenuation(e,t)})}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise(function(e){t.resolveReadyPromise=function(){e(t)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t,e=0>=arguments.length||void 0===arguments[0]||arguments[0],n=arguments.length>1?arguments[1]:void 0;cr.clearCache();var r=!0===(null===(t=this.getConfig().future)||void 0===t?void 0:t.experimentalCancelEventPropagation);n||this.dispatchEvent(new qo(Tu.BEFORE_DESTROY),r,r),this.frameId&&this.cancelAnimationFrame(this.frameId);var i=this.getRoot();e&&(this.unmountChildren(i),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),n||this.dispatchEvent(new qo(Tu.AFTER_DESTROY),r,r);var a=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};a(Mu),a(wu),a(Su),a(Nu),a(Pu),a(zs),a(_s),a(Gs),a(Fs),Rs.textService.clearCache()}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n,r=this.context.config;r.width=t,r.height=e,this.getContextService().resize(t,e);var i=this.context.camera,a=i.getProjectionMode();i.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),a===yn.ORTHOGRAPHIC?i.setOrthographic(t/-2,t/2,e/2,e/-2,i.getNear(),i.getFar()):i.setAspect(t/e);var o=!0===(null===(n=r.future)||void 0===n?void 0:n.experimentalCancelEventPropagation);this.dispatchEvent(new qo(Tu.RESIZE,{width:t,height:e}),o,o)}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e,n=this;t&&(Su.detail=t,Pu.detail=t);var r=!0===(null===(e=this.getConfig().future)||void 0===e?void 0:e.experimentalCancelEventPropagation);this.dispatchEvent(Su,r,r),this.getRenderingService().render(this,t,function(){n.dispatchEvent(Nu,r,r)}),this.dispatchEvent(Pu,r,r)}},{key:"run",value:function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new gu,new Eu,new yu([new ku])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(a(a({},Rs),this.context)),this.context.renderingService=new Jo(Rs,this.context),this.context.eventService=new $o(Rs,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then(function(){e.initRenderingService(t,n)}).catch(function(t){console.error(t)})}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init(function(){var i;e.inited=!0;var a=!0===(null===(i=e.getConfig().future)||void 0===i?void 0:i.experimentalCancelEventPropagation);n?r?e.requestAnimationFrame(function(){e.dispatchEvent(new qo(Tu.READY),a,a)}):e.dispatchEvent(new qo(Tu.READY),a,a):e.dispatchEvent(new qo(Tu.RENDERER_CHANGED),a,a),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach(function(t){var e,n;null===(e=(n=t).dirty)||void 0===e||e.call(n,!0,!0)}),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()})}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach(function(t){t.context=e.context,t.init(Rs)})}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),p((null==n?void 0:n.getPlugins())||[]).reverse().forEach(function(t){t.destroy(Rs)}),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;if(t.childNodes.forEach(function(t){e.unmountChildren(t)}),this.inited){if(t.isMutationObserved)t.dispatchEvent(wu);else{var n,r=!0===(null===(n=this.getConfig().future)||void 0===n?void 0:n.experimentalCancelEventPropagation);wu.target=t,this.dispatchEvent(wu,!0,r)}t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1}t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ha(t);if(this.inited){if(!t.isConnected&&(t.ownerDocument=this.document,t.isConnected=!0,!n))if(t.isMutationObserved)t.dispatchEvent(Mu);else{var r,i=!0===(null===(r=this.getConfig().future)||void 0===r?void 0:r.experimentalCancelEventPropagation);Mu.target=t,this.dispatchEvent(Mu,!0,i)}}else console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName);t.childNodes.forEach(function(t){e.mountChildren(t,n)}),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(Xo),Au=0,Ou=new WeakMap,Ru=function(){function t(e,n){o(this,t),this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=e,this.target=n}return u(t,null,[{key:"copy",value:function(e){var n=new t(e.type,e.target);return n.addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,n}}])}(),Lu=function(){return u(function t(e,n,r){o(this,t),this.transientObservedNodes=[],this.observer=e,this.target=n,this.options=r},[{key:"enqueue",value:function(t){var e=this.observer.records,n=e.length;if(e.length>0){var r=function(t,e){return t===e?t:bu&&function(t){return t===bu||t===xu}(t)?bu:null}(e[n-1],t);if(r)return void(e[n-1]=r)}else Fu.push(this.observer),Gu||(Gu=!0,void 0!==Rs.globalThis?Rs.globalThis.setTimeout(Bu):Bu());e[n]=t}},{key:"addListeners",value:function(){this.addListeners_(this.target)}},{key:"addListeners_",value:function(t){var e=this.options;e.attributes&&t.addEventListener(ns.ATTR_MODIFIED,this,!0),e.childList&&t.addEventListener(ns.INSERTED,this,!0),(e.childList||e.subtree)&&t.addEventListener(ns.REMOVED,this,!0)}},{key:"removeListeners",value:function(){this.removeListeners_(this.target)}},{key:"removeListeners_",value:function(t){var e=this.options;e.attributes&&t.removeEventListener(ns.ATTR_MODIFIED,this,!0),e.childList&&t.removeEventListener(ns.INSERTED,this,!0),(e.childList||e.subtree)&&t.removeEventListener(ns.REMOVED,this,!0)}},{key:"removeTransientObservers",value:function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach(function(t){this.removeListeners_(t);for(var e=Ou.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}},this)}},{key:"handleEvent",value:function(t){var e,n;switch(t.stopImmediatePropagation(),t.type){case ns.ATTR_MODIFIED:var r=t.attrName,i=t.relatedNode.namespaceURI;(e=Du("attributes",n=t.target)).attributeName=r,e.attributeNamespace=i;var a=t.attrChange===rs.ADDITION?null:t.prevValue;_u(n,function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(r)||-1!==t.attributeFilter.indexOf(i)))return t.attributeOldValue?function(t){return bu||((bu=Ru.copy(xu)).oldValue=t,bu)}(a):e});break;case ns.REMOVED:case ns.INSERTED:var o,s,u=t.target;t.type===ns.INSERTED?(o=[u],s=[]):(o=[],s=[u]);var l=u.previousSibling,c=u.nextSibling;(e=Du("childList",n=t.relatedNode)).addedNodes=o,e.removedNodes=s,e.previousSibling=l,e.nextSibling=c,_u(n,function(t){if(t.childList)return e})}xu=bu=void 0}}])}(),Iu=function(){return u(function t(e){o(this,t),this.nodes=[],this.records=[],this.uid=Au++,this.callback=e},[{key:"observe",value:function(t,e){if(!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,r=Ou.get(t);r||Ou.set(t,r=[]);for(var i=0;r.length>i;i++)if(r[i].observer===this){(n=r[i]).removeListeners(),n.options=e;break}n||(n=new Lu(this,t,e),r.push(n),this.nodes.push(t)),n.addListeners()}},{key:"disconnect",value:function(){var t=this;this.nodes.forEach(function(e){for(var n=Ou.get(e),r=0;n.length>r;r++){var i=n[r];if(i.observer===t){i.removeListeners(),n.splice(r,1);break}}},this),this.records=[]}},{key:"takeRecords",value:function(){var t=this.records;return this.records=[],t}}])}();function Du(t,e){return xu=new Ru(t,e)}function _u(t,e){for(var n=t;n;n=n.parentNode){var r=Ou.get(n);if(r)for(var i=0;r.length>i;i++){var a=r[i],o=a.options;if(n===t||o.subtree){var s=e(o);s&&a.enqueue(s)}}}}var Gu=!1,Fu=[];function Bu(){Gu=!1;var t=Fu;Fu=[],t.sort(function(t,e){return t.uid-e.uid});var e=!1;t.forEach(function(t){var n=t.takeRecords();!function(t){t.nodes.forEach(function(e){var n=Ou.get(e);n&&n.forEach(function(e){e.observer===t&&e.removeTransientObservers()})})}(t),n.length&&(t.callback(n,t),e=!0)}),e&&Bu()}var Vu=function(){return u(function t(){o(this,t),this.cacheStore=new Map},[{key:"onRefAdded",value:function(t){}},{key:"has",value:function(t){return this.cacheStore.has(t)}},{key:"put",value:function(t,e,n){return!this.cacheStore.has(t)&&(this.cacheStore.set(t,{value:e,counter:new Set([n.entity])}),this.onRefAdded(n),!0)}},{key:"get",value:function(t,e){var n=this.cacheStore.get(t);return n?(n.counter.has(e.entity)||(n.counter.add(e.entity),this.onRefAdded(e)),n.value):null}},{key:"update",value:function(t,e,n){var r=this.cacheStore.get(t);return!!r&&(r.value=a(a({},r.value),e),r.counter.has(n.entity)||(r.counter.add(n.entity),this.onRefAdded(n)),!0)}},{key:"release",value:function(t,e){var n=this.cacheStore.get(t);return!!n&&(n.counter.delete(e.entity),n.counter.size>0||this.cacheStore.delete(t),!0)}},{key:"releaseRef",value:function(t){var e=this;Array.from(this.cacheStore.keys()).forEach(function(n){e.release(n,t)})}},{key:"getSize",value:function(){return this.cacheStore.size}},{key:"clear",value:function(){this.cacheStore.clear()}}])}(),Uu=[],zu=[],Hu=function(){function t(){o(this,t)}return u(t,null,[{key:"stop",value:function(){t.rafId&&((arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api).cancelAnimationFrame(t.rafId),t.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;(Uu.length>0||zu.length>0)&&(zu.forEach(function(t){return t()}),zu=Uu.splice(0,t.TASK_NUM_PER_FRAME),t.rafId=e.requestAnimationFrame(function(){t.executeTask(e)}))}},{key:"sliceImage",value:function(e,n,r,i){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.api,s=e.naturalWidth||e.width,u=e.naturalHeight||e.height,l=n-a,c=r-a,h=Math.ceil(s/l),f=Math.ceil(u/c),d={tileSize:[n,r],gridSize:[f,h],tiles:Array(f).fill(null).map(function(){return Array(h).fill(null)})},v=function(t){for(var a=function(a){Uu.push(function(){var h=a*l,f=t*c,v=[Math.min(n,s-h),Math.min(r,u-f)],p=v[0],y=v[1],g=o.createCanvas();g.width=n,g.height=r,g.getContext("2d").drawImage(e,h,f,p,y,0,0,p,y),d.tiles[t][a]={x:h,y:f,tileX:a,tileY:t,data:g},i()})},f=0;h>f;f++)a(f)},p=0;f>p;p++)v(p);return t.stop(),t.executeTask(),d}}])}();Hu.TASK_NUM_PER_FRAME=10;var ju=new Vu;ju.onRefAdded=function(t){var e=this;t.addEventListener(ns.DESTROY,function(){e.releaseRef(t)},{once:!0})};var Yu=function(){return u(function t(e,n){o(this,t),this.gradientCache={},this.patternCache={},this.context=e,this.runtime=n},[{key:"getImageSync",value:function(t,e,n){var r=ne(t)?t:t.src;if(ju.has(r)){var i=ju.get(r,e);if(i.img.complete)return null==n||n(i),i}return this.getOrCreateImage(t,e).then(function(t){null==n||n(t)}).catch(function(t){console.error(t)}),null}},{key:"getOrCreateImage",value:function(t,e){var n=this,r=ne(t)?t:t.src;if(!ne(t)&&!ju.has(r)){var i={img:t,size:[t.naturalWidth||t.width,t.naturalHeight||t.height],tileSize:Wu(t)};ju.put(r,i,e)}if(ju.has(r)){var a=ju.get(r,e);return a.img.complete?Promise.resolve(a):new Promise(function(t,e){a.img.addEventListener("load",function(){a.size=[a.img.naturalWidth||a.img.width,a.img.naturalHeight||a.img.height],a.tileSize=Wu(a.img),t(a)}),a.img.addEventListener("error",function(t){e(t)})})}return new Promise(function(t,i){var a=n.context.config.createImage();if(a){var o={img:a,size:[0,0],tileSize:Wu(a)};ju.put(r,o,e),a.onload=function(){o.size=[a.naturalWidth||a.width,a.naturalHeight||a.height],o.tileSize=Wu(o.img),t(o)},a.onerror=function(t){i(t)},a.crossOrigin="Anonymous",a.src=r}})}},{key:"createDownSampledImage",value:(e=fo(co().mark(function t(e,n){var r,i,o,s,u,l,c,h,f,d,v,p,y,g;return co().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,n);case 1:if(void 0===(r=t.sent).downSamplingRate){t.next=2;break}return t.abrupt("return",r);case 2:if(u=void 0===(s=(o="boolean"==typeof(i=this.context.config.enableLargeImageOptimization)?{}:i).maxDownSampledImageSize)?2048:s,c=void 0===(l=o.downSamplingRateThreshold)?.5:l,h=this.runtime.globalThis.createImageBitmap,f=b(r.size,2),p=r.img,y=Math.min((u+u)/((d=f[0])+(v=f[1])),Math.max(.01,Math.min(c,.5))),g=a(a({},r),{},{downSamplingRate:y}),ju.update(r.img.src,g,n),!h){t.next=7;break}return t.prev=3,t.next=4,h(r.img,{resizeWidth:d*y,resizeHeight:v*y});case 4:p=t.sent,t.next=6;break;case 5:t.prev=5,t.catch(3),y=1;case 6:t.next=8;break;case 7:y=1;case 8:return g=a(a({},this.getImageSync(e,n)),{},{downSampled:p,downSamplingRate:y}),ju.update(r.img.src,g,n),t.abrupt("return",g);case 9:case"end":return t.stop()}},t,this,[[3,5]])})),function(t,n){return e.apply(this,arguments)})},{key:"createImageTiles",value:(t=fo(co().mark(function t(e,n,r,i){var o,s,u;return co().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=1,this.getOrCreateImage(e,i);case 1:return o=t.sent,Hu.api={requestAnimationFrame:(s=i.ownerDocument.defaultView).requestAnimationFrame,cancelAnimationFrame:s.cancelAnimationFrame,createCanvas:function(){return Ko.createCanvas()}},u=a(a({},o),Hu.sliceImage(o.img,o.tileSize[0],o.tileSize[0],r)),ju.update(o.img.src,u,i),t.abrupt("return",u);case 2:case"end":return t.stop()}},t,this)})),function(e,n,r,i){return t.apply(this,arguments)})},{key:"releaseImage",value:function(t,e){ju.release(ne(t)?t:t.src,e)}},{key:"releaseImageRef",value:function(t){ju.releaseRef(t)}},{key:"getOrCreatePatternSync",value:function(t,e,n,r,i,a,o){var s=this.generatePatternKey(e);if(s&&this.patternCache[s])return this.patternCache[s];var u,l=e.image,c=e.repetition,h=e.transform,f=!1;if(ne(l)){var d=this.getImageSync(l,t,o);u=null==d?void 0:d.img}else r?(u=r,f=!0):u=l;var v,p=u&&n.createPattern(u,c);p&&(v=h?Co(Ji(h),new Ys({})):O(P()),f&&G(v,v,[1/i,1/i,1]),p.setTransform({a:v[0],b:v[1],c:v[4],d:v[5],e:v[12]+a[0],f:v[13]+a[1]}));return s&&p&&(this.patternCache[s]=p),p}},{key:"getOrCreateGradient",value:function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,a=t.min,o=t.width,s=t.height,u=t.cx,l=t.cy,c=t.size;if(this.gradientCache[n])return this.gradientCache[n];var h=null;if(r===br.LinearGradient){var f=Fr(a,o,s,t.angle);h=e.createLinearGradient(f.x1,f.y1,f.x2,f.y2)}else if(r===br.RadialGradient){var d=Br(a,o,s,u,l,c),v=d.x,p=d.y;h=e.createRadialGradient(v,p,0,v,p,d.r)}return h&&(i.forEach(function(t){var e,n=t.offset;n.unit===hr.kPercentage&&(null===(e=h)||void 0===e||e.addColorStop(n.value/100,""+t.color))}),this.gradientCache[n]=h),this.gradientCache[n]}},{key:"generateGradientKey",value:function(t){var e=t.min,n=t.width,r=t.height,i=t.steps,a=t.angle,o=t.cx,s=t.cy,u=t.size;return"gradient-".concat(t.type,"-").concat((null==a?void 0:""+a)||0,"-").concat((null==o?void 0:""+o)||0,"-").concat((null==s?void 0:""+s)||0,"-").concat((null==u?void 0:""+u)||0,"-").concat(e[0],"-").concat(e[1],"-").concat(n,"-").concat(r,"-").concat(i.map(function(t){var e=t.color;return"".concat(t.offset).concat(e)}).join("-"))}},{key:"generatePatternKey",value:function(t){var e=t.image,n=t.repetition;return ne(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0}}]);var t,e}();function Wu(t){if(!t.complete)return[0,0];var e=t.naturalWidth||t.width,n=t.naturalHeight||t.height,r=256;return[256,512].forEach(function(t){1e3>Math.ceil(n/t)*Math.ceil(e/t)&&(r=t)}),[r,r]}Yu.isSupportTile=!!Ko.createCanvas();var qu=function(){function t(){o(this,t)}return u(t,[{key:"apply",value:function(e){var n=e.renderingService,r=e.imagePool,i=e.renderingContext.root.ownerDocument.defaultView,a=function(t,e,n){var r=t.parsedStyle,i=r.width,a=r.height;i&&!a?t.setAttribute("height",n/e*i):!i&&a&&t.setAttribute("width",e/n*a)},o=function(t){var e=t.target,i=e.attributes;if(e.nodeName===l.IMAGE){var o=i.keepAspectRatio;r.getImageSync(i.src,e,function(t){var r=t.img;o&&a(e,r.width,r.height),e.dirty(),n.dirty()})}},s=function(t){var e=t.target,i=t.prevValue,o=t.newValue;e.nodeName===l.IMAGE&&"src"===t.attrName&&(i!==o&&r.releaseImage(i,e),ne(o)&&r.getOrCreateImage(o,e).then(function(t){var r=t.img;e.attributes.keepAspectRatio&&a(e,r.width,r.height),e.dirty(),n.dirty()}).catch(function(){}))};n.hooks.init.tap(t.tag,function(){i.addEventListener(ns.MOUNTED,o),i.addEventListener(ns.ATTR_MODIFIED,s)}),n.hooks.destroy.tap(t.tag,function(){i.removeEventListener(ns.MOUNTED,o),i.removeEventListener(ns.ATTR_MODIFIED,s)})}}])}();qu.tag="LoadImage";var Xu=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).name="image-loader",t}return x(e,t),u(e,[{key:"init",value:function(t){this.context.imagePool=new Yu(this.context,t),this.addRenderingPlugin(new qu)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(h),Zu=Object.freeze({__proto__:null,ImagePool:Yu,Plugin:Xu}),$u=function(){function t(){o(this,t),this.displayObjectHTMLElementMap=new WeakMap}return u(t,[{key:"joinTransformMatrix",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+e[0],t[13]+e[1]].join(","),")")}},{key:"apply",value:function(e,n){var r=this,i=e.camera,a=e.renderingContext,o=e.renderingService;this.context=e;var s=a.root.ownerDocument.defaultView,u=s.context.eventService.nativeHTMLMap,c=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())},h=function(t){var e=t.target;if(e.nodeName===l.HTML){r.$camera||(r.$camera=r.createCamera(i));var n=r.getOrCreateEl(e);r.$camera.appendChild(n),Object.keys(e.attributes).forEach(function(t){r.updateAttribute(t,e)}),c(e,n),u.set(n,e)}},f=function(t){var e=t.target;if(e.nodeName===l.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),u.delete(n))}},d=function(t){var e=t.target;e.nodeName===l.HTML&&r.updateAttribute(t.attrName,e)},v=function(t){for(var e=t.detail,n=0;e.length>n;n++){var i=e[n].target;(i.nodeName===l.FRAGMENT?i.childNodes:[i]).forEach(function(t){if(t.nodeName===l.HTML){var e=r.getOrCreateEl(t);c(t,e)}})}},p=function(){if(r.$camera){var t=r.context.config,e=t.height;r.$camera.parentElement.style.width="".concat(t.width||0,"px"),r.$camera.parentElement.style.height="".concat(e||0,"px")}};o.hooks.init.tap(t.tag,function(){s.addEventListener(Tu.RESIZE,p),s.addEventListener(ns.MOUNTED,h),s.addEventListener(ns.UNMOUNTED,f),s.addEventListener(ns.ATTR_MODIFIED,d),s.addEventListener(ns.BOUNDS_CHANGED,v)}),o.hooks.endFrame.tap(t.tag,function(){r.$camera&&a.renderReasons.has(Qo.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))}),o.hooks.destroy.tap(t.tag,function(){r.$camera&&r.$camera.remove(),s.removeEventListener(Tu.RESIZE,p),s.removeEventListener(ns.MOUNTED,h),s.removeEventListener(ns.UNMOUNTED,f),s.removeEventListener(ns.ATTR_MODIFIED,d),s.removeEventListener(ns.BOUNDS_CHANGED,v)})}},{key:"createCamera",value:function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,a=this.context.contextService.getDomElement(),o=a.parentNode;if(o){var s="g-canvas-camera",u=o.querySelector("#".concat(s));if(!u){var l=(n||document).createElement("div");l.style.overflow="hidden",l.style.pointerEvents="none",l.style.position="absolute",l.style.left="0px",l.style.top="0px",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px");var c=(n||document).createElement("div");u=c,c.id=s,c.style.position="absolute",c.style.left="".concat(a.offsetLeft||0,"px"),c.style.top="".concat(a.offsetTop||0,"px"),c.style.transformOrigin="left top",c.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),c.style.pointerEvents="none",c.style.width="100%",c.style.height="100%",l.appendChild(c),o.appendChild(l)}return u}return null}},{key:"getOrCreateEl",value:function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),n}},{key:"updateAttribute",value:function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;ne(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"x":n.style.left="".concat(e.parsedStyle.x,"px");break;case"y":n.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].buildCSSText(null,null,"")," ").concat(i[1].buildCSSText(null,null,""));break;case"width":var a=e.parsedStyle.width;n.style.width=ie(a)?"".concat(a,"px"):""+a;break;case"height":var o=e.parsedStyle.height;n.style.height=ie(o)?"".concat(o,"px"):""+o;break;case"zIndex":n.style["z-index"]="".concat(e.parsedStyle.zIndex);break;case"visibility":n.style.visibility=e.parsedStyle.visibility;break;case"pointerEvents":var s=e.parsedStyle.pointerEvents;n.style.pointerEvents=void 0===s?"auto":s;break;case"opacity":n.style.opacity="".concat(e.parsedStyle.opacity);break;case"fill":var u=e.parsedStyle.fill,l="";Zr(u)?l=u.isNone?"transparent":e.getAttribute("fill"):Array.isArray(u)?l=e.getAttribute("fill"):Xr(u),n.style.background=l;break;case"stroke":var c=e.parsedStyle.stroke,h="";Zr(c)?h=c.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(c)?h=e.getAttribute("stroke"):Xr(c),n.style["border-color"]=h,n.style["border-style"]="solid";break;case"lineWidth":n.style["border-width"]="".concat(e.parsedStyle.lineWidth||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":n.style.filter=e.style.filter;break;default:$t(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}}}])}();$u.tag="HTMLRendering";var Ku=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).name="html-renderer",t}return x(e,t),u(e,[{key:"init",value:function(){this.addRenderingPlugin(new $u)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(h),Qu=Object.freeze({__proto__:null,Plugin:Ku}),Ju=function(){function t(){o(this,t)}return u(t,[{key:"apply",value:function(e,n){var r=this,i=e.renderingService,a=e.renderingContext,o=e.config;this.context=e;var s=a.root.ownerDocument.defaultView,u=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},c=function(t){i.hooks.pointerDown.call(t)},h=function(t){i.hooks.pointerOver.call(t)},f=function(t){i.hooks.pointerOut.call(t)},d=function(t){i.hooks.pointerCancel.call(t)},v=function(t){i.hooks.pointerWheel.call(t)},p=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",u,!0),t.addEventListener("pointerdown",c,!0),t.addEventListener("pointerleave",f,!0),t.addEventListener("pointerover",h,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",u,!0),t.addEventListener("mousedown",c,!0),t.addEventListener("mouseout",f,!0),t.addEventListener("mouseover",h,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",c,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",u,!0),t.addEventListener("touchcancel",d,!0)}(t),o.useNativeClickEvent&&t.addEventListener("click",p,!0),t.addEventListener("wheel",v,{passive:!0,capture:!0})}),i.hooks.destroy.tap(t.tag,function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",u,!0),t.removeEventListener("pointerdown",c,!0),t.removeEventListener("pointerleave",f,!0),t.removeEventListener("pointerover",h,!0),n.globalThis.removeEventListener("pointerup",l,!0),n.globalThis.removeEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",u,!0),t.removeEventListener("mousedown",c,!0),t.removeEventListener("mouseout",f,!0),t.removeEventListener("mouseover",h,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",c,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",u,!0),t.removeEventListener("touchcancel",d,!0)}(t),o.useNativeClickEvent&&t.removeEventListener("click",p,!0),t.removeEventListener("wheel",v,!0)})}}])}();Ju.tag="DOMInteraction";var tl=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).name="dom-interaction",t}return x(e,t),u(e,[{key:"init",value:function(){this.addRenderingPlugin(new Ju)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(h),el=Object.freeze({__proto__:null,Plugin:tl}),nl=function(){function t(){o(this,t)}return u(t,[{key:"apply",value:function(e){var n=e.renderingService,r=e.config,i=e.contextService.getDomElement(),a=function(t){n.hooks.pointerDown.call(t)},o=function(t){n.hooks.pointerUp.call(t)},s=function(t){n.hooks.pointerMove.call(t)},u=function(t){n.hooks.pointerOver.call(t)},l=function(t){n.hooks.pointerOut.call(t)},c=function(t){n.hooks.click.call(t)},h=function(t){n.hooks.pointerCancel.call(t)};n.hooks.init.tap(t.tag,function(){i.addEventListener("touchstart",a,!0),i.addEventListener("touchend",o,!0),i.addEventListener("touchmove",s,!0),i.addEventListener("touchcancel",h,!0),i.addEventListener("mouseout",l,!0),i.addEventListener("mouseover",u,!0),r.useNativeClickEvent&&i.addEventListener("click",c,!0)}),n.hooks.destroy.tap(t.tag,function(){i.removeEventListener("touchstart",a,!0),i.removeEventListener("touchend",o,!0),i.removeEventListener("touchmove",s,!0),i.removeEventListener("touchcancel",h,!0),i.removeEventListener("mouseout",l,!0),i.removeEventListener("mouseover",u,!0),r.useNativeClickEvent&&i.removeEventListener("click",c,!0)})}}])}();nl.tag="MobileInteraction";var rl=function(t){function e(){var t;o(this,e);for(var n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=k(this,e,[].concat(r))).name="mobile-interaction",t}return x(e,t),u(e,[{key:"init",value:function(){this.addRenderingPlugin(new nl)}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}}])}(h),il=Object.freeze({__proto__:null,Plugin:rl});t.AABB=Ut,t.AbstractRenderer=f,t.AbstractRendererPlugin=h,t.BUILT_IN_PROPERTIES=da,t.CSS=vu,t.CSSGradientValue=Tr,t.CSSKeywordValue=Mr,t.CSSRGB=Cr,t.CSSStyleValue=Er,t.CSSUnitValue=Sr,t.Camera=kn,t.CameraEvent=gn,t.CameraProjectionMode=yn,t.CameraTrackingMode=pn,t.CameraType=vn,t.Canvas=Cu,t.CanvasEvent=Tu,t.Circle=Ws,t.CircleUpdater=Lo,t.ClipSpaceNearZ=c,t.CustomElement=Zs,t.CustomElementRegistry=du,t.CustomEvent=qo,t.DefaultSceneGraphSelector=es,t.DefaultSceneGraphService=ws,t.DisplayObject=Ys,t.Document=pu,t.DomInteraction=el,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=qt,t.Element=Bs,t.ElementEvent=ns,t.Ellipse=$s,t.EllipseUpdater=Io,t.EventService=$o,t.EventTarget=Xo,t.FederatedEvent=zo,t.FederatedMouseEvent=Ho,t.FederatedPointerEvent=jo,t.FederatedWheelEvent=Yo,t.Fragment=Ks,t.Frustum=jt,t.GradientType=br,t.Group=Qs,t.GroupUpdater=Vo,t.HTML=tu,t.HTMLRenderer=Qu,t.HTMLUpdater=Uo,t.Image=eu,t.ImageLoader=Zu,t.ImagePool=Yu,t.Line=ru,t.LineUpdater=Do,t.Mask=Ht,t.MobileInteraction=il,t.MutationEvent=rs,t.MutationObserver=Iu,t.MutationRecord=Ru,t.Node=Zo,t.OffscreenCanvasCreator=Ko,t.Path=au,t.PathUpdater=_o,t.Plane=zt,t.Point=Yt,t.Polygon=su,t.Polyline=lu,t.PolylineUpdater=Go,t.PropertySyntax=An,t.Rect=cu,t.RectUpdater=Fo,t.Rectangle=Wt,t.Registration=Lu,t.RenderReason=Qo,t.RenderingService=Jo,t.Shape=l,t.SortReason=Tn,t.Strategy=bn,t.Text=fu,t.TextService=Os,t.TextUpdater=Bo,t.UnitType=hr,t.attrModifiedEvent=zs,t.computeLinearGradient=Fr,t.computeRadialGradient=Br,t.convertToPath=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),n=[];switch(t.nodeName){case l.LINE:var r=t.parsedStyle,i=r.x1,a=r.y1,o=r.x2,s=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(void 0===i?0:i,void 0===a?0:a,void 0===o?0:o,void 0===s?0:s);break;case l.CIRCLE:var u=t.parsedStyle,c=u.r,h=void 0===c?0:c,f=u.cx,d=u.cy;n=Ui(h,h,void 0===f?0:f,void 0===d?0:d);break;case l.ELLIPSE:var v=t.parsedStyle,y=v.rx,g=v.ry,m=v.cx,k=v.cy;n=Ui(void 0===y?0:y,void 0===g?0:g,void 0===m?0:m,void 0===k?0:k);break;case l.POLYLINE:case l.POLYGON:n=function(t,e){var n=t.map(function(t,e){return[0===e?"M":"L",t[0],t[1]]});return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===l.POLYGON);break;case l.RECT:var E=t.parsedStyle,x=E.width,T=void 0===x?0:x,M=E.height,w=void 0===M?0:M,S=E.x,N=void 0===S?0:S,P=E.y,C=void 0===P?0:P,A=E.radius,O=A&&A.some(function(t){return 0!==t});n=function(t,e,n,r,i){if(i){var a=b(i,4),o=a[0],s=a[1],u=a[2],l=a[3],c=t>0?1:-1,h=e>0?1:-1,f=c+h!==0?1:0;return[["M",c*o+n,r],["L",t-c*s+n,r],s?["A",s,s,0,0,f,t+n,h*s+r]:null,["L",t+n,e-h*u+r],u?["A",u,u,0,0,f,t+n-c*u,e+r]:null,["L",n+c*l,e+r],l?["A",l,l,0,0,f,n,e+r-h*l]:null,["L",n,h*o+r],o?["A",o,o,0,0,f,c*o+n,r]:null,["Z"]].filter(function(t){return t})}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(T,w,N,C,O&&A.map(function(t){return re(t,0,Math.min(Math.abs(T)/2,Math.abs(w)/2))}));break;case l.PATH:n=p(t.parsedStyle.d.absolutePath)}if(n.length)return function(t,e,n){return t.reduce(function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=ut(e[1],e[2],0);n&>(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=ut(e[1],e[2],0),o=ut(e[3],e[4],0),s=ut(e[5],e[6],0);n&&(gt(a,a,n),gt(o,o,n),gt(s,s,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(o[0],",").concat(o[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var u=ut(e[6],e[7],0);n&>(u,u,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(u[0],",").concat(u[1])}else if("Q"===e[0]){var l=ut(e[1],e[2],0),c=ut(e[3],e[4],0);n&&(gt(l,l,n),gt(c,c,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r},"")}(n,0,e)},t.createVec3=Ke,t.decompose=sn,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter(function(t){return void 0!==b(t,2)[1]}))},t.deg2rad=Je,t.deg2turn=function(t){return t/360},t.destroyEvent=Fs,t.findClosestClipPathTarget=Ba,t.fromRotationTranslationScale=on,t.getAngle=Ze,t.getEuler=an,t.getOrCalculatePathTotalLength=Ai,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),.9*t},t.insertedEvent=_s,t.isBrowser=_a,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=Zr,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=Vs,t.isFederatedEvent=function(t){return!!t.type},t.isFillOrStrokeAffected=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=Xr,t.mergeColors=Kr,t.parseColor=$r,t.parseLength=ti,t.parsePath=ji,t.parseTransform=Ji,t.parsedTransformToMat4=Co,t.propertyMetadataCache=pa,t.rad2deg=en,t.removedEvent=Gs,t.resetEntityCounter=function(){Ds=0},t.runtime=Rs,t.setDOMSize=function(t,e,n){_a&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=t.map(function(a,o){var s=a[0],u=t[o+1],l=(o===t.length-1||u&&("M"===u[0]||"Z"===u[0]))&&0!==r&&0!==i,c=b(0===o&&(0!==e||0!==n)?[e,n]:[0,0],2),h=c[0],f=c[1],d=b(l?[r,i]:[0,0],2),v=d[0],p=d[1];switch(s){case"M":return"M ".concat(a[1]+h,",").concat(a[2]+f);case"L":return"L ".concat(a[1]+v,",").concat(a[2]+p);case"Q":return"Q ".concat(a[1]," ").concat(a[2],",").concat(a[3]+v," ").concat(a[4]+p);case"C":return"C ".concat(a[1]," ").concat(a[2],",").concat(a[3]," ").concat(a[4],",").concat(a[5]+v," ").concat(a[6]+p);case"A":return"A ".concat(a[1]," ").concat(a[2]," ").concat(a[3]," ").concat(a[4]," ").concat(a[5]," ").concat(a[6]," ").concat(a[7]).concat(l?" L ".concat(a[6]+r,",").concat(a[7]+i):"");case"Z":return"Z";default:return null}}).filter(function(t){return null!==t}).join(" ");return~a.indexOf("NaN")?"":a},t.turn2deg=nn,t.updateLocalTransform=Nn,t.updateWorldTransform=Pn});
|
|
20
20
|
//# sourceMappingURL=index.umd.min.js.map
|