1 | !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).F2={})}(this,(function(t){"use strict";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+n+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=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},r.apply(this,arguments)};function i(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&0>e.indexOf(r)&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);r.length>i;i++)0>e.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function o(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function a(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&i[3]>s[1])){o.label=s[1];break}if(6===s[0]&&i[1]>o.label){o.label=i[1],i=s;break}if(i&&i[2]>o.label){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function u(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function l(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;o>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 c=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},h=function(t){return"function"==typeof t},p=function(t){return null==t},f={}.toString,d=function(t,e){return f.call(t)==="[object "+e+"]"},y=function(t){return Array.isArray?Array.isArray(t):d(t,"Array")},v=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function g(t,e){if(t)if(y(t))for(var n=0,r=t.length;r>n&&!1!==e(t[n],n);n++);else if(v(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}var m=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return g(t,(function(n,r){h(t)&&"prototype"===r||e.push(r)})),e};var x=function(t){return"object"==typeof t&&null!==t},b=function(t){if(!x(t)||!d(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function M(t,e){if(!y(t))return null;var n;if(h(e)&&(n=e),b(e)&&(n=function(t){return function(t,e){var n=m(e),r=n.length;if(p(t))return!r;for(var i=0;r>i;i+=1){var o=n[i];if(e[o]!==t[o]||!(o in t))return!1}return!0}(t,e)}),n)for(var r=0;t.length>r;r+=1)if(n(t[r]))return t[r];return null}var w=function(t){if(!y(t))return[];for(var e=[],n=0;t.length>n;n++)e=e.concat(t[n]);return e},E=function(t){if(y(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},k=function(t){if(y(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},S=function(t){var e=t.filter((function(t){return!isNaN(t)}));if(!e.length)return{min:0,max:0};if(y(t[0])){for(var n=[],r=0;t.length>r;r++)n=n.concat(t[r]);e=n}var i=E(e);return{min:k(e),max:i}},P=function(t){return d(t,"String")},T=function(t,e){for(var n=[],r={},i=0;t.length>i;i++){var o=t[i][e];if(!p(o)){y(o)||(o=[o]);for(var a=0;o.length>a;a++){var s=o[a];r[s]||(n.push(s),r[s]=!0)}}}return n};function N(t){if(c(t))return t[0]}function C(t){if(c(t)){return t[t.length-1]}}var A=Object.prototype.hasOwnProperty;function O(t,e){if(!e||!y(t))return{};for(var n,r={},i=h(e)?e:function(t){return t[e]},o=0;t.length>o;o++){var a=t[o];n=i(a),A.call(r,n)?r[n].push(a):r[n]=[a]}return r}function R(t,e){if(!e)return{0:t};if(!h(e)){var n=y(e)?e:e.replace(/\s+/g,"").split("*");e=function(t){for(var e="_",r=0,i=n.length;i>r;r++)e+=t[n[r]]&&""+t[n[r]];return e}}return O(t,e)}var L=function(t,e,n){return e>t?e:t>n?n:t},_=function(t){return d(t,"Number")};function I(t,e,n){return void 0===n&&(n=1e-5),n>Math.abs(t-e)}var D=function(t,e){return(t%e+e)%e},F=function(t){var e=function(t){return p(t)?"":""+t}(t);return e.charAt(0).toUpperCase()+e.substring(1)},B={}.toString,j=function(t){return d(t,"Boolean")},G=function(t){return d(t,"Date")},Y=Object.prototype,W=function(t){return void 0===t};function z(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}function V(t,e,n,r){return e&&z(t,e),n&&z(t,n),r&&z(t,r),t}var X=function(t){if("object"!=typeof t||null===t)return t;var e;if(y(t)){e=[];for(var n=0,r=t.length;r>n;n++)e[n]="object"==typeof t[n]&&null!=t[n]?X(t[n]):t[n]}else for(var i in e={},t)e[i]="object"==typeof t[i]&&null!=t[i]?X(t[i]):t[i];return e};function U(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function H(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(U(e,i)){var o=e[i];null!==o&&b(o)?(b(t[i])||(t[i]={}),r>n?H(t[i],o,n+1,r):t[i]=e[i]):y(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var q=function(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];for(var r=0;e.length>r;r+=1)H(t,e[r]);return t},Z=Object.prototype.hasOwnProperty;function K(t){if(p(t))return!0;if(c(t))return!t.length;var e=function(t){return B.call(t).replace(/^\[object /,"").replace(/]$/,"")}(t);if("Map"===e||"Set"===e)return!t.size;if(function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Y)}(t))return!Object.keys(t).length;for(var n in t)if(Z.call(t,n))return!1;return!0}var $=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(P(t)||P(e))return!1;if(c(t)||c(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;t.length>r&&(n=$(t[r],e[r]));r++);return n}if(x(t)||x(e)){var i=Object.keys(t);if(i.length!==Object.keys(e).length)return!1;for(n=!0,r=0;i.length>r&&(n=$(t[i[r]],e[i[r]]));r++);return n}return!1},J=function(t,e){if(!c(t))return t;for(var n=[],r=0;t.length>r;r++){n.push(e(t[r],r))}return n},Q=function(t){return t},tt=function(t,e,n){for(var r=0,i=P(e)?e.split("."):e;t&&i.length>r;)t=t[i[r++]];return void 0===t||i.length>r?n:t},et=Object.prototype.hasOwnProperty,nt=function(t,e){if(null===t||!b(t))return{};var n={};return g(e,(function(e){et.call(t,e)&&(n[e]=t[e])})),n},rt=function(t,e){return function(t,e,n){if(!y(t)&&!b(t))return t;var r=n;return g(t,(function(t,n){r=e(r,t,n)})),r}(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},it=function(){function t(){this.map={}}return t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length},t}(),ot=1e-6,at="undefined"!=typeof Float32Array?Float32Array:Array;function st(){var t=new at(9);return at!=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 ut(){var t=new at(16);return at!=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 lt(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 ct(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d,y,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=h,t[11]=p,t[12]=f,t[13]=d,t[14]=y,t[15]=v,t}function ht(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 pt(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=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]=o,t[11]=e[14],t[12]=i,t[13]=a,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 ft(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],g=e[15],m=n*s-r*a,x=n*u-i*a,b=n*l-o*a,M=r*u-i*s,w=r*l-o*s,E=i*l-o*u,k=c*y-h*d,S=c*v-p*d,P=c*g-f*d,T=h*v-p*y,N=h*g-f*y,C=p*g-f*v,A=m*C-x*N+b*T+M*P-w*S+E*k;return A?(t[0]=(s*C-u*N+l*T)*(A=1/A),t[1]=(i*N-r*C-o*T)*A,t[2]=(y*E-v*w+g*M)*A,t[3]=(p*w-h*E-f*M)*A,t[4]=(u*P-a*C-l*S)*A,t[5]=(n*C-i*P+o*S)*A,t[6]=(v*b-d*E-g*x)*A,t[7]=(c*E-p*b+f*x)*A,t[8]=(a*N-s*P+l*k)*A,t[9]=(r*P-n*N-o*k)*A,t[10]=(d*w-y*b+g*m)*A,t[11]=(h*b-c*w-f*m)*A,t[12]=(s*S-a*T-u*k)*A,t[13]=(n*T-r*S+i*k)*A,t[14]=(y*x-d*M-v*m)*A,t[15]=(c*M-h*x+p*m)*A,t):null}function dt(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],l=t[8],c=t[9],h=t[10],p=t[11],f=t[12],d=t[13],y=t[14],v=t[15];return(e*a-n*o)*(h*v-p*y)-(e*s-r*o)*(c*v-p*d)+(e*u-i*o)*(c*y-h*d)+(n*s-r*a)*(l*v-p*f)-(n*u-i*a)*(l*y-h*f)+(r*u-i*s)*(l*d-c*f)}function yt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],v=e[13],g=e[14],m=e[15],x=n[0],b=n[1],M=n[2],w=n[3];return t[0]=x*r+b*s+M*h+w*y,t[1]=x*i+b*u+M*p+w*v,t[2]=x*o+b*l+M*f+w*g,t[3]=x*a+b*c+M*d+w*m,t[4]=(x=n[4])*r+(b=n[5])*s+(M=n[6])*h+(w=n[7])*y,t[5]=x*i+b*u+M*p+w*v,t[6]=x*o+b*l+M*f+w*g,t[7]=x*a+b*c+M*d+w*m,t[8]=(x=n[8])*r+(b=n[9])*s+(M=n[10])*h+(w=n[11])*y,t[9]=x*i+b*u+M*p+w*v,t[10]=x*o+b*l+M*f+w*g,t[11]=x*a+b*c+M*d+w*m,t[12]=(x=n[12])*r+(b=n[13])*s+(M=n[14])*h+(w=n[15])*y,t[13]=x*i+b*u+M*p+w*v,t[14]=x*o+b*l+M*f+w*g,t[15]=x*a+b*c+M*d+w*m,t}function vt(t,e,n){var r,i,o,a,s,u,l,c,h,p,f,d,y=n[0],v=n[1],g=n[2];return e===t?(t[12]=e[0]*y+e[4]*v+e[8]*g+e[12],t[13]=e[1]*y+e[5]*v+e[9]*g+e[13],t[14]=e[2]*y+e[6]*v+e[10]*g+e[14],t[15]=e[3]*y+e[7]*v+e[11]*g+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=p,t[10]=f,t[11]=d,t[12]=r*y+s*v+h*g+e[12],t[13]=i*y+u*v+p*g+e[13],t[14]=o*y+l*v+f*g+e[14],t[15]=a*y+c*v+d*g+e[15]),t}function gt(t,e,n){var r=n[0],i=n[1],o=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]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function mt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],h=e[10],p=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]=o*i+l*r,t[5]=a*i+c*r,t[6]=s*i+h*r,t[7]=u*i+p*r,t[8]=l*i-o*r,t[9]=c*i-a*r,t[10]=h*i-s*r,t[11]=p*i-u*r,t}function xt(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],l=e[8],c=e[9],h=e[10],p=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]=o*i-l*r,t[1]=a*i-c*r,t[2]=s*i-h*r,t[3]=u*i-p*r,t[8]=o*r+l*i,t[9]=a*r+c*i,t[10]=s*r+h*i,t[11]=u*r+p*i,t}function bt(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 Mt(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 wt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,l=o+o,c=r*s,h=r*u,p=r*l,f=i*u,d=i*l,y=o*l,v=a*s,g=a*u,m=a*l;return t[0]=1-(f+y),t[1]=h+m,t[2]=p-g,t[3]=0,t[4]=h-m,t[5]=1-(c+y),t[6]=d+v,t[7]=0,t[8]=p+g,t[9]=d-v,t[10]=1-(c+f),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Et(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function kt(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,s),t}function St(t,e){var n=new at(3);kt(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,u=e[2]*o,l=e[4]*r,c=e[5]*i,h=e[6]*o,p=e[8]*r,f=e[9]*i,d=e[10]*o,y=a+c+d,v=0;return y>0?(t[3]=.25*(v=2*Math.sqrt(y+1)),t[0]=(h-f)/v,t[1]=(p-u)/v,t[2]=(s-l)/v):a>c&&a>d?(t[3]=(h-f)/(v=2*Math.sqrt(1+a-c-d)),t[0]=.25*v,t[1]=(s+l)/v,t[2]=(p+u)/v):c>d?(t[3]=(p-u)/(v=2*Math.sqrt(1+c-a-d)),t[0]=(s+l)/v,t[1]=.25*v,t[2]=(h+f)/v):(t[3]=(s-l)/(v=2*Math.sqrt(1+d-a-c)),t[0]=(p+u)/v,t[1]=(h+f)/v,t[2]=.25*v),t}function Pt(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],l=o+o,c=a+a,h=s+s,p=o*l,f=o*c,d=o*h,y=a*c,v=a*h,g=s*h,m=u*l,x=u*c,b=u*h,M=r[0],w=r[1],E=r[2],k=i[0],S=i[1],P=i[2],T=(1-(y+g))*M,N=(f+b)*M,C=(d-x)*M,A=(f-b)*w,O=(1-(p+g))*w,R=(v+m)*w,L=(d+x)*E,_=(v-m)*E,I=(1-(p+y))*E;return t[0]=T,t[1]=N,t[2]=C,t[3]=0,t[4]=A,t[5]=O,t[6]=R,t[7]=0,t[8]=L,t[9]=_,t[10]=I,t[11]=0,t[12]=n[0]+k-(T*k+A*S+L*P),t[13]=n[1]+S-(N*k+O*S+_*P),t[14]=n[2]+P-(C*k+R*S+I*P),t[15]=1,t}function Tt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,l=n*a,c=r*a,h=r*s,p=i*a,f=i*s,d=i*u,y=o*a,v=o*s,g=o*u;return t[0]=1-h-d,t[1]=c+g,t[2]=p-v,t[3]=0,t[4]=c-g,t[5]=1-l-d,t[6]=f+y,t[7]=0,t[8]=p+v,t[9]=f-y,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Nt(t,e,n,r,i){var o,a=1/Math.tan(e/2);return 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?(t[10]=(i+r)*(o=1/(r-i)),t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function Ct(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),l=1/(o-a);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]=(a+o)*l,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var At=Ct;function Ot(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),l=1/(o-a);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]=o*l,t[15]=1,t}function Rt(t,e,n,r){var i,o,a,s,u,l,c,h,p,f,d=e[0],y=e[1],v=e[2],g=r[0],m=r[1],x=r[2],b=n[0],M=n[1],w=n[2];return ot>Math.abs(d-b)&&ot>Math.abs(y-M)&&ot>Math.abs(v-w)?ht(t):(f=1/Math.hypot(c=d-b,h=y-M,p=v-w),(f=Math.hypot(i=m*(p*=f)-x*(h*=f),o=x*(c*=f)-g*p,a=g*h-m*c))?(i*=f=1/f,o*=f,a*=f):(i=0,o=0,a=0),(f=Math.hypot(s=h*a-p*o,u=p*i-c*a,l=c*o-h*i))?(s*=f=1/f,u*=f,l*=f):(s=0,u=0,l=0),t[0]=i,t[1]=s,t[2]=c,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=a,t[9]=l,t[10]=p,t[11]=0,t[12]=-(i*d+o*y+a*v),t[13]=-(s*d+u*y+l*v),t[14]=-(c*d+h*y+p*v),t[15]=1,t)}function Lt(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 _t=Object.freeze({__proto__:null,create:ut,clone:function(t){var e=new at(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:lt,fromValues:function(t,e,n,r,i,o,a,s,u,l,c,h,p,f,d,y){var v=new at(16);return v[0]=t,v[1]=e,v[2]=n,v[3]=r,v[4]=i,v[5]=o,v[6]=a,v[7]=s,v[8]=u,v[9]=l,v[10]=c,v[11]=h,v[12]=p,v[13]=f,v[14]=d,v[15]=y,v},set:ct,identity:ht,transpose:pt,invert:ft,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],p=e[10],f=e[11],d=e[12],y=e[13],v=e[14],g=e[15];return t[0]=s*(p*g-f*v)-h*(u*g-l*v)+y*(u*f-l*p),t[1]=-(r*(p*g-f*v)-h*(i*g-o*v)+y*(i*f-o*p)),t[2]=r*(u*g-l*v)-s*(i*g-o*v)+y*(i*l-o*u),t[3]=-(r*(u*f-l*p)-s*(i*f-o*p)+h*(i*l-o*u)),t[4]=-(a*(p*g-f*v)-c*(u*g-l*v)+d*(u*f-l*p)),t[5]=n*(p*g-f*v)-c*(i*g-o*v)+d*(i*f-o*p),t[6]=-(n*(u*g-l*v)-a*(i*g-o*v)+d*(i*l-o*u)),t[7]=n*(u*f-l*p)-a*(i*f-o*p)+c*(i*l-o*u),t[8]=a*(h*g-f*y)-c*(s*g-l*y)+d*(s*f-l*h),t[9]=-(n*(h*g-f*y)-c*(r*g-o*y)+d*(r*f-o*h)),t[10]=n*(s*g-l*y)-a*(r*g-o*y)+d*(r*l-o*s),t[11]=-(n*(s*f-l*h)-a*(r*f-o*h)+c*(r*l-o*s)),t[12]=-(a*(h*v-p*y)-c*(s*v-u*y)+d*(s*p-u*h)),t[13]=n*(h*v-p*y)-c*(r*v-i*y)+d*(r*p-i*h),t[14]=-(n*(s*v-u*y)-a*(r*v-i*y)+d*(r*u-i*s)),t[15]=n*(s*p-u*h)-a*(r*p-i*h)+c*(r*u-i*s),t},determinant:dt,multiply:yt,translate:vt,scale:gt,rotate:function(t,e,n,r){var i,o,a,s,u,l,c,h,p,f,d,y,v,g,m,x,b,M,w,E,k,S,P,T,N=r[0],C=r[1],A=r[2],O=Math.hypot(N,C,A);return ot>O?null:(N*=O=1/O,C*=O,A*=O,i=Math.sin(n),u=e[1],l=e[2],c=e[3],p=e[5],f=e[6],d=e[7],v=e[9],g=e[10],m=e[11],w=N*C*(a=1-(o=Math.cos(n)))-A*i,E=C*C*a+o,k=A*C*a+N*i,S=N*A*a+C*i,P=C*A*a-N*i,T=A*A*a+o,t[0]=(s=e[0])*(x=N*N*a+o)+(h=e[4])*(b=C*N*a+A*i)+(y=e[8])*(M=A*N*a-C*i),t[1]=u*x+p*b+v*M,t[2]=l*x+f*b+g*M,t[3]=c*x+d*b+m*M,t[4]=s*w+h*E+y*k,t[5]=u*w+p*E+v*k,t[6]=l*w+f*E+g*k,t[7]=c*w+d*E+m*k,t[8]=s*S+h*P+y*T,t[9]=u*S+p*P+v*T,t[10]=l*S+f*P+g*T,t[11]=c*S+d*P+m*T,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:mt,rotateY:xt,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],h=e[6],p=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]=o*i+l*r,t[1]=a*i+c*r,t[2]=s*i+h*r,t[3]=u*i+p*r,t[4]=l*i-o*r,t[5]=c*i-a*r,t[6]=h*i-s*r,t[7]=p*i-u*r,t},fromTranslation:bt,fromScaling:Mt,fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],u=n[2],l=Math.hypot(a,s,u);return ot>l?null:(a*=l=1/l,s*=l,u*=l,r=Math.sin(e),t[0]=a*a*(o=1-(i=Math.cos(e)))+i,t[1]=s*a*o+u*r,t[2]=u*a*o-s*r,t[3]=0,t[4]=a*s*o-u*r,t[5]=s*s*o+i,t[6]=u*s*o+a*r,t[7]=0,t[8]=a*u*o+s*r,t[9]=s*u*o-a*r,t[10]=u*u*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(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},fromYRotation:function(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},fromZRotation:function(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},fromRotationTranslation:wt,fromQuat2:function(t,e){var n=new at(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=r*r+i*i+o*o+a*a;return h>0?(n[0]=2*(s*a+c*r+u*o-l*i)/h,n[1]=2*(u*a+c*i+l*r-s*o)/h,n[2]=2*(l*a+c*o+s*i-u*r)/h):(n[0]=2*(s*a+c*r+u*o-l*i),n[1]=2*(u*a+c*i+l*r-s*o),n[2]=2*(l*a+c*o+s*i-u*r)),wt(t,e,n),t},getTranslation:Et,getScaling:kt,getRotation:St,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,l=o+o,c=a+a,h=i*u,p=i*l,f=i*c,d=o*l,y=o*c,v=a*c,g=s*u,m=s*l,x=s*c,b=r[0],M=r[1],w=r[2];return t[0]=(1-(d+v))*b,t[1]=(p+x)*b,t[2]=(f-m)*b,t[3]=0,t[4]=(p-x)*M,t[5]=(1-(h+v))*M,t[6]=(y+g)*M,t[7]=0,t[8]=(f+m)*w,t[9]=(y-g)*w,t[10]=(1-(h+d))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:Pt,fromQuat:Tt,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),l=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*l,t[15]=0,t},perspectiveNO:Nt,perspective:Nt,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return 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?(t[10]=i*(o=1/(r-i)),t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),l=2/(i+o);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]=-(a-s)*u*.5,t[9]=(i-o)*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},orthoNO:Ct,ortho:At,orthoZO:Ot,lookAt:Rt,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],l=r[2],c=i-n[0],h=o-n[1],p=a-n[2],f=c*c+h*h+p*p;f>0&&(c*=f=1/Math.sqrt(f),h*=f,p*=f);var d=u*p-l*h,y=l*c-s*p,v=s*h-u*c;return(f=d*d+y*y+v*v)>0&&(d*=f=1/Math.sqrt(f),y*=f,v*=f),t[0]=d,t[1]=y,t[2]=v,t[3]=0,t[4]=h*v-p*y,t[5]=p*d-c*v,t[6]=c*y-h*d,t[7]=0,t[8]=c,t[9]=h,t[10]=p,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},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]+")"},frob:function(t){return Math.hypot(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])},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},subtract:Lt,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},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]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],l=t[7],c=t[8],h=t[9],p=t[10],f=t[11],d=t[12],y=t[13],v=t[14],g=t[15],m=e[0],x=e[1],b=e[2],M=e[3],w=e[4],E=e[5],k=e[6],S=e[7],P=e[8],T=e[9],N=e[10],C=e[11],A=e[12],O=e[13],R=e[14],L=e[15];return!(Math.abs(n-m)>ot*Math.max(1,Math.abs(n),Math.abs(m))||Math.abs(r-x)>ot*Math.max(1,Math.abs(r),Math.abs(x))||Math.abs(i-b)>ot*Math.max(1,Math.abs(i),Math.abs(b))||Math.abs(o-M)>ot*Math.max(1,Math.abs(o),Math.abs(M))||Math.abs(a-w)>ot*Math.max(1,Math.abs(a),Math.abs(w))||Math.abs(s-E)>ot*Math.max(1,Math.abs(s),Math.abs(E))||Math.abs(u-k)>ot*Math.max(1,Math.abs(u),Math.abs(k))||Math.abs(l-S)>ot*Math.max(1,Math.abs(l),Math.abs(S))||Math.abs(c-P)>ot*Math.max(1,Math.abs(c),Math.abs(P))||Math.abs(h-T)>ot*Math.max(1,Math.abs(h),Math.abs(T))||Math.abs(p-N)>ot*Math.max(1,Math.abs(p),Math.abs(N))||Math.abs(f-C)>ot*Math.max(1,Math.abs(f),Math.abs(C))||Math.abs(d-A)>ot*Math.max(1,Math.abs(d),Math.abs(A))||Math.abs(y-O)>ot*Math.max(1,Math.abs(y),Math.abs(O))||Math.abs(v-R)>ot*Math.max(1,Math.abs(v),Math.abs(R))||Math.abs(g-L)>ot*Math.max(1,Math.abs(g),Math.abs(L)))},mul:yt,sub:Lt});function It(){var t=new at(3);return at!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Dt(t){return Math.hypot(t[0],t[1],t[2])}function Ft(t,e,n){var r=new at(3);return r[0]=t,r[1]=e,r[2]=n,r}function Bt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function jt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Gt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Yt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Wt(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function zt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Vt(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function Xt(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function Ut(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return ot*Math.max(1,Math.abs(n),Math.abs(o))>=Math.abs(n-o)&&ot*Math.max(1,Math.abs(r),Math.abs(a))>=Math.abs(r-a)&&ot*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)}var Ht,qt=Dt;Ht=It();function Zt(){var t=new at(4);return at!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Kt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}!function(){var t=Zt()}();function $t(){var t=new at(4);return at!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Jt(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 Qt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=r*c+a*s+i*l-o*u,t[1]=i*c+a*u+o*s-r*l,t[2]=o*c+a*l+r*u-i*s,t[3]=a*c-r*s-i*u-o*l,t}function te(t,e,n,r){var i,o,a,s,u,l=e[0],c=e[1],h=e[2],p=e[3],f=n[0],d=n[1],y=n[2],v=n[3];return 0>(o=l*f+c*d+h*y+p*v)&&(o=-o,f=-f,d=-d,y=-y,v=-v),1-o>ot?(a=Math.sin(i=Math.acos(o)),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r),t[0]=s*l+u*f,t[1]=s*c+u*d,t[2]=s*h+u*y,t[3]=s*p+u*v,t}function ee(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function ne(t,e,n,r){var i=.5*Math.PI/180;n*=i,r*=i;var o=Math.sin(e*=i),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),l=Math.sin(r),c=Math.cos(r);return t[0]=o*u*c-a*s*l,t[1]=a*s*c+o*u*l,t[2]=a*u*l-o*s*c,t[3]=a*u*c+o*s*l,t}var re,ie,oe,ae,se,ue,le=function(t,e,n,r){var i=new at(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ce=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},he=Qt,pe=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};re=It(),ie=Ft(1,0,0),oe=Ft(0,1,0),ae=$t(),se=$t(),ue=st();function fe(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}function de(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t}function ye(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}function ve(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t}function ge(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1])}function me(t){return Math.hypot(t[0],t[1])}var xe=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t};!function(){var t,e=(t=new at(2),at!=Float32Array&&(t[0]=0,t[1]=0),t)}();function be(t,e){return void 0===e&&(e="off"),function(t,e){if("off"===e)return[].concat(t);var n="number"!=typeof e||1>e?1:Math.pow(10,e);return t.map((function(t){var r=t.slice(1).map(Number).map((function(t){return e?Math.round(t*n)/n:Math.round(t)}));return[t[0]].concat(r)}))}(t,e).map((function(t){return t[0]+t.slice(1).join(" ")})).join("")}var Me={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function we(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 Ee={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function ke(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Ee[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Se(t){return ke(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Pe(t){return Se(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function Te(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Ee[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,Ee[n]))),Ee[n]););}function Ne(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 "'+n[e]+'", expecting 0 or 1 at index '+e)}function Ce(t){return t>=48&&57>=t||43===t||45===t||46===t}function Ae(t){return t>=48&&57>=t}function Oe(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,l=!1;if(n>o)if(43!==(e=r.charCodeAt(o))&&45!==e||(e=r.charCodeAt(o+=1)),Ae(e)||46===e){if(46!==e){if(a=48===e,e=r.charCodeAt(o+=1),a&&n>o&&e&&Ae(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>o&&Ae(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;Ae(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(l&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(43!==(e=r.charCodeAt(o+=1))&&45!==e||(o+=1),o>=n||!Ae(r.charCodeAt(o)))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;n>o&&Ae(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param'}function Re(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function Le(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Ee[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,Re(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Oe(t):Ne(t),t.err.length)return;t.data.push(t.param),Re(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,Re(t))}if(t.index>=t.max)break;if(!Ce(n.charCodeAt(t.index)))break}Te(t)}else Te(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var _e=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 Ie(t){if(Se(t))return[].concat(t);var e=function(t){if(ke(t))return[].concat(t);var e=new _e(t);for(Re(e);e.max>e.index&&!e.err.length;)Le(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=a[0],o=r=a[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[u,a[0]+r];break;case"H":e=[u,a[0]+n];break;default:var l=a.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(l)}else e=[u].concat(a);var c=e.length;switch(u){case"Z":n=i,r=o;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,o=r)}return e}))}function De(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=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-o,c=2*i-a;e.x1=l,e.y1=c,u=["C",l,c].concat(s)}else if("T"===n){var h=2*r-e.qx,p=2*i-e.qy;e.qx=h,e.qy=p,u=["Q",h,p].concat(s)}else if("Q"===n){var f=s[1];e.qx=s[0],e.qy=f}return u}function Fe(t){if(Pe(t))return[].concat(t);for(var e=Ie(t),n=r({},Me),i=0;e.length>i;i+=1){e[i]=De(e[i],n);var o=e[i],a=o.length;n.x1=+o[a-2],n.y1=+o[a-1],n.x2=+o[a-4]||n.x1,n.y2=+o[a-3]||n.y1}return e}function Be(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function je(t,e,n,r,i,o,a,s,u,l){var c,h,p,f,d,y=t,v=e,g=n,m=r,x=s,b=u,M=120*Math.PI/180,w=Math.PI/180*(+i||0),E=[];if(l)h=l[0],p=l[1],f=l[2],d=l[3];else{v=(c=Be(y,v,-w)).y;var k=((y=c.x)-(x=(c=Be(x,b,-w)).x))/2,S=(v-(b=c.y))/2,P=k*k/(g*g)+S*S/(m*m);P>1&&(g*=P=Math.sqrt(P),m*=P);var T=g*g,N=m*m,C=(o===a?-1:1)*Math.sqrt(Math.abs((T*N-T*S*S-N*k*k)/(T*S*S+N*k*k)));f=C*g*S/m+(y+x)/2,h=Math.asin(((v-(d=C*-m*k/g+(v+b)/2))/m*1e9|0)/1e9),p=Math.asin(((b-d)/m*1e9|0)/1e9),0>(h=f>y?Math.PI-h:h)&&(h=2*Math.PI+h),0>(p=f>x?Math.PI-p:p)&&(p=2*Math.PI+p),a&&h>p&&(h-=2*Math.PI),!a&&p>h&&(p-=2*Math.PI)}var A=p-h;if(Math.abs(A)>M){var O=p,R=x,L=b;E=je(x=f+g*Math.cos(p=h+M*(a&&p>h?1:-1)),b=d+m*Math.sin(p),g,m,i,0,a,R,L,[p,O,f,d])}A=p-h;var _=Math.cos(h),I=Math.sin(h),D=Math.cos(p),F=Math.sin(p),B=Math.tan(A/4),j=4/3*g*B,G=4/3*m*B,Y=[y,v],W=[y+j*I,v-G*_],z=[x+j*F,b-G*D],V=[x,b];if(W[0]=2*Y[0]-W[0],W[1]=2*Y[1]-W[1],l)return W.concat(z,V,E);for(var X=[],U=0,H=(E=W.concat(z,V,E)).length;H>U;U+=1)X[U]=U%2?Be(E[U-1],E[U],w).y:Be(E[U],E[U+1],w).x;return X}function Ge(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var Ye=function(t,e,n,r){return l(l([],Ge([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function We(t,e){var n,r,i,o,a,s,u,l=t[0],c=t.slice(1).map(Number),h=c[0],p=c[1],f=e.x1,d=e.y1,y=e.x,v=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=h,e.y=p,t;case"A":return n=[f,d].concat(c),["C"].concat(je(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=p,n=[f,d].concat(c),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(o=n[4])+u*r,s*(a=n[5])+u*i,o,a]);case"L":return["C"].concat(Ye(f,d,h,p));case"Z":return f===y&&d===v?["C",f,d,y,v,y,v]:["C"].concat(Ye(f,d,y,v))}return t}function ze(t,e){if(void 0===e&&(e=!1),function(t){return Pe(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var i,o,a=Fe(t),s=r({},Me),u=[],l="",c=a.length,h=[],p=0;c>p;p+=1){a[p]&&(l=a[p][0]),u[p]=l;var f=We(a[p],s);a[p]=f,we(a,u,p),c=a.length,"Z"===l&&h.push(p),s.x1=+(i=a[p])[(o=i.length)-2],s.y1=+i[o-1],s.x2=+i[o-4]||s.x1,s.y2=+i[o-3]||s.y1}return e?[a,h]:a}function Ve(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Xe(t,e,n,r,i){var o=Ve([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(0<i)if(i<o){var s=Ge([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}else a={x:n,y:r};else a={x:t,y:e};return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Ue(t,e){var n=t.x,r=t.y,i=e.x,o=e.y;return(0>n*o-r*i?-1:1)*Math.acos((n*i+r*o)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2))))}function He(t,e,n,r,i,o,a,s,u,l){var c=Math.abs,h=Math.sin,p=Math.cos,f=Math.sqrt,d=Math.PI,y=c(n),v=c(r),g=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===y||0===v)return Xe(t,e,s,u,l).point;var m=(t-s)/2,x=(e-u)/2,b={x:p(g)*m+h(g)*x,y:-h(g)*m+p(g)*x},M=Math.pow(b.x,2)/Math.pow(y,2)+Math.pow(b.y,2)/Math.pow(v,2);M>1&&(y*=f(M),v*=f(M));var w=(Math.pow(y,2)*Math.pow(v,2)-Math.pow(y,2)*Math.pow(b.y,2)-Math.pow(v,2)*Math.pow(b.x,2))/(Math.pow(y,2)*Math.pow(b.y,2)+Math.pow(v,2)*Math.pow(b.x,2)),E=(o!==a?1:-1)*f(w=0>w?0:w),k=E*(y*b.y/v),S=E*(-v*b.x/y),P=p(g)*k-h(g)*S+(t+s)/2,T=h(g)*k+p(g)*S+(e+u)/2,N={x:(b.x-k)/y,y:(b.y-S)/v},C=Ue({x:1,y:0},N),A=Ue(N,{x:(-b.x-k)/y,y:(-b.y-S)/v});!a&&A>0?A-=2*d:a&&0>A&&(A+=2*d);var O=C+(A%=2*d)*l,R=y*p(O),L=v*h(O);return{x:p(g)*R-h(g)*L+P,y:h(g)*R+p(g)*L+T}}function qe(t,e,n,r,i,o,a,s,u,l,c){var h,p=c.bbox,f=void 0===p||p,d=c.length,y=void 0===d||d,v=c.sampleSize,g=void 0===v?30:v,m="number"==typeof l,x=t,b=e,M=0,w=[x,b,M],E=[x,b],k={x:0,y:0},S=[{x:x,y:b}];m&&0>=l&&(k={x:x,y:b});for(var P=0;g>=P;P+=1){if(x=(h=He(t,e,n,r,i,o,a,s,u,P/g)).x,b=h.y,f&&S.push({x:x,y:b}),y&&(M+=Ve(E,[x,b])),E=[x,b],m&&M>=l&&l>w[2]){var T=(M-l)/(M-w[2]);k={x:E[0]*(1-T)+w[0]*T,y:E[1]*(1-T)+w[1]*T}}w=[x,b,M]}return m&&l>=M&&(k={x:s,y:u}),{length:M,point:k,min:{x:Math.min.apply(null,S.map((function(t){return t.x}))),y:Math.min.apply(null,S.map((function(t){return t.y})))},max:{x:Math.max.apply(null,S.map((function(t){return t.x}))),y:Math.max.apply(null,S.map((function(t){return t.y})))}}}function Ze(t,e,n,r,i,o,a,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)*a,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*o+Math.pow(u,3)*s}}function Ke(t,e,n,r,i,o,a,s,u,l){var c,h=l.bbox,p=void 0===h||h,f=l.length,d=void 0===f||f,y=l.sampleSize,v=void 0===y?10:y,g="number"==typeof u,m=t,x=e,b=0,M=[m,x,b],w=[m,x],E={x:0,y:0},k=[{x:m,y:x}];g&&0>=u&&(E={x:m,y:x});for(var S=0;v>=S;S+=1){if(m=(c=Ze(t,e,n,r,i,o,a,s,S/v)).x,x=c.y,p&&k.push({x:m,y:x}),d&&(b+=Ve(w,[m,x])),w=[m,x],g&&b>=u&&u>M[2]){var P=(b-u)/(b-M[2]);E={x:w[0]*(1-P)+M[0]*P,y:w[1]*(1-P)+M[1]*P}}M=[m,x,b]}return g&&u>=b&&(E={x:a,y:s}),{length:b,point:E,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,k.map((function(t){return t.x}))),y:Math.max.apply(null,k.map((function(t){return t.y})))}}}function $e(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function Je(t,e,n,r,i,o,a,s){var u,l=s.bbox,c=void 0===l||l,h=s.length,p=void 0===h||h,f=s.sampleSize,d=void 0===f?10:f,y="number"==typeof a,v=t,g=e,m=0,x=[v,g,m],b=[v,g],M={x:0,y:0},w=[{x:v,y:g}];y&&0>=a&&(M={x:v,y:g});for(var E=0;d>=E;E+=1){if(v=(u=$e(t,e,n,r,i,o,E/d)).x,g=u.y,c&&w.push({x:v,y:g}),p&&(m+=Ve(b,[v,g])),b=[v,g],y&&m>=a&&a>x[2]){var k=(m-a)/(m-x[2]);M={x:b[0]*(1-k)+x[0]*k,y:b[1]*(1-k)+x[1]*k}}x=[v,g,m]}return y&&a>=m&&(M={x:i,y:o}),{length:m,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 Qe(t,e,n){for(var r,i,o,a,s,u,l,c,h,p=Fe(t),f="number"==typeof e,d=[],y=0,v=0,g=0,m=0,x=[],b=[],M=0,w={x:0,y:0},E=w,k=w,S=w,P=0,T=0,N=p.length;N>T;T+=1)d=(l="M"===(c=(h=p[T])[0]))?d:[y,v].concat(h.slice(1)),l?(E=w={x:g=h[1],y:m=h[2]},M=0,f&&.001>e&&(S=w)):"L"===c?(M=(r=Xe(d[0],d[1],d[2],d[3],(e||0)-P)).length,w=r.min,E=r.max,k=r.point):"A"===c?(M=(i=qe(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-P,n||{})).length,w=i.min,E=i.max,k=i.point):"C"===c?(M=(o=Ke(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-P,n||{})).length,w=o.min,E=o.max,k=o.point):"Q"===c?(M=(a=Je(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-P,n||{})).length,w=a.min,E=a.max,k=a.point):"Z"===c&&(M=(s=Xe((d=[y,v,g,m])[0],d[1],d[2],d[3],(e||0)-P)).length,w=s.min,E=s.max,k=s.point),f&&e>P&&P+M>=e&&(S=k),b.push(E),x.push(w),P+=M,y=(u="Z"!==c?h.slice(-2):[g,m])[0],v=u[1];return f&&e>=P&&(S={x:y,y:v}),{length:P,point:S,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.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 tn(t,e){return Qe(t,void 0,r(r({},e),{bbox:!1,length:!0})).length}function en(t){return function(t){var e=0,n=0,r=0;return ze(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o,a,s,u,l,c,h,p,f=t.slice(1);return r=3*(((p=f[5])-(a=n))*((s=f[0])+(l=f[2]))-((h=f[4])-(o=e))*((u=f[1])+(c=f[3]))+u*(o-l)-s*(a-c)+p*(l+o/3)-h*(c+a/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function nn(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Ke(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),o=t.slice(6,8),a=Ge(n,r,e),s=Ge(r,i,e),u=Ge(i,o,e),l=Ge(a,s,e),c=Ge(s,u,e),h=Ge(l,c,e);return[["C"].concat(a,l,h),["C"].concat(c,u,o)]}(r):[t,t]:[t],l:i}}))}function rn(t,e,n){var r=nn(t),i=nn(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,c=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),p=[l,c],f=[h-o,h-a],d=0,y=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return f[e]-=(d=n&&f[e]&&t.l>=p[e])?1:0,d?t.ss:[t.s]})).flat()}));return y[0].length===y[1].length?y:rn(y[0],y[1],h)}var on=function(){function t(t,e,n){this.isMounted=!1,this.destroyed=!1,this.props=t,this.state={},this.context=e,this.updater=n}return t.prototype.willMount=function(){},t.prototype.didMount=function(){},t.prototype.shouldUpdate=function(t){return!0},t.prototype.willReceiveProps=function(t,e){},t.prototype.willUpdate=function(){},t.prototype.didUpdate=function(){},t.prototype.render=function(){return null},t.prototype.willUnmount=function(){},t.prototype.didUnmount=function(){},t.prototype.setState=function(t,e){this.destroyed||this.updater.enqueueSetState(this,t,e)},t.prototype.forceUpdate=function(t){this.destroyed||this.updater.enqueueForceUpdate(this,{},t)},t.prototype.setAnimate=function(t){this.animate=t,this._vNode.animate=t},t.prototype.destroy=function(){this.destroyed=!0,this.animator=null},t}();function an(t,e,n){return t&&e&&(y(t)||y(e))?function(t,e,n){for(var r={},i=t.length,o=e.length,a=0,s=o;s>a;a++)(l=e[a])&&!p(l.key)&&(r[c=l.key]=l);var u=[];for(a=0,s=i;s>a;a++){var l;if(l=t[a]){var c=l.key,h=void 0;p(l.key)?h=e[a]:(h=r[c])&&delete r[c],h?(null==h?void 0:h.__processed)?u.push(an(l,null,n)):(h.__processed=!0,u.push(an(l,h,n))):u.push(an(l,null,n))}}for(a=0,s=o;s>a;a++)(h=e[a])&&((null==h?void 0:h.__processed)?delete h.__processed:u.push(an(null,h,n)));return u}(y(t)?t:[t],y(e)?e:[e],n):n(t,e)}on.prototype.isF2Component=!0;var sn={cloneElement:function(t,e){return t?r(r({},t),{props:r(r({},t.props),e)}):t},map:function t(e,n){return e&&y(e)?e.map((function(e){return t(e,n)})):n(e)},toArray:function t(e){if(!e)return e;if(!y(e))return[e];for(var n=[],r=0,i=e.length;i>r;r++){var o=e[r];y(o)?n=n.concat(t(o)):n.push(o)}return n},compare:an};function un(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ln(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var cn=ln((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 o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),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 a(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,o=Array(i);i>r;r++)o[r]=e[r].fn;return o},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,o,a){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,o),!0;case 6:return c.fn.call(c.context,e,r,i,o,a),!0}for(l=1,u=Array(h-1);h>l;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var p,f=c.length;for(l=0;f>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(p=1,u=Array(h-1);h>p;p++)u[p-1]=arguments[p];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);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[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(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}));function hn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function pn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function fn(){}var dn=.7,yn=1/dn,vn="\\s*([+-]?\\d+)\\s*",gn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",mn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",xn=/^#([0-9a-f]{3,8})$/,bn=RegExp("^rgb\\("+[vn,vn,vn]+"\\)$"),Mn=RegExp("^rgb\\("+[mn,mn,mn]+"\\)$"),wn=RegExp("^rgba\\("+[vn,vn,vn,gn]+"\\)$"),En=RegExp("^rgba\\("+[mn,mn,mn,gn]+"\\)$"),kn=RegExp("^hsl\\("+[gn,mn,mn]+"\\)$"),Sn=RegExp("^hsla\\("+[gn,mn,mn,gn]+"\\)$"),Pn={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 Tn(){return this.rgb().formatHex()}function Nn(){return this.rgb().formatRgb()}function Cn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=xn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?An(e):3===n?new Rn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?On(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?On(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=bn.exec(t))?new Rn(e[1],e[2],e[3],1):(e=Mn.exec(t))?new Rn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=wn.exec(t))?On(e[1],e[2],e[3],e[4]):(e=En.exec(t))?On(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=kn.exec(t))?Dn(e[1],e[2]/100,e[3]/100,1):(e=Sn.exec(t))?Dn(e[1],e[2]/100,e[3]/100,e[4]):Pn.hasOwnProperty(t)?An(Pn[t]):"transparent"===t?new Rn(NaN,NaN,NaN,0):null}function An(t){return new Rn(t>>16&255,t>>8&255,255&t,1)}function On(t,e,n,r){return r>0||(t=e=n=NaN),new Rn(t,e,n,r)}function Rn(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ln(){return"#"+In(this.r)+In(this.g)+In(this.b)}function _n(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function In(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Dn(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Bn(t,e,n,r)}function Fn(t){if(t instanceof Bn)return new Bn(t.h,t.s,t.l,t.opacity);if(t instanceof fn||(t=Cn(t)),!t)return new Bn;if(t instanceof Bn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new Bn(a,s,u,t.opacity)}function Bn(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function jn(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 Gn(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Yn(t,e){var n=Math.min.apply(Math,l([],u(t),!1)),r=Math.min.apply(Math,l([],u(e),!1));return{x:n,y:r,width:Math.max.apply(Math,l([],u(t),!1))-n,height:Math.max.apply(Math,l([],u(e),!1))-r}}function Wn(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function zn(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function Vn(t,e,n,r,i,o,a){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=[o,a],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var p=s+h;a>o?p>o&&a>p&&c.push(p):p>a&&o>p&&c.push(p)}for(h=0;c.length>h;h++){var f=Wn(t,0,n,r,i,c[h]);u>f&&(u=f),f>l&&(l=f)}var d=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),y=1/0,v=-1/0,g=[o,a];for(h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var m=d+h;a>o?m>o&&a>m&&g.push(m):m>a&&o>m&&g.push(m)}for(h=0;g.length>h;h++){var x=zn(0,e,n,r,i,g[h]);y>x&&(y=x),x>v&&(v=x)}return{x:u,y:y,width:l-u,height:v-y}}hn(fn,Cn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Tn,formatHex:Tn,formatHsl:function(){return Fn(this).formatHsl()},formatRgb:Nn,toString:Nn}),hn(Rn,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof fn||(i=Cn(i)),i?new Rn((i=i.rgb()).r,i.g,i.b,i.opacity):new Rn):new Rn(t,e,n,null==r?1:r);var i}),pn(fn,{brighter:function(t){return new Rn(this.r*(t=null==t?yn:Math.pow(yn,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new Rn(this.r*(t=null==t?dn:Math.pow(dn,t)),this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){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:Ln,formatHex:Ln,formatRgb:_n,toString:_n})),hn(Bn,(function(t,e,n,r){return 1===arguments.length?Fn(t):new Bn(t,e,n,null==r?1:r)}),pn(fn,{brighter:function(t){return new Bn(this.h,this.s,this.l*(t=null==t?yn:Math.pow(yn,t)),this.opacity)},darker:function(t){return new Bn(this.h,this.s,this.l*(t=null==t?dn:Math.pow(dn,t)),this.opacity)},rgb:function(){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 Rn(jn(240>t?t+120:t-240,r,n),jn(t,r,n),jn(120>t?t+240:t-120,r,n),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));function Xn(t,e,n,r,i,o){var a=-1,s=1/0,c=[n,r],h=20;o&&o>200&&(h=o/10);for(var p=1/h,f=p/10,d=0;h>=d;d++){var y=d*p,v=[i.apply(void 0,l([],u(t.concat([y])),!1)),i.apply(void 0,l([],u(e.concat([y])),!1))];s>(b=Gn(c[0],c[1],v[0],v[1]))&&(a=y,s=b)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var g=t.length;return{x:t[g-1],y:e[g-1]}}s=1/0;for(d=0;32>d&&1e-4<=f;d++){var m=a-f,x=a+f,b=(v=[i.apply(void 0,l([],u(t.concat([m])),!1)),i.apply(void 0,l([],u(e.concat([m])),!1))],Gn(c[0],c[1],v[0],v[1]));if(m>=0&&s>b)a=m,s=b;else{var M=[i.apply(void 0,l([],u(t.concat([x])),!1)),i.apply(void 0,l([],u(e.concat([x])),!1))],w=Gn(c[0],c[1],M[0],M[1]);1>=x&&s>w?(a=x,s=w):f*=.5}}return{x:i.apply(void 0,l([],u(t.concat([a])),!1)),y:i.apply(void 0,l([],u(e.concat([a])),!1))}}function Un(t,e,n,r){return Gn(t,e,n,r)}function Hn(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function qn(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];return function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,o-e],s))}function Zn(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function Kn(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,l=3*e-3*t,c=[];if(I(s,0))I(u,0)||0>(i=-l/u)||i>1||c.push(i);else{var h=u*u-4*s*l;I(h,0)?c.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(i=(-u+a)/(2*s))||i>1||c.push(i),0>o||o>1||c.push(o))}return c}function $n(t,e,n,r,i,o,a,s){for(var u=[t,a],l=[e,s],c=Kn(t,n,i,a),h=Kn(e,r,o,s),p=0;c.length>p;p++)u.push(Zn(t,n,i,a,c[p]));for(p=0;h.length>p;p++)l.push(Zn(e,r,o,s,h[p]));return Yn(u,l)}function Jn(t,e,n,r,i,o,a,s,u,l,c){var h=function(t,e,n,r,i,o,a,s,u,l,c){return Xn([t,n,i,a],[e,r,o,s],u,l,Zn,c)}(t,e,n,r,i,o,a,s,u,l,c);return Gn(h.x,h.y,u,l)}function Qn(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+=Gn(r[0],r[1],i[0],i[1])}return e}(t)}function tr(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function er(t,e,n){var r=t+n-2*e;if(I(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}function nr(t,e,n,r,i,o){var a=er(t,n,i)[0],s=er(e,r,o)[0],u=[t,i],l=[e,o];return void 0!==a&&u.push(tr(t,n,i,a)),void 0!==s&&l.push(tr(e,r,o,s)),Yn(u,l)}function rr(t,e,n,r,i,o,a,s){var u=function(t,e,n,r,i,o,a,s){return Xn([t,n,i],[e,r,o],a,s,tr)}(t,e,n,r,i,o,a,s);return Gn(u.x,u.y,a,s)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var ir={exports:{}};!function(t){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(o,Math.floor(r+(s-u)*c/s+h)),a)}var p=t[r],f=i,d=o;for(n(t,i,r),a(t[o],p)>0&&n(t,i,o);d>f;){for(n(t,f,d),f++,d--;0>a(t[f],p);)f++;for(;a(t[d],p)>0;)d--}0===a(t[i],p)?n(t,i,d):n(t,++d,o),d>r||(i=d+1),r>d||(o=d-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return e>t?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function a(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=g(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;n>o;o++){var a=t.children[o];u(i,t.leaf?r(a):a)}return i}function u(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function f(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function d(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function y(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function v(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(e,n,r,i,o){for(var a=[n,r];a.length;)if((r=a.pop())-(n=a.pop())>i){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!v(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;e.children.length>o;o++){var a=e.children[o],s=e.leaf?r(a):a;v(t,s)&&(e.leaf?n.push(a):y(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!v(t,e))return!1;for(var n=[];e;){for(var r=0;e.children.length>r;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(v(t,o)){if(e.leaf||y(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(var e=0;t.length>e;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(n.height>this.data.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=g([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),u=[],l=[];a||u.length;){if(a||(a=u.pop(),r=u[u.length-1],n=l.pop(),i=!0),a.leaf){var c=o(t,a.children,e);if(-1!==c)return a.children.splice(c,1),u.push(a),this._condense(u),this}i||a.leaf||!y(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(u.push(a),l.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(s>=o)return a(i=g(t.slice(e,n+1)),this.toBBox),i;r||(s=Math.ceil(o/Math.pow(s,(r=Math.ceil(Math.log(o)/Math.log(s)))-1))),(i=g([])).leaf=!1,i.height=r;var u=Math.ceil(o/s),l=u*Math.ceil(Math.sqrt(s));m(t,e,n,l,this.compareMinX);for(var c=e;n>=c;c+=l){var h=Math.min(c+l-1,n);m(t,c,h,u,this.compareMinY);for(var p=c;h>=p;p+=u)i.children.push(this._build(t,p,Math.min(p+u-1,h),r-1))}return a(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,a=void 0,s=0;e.children.length>s;s++){var u=e.children[s],l=h(u),c=f(t,u)-l;o>c?(o=c,i=i>l?l:i,a=u):c===o&&i>l&&(i=l,a=u)}e=a||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),u(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=g(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;n-e>=a;a++){var u=s(t,0,a,this.toBBox),l=s(t,a,n,this.toBBox),c=d(u,l),p=h(u)+h(l);i>c?(i=c,r=a,o=o>p?p:o):c===i&&o>p&&(o=p,r=a)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:c,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),a=s(t,n-e,n,i),l=p(o)+p(a),c=e;n-e>c;c++){var h=t.children[c];u(o,t.leaf?i(h):h),l+=p(o)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];u(a,t.leaf?i(d):d),l+=p(a)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)},i}()}(ir);var or,ar,sr=ir.exports;!function(t){t.GROUP="g",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"}(or||(or={})),function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"}(ar||(ar={}));var ur=function(){function t(){this.plugins=[]}return t.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},t.prototype.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)}))},t}(),lr=function(){function t(t){this.clipSpaceNearZ=ar.NEGATIVE_ONE,this.plugins=[],this.config=r({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0},t)}return t.prototype.registerPlugin=function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)},t.prototype.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},t.prototype.getPlugins=function(){return this.plugins},t.prototype.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(t){Object.assign(this.config,t)},t}();function cr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function hr(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function pr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function fr(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function dr(t){return void 0===t?0:t>360||-360>t?t%360:t}function yr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?(r=t,(i=new at(3))[0]=r[0],i[1]=r[1],i[2]=r[2],i):_(t)?Ft(t,e,n):Ft(t[0],t[1]||e,t[2]||n);var r,i}function vr(t){return t*(Math.PI/180)}function gr(t){return t*(180/Math.PI)}function mr(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=u(kt(It(),e),3),a=o[0],s=o[1],l=o[2],c=Math.asin(-e[2]/a);return i>c?c>-i?(n=Math.atan2(e[6]/s,e[10]/l),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=c,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,l=n*n+a+s+u,c=n*o-r*i;return c>.499995*l?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*l>c?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function xr(t,e,n,r,i){var o,a,s,u,l,c,h,p,f,d,y=Math.cos(t),v=Math.sin(t);return o=r*y,a=i*v,s=0,u=-r*v,l=i*y,c=0,h=e,p=n,f=1,(d=new at(9))[0]=o,d[1]=a,d[2]=s,d[3]=u,d[4]=l,d[5]=c,d[6]=h,d[7]=p,d[8]=f,d}function br(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);0>e*i-n*r&&(i>e?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=gr(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var Mr=ut(),wr=ut(),Er=Zt(),kr=[It(),It(),It()],Sr=It();function Pr(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 Tr,Nr=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},t.prototype.update=function(t,e){cr(this.center,t),cr(this.halfExtents,e),hr(this.min,this.center,this.halfExtents),pr(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){pr(this.center,e,t),fr(this.center,this.center,.5),hr(this.halfExtents,e,t),fr(this.halfExtents,this.halfExtents,.5),cr(this.min,t),cr(this.max,e)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=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],o=n[2],a=this.halfExtents,s=a[0],u=a[1],l=a[2],c=r-s,h=r+s,p=i-u,f=i+u,d=o-l,y=o+l,v=e.center,g=v[0],m=v[1],x=v[2],b=e.halfExtents,M=b[0],w=b[1],E=b[2],k=g-M,S=g+M,P=m-w,T=m+w,N=x-E,C=x+E;c>k&&(c=k),S>h&&(h=S),p>P&&(p=P),T>f&&(f=T),d>N&&(d=N),C>y&&(y=C),n[0]=.5*(c+h),n[1]=.5*(p+f),n[2]=.5*(d+y),a[0]=.5*(h-c),a[1]=.5*(f-p),a[2]=.5*(y-d),this.min[0]=c,this.min[1]=p,this.min[2]=d,this.max[0]=h,this.max[1]=f,this.max[2]=y}},t.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],l=e[1],c=e[5],h=e[9],p=e[2],f=e[6],d=e[10],y=Math.abs(a),v=Math.abs(s),g=Math.abs(u),m=Math.abs(l),x=Math.abs(c),b=Math.abs(h),M=Math.abs(p),w=Math.abs(f),E=Math.abs(d);n[0]=e[12]+a*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]+p*i[0]+f*i[1]+d*i[2],r[0]=y*o[0]+v*o[1]+g*o[2],r[1]=m*o[0]+x*o[1]+b*o[2],r[2]=M*o[0]+w*o[1]+E*o[2],hr(this.min,n,r),pr(this.max,n,r)},t.prototype.intersects=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])},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n,r,i,o=new t,a=(n=[0,0,0],r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=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}([0,0,0],this.getMax(),e.getMax());return o.setMinMax(a,s),o},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?cr([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]]},t.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?cr([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]]},t}(),Cr=function(){function t(t,e){this.distance=t||0,this.normal=e||Ft(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},t.prototype.distanceToPoint=function(t){return zt(t,this.normal)-this.distance},t.prototype.normalize=function(){var t,e,n,r=1/qt(this.normal);(t=this.normal)[0]=(e=this.normal)[0]*(n=r),t[1]=e[1]*n,t[2]=e[2]*n,this.distance*=r},t.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&1>=i;return o&&n&&function(t,e,n,r){var i=e[0],o=e[1],a=e[2];t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a)}(n,t,e,i),o},t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(Tr||(Tr={}));var Ar,Or,Rr,Lr=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new Cr)}return t.prototype.extractFromVPMatrix=function(t){var e=u(t,16),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],h=e[8],p=e[9],f=e[10],d=e[11],y=e[12],v=e[13],g=e[14],m=e[15];jt(this.planes[0].normal,o-n,c-a,d-h),this.planes[0].distance=m-y,jt(this.planes[1].normal,o+n,c+a,d+h),this.planes[1].distance=m+y,jt(this.planes[2].normal,o+r,c+s,d+p),this.planes[2].distance=m+v,jt(this.planes[3].normal,o-r,c-s,d-p),this.planes[3].distance=m-v,jt(this.planes[4].normal,o-i,c-l,d-f),this.planes[4].distance=m-g,jt(this.planes[5].normal,o+i,c+l,d+f),this.planes[5].distance=m+g,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),_r=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Ir=function(){function t(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}(),Dr="Method not implemented.",Fr="Use document.documentElement instead.";!function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"}(Ar||(Ar={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"}(Or||(Or={})),function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"}(Rr||(Rr={}));var Br,jr,Gr,Yr,Wr,zr="updated",Vr=2e-4,Xr=function(){function t(){this.clipSpaceNearZ=ar.NEGATIVE_ONE,this.eventEmitter=new cn,this.matrix=ut(),this.right=Ft(1,0,0),this.up=Ft(0,1,0),this.forward=Ft(0,0,1),this.position=Ft(0,0,1),this.focalPoint=Ft(0,0,0),this.distanceVector=Ft(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=ut(),this.projectionMatrixInverse=ut(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Ar.EXPLORING,this.trackingMode=Or.DEFAULT,this.projectionMode=Rr.PERSPECTIVE,this.frustum=new Lr,this.orthoMatrix=ut()}return t.prototype.isOrtho=function(){return this.projectionMode===Rr.ORTHOGRAPHIC},t.prototype.getProjectionMode=function(){return this.projectionMode},t.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},t.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},t.prototype.getFrustum=function(){return this.frustum},t.prototype.getPosition=function(){return this.position},t.prototype.getFocalPoint=function(){return this.focalPoint},t.prototype.getDollyingStep=function(){return this.dollyingStep},t.prototype.getNear=function(){return this.near},t.prototype.getFar=function(){return this.far},t.prototype.getZoom=function(){return this.zoom},t.prototype.getOrthoMatrix=function(){return this.orthoMatrix},t.prototype.getView=function(){return this.view},t.prototype.setEnableUpdate=function(t){this.enableUpdate=t},t.prototype.setType=function(t,e){return this.type=t,this.setWorldRotation(this.type===Ar.EXPLORING),this._getAngles(),this.type===Ar.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},t.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},t.prototype.setTrackingMode=function(t){if(this.type!==Ar.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},t.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},t.prototype.getViewTransform=function(){return ft(ut(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(t,e){var n=bt(ut(),[t,e,0]);this.jitteredProjectionMatrix=yt(ut(),n,this.projectionMatrix)},t.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},t.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},t.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},t.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},t.prototype.setNear=function(t){return this.projectionMode===Rr.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},t.prototype.setFar=function(t){return this.projectionMode===Rr.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},t.prototype.setViewOffset=function(t,e,n,r,i,o){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=o,this.projectionMode===Rr.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},t.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Rr.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},t.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===Rr.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Rr.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},t.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=Ft(a.x-r,a.y-i,0),u=zt(s,this.right)/Dt(this.right),l=zt(s,this.up)/Dt(this.up);return this.pan(-u,-l),this},t.prototype.setPerspective=function(t,e,n,r){var i;this.projectionMode=Rr.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(vr(.5*this.fov))/this.zoom,a=2*o,s=this.aspect*a,u=-.5*s;if(null===(i=this.view)||void 0===i?void 0:i.enabled){var l=this.view.fullWidth,c=this.view.fullHeight;u+=this.view.offsetX*s/l,o-=this.view.offsetY*a/c,s*=this.view.width/l,a*=this.view.height/c}return function(t,e,n,r,i,o,a,s){void 0===s&&(s=!1);var u,l,c=2*o/(r-i),h=(n+e)/(n-e),p=(r+i)/(r-i);s?(u=-a/(a-o),l=-a*o/(a-o)):(u=-(a+o)/(a-o),l=-2*a*o/(a-o)),t[0]=2*o/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=h,t[9]=p,t[10]=u,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,u,u+s,o,o-a,t,this.far,this.clipSpaceNearZ===ar.ZERO),gt(this.projectionMatrix,this.projectionMatrix,Ft(1,-1,1)),ft(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(t,e,n,r,i,o){var a;this.projectionMode=Rr.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var s=(this.rright-this.left)/(2*this.zoom),u=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,h=l-s,p=l+s,f=c+u,d=c-u;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var y=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;p=(h+=y*this.view.offsetX)+y*this.view.width,d=(f-=v*this.view.offsetY)-v*this.view.height}return this.clipSpaceNearZ===ar.NEGATIVE_ONE?At(this.projectionMatrix,h,p,d,f,i,o):Ot(this.projectionMatrix,h,p,d,f,i,o),gt(this.projectionMatrix,this.projectionMatrix,Ft(1,-1,1)),ft(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},t.prototype.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=yr(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},t.prototype.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r=Ft(0,1,0);if(this.focalPoint=yr(t,e,n),this.trackingMode===Or.CINEMATIC){var i=Yt(It(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=Dt(i),a=gr(Math.asin(e/o)),s=90+gr(Math.atan2(n,t)),u=ut();xt(u,u,vr(s)),mt(u,u,vr(a)),r=Xt(It(),[0,1,0],u)}return ft(this.matrix,Rt(ut(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},t.prototype.getDistance=function(){return this.distance},t.prototype.getDistanceVector=function(){return this.distanceVector},t.prototype.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,Vr>this.distance&&(this.distance=Vr),this.dollyingStep=this.distance/100;var e=It(),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},t.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},t.prototype.setMinDistance=function(t){return this.minDistance=t,this},t.prototype.setAzimuth=function(t){return this.azimuth=dr(t),this.computeMatrix(),this._getAxes(),this.type===Ar.ORBITING||this.type===Ar.EXPLORING?this._getPosition():this.type===Ar.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(t){return this.elevation=dr(t),this.computeMatrix(),this._getAxes(),this.type===Ar.ORBITING||this.type===Ar.EXPLORING?this._getPosition():this.type===Ar.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(t){return this.roll=dr(t),this.computeMatrix(),this._getAxes(),this.type===Ar.ORBITING||this.type===Ar.EXPLORING?this._getPosition():this.type===Ar.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getRoll=function(){return this.roll},t.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},t.prototype.computeMatrix=function(){var t=Jt($t(),[0,0,1],vr(this.roll));ht(this.matrix);var e=Jt($t(),[1,0,0],vr((this.rotateWorld&&this.type!==Ar.TRACKING||this.type===Ar.TRACKING?1:-1)*this.elevation)),n=Jt($t(),[0,1,0],vr((this.rotateWorld&&this.type!==Ar.TRACKING||this.type===Ar.TRACKING?1:-1)*this.azimuth)),r=Qt($t(),n,e);r=Qt($t(),r,t);var i=Tt(ut(),r);this.type===Ar.ORBITING||this.type===Ar.EXPLORING?(vt(this.matrix,this.matrix,this.focalPoint),yt(this.matrix,this.matrix,i),vt(this.matrix,this.matrix,[0,0,this.distance])):this.type===Ar.TRACKING&&(vt(this.matrix,this.matrix,this.position),yt(this.matrix,this.matrix,i))},t.prototype._setPosition=function(t,e,n){this.position=yr(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()},t.prototype._getAxes=function(){Bt(this.right,yr(Kt(Zt(),[1,0,0,0],this.matrix))),Bt(this.up,yr(Kt(Zt(),[0,1,0,0],this.matrix))),Bt(this.forward,yr(Kt(Zt(),[0,0,1,0],this.matrix))),Wt(this.right,this.right),Wt(this.up,this.up),Wt(this.forward,this.forward)},t.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Dt(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===Ar.TRACKING||this.rotateWorld?(this.elevation=gr(Math.asin(e/r)),this.azimuth=gr(Math.atan2(-t,-n))):(this.elevation=-gr(Math.asin(e/r)),this.azimuth=-gr(Math.atan2(-t,-n)))},t.prototype._getPosition=function(){Bt(this.position,yr(Kt(Zt(),[0,0,0,1],this.matrix))),this._getDistance()},t.prototype._getFocalPoint=function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],o=e[2];t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=st(),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)),Gt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},t.prototype._getDistance=function(){this.distanceVector=Yt(It(),this.focalPoint,this.position),this.distance=Dt(this.distanceVector),this.dollyingStep=this.distance/100},t.prototype._getOrthoMatrix=function(){if(this.projectionMode===Rr.ORTHOGRAPHIC){var t=this.position,e=Jt($t(),[0,0,1],-this.roll*Math.PI/180);Pt(this.orthoMatrix,e,Ft((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Ft(this.zoom,this.zoom,1),t)}},t.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=yt(ut(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(zr)}},t.prototype.rotate=function(t,e,n){throw Error(Dr)},t.prototype.pan=function(t,e){throw Error(Dr)},t.prototype.dolly=function(t){throw Error(Dr)},t.prototype.createLandmark=function(t,e){throw Error(Dr)},t.prototype.gotoLandmark=function(t,e){throw Error(Dr)},t.prototype.cancelLandmarkAnimation=function(){throw Error(Dr)},t}();function Ur(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;arguments.length>i;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(Ur.Cache||Map),n}Ur.Cache=Map,function(t){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"}(Br||(Br={})),function(t){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"}(jr||(jr={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(Gr||(Gr={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Yr||(Yr={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Wr||(Wr={}));var Hr,qr=[{name:"em",unit_type:Br.kEms},{name:"px",unit_type:Br.kPixels},{name:"deg",unit_type:Br.kDegrees},{name:"rad",unit_type:Br.kRadians},{name:"grad",unit_type:Br.kGradians},{name:"ms",unit_type:Br.kMilliseconds},{name:"s",unit_type:Br.kSeconds},{name:"rem",unit_type:Br.kRems},{name:"turn",unit_type:Br.kTurns}];!function(t){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"}(Hr||(Hr={}));var Zr,Kr=function(t){return t?"number"===t?Br.kNumber:"percent"===t||"%"===t?Br.kPercentage:function(t){return qr.find((function(e){return e.name===t})).unit_type}(t):Br.kUnknown},$r=function(t){var e=1;switch(t){case Br.kPixels:case Br.kDegrees:case Br.kSeconds:break;case Br.kMilliseconds:e=.001;break;case Br.kRadians:e=180/Math.PI;break;case Br.kGradians:e=.9;break;case Br.kTurns:e=360}return e},Jr=function(t){switch(t){case Br.kNumber:case Br.kInteger:return"";case Br.kPercentage:return"%";case Br.kEms:return"em";case Br.kRems:return"rem";case Br.kPixels:return"px";case Br.kDegrees:return"deg";case Br.kRadians:return"rad";case Br.kGradians:return"grad";case Br.kMilliseconds:return"ms";case Br.kSeconds:return"s";case Br.kTurns:return"turn"}return""},Qr=function(){function t(){}return t.isAngle=function(t){return t===Br.kDegrees||t===Br.kRadians||t===Br.kGradians||t===Br.kTurns},t.isLength=function(t){return t>=Br.kEms&&Br.kDegrees>t},t.isRelativeUnit=function(t){return t===Br.kPercentage||t===Br.kEms||t===Br.kRems},t.isTime=function(t){return t===Br.kSeconds||t===Br.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(Yr.kNo,Wr.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=Hr.kUnitType&&this.getType()<=Hr.kClampType},t}(),ti=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return n(e,t),e.prototype.getType=function(){return Hr.kColorType},e.prototype.to=function(t){return this},e}(Qr);!function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"}(Zr||(Zr={}));var ei=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return n(e,t),e.prototype.clone=function(){return new e(this.type,this.value)},e.prototype.buildCSSText=function(t,e,n){return n},e.prototype.getType=function(){return Hr.kColorType},e}(Qr),ni=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return n(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return Hr.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(Qr),ri=Ur((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),ii=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function oi(t){return"function"==typeof t}var ai=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==u(t,2)[1]})))},si={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},ui=Ur((function(t){var e=ri(t),n=si[e];return e=(null==n?void 0:n.alias)||e})),li=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw Error()}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},ci=function(t){return function(t){switch(t){case jr.kUNumber:return Br.kNumber;case jr.kULength:return Br.kPixels;case jr.kUPercent:return Br.kPercentage;case jr.kUTime:return Br.kSeconds;case jr.kUAngle:return Br.kDegrees;default:return Br.kUnknown}}(function(t){switch(t){case Br.kNumber:case Br.kInteger:return jr.kUNumber;case Br.kPercentage:return jr.kUPercent;case Br.kPixels:return jr.kULength;case Br.kMilliseconds:case Br.kSeconds:return jr.kUTime;case Br.kDegrees:case Br.kRadians:case Br.kGradians:case Br.kTurns:return jr.kUAngle;default:return jr.kUOther}}(t))},hi=function(t){function e(e,n){void 0===n&&(n=Br.kNumber);var r,i=t.call(this)||this;return r="string"==typeof n?Kr(n):n,i.unit=r,i.value=e,i}return n(e,t),e.prototype.clone=function(){return new e(this.value,this.unit)},e.prototype.equals=function(t){return this.value===t.value&&this.unit===t.unit},e.prototype.getType=function(){return Hr.kUnitType},e.prototype.convertTo=function(t){if(this.unit===t)return new e(this.value,this.unit);var n=ci(this.unit);if(n!==ci(t)||n===Br.kUnknown)return null;var r=$r(this.unit)/$r(t);return new e(this.value*r,t)},e.prototype.buildCSSText=function(t,e,n){var r;switch(this.unit){case Br.kUnknown:break;case Br.kInteger:r=Number(this.value).toFixed(0);break;case Br.kNumber:case Br.kPercentage:case Br.kEms:case Br.kRems:case Br.kPixels:case Br.kDegrees:case Br.kRadians:case Br.kGradians:case Br.kMilliseconds:case Br.kSeconds:case Br.kTurns:var i=this.value,o=Jr(this.unit);if(-999999>i||i>999999){var a=Jr(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?li(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r},e}(Qr),pi=new hi(0,"px");new hi(1,"px");var fi,di,yi=new hi(0,"deg"),vi=function(t){function e(e,n,r,i,o){void 0===i&&(i=1),void 0===o&&(o=!1);var a=t.call(this,"rgb")||this;return a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}return n(e,t),e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},e.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},e}(ti),gi=new ni("unset"),mi=new ni("initial"),xi=new ni("inherit"),bi={"":gi,unset:gi,initial:mi,inherit:xi},Mi=function(t){return bi[t]||(bi[t]=new ni(t)),bi[t]},wi=new vi(0,0,0,0,!0),Ei=new vi(0,0,0,0),ki=Ur((function(t,e,n,r){return new vi(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Si=function(t,e){return void 0===e&&(e=Br.kNumber),new hi(t,e)},Pi=new hi(50,"%");!function(t){t[t.Standard=0]="Standard"}(fi||(fi={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"}(di||(di={}));var Ti,Ni={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ir(0,0,0,0)};function Ci(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(","),")")}!function(t){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>"}(Ti||(Ti={}));var Ai=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,a=/^(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/,p=/^\(/,f=/^\)/,d=/^,/,y=/^\#([0-9a-fA-F]+)/,v=/^([a-zA-Z]+)/,g=/^rgb/i,m=/^rgba/i,x=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,b="";function M(t){throw Error(b+": "+t)}function w(){var t=R(E);return b.length>0&&M("Invalid input not EOF"),t}function E(){return k("linear-gradient",t,P)||k("repeating-linear-gradient",e,P)||k("radial-gradient",n,T)||k("repeating-radial-gradient",r,T)||k("conic-gradient",i,T)}function k(t,e,n){return S(e,(function(e){var r=n();return r&&(B(d)||M("Missing comma before color stops")),{type:t,orientation:r,colorStops:R(L)}}))}function S(t,e){var n=B(t);if(n){B(p)||M("Missing (");var r=e(n);return B(f)||M("Missing )"),r}}function P(){return F("directional",o,1)||F("angular",h,1)}function T(){var t,e,n=N();return n&&((t=[]).push(n),e=b,B(d)&&((n=N())?t.push(n):b=e)),t}function N(){var t=function(){var t=F("shape",/^(circle)/i,0);t&&(t.style=D()||C());return t}()||function(){var t=F("shape",/^(ellipse)/i,0);t&&(t.style=I()||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 F("extent-keyword",a,1)}function A(){if(F("position",/^at/,0)){var t=O();return t||M("Missing positioning value"),t}}function O(){var t={x:I(),y:I()};if(t.x||t.y)return{type:"position",value:t}}function R(t){var e=t(),n=[];if(e)for(n.push(e);B(d);)(e=t())?n.push(e):M("One extra comma");return n}function L(){var t=F("hex",y,1)||S(m,(function(){return{type:"rgba",value:R(_)}}))||S(g,(function(){return{type:"rgb",value:R(_)}}))||F("literal",v,0);return t||M("Expected color definition"),t.length=I(),t}function _(){return B(x)[1]}function I(){return F("%",l,1)||F("position-keyword",s,1)||D()}function D(){return F("px",u,1)||F("em",c,1)}function F(t,e,n){var r=B(e);if(r)return{type:t,value:r[n]}}function B(t){var e=/^[\n\r\t\s]+/.exec(b);e&&j(e[0].length);var n=t.exec(b);return n&&j(n[0].length),n}function j(t){b=b.substring(t)}return function(t){return b=t,w()}}();var Oi=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Ri=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Li=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,_i=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Ii={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},Di=Ur((function(t){return Si("angular"===t.type?Number(t.value):Ii[t.value]||0,"deg")})),Fi=Ur((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.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==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.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:Si(e,r),cy:Si(n,i)}})),Bi=Ur((function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Ai(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var o=0,a=Number(t[0].length.value),s=1;i>s;s++){var u=null===(r=t[s].length)||void 0===r?void 0:r.value;if(!p(u)&&!p(a)){for(var l=1;s-o>l;l++)t[o+l].length={type:"%",value:"".concat(a+(Number(u)-a)*l/(s-o))};o=s,a=Number(u)}}}(r);var i=r.map((function(t){return{offset:Si(Number(t.length.value),"%"),color:Ci(t)}}));if("linear-gradient"===e)return new ei(Zr.LinearGradient,{angle:n?Di(n):yi,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o=Fi(n[0].at),a=o.cx,s=o.cy,u=void 0;if(n[0].style){var l=n[0].style,c=l.type,h=l.value;u="extent-keyword"===c?Mi(h):Si(h,c)}return new ei(Zr.RadialGradient,{cx:a,cy:s,size:u,steps:i})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=Oi.exec(t);if(r){var i=(null===(e=r[2].match(_i))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return[new ei(Zr.LinearGradient,{angle:Si(parseFloat(r[1]),"deg"),steps:i.map((function(t){var e=u(t,2),n=e[1];return{offset:Si(100*Number(e[0]),"%"),color:n}}))})]}}else if("r"===n){var o=function(t){var e,n=Ri.exec(t);if(n){var r=(null===(e=n[4].match(_i))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:Si(50,"%"),cy:Si(50,"%"),steps:r.map((function(t){var e=u(t,2),n=e[1];return{offset:Si(100*Number(e[0]),"%"),color:n}}))}}return null}(t);if(o){if(!P(o))return[new ei(Zr.RadialGradient,o)];t=o}}else if("p"===n)return function(t){var e=Li.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 ji(t){return t&&!!t.image}function Gi(t){return t&&!p(t.r)&&!p(t.g)&&!p(t.b)}var Yi=Ur((function(t){if(ji(t))return r({repetition:"repeat"},t);if(p(t)&&(t=""),"transparent"===t)return Ei;"currentColor"===t&&(t="black");var e=Bi(t);if(e)return e;var n=Cn(t),i=[0,0,0,0];return null!==n&&(i[0]=n.r||0,i[1]=n.g||0,i[2]=n.b||0,i[3]=n.opacity),ki.apply(void 0,l([],u(i),!1))}));function Wi(t,e){if(Gi(t)&&Gi(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(L(e[n],0,255));return e[3]=L(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function zi(t,e){if(p(e))return Si(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Si(Number(e),"px");if("deg".search(t)>=0)return Si(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return Si(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var Vi=function(t){return zi(/px/g,t)},Xi=Ur(Vi);Ur((function(t){return zi(RegExp("%","g"),t)}));var Ui=function(t){return _(t)||isFinite(Number(t))?Si(Number(t)||0,"px"):zi(RegExp("px|%|em|rem","g"),t)},Hi=Ur(Ui),qi=function(t){return zi(/deg|rad|grad|turn/g,t)},Zi=Ur(qi);function Ki(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=ci(t.unit),l=t.convertTo(u),c=e.convertTo(u);return l&&c?(a=l.value,s=c.value,o=Jr(t.unit)):(hi.isLength(t.unit)||hi.isLength(e.unit))&&(a=to(t,i,n),s=to(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function $i(t){var e=0;return t.unit===Br.kDegrees?e=t.value:t.unit===Br.kRadians?e=gr(Number(t.value)):t.unit===Br.kTurns&&(e=360*Number(t.value)),e}function Ji(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):P(t)?n=t.split(" ").map((function(t){return Number(t)})):_(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]: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]]}function Qi(t){return P(t)?t.split(" ").map((function(t){return Hi(t)})):t.map((function(t){return Hi(""+t)}))}function to(t,e,n){if(0===t.value)return 0;if(t.unit===Br.kPixels)return Number(t.value);if(t.unit===Br.kPercentage&&n){var r=n.nodeName===or.GROUP?n.getLocalBounds():n.geometry.contentBounds;return t.value/100*r.halfExtents[e]*2}return 0}var eo=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function no(t){if(void 0===t&&(t=""),"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,eo.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return zi(/deg|rad|grad|turn|px|%/g,t)||Yi(t)}))}),n.lastIndex===t.length)return r}return[]}function ro(t){return""+t}var io=function(t){return Si("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)},oo=Ur(io);function ao(t,e){return[t,e,ro]}function so(t,e){return function(n,r){return[n,r,function(n){return ro(L(n,t,e))}]}}function uo(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function lo(t){return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=tn(t.parsedStyle.path.absolutePath)),t.parsedStyle.path.totalLength}function co(t,e){return t[0]===e[0]&&t[1]===e[1]}function ho(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.acos((o+a-(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)))/(2*Math.sqrt(o)*Math.sqrt(a)));if(!s||0===Math.sin(s)||I(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 po(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Ur((function(t){return P(t)?t.split(" ").map(oo):t.map(oo)}));var fo=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))))},yo=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var u=vr(r=D(r,360));if(t.x===a.x&&t.y===a.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-a.x)/2,c=(t.y-a.y)/2,h={x:Math.cos(u)*l+Math.sin(u)*c,y:-Math.sin(u)*l+Math.cos(u)*c},p=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);p>1&&(e*=Math.sqrt(p),n*=Math.sqrt(p));var f=(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)),d=(i!==o?1:-1)*Math.sqrt(f=0>f?0:f),y=d*(e*h.y/n),v=d*(-n*h.x/e),g={x:Math.cos(u)*y-Math.sin(u)*v+(t.x+a.x)/2,y:Math.sin(u)*y+Math.cos(u)*v+(t.y+a.y)/2},m={x:(h.x-y)/e,y:(h.y-v)/n},x=fo({x:1,y:0},m),b=fo(m,{x:(-h.x-y)/e,y:(-h.y-v)/n});!o&&b>0?b-=2*Math.PI:o&&0>b&&(b+=2*Math.PI);var M=x+(b%=2*Math.PI)*s,w=e*Math.cos(M),E=n*Math.sin(M);return{x:Math.cos(u)*w-Math.sin(u)*E+g.x,y:Math.sin(u)*w+Math.cos(u)*E+g.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+b,ellipticalArcAngle:M,ellipticalArcCenter:g,resultantRx:e,resultantRy:n}};function vo(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,u=r.xRotation,l=r.arcFlag,c=r.sweepFlag,h=yo({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),p=yo({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),f=p.x-h.x,d=p.y-h.y,y=Math.sqrt(f*f+d*d);return{x:-f/y,y:-d/y}}function go(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function mo(t,e){return go(t)*go(e)?(t[0]*e[0]+t[1]*e[1])/(go(t)*go(e)):1}function xo(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(mo(t,e))}function bo(t,e){var n=e[1],r=e[2],i=D(vr(e[3]),2*Math.PI),o=e[4],a=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,p=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(u-c)/2,f=h*h/(n*n)+p*p/(r*r);f>1&&(n*=Math.sqrt(f),r*=Math.sqrt(f));var d=n*n*(p*p)+r*r*(h*h),y=d?Math.sqrt((n*n*(r*r)-d)/d):1;o===a&&(y*=-1),isNaN(y)&&(y=0);var v=r?y*n*p/r:0,g=n?y*-r*h/n:0,m=(s+l)/2+Math.cos(i)*v-Math.sin(i)*g,x=(u+c)/2+Math.sin(i)*v+Math.cos(i)*g,b=[(h-v)/n,(p-g)/r],M=[(-1*h-v)/n,(-1*p-g)/r],w=xo([1,0],b),E=xo(b,M);return mo(b,M)>-1||(E=Math.PI),1>mo(b,M)||(E=0),0===a&&E>0&&(E-=2*Math.PI),1===a&&0>E&&(E+=2*Math.PI),{cx:m,cy:x,rx:co(t,[l,c])?0:n,ry:co(t,[l,c])?0:r,startAngle:w,endAngle:w+E,xRotation:i,arcFlag:o,sweepFlag:a}}function Mo(t,e,n,r){var i=.5522847498307936,o=t*i,a=e*i,s=n-t,u=n+t,l=r-e,c=r+e;return[["M",s,r],["C",s,r-a,n-o,l,n,l],["C",n+o,l,u,r-a,u,r],["C",u,r+a,n+o,c,n,c],["C",n-o,c,s,r+a,s,r],["Z"]]}function wo(t,e){void 0===e&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case or.LINE:var r=t.parsedStyle,i=r.x1,o=r.y1,a=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===o?0:o,void 0===a?0:a,void 0===s?0:s);break;case or.CIRCLE:var c=t.parsedStyle,h=c.r,p=void 0===h?0:h,f=c.cx,d=c.cy;n=Mo(p,p,void 0===f?0:f,void 0===d?0:d);break;case or.ELLIPSE:var y=t.parsedStyle,v=y.rx,g=y.ry,m=y.cx,x=y.cy;n=Mo(void 0===v?0:v,void 0===g?0:g,void 0===m?0:m,void 0===x?0:x);break;case or.POLYLINE:case or.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===or.POLYGON);break;case or.RECT:var b=t.parsedStyle,M=b.width,w=void 0===M?0:M,E=b.height,k=void 0===E?0:E,S=b.x,P=void 0===S?0:S,T=b.y,N=void 0===T?0:T,C=b.radius,A=C&&C.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var o=u(i,4),a=o[0],s=o[1],l=o[2],c=o[3],h=t>0?1:-1,p=e>0?1:-1,f=h+p!==0?1:0;return[["M",h*a+n,r],["L",t-h*s+n,r],s?["A",s,s,0,0,f,t+n,p*s+r]:null,["L",t+n,e-p*l+r],l?["A",l,l,0,0,f,t+n-h*l,e+r]:null,["L",n+h*c,e+r],c?["A",c,c,0,0,f,n,e+r-p*c]:null,["L",n,p*a+r],a?["A",a,a,0,0,f,h*a+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"]]}(w,k,P,N,A&&C.map((function(t){return L(t,0,Math.min(Math.abs(w)/2,Math.abs(k)/2))})));break;case or.PATH:n=l([],u(t.parsedStyle.path.absolutePath),!1)}if(n.length)return function(t,e,n){var r=e.parsedStyle,i=r.defX,o=void 0===i?0:i,a=r.defY,s=void 0===a?0:a;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=Ft(e[1]-o,e[2]-s,0);n&&Xt(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=Ft(e[1]-o,e[2]-s,0),u=Ft(e[3]-o,e[4]-s,0),l=Ft(e[5]-o,e[6]-s,0);n&&(Xt(a,a,n),Xt(u,u,n),Xt(l,l,n)),r="".concat(e[0]).concat(a[0],",").concat(a[1],",").concat(u[0],",").concat(u[1],",").concat(l[0],",").concat(l[1])}else if("A"===e[0]){var c=Ft(e[6]-o,e[7]-s,0);n&&Xt(c,c,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(c[0],",").concat(c[1])}else"Q"===e[0]&&(a=Ft(e[1]-o,e[2]-s,0),u=Ft(e[3]-o,e[4]-s,0),n&&(Xt(a,a,n),Xt(u,u,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(n,t,e)}var Eo=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=Fe(t)}catch(n){e=Fe(""),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],o=void 0;"L"===i||"M"===i?o=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(o=[n[n.length-2],n[n.length-1]]),o&&co([r[1],r[2]],o)&&(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 o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;a>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]],o=s;break;case"A":var h=bo(n,u);c.arcParams=h}if("Z"===l)n=i,r=t[o+1];else{var p=u.length;n=[u[p-2],u[p-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),c.currentPoint=n,e[o]&&co(n,e[o].currentPoint)&&(e[o].prePoint=c.prePoint),c.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var f=c.prePoint;if(["L","H","V"].includes(l))c.startTangent=[f[0]-n[0],f[1]-n[1]],c.endTangent=[n[0]-f[0],n[1]-f[1]];else if("Q"===l)c.startTangent=[f[0]-(d=[u[1],u[2]])[0],f[1]-d[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]];else if("T"===l){var d=po((v=e[s-1]).currentPoint,f);"Q"===v.command?(c.command="Q",c.startTangent=[f[0]-d[0],f[1]-d[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]]):(c.command="TL",c.startTangent=[f[0]-n[0],f[1]-n[1]],c.endTangent=[n[0]-f[0],n[1]-f[1]])}else if("C"===l){var y=[u[3],u[4]];c.startTangent=[f[0]-(g=[u[1],u[2]])[0],f[1]-g[1]],c.endTangent=[n[0]-y[0],n[1]-y[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[g[0]-y[0],g[1]-y[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[y[0]-g[0],y[1]-g[1]])}else if("S"===l){var v,g=po((v=e[s-1]).currentPoint,f);y=[u[1],u[2]],"C"===v.command?(c.command="C",c.startTangent=[f[0]-g[0],f[1]-g[1]],c.endTangent=[n[0]-y[0],n[1]-y[1]]):(c.command="SQ",c.startTangent=[f[0]-y[0],f[1]-y[1]],c.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===l){var m=vo(c,0),x=m.x,b=m.y,M=vo(c,1,!1),w=M.x,E=M.y;c.startTangent=[x,b],c.endTangent=[w,E]}e.push(c)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;t.length>o;o++){var a=(y=t[o]).currentPoint,s=y.params,u=y.prePoint,l=void 0;switch(y.command){case"Q":l=nr(u[0],u[1],s[1],s[2],s[3],s[4]);break;case"C":l=$n(u[0],u[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var c=y.arcParams;l=Vn(c.cx,c.cy,c.rx,c.ry,c.xRotation,c.startAngle,c.endAngle);break;default:n.push(a[0]),r.push(a[1])}l&&(y.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height)),e&&("L"===y.command||"M"===y.command)&&y.prePoint&&y.nextPoint&&i.push(y)}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 h=k(n),p=k(r),f=E(n),d=E(r);if(0===i.length)return{x:h,y:p,width:f-h,height:d-p};for(o=0;i.length>o;o++){var y;(a=(y=i[o]).currentPoint)[0]===h?h-=ho(y,e).xExtra:a[0]===f&&(f+=ho(y,e).xExtra),a[1]===p?p-=ho(y,e).yExtra:a[1]===d&&(d+=ho(y,e).yExtra)}return{x:h,y:p,width:f-h,height:d-p}}(a,0),u=s.x,l=s.y,c=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,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}}},ko=Ur(Eo);function So(t){return P(t)?ko(t):Eo(t)}function Po(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=ze(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=ze(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=rn(r,i));var a,s,u,l,c,h,p,f,d=en(o[0])!==en(o[1])?(s=(a=o[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[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))})))):o[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[d,(u=o[1],l=d,c=u.length-1,h=[],p=0,f=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a=i+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(u),f.forEach((function(t,e){u.slice(1).forEach((function(t,n){p+=Ve(u[(e+n)%c].slice(-2),l[n%c].slice(-2))})),h[e]=p,p=0})),f[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function To(t,e){var n;n=P(t)?t.split(" ").map((function(t){var e=u(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,o=[],a=0,s=Qn(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=Un(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))}));var c=Math.min.apply(Math,l([],u(n.map((function(t){return t[0]}))),!1)),h=Math.min.apply(Math,l([],u(n.map((function(t){return t[1]}))),!1));return e&&(e.parsedStyle.defX=c,e.parsedStyle.defY=h),{points:n,totalLength:s,segments:o}}function No(t,e){return[t.points,e.points,function(t){return t}]}var Co=null;function Ao(t){return function(e){var n=0;return t.map((function(t){return t===Co?e[n++]:t}))}}function Oo(t){return t}var Ro={matrix:["NNNNNN",[Co,Co,0,0,Co,Co,0,0,0,0,1,0,Co,Co,0,1],Oo],matrix3d:["NNNNNNNNNNNNNNNN",Oo],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Ao([Co,Co,new hi(1)]),Oo],scalex:["N",Ao([Co,new hi(1),new hi(1)]),Ao([Co,new hi(1)])],scaley:["N",Ao([new hi(1),Co,new hi(1)]),Ao([new hi(1),Co])],scalez:["N",Ao([new hi(1),new hi(1),Co])],scale3d:["NNN",Oo],skew:["Aa",null,Oo],skewx:["A",null,Ao([Co,yi])],skewy:["A",null,Ao([yi,Co])],translate:["Tt",Ao([Co,Co,pi]),Oo],translatex:["T",Ao([Co,pi,pi]),Ao([Co,pi])],translatey:["T",Ao([pi,Co,pi]),Ao([pi,Co])],translatez:["L",Ao([pi,pi,Co])],translate3d:["TTL",Oo]};function Lo(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=Ro[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(s.length>u.length)return[];for(var l=[],c=0;u.length>c;c++){var h=s[c],p=u[c],f=void 0;if(void 0===(f=h?{A:function(t){return"0"===t.trim()?yi:Zi(t)},N:oo,T:Hi,L:Xi}[p.toUpperCase()](h):{a:yi,n:l[0],t:pi}[p]))return[];l.push(f)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function _o(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=Ro[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(s.length>u.length)return[];for(var l=[],c=0;u.length>c;c++){var h=s[c],p=u[c],f=void 0;if(void 0===(f=h?{A:function(t){return"0"===t.trim()?yi:qi(t)},N:io,T:Ui,L:Vi}[p.toUpperCase()](h):{a:yi,n:l[0],t:pi}[p]))return[];l.push(f)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function Io(t){var e,n,r,i;switch(t.t){case"rotatex":return i=vr($i(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=vr($i(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=vr($i(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=vr($i(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}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=vr($i(t.d[0])),h=vr($i(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=vr($i(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=vr($i(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=to(t.d[0],0,null)||0,n=to(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=to(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=to(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=to(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=to(t.d[0],0,null)||0,n=to(t.d[1],0,null)||0,r=to(t.d[2],0,null)||0,1];case"perspective":var p=to(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,p?-1/p: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 Do(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 Fo(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return function(t,e,n,r,i,o){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}(Mr,t))return!1;if(lt(wr,Mr),wr[3]=0,wr[7]=0,wr[11]=0,wr[15]=1,1e-8>Math.abs(dt(wr)))return!1;var a,s,u=Mr[3],l=Mr[7],c=Mr[11],h=Mr[12],p=Mr[13],f=Mr[14],d=Mr[15];if(0!==u||0!==l||0!==c){if(Er[0]=u,Er[1]=l,Er[2]=c,Er[3]=d,!ft(wr,wr))return!1;pt(wr,wr),Kt(i,Er,wr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=h,e[1]=p,e[2]=f,(a=kr)[0][0]=(s=Mr)[0],a[0][1]=s[1],a[0][2]=s[2],a[1][0]=s[4],a[1][1]=s[5],a[1][2]=s[6],a[2][0]=s[8],a[2][1]=s[9],a[2][2]=s[10],n[0]=Dt(kr[0]),Wt(kr[0],kr[0]),r[0]=zt(kr[0],kr[1]),Pr(kr[1],kr[1],kr[0],1,-r[0]),n[1]=Dt(kr[1]),Wt(kr[1],kr[1]),r[0]/=n[1],r[1]=zt(kr[0],kr[2]),Pr(kr[2],kr[2],kr[0],1,-r[1]),r[2]=zt(kr[1],kr[2]),Pr(kr[2],kr[2],kr[1],1,-r[2]),n[2]=Dt(kr[2]),Wt(kr[2],kr[2]),r[1]/=n[2],r[2]/=n[2],Vt(Sr,kr[1],kr[2]),0>zt(kr[0],Sr))for(var y=0;3>y;y++)n[y]*=-1,kr[y][0]*=-1,kr[y][1]*=-1,kr[y][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+kr[0][0]-kr[1][1]-kr[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-kr[0][0]+kr[1][1]-kr[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-kr[0][0]-kr[1][1]+kr[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+kr[0][0]+kr[1][1]+kr[2][2],0)),kr[2][1]>kr[1][2]&&(o[0]=-o[0]),kr[0][2]>kr[2][0]&&(o[1]=-o[1]),kr[1][0]>kr[0][1]&&(o[2]=-o[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(Io).reduce(Do)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var Bo=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 o=0;4>o;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)a[s][3]=o[s];for(s=0;3>s;s++)for(var u=0;3>u;u++)a[3][s]+=e[u]*a[u][s];var l=i[0],c=i[1],h=i[2],p=i[3],f=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];f[0][0]=1-2*(c*c+h*h),f[0][1]=2*(l*c-h*p),f[0][2]=2*(l*h+c*p),f[1][0]=2*(l*c+h*p),f[1][1]=1-2*(l*l+h*h),f[1][2]=2*(c*h-l*p),f[2][0]=2*(l*h-c*p),f[2][1]=2*(c*h+l*p),f[2][2]=1-2*(l*l+c*c),a=t(a,f);var d,y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(r[2]&&(y[2][1]=r[2],a=t(a,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],a=t(a,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],a=t(a,y)),s=0;3>s;s++)for(u=0;3>u;u++)a[s][u]*=n[s];return 0==(d=a)[0][2]&&0==d[0][3]&&0==d[1][2]&&0==d[1][3]&&0==d[2][0]&&0==d[2][1]&&1==d[2][2]&&0==d[2][3]&&0==d[3][2]&&1==d[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function jo(t){return t.toFixed(6).replace(".000000","")}function Go(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Fo(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Fo(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=L(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return Bo(t[0],t[1],t[2],e,t[4]).map(jo).join(",")}])}function Yo(t){return t.replace(/[xy]/,"")}function Wo(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function zo(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?Si(a):Si(a,t.unit)}))})},o=0;t.length>o;o++)i(o)}var a,s,u=[],l=[],c=[];if(t.length!==e.length)u=[(m=Go(t,e))[0]],l=[m[1]],c=[["matrix",[m[2]]]];else for(o=0;t.length>o;o++){var h=t[o].t,p=e[o].t,f=t[o].d,d=e[o].d,y=Ro[h],v=Ro[p],g=void 0;if(s=p,"perspective"===(a=h)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var m=Go([t[o]],[e[o]]);u.push(m[0]),l.push(m[1]),c.push(["matrix",[m[2]]])}else{if(h===p)g=h;else if(y[2]&&v[2]&&Yo(h)===Yo(p))g=Yo(h),f=y[2](f),d=v[2](d);else{if(!y[1]||!v[1]||Wo(h)!==Wo(p)){u=[(m=Go(t,e))[0]],l=[m[1]],c=[["matrix",[m[2]]]];break}g=Wo(h),f=y[1](f),d=v[1](d)}for(var x=[],b=[],M=[],w=0;f.length>w;w++){m=Ki(f[w],d[w],n,!1,w);x[w]=m[0],b[w]=m[1],M.push(m[2])}u.push(x),l.push(b),c.push([g,M])}}if(r){var E=u;u=l,l=E}return[u,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return c[e][1][n](t)})).join(",");return"matrix"===c[e][0]&&16===n.split(",").length&&(c[e][0]="matrix3d"),"matrix3d"===c[e][0]&&6===n.split(",").length&&(c[e][0]="matrix"),c[e][0]+"("+n+")"})).join(" ")}]}var Vo=Ur((function(t){if(P(t)){if("text-anchor"===t)return[Si(0,"px"),Si(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:[Hi(Uo(e[0])),Hi(Uo(e[1]))]}return[Si(t[0]||0,"px"),Si(t[1]||0,"px")]})),Xo=function(t){if(P(t)){if("text-anchor"===t)return[Si(0,"px"),Si(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:[Ui(Uo(e[0])),Ui(Uo(e[1]))]}return[Si(t[0]||0,"px"),Si(t[1]||0,"px")]};function Uo(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var Ho=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Ti.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Ti.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Ti.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Ti.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Ti.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Ti.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Ti.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Ti.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Ti.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Ti.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Ti.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:Ti.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Ti.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Ti.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Ti.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Ti.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Ti.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Ti.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:Ti.FILTER},{n:"clipPath",syntax:Ti.DEFINED_PATH},{n:"textPath",syntax:Ti.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Ti.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Ti.TRANSFORM},{n:"transformOrigin",p:100,d:function(t){return t===or.CIRCLE||t===or.ELLIPSE?"center":t===or.TEXT?"text-anchor":"left top"},l:!0,syntax:Ti.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(t){return t===or.CIRCLE||t===or.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:Ti.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:Ti.COORDINATE},{n:"cy",int:!0,d:"0",syntax:Ti.COORDINATE},{n:"cz",int:!0,d:"0",syntax:Ti.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Ti.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Ti.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Ti.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:Ti.COORDINATE},{n:"y",int:!0,d:"0",syntax:Ti.COORDINATE},{n:"z",int:!0,d:"0",syntax:Ti.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Ti.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Ti.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Ti.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Ti.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Ti.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Ti.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Ti.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Ti.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Ti.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:Ti.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Ti.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Ti.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Ti.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Ti.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:Ti.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Ti.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Ti.NUMBER,d:function(t){return t===or.PATH||t===or.POLYGON||t===or.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:Ti.MARKER},{n:"markerEnd",syntax:Ti.MARKER},{n:"markerMid",syntax:Ti.MARKER},{n:"markerStartOffset",syntax:Ti.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Ti.LENGTH,l:!0,int:!0,d:"0"}],qo=Ho.filter((function(t){return!!t.l})).map((function(t){return t.n})),Zo={},Ko=new WeakMap,$o=function(){function t(t){var e=this;this.runtime=t,Ho.forEach((function(t){e.registerMetadata(t)}))}return t.prototype.registerMetadata=function(t){l([t.n],u(t.a||[]),!1).forEach((function(e){Zo[e]=t}))},t.prototype.unregisterMetadata=function(t){delete Zo[t]},t.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},t.prototype.processProperties=function(t,e,n){var i=this;if(void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0}),!this.runtime.enableCSSParsing){Object.assign(t.attributes,e);var o=Object.keys(e),a=t.parsedStyle.clipPath,s=t.parsedStyle.offsetPath;t.parsedStyle=Object.assign(t.parsedStyle,e);var u=!!n.forceUpdateGeometry;if(!u)for(var l=0;qo.length>l;l++)if(qo[l]in e){u=!0;break}return e.fill&&(t.parsedStyle.fill=Yi(e.fill)),e.stroke&&(t.parsedStyle.stroke=Yi(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=Yi(e.shadowColor)),e.filter&&(t.parsedStyle.filter=no(e.filter)),p(e.radius)||(t.parsedStyle.radius=Ji(e.radius,4)),p(e.lineDash)||(t.parsedStyle.lineDash=Ji(e.lineDash,2)),e.points&&(t.parsedStyle.points=To(e.points,t)),""===e.path&&(t.parsedStyle.path=r({},Ni)),e.path&&(t.parsedStyle.path=So(e.path),t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},t,null),e.clipPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",a,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,e.offsetPath,t,this.runtime),e.anchor&&(t.parsedStyle.anchor=Ji(e.anchor,2)),e.transform&&(t.parsedStyle.transform=Lo(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=Vo(e.transformOrigin)),e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),(t.nodeName!==or.CIRCLE&&t.nodeName!==or.ELLIPSE||p(e.cx)&&p(e.cy))&&(t.nodeName!==or.RECT&&t.nodeName!==or.IMAGE&&t.nodeName!==or.GROUP&&t.nodeName!==or.HTML&&t.nodeName!==or.TEXT&&t.nodeName!==or.MESH||p(e.x)&&p(e.y)&&p(e.z))&&(t.nodeName!==or.LINE||p(e.x1)&&p(e.y1)&&p(e.z1)&&p(e.x2)&&p(e.y2)&&p(e.z2))||this.runtime.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(t,o),p(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(t,o),e.path&&this.runtime.CSSPropertySyntaxFactory["<path>"].postProcessor(t,o),e.points&&this.runtime.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(t,o),p(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(t,o),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(t,o),void(u&&this.updateGeometry(t))}var c=n.skipUpdateAttribute,h=n.skipParse,f=n.usedAttributes,d=n.memoize,y=n.forceUpdateGeometry,v=Object.keys(e);v.forEach((function(n){var r;c||(t.attributes[n]=e[n]),!y&&(null===(r=Zo[n])||void 0===r?void 0:r.l)&&(y=!0)})),h||v.forEach((function(e){t.computedStyle[e]=i.parseProperty(e,t.attributes[e],t,d)})),(null==f?void 0:f.length)&&(v=Array.from(new Set(v.concat(f)))),v.forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=i.computeProperty(e,t.computedStyle[e],t,d))})),y&&this.updateGeometry(t),v.forEach((function(e){e in t.parsedStyle&&i.postProcessProperty(e,t,v)})),this.runtime.enableCSSParsing&&t.children.length&&v.forEach((function(e){e in t.parsedStyle&&i.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},t.prototype.parseProperty=function(t,e,n,r){var i=Zo[t],o=e;if((""===e||p(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)o=Mi(e);else if(i){var a=i.k,s=i.syntax,u=s&&this.getPropertySyntax(s);a&&a.indexOf(e)>-1?o=Mi(e):u&&(!r&&u.parserUnmemoize?o=u.parserUnmemoize(e,n):u.parser&&(o=u.parser(e,n)))}return o},t.prototype.computeProperty=function(t,e,n,r){var i=Zo[t],o=e;if(i){var a=i.syntax,s=i.d;if(e instanceof ni){var u=e.value;if("unset"===u&&(u=i.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===u)p(s)||(e=this.parseProperty(t,oi(s)?s(n.nodeName):s,n,r));else if("inherit"===u){var l=this.tryToResolveProperty(n,t,{inherited:!0});return p(l)?void this.addUnresolveProperty(n,t):l}}var c=a&&this.getPropertySyntax(a);if(c&&c.calculator)o=c.calculator(t,n.parsedStyle[t],e,n,this.runtime);else o=e instanceof ni?e.value:e}return o},t.prototype.postProcessProperty=function(t,e,n){var r=Zo[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},t.prototype.addUnresolveProperty=function(t,e){var n=Ko.get(t);n||(Ko.set(t,[]),n=Ko.get(t)),-1===n.indexOf(e)&&n.push(e)},t.prototype.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=Ko.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},t.prototype.recalc=function(t){var e=Ko.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Ko.delete(t)}},t.prototype.updateGeometry=function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new Nr),r.renderBounds||(r.renderBounds=new Nr);var i=t.parsedStyle,o=n.update(i,t),a=o.width,s=o.height,u=o.depth,l=void 0===u?0:u,c=o.offsetX,h=void 0===c?0:c,p=o.offsetY,f=void 0===p?0:p,d=o.offsetZ,y=void 0===d?0:d,v=[Math.abs(a)/2,Math.abs(s)/2,l/2],g=i.stroke,m=i.lineWidth,x=i.increasedLineWidthForHitTesting,b=i.shadowType,M=i.shadowColor,w=i.filter,E=void 0===w?[]:w,k=i.transformOrigin,S=i.anchor;e===or.TEXT?delete i.anchor:e===or.MESH&&(i.anchor[2]=.5);var P=[(1-2*(S&&S[0]||0))*a/2+h,(1-2*(S&&S[1]||0))*s/2+f,(1-2*(S&&S[2]||0))*v[2]+y];if(r.contentBounds.update(P,v),g&&!g.isNone){var T=((m||0)+(x||0))*(e===or.POLYLINE||e===or.POLYGON||e===or.PATH?Math.SQRT2:.5);v[0]+=T,v[1]+=T}if(r.renderBounds.update(P,v),M&&b&&"inner"!==b){var N=r.renderBounds,C=N.min,A=N.max,O=i.shadowBlur||0,R=i.shadowOffsetX||0,L=i.shadowOffsetY||0,_=A[0]+O+R,I=C[1]-O+L,D=A[1]+O+L;C[0]=Math.min(C[0],C[0]-O+R),A[0]=Math.max(A[0],_),C[1]=Math.min(C[1],I),A[1]=Math.max(A[1],D),r.renderBounds.setMinMax(C,A)}E.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,pr(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=r.renderBounds,l=u.min,c=u.max,h=c[0]+s+o,p=l[1]-s+a,f=c[1]+s+a;l[0]=Math.min(l[0],l[0]-s+o),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],p),c[1]=Math.max(c[1],f),r.renderBounds.setMinMax(l,c)}})),S=i.anchor;var F=0>a,B=0>s,j=(F?-1:1)*(k?to(k[0],0,t):0),G=(B?-1:1)*(k?to(k[1],1,t):0);t.setOrigin(j-=(F?-1:1)*(S&&S[0]||0)*r.contentBounds.halfExtents[0]*2,G-=(B?-1:1)*(S&&S[1]||0)*r.contentBounds.halfExtents[1]*2),this.runtime.sceneGraphService.dirtifyToRoot(t)}},t.prototype.updateSizeAttenuation=function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=t.style.rawLineWidth/e,t.nodeName===or.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=t.style.rawR/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===or.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))},t.prototype.isPropertyInheritable=function(t){var e=Zo[t];return!!e&&e.inh},t}(),Jo=function(){function t(){this.parser=Zi,this.parserUnmemoize=qi,this.parserWithCSSDisabled=null,this.mixer=ao}return t.prototype.calculator=function(t,e,n,r){return $i(n)},t}(),Qo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof ni&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n},t}(),ta=function(){function t(){this.parser=Yi,this.parserWithCSSDisabled=Yi,this.mixer=Wi}return t.prototype.calculator=function(t,e,n,r){return n instanceof ni?"none"===n.value?wi:Ei:n},t}(),ea=function(){function t(){this.parser=no}return t.prototype.calculator=function(t,e,n){return n instanceof ni?[]:n},t}();function na(t){var e=t.parsedStyle.fontSize;return p(e)?null:e}var ra=function(){function t(){this.parser=Hi,this.parserUnmemoize=Ui,this.parserWithCSSDisabled=null,this.mixer=ao}return t.prototype.calculator=function(t,e,n,r,i){var o;if(_(n))return n;if(!hi.isRelativeUnit(n.unit))return n.value;var a=i.styleValueRegistry;if(n.unit===Br.kPercentage)return 0;if(n.unit===Br.kEms){if(r.parentNode){if(s=na(r.parentNode))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}if(n.unit===Br.kRems){if(null===(o=null==r?void 0:r.ownerDocument)||void 0===o?void 0:o.documentElement){var s;if(s=na(r.ownerDocument.documentElement))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}},t}(),ia=function(){function t(){this.mixer=uo}return t.prototype.parser=function(t){var e=Qi(_(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),oa=function(){function t(){this.mixer=uo}return t.prototype.parser=function(t){var e=Qi(_(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),aa=ut();function sa(t,e){var n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0;return e.resetLocalTransform(),e.setLocalPosition(n,r),t.forEach((function(t){var i=t.t,o=t.d;if("scale"===i){var a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1];e.scaleLocal(a[0],a[1],1)}else if("scalex"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(a[0],1,1)}else if("scaley"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,a[0],1)}else if("scalez"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1];e.scaleLocal(1,1,a[0])}else if("scale3d"===i){a=(null==o?void 0:o.map((function(t){return t.value})))||[1,1,1];e.scaleLocal(a[0],a[1],a[2])}else if("translate"===i){e.translateLocal((s=o||[pi,pi])[0].value,s[1].value,0)}else if("translatex"===i){e.translateLocal((s=o||[pi])[0].value,0,0)}else if("translatey"===i){e.translateLocal(0,(s=o||[pi])[0].value,0)}else if("translatez"===i){e.translateLocal(0,0,(s=o||[pi])[0].value)}else if("translate3d"===i){var s;e.translateLocal((s=o||[pi,pi,pi])[0].value,s[1].value,s[2].value)}else if("rotate"===i){e.rotateLocal(0,0,$i((o||[yi])[0]))}else if("rotatex"===i){e.rotateLocal($i((o||[yi])[0]),0,0)}else if("rotatey"===i){e.rotateLocal(0,$i((o||[yi])[0]),0)}else if("rotatez"===i){e.rotateLocal(0,0,$i((o||[yi])[0]))}else if("rotate3d"===i);else if("skew"===i){var c=(null==o?void 0:o.map((function(t){return t.value})))||[0,0];e.setLocalSkew(vr(c[0]),vr(c[1]))}else if("skewx"===i){c=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(vr(c[0]),e.getLocalSkew()[1])}else if("skewy"===i){c=(null==o?void 0:o.map((function(t){return t.value})))||[0];e.setLocalSkew(e.getLocalSkew()[0],vr(c[0]))}else if("matrix"===i){var h=u(o.map((function(t){return t.value})),6);e.setLocalTransform(ct(aa,h[0],h[1],0,0,h[2],h[3],0,0,0,0,1,0,h[4]+n,h[5]+r,0,1))}else"matrix3d"===i&&(ct.apply(_t,l([aa],u(o.map((function(t){return t.value}))),!1)),aa[12]+=n,aa[13]+=r,e.setLocalTransform(aa))})),e.getLocalTransform()}var ua=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.postProcessor=function(t,e){var n,r,i;switch(t.nodeName){case or.CIRCLE:case or.ELLIPSE:var o=t.parsedStyle,a=o.cx,s=o.cy,l=o.cz;p(a)||(n=a),p(s)||(r=s),p(l)||(i=l);break;case or.LINE:var c=t.parsedStyle,h=c.y1,f=c.y2;n=Math.min(c.x1,c.x2),r=Math.min(h,f),i=0;break;case or.RECT:case or.IMAGE:case or.GROUP:case or.HTML:case or.TEXT:case or.MESH:p(t.parsedStyle.x)||(n=t.parsedStyle.x),p(t.parsedStyle.y)||(r=t.parsedStyle.y),p(t.parsedStyle.z)||(i=t.parsedStyle.z)}if(t.nodeName!==or.PATH&&t.nodeName!==or.POLYLINE&&t.nodeName!==or.POLYGON&&(t.parsedStyle.defX=n||0,t.parsedStyle.defY=r||0),(!p(n)||!p(r)||!p(i))&&-1===e.indexOf("transform")){var d=t.parsedStyle.transform;if(d&&d.length)sa(d,t);else{var y=u(t.getLocalPosition(),3),v=y[0],g=y[1],m=y[2];t.setLocalPosition(p(n)?v:n,p(r)?g:r,p(i)?m:i)}}},e}(ra),la=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof ni&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),ca=function(){function t(){this.mixer=ao,this.parser=oo,this.parserUnmemoize=io,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),ha=function(){function t(){this.parser=oo,this.parserUnmemoize=io,this.parserWithCSSDisabled=null,this.mixer=so(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t.prototype.postProcessor=function(t){var e=t.parsedStyle,n=e.offsetPath;if(n){var r=n.nodeName;if(r===or.LINE||r===or.PATH||r===or.POLYLINE){var i=n.getPoint(e.offsetDistance);i&&(t.parsedStyle.defX=i.x,t.parsedStyle.defY=i.y,t.setLocalPosition(i.x,i.y))}}},t}(),pa=function(){function t(){this.parser=oo,this.parserUnmemoize=io,this.parserWithCSSDisabled=null,this.mixer=so(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),fa=function(){function t(){this.parser=So,this.parserWithCSSDisabled=So,this.mixer=Po}return t.prototype.calculator=function(t,e,n){return n instanceof ni&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Ir(0,0,0,0)}:n},t.prototype.postProcessor=function(t,e){if(t.parsedStyle.defX=t.parsedStyle.path.rect.x,t.parsedStyle.defY=t.parsedStyle.path.rect.y,t.nodeName===or.PATH&&-1===e.indexOf("transform")){var n=t.parsedStyle,r=n.defX,i=n.defY;t.setLocalPosition(void 0===r?0:r,void 0===i?0:i)}},t}(),da=function(){function t(){this.parser=To,this.mixer=No}return t.prototype.postProcessor=function(t,e){if((t.nodeName===or.POLYGON||t.nodeName===or.POLYLINE)&&-1===e.indexOf("transform")){var n=t.parsedStyle;t.setLocalPosition(n.defX,n.defY)}},t}(),ya=function(t){function e(){var e=t.apply(this,l([],u(arguments),!1))||this;return e.mixer=so(0,1/0),e}return n(e,t),e}(ra),va=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof ni?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),ga=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),ma={},xa=0;var ba="undefined"!=typeof window&&void 0!==window.document;function Ma(t){return!!t.getAttribute}function wa(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function Ea(t){var e,n=t;do{if(null===(e=n.parsedStyle)||void 0===e?void 0:e.clipPath)return n;n=n.parentElement}while(null!==n);return null}function ka(t,e){if(ba)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Sa={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Pa="object"==typeof performance&&performance.now?performance:Date;function Ta(t,e,n){var 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]}var Na=1,Ca="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},Aa=Date.now(),Oa={},Ra=Date.now(),La=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Ra,r=n>16?0:16-n,i=Na++;return Oa[i]=t,Object.keys(Oa).length>1||setTimeout((function(){Ra=e;var t=Oa;Oa={},Object.keys(t).forEach((function(e){return t[e](Ca.performance&&"function"==typeof Ca.performance.now?Ca.performance.now():Date.now()-Aa)}))}),r),i},_a=function(t){delete Oa[t]},Ia=function(t){return"string"!=typeof t?La:""===t?Ca.requestAnimationFrame:Ca[t+"RequestAnimationFrame"]},Da=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!!Ia(t)})),Fa=Ia(Da),Ba=function(t){return"string"!=typeof t?_a:""===t?Ca.cancelAnimationFrame:Ca[t+"CancelAnimationFrame"]||Ca[t+"CancelRequestAnimationFrame"]}(Da);Ca.requestAnimationFrame=Fa,Ca.cancelAnimationFrame=Ba;var ja=function(){function t(){this.callbacks=[]}return t.prototype.getCallbacksNum=function(){return this.callbacks.length},t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map((function(e){return e.apply(void 0,l([],u(t),!1))})))},t}(),Ga=function(){function t(){this.callbacks=[]}return t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return o(this,void 0,void 0,(function(){var e,n,r;return a(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,l([],u(t),!1))]:[3,6];case 1:e=i.sent(),n=0,i.label=2;case 2:return this.callbacks.length-1>n?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=i.sent(),i.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}}))}))},t}(),Ya=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){var t=arguments;this.callbacks.forEach((function(e){e.apply(void 0,t)}))},t}(),Wa=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){if(this.callbacks.length){for(var t=this.callbacks[0].apply(void 0,arguments),e=0;this.callbacks.length-1>e;e++){t=(0,this.callbacks[e])(t)}return t}return null},t}(),za=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Va=/([\"\'])[^\'\"]+\1/;var Xa=function(){function t(){this.parser=Lo,this.parserUnmemoize=_o,this.parserWithCSSDisabled=_o,this.mixer=zo}return t.prototype.calculator=function(t,e,n,r){return n instanceof ni?[]:n},t.prototype.postProcessor=function(t){sa(t.parsedStyle.transform,t)},t}(),Ua=function(){this.parser=Vo,this.parserUnmemoize=Xo},Ha=function(){function t(){this.parser=oo,this.parserUnmemoize=io}return t.prototype.calculator=function(t,e,n,r){return n.value},t.prototype.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=di.Z_INDEX_CHANGED)}},t}(),qa=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),Za=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),Ka=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-s}},t}(),$a=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),Ja=function(){function t(){}return t.prototype.update=function(t){if(t.points&&y(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,l([],u(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,l([],u(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,l([],u(e.map((function(t){return t[1]}))),!1));return{width:r-n,height:Math.max.apply(Math,l([],u(e.map((function(t){return t[1]}))),!1))-i}}return{width:0,height:0}},t}(),Qa=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,o=void 0===r?0:r,a=void 0===i?0:i;return n&&!P(n)&&(o||(t.width=o=n.width),a||(t.height=a=n.height)),{width:o,height:a}},t}(),ts=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&!p(t.lineWidth)},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,u=t.dx,l=t.dy;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:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var c=((null===(r=null===(n=null==e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas,h=this.globalRuntime.textService.measureText(i,t,c);t.metrics=h;var p=[h.width/2,h.height/2,0],f=[0,1],d=0;"center"===o||"middle"===o?(d=a/2,f=[.5,1]):"right"!==o&&"end"!==o||(d=a,f=[1,1]);var y=0;return"middle"===s?y=p[1]:"top"===s||"hanging"===s?y=2*p[1]:"alphabetic"===s?y=this.globalRuntime.enableCSSParsing?h.lineHeight-h.fontProperties.ascent:0:"bottom"!==s&&"ideographic"!==s||(y=0),u&&(d+=u),l&&(y+=l),t.anchor=[f[0],f[1],0],{width:2*p[0],height:2*p[1],offsetX:d,offsetY:y}},t}();var es,ns=function(){function t(e){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 _r,this.page=new _r,this.canvas=new _r,this.viewport=new _r,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t.prototype.clone=function(){throw Error(Dr)},t}(),rs=function(t){function e(){var e=t.apply(this,l([],u(arguments),!1))||this;return e.client=new _r,e.movement=new _r,e.offset=new _r,e.global=new _r,e.screen=new _r,e}return n(e,t),Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.prototype.initMouseEvent=function(){throw Error(Dr)},e}(ns),is=function(t){function e(){var e=t.apply(this,l([],u(arguments),!1))||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return n(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(rs),os=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(rs),as=function(t){function e(e,n){var r=t.call(this,null)||this;return r.type=e,r.detail=n,Object.assign(r,n),r}return n(e,t),e}(ns),ss=function(){function t(){this.emitter=new cn}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r=j(n)&&n||v(n)&&n.capture,i=v(n)&&n.once,o=oi(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var c=u(t.split(":"),2);t=c[1],s=c[0],a=!0}if(t=r?"".concat(t,"capture"):t,e=oi(e)?e:e.handleEvent,a){var h=e;e=function(){for(var t,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];(null===(t=e[0].target)||void 0===t?void 0:t.name)===s&&h.apply(void 0,l([],u(e),!1))}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){var r=j(n)&&n||v(n)&&n.capture,i=oi(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=oi(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new as(t,e))},t.prototype.dispatchEvent=function(t,e){var n,r,i;if(void 0===e&&(e=!1),!t.type)throw Error("DisplayObject cannot propagate events outside of the Federated Events API");if(i=this.document?this:this.defaultView?this.defaultView:null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView){if(t.manager=i.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null===(r=t.manager)||void 0===r||r.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),us=function(t){function e(){var e=t.apply(this,l([],u(arguments),!1))||this;return e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.parentNode=null,e}return n(e,t),e.isNode=function(t){return!!t.childNodes},Object.defineProperty(e.prototype,"textContent",{get:function(){var t,e,n="";this.nodeName===or.TEXT&&(n+=this.style.text);try{for(var r=s(this.childNodes),i=r.next();!i.done;i=r.next()){var o=i.value;n+=o.nodeName===or.TEXT?o.nodeValue:o.textContent}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===or.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),e.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},e.prototype.hasChildNodes=function(){return this.childNodes.length>0},e.prototype.isDefaultNamespace=function(t){throw Error(Dr)},e.prototype.lookupNamespaceURI=function(t){throw Error(Dr)},e.prototype.lookupPrefix=function(t){throw Error(Dr)},e.prototype.normalize=function(){throw Error(Dr)},e.prototype.isEqualNode=function(t){return this===t},e.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),e.prototype.compareDocumentPosition=function(t){var n;if(t===this)return 0;for(var r=t,i=this,o=[r],a=[i];null!==(n=r.parentNode)&&void 0!==n?n:i.parentNode;)r=r.parentNode?(o.push(r.parentNode),r.parentNode):r,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i;if(r!==i)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=o.length>a.length?o:a,u=s===o?a:o;if(s[s.length-u.length]===u[0])return s===o?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],p=s[l+c];if(p!==h){var f=h.parentNode.childNodes;return f.indexOf(h)<f.indexOf(p)?u===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING},e.prototype.contain=function(t){return this.contains(t)},e.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},e.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},e.prototype.forEach=function(t,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},e.DOCUMENT_POSITION_DISCONNECTED=1,e.DOCUMENT_POSITION_PRECEDING=2,e.DOCUMENT_POSITION_FOLLOWING=4,e.DOCUMENT_POSITION_CONTAINS=8,e.DOCUMENT_POSITION_CONTAINED_BY=16,e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,e}(ss),ls=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new cn,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=ut(),this.tmpVec3=It(),this.onPointerDown=function(t){var e=n.createPointerEvent(t);if(n.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)n.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){n.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e,r=Pa.now(),i=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)n.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){n.dispatchEvent(i,2===i.button?"rightup":"mouseup")}var o=n.trackingData(t.pointerId),a=n.findMountedTarget(o.pressTargetsByButton[t.button]),s=a;if(a&&!i.composedPath().includes(a)){for(var u=a;u&&!i.composedPath().includes(u);){if(i.currentTarget=u,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)n.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside")}us.isNode(u)&&(u=u.parentNode)}delete o.pressTargetsByButton[t.button],s=u}if(s){var l=n.clonePointerEvent(i,"click");l.target=s,l.path=[],o.clicksByButton[t.button]||(o.clicksByButton[t.button]={clickCount:0,target:l.target,timeStamp:r});var c=o.clicksByButton[t.button];c.target===l.target&&200>r-c.timeStamp?++c.clickCount:c.clickCount=1,c.target=l.target,c.timeStamp=r,l.detail=c.clickCount,(null===(e=i.detail)||void 0===e?void 0:e.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==l.pointerType&&"touch"!==l.pointerType||n.dispatchEvent(l,"click"),n.dispatchEvent(l,"pointertap")),n.freeEvent(l)}n.freeEvent(i)},this.onPointerMove=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),r="mouse"===e.pointerType||"pen"===e.pointerType,i=n.trackingData(t.pointerId),o=n.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a=n.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",o||void 0);if(n.dispatchEvent(a,"pointerout"),r&&n.dispatchEvent(a,"mouseout"),!e.composedPath().includes(o)){var s=n.createPointerEvent(t,"pointerleave",o||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,n.notifyTarget(s),r&&n.notifyTarget(s,"mouseleave"),us.isNode(s.target)&&(s.target=s.target.parentNode);n.freeEvent(s)}n.freeEvent(a)}if(o!==e.target){var u=n.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var l=o&&us.isNode(o)&&o.parentNode;l&&l!==(us.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(us.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var c=n.clonePointerEvent(e,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==o&&c.target!==(us.isNode(n.rootTarget)&&n.rootTarget.parentNode);)c.currentTarget=c.target,n.notifyTarget(c),r&&n.notifyTarget(c,"mouseenter"),us.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c)}n.freeEvent(u)}n.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&n.dispatchEvent(e,"touchmove"),r&&(n.dispatchEvent(e,"mousemove"),n.cursor=n.getCursor(e.target)),i.overTargets=e.composedPath(),n.freeEvent(e)},this.onPointerOut=function(t){var e=n.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,i=n.findMountedTarget(e.overTargets),o=n.createPointerEvent(t,"pointerout",i||void 0);n.dispatchEvent(o),r&&n.dispatchEvent(o,"mouseout");var a=n.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(us.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),us.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,n.freeEvent(o),n.freeEvent(a)}n.cursor=null},this.onPointerOver=function(t){var e=n.trackingData(t.pointerId),r=n.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;n.dispatchEvent(r,"pointerover"),i&&n.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(n.cursor=n.getCursor(r.target));var o=n.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(us.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),us.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=r.composedPath(),n.freeEvent(r),n.freeEvent(o)},this.onPointerUpOutside=function(t){var e=n.trackingData(t.pointerId),r=n.findMountedTarget(e.pressTargetsByButton[t.button]),i=n.createPointerEvent(t);if(r){for(var o=r;o;)i.currentTarget=o,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),us.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}n.freeEvent(i)},this.onWheel=function(t){var e=n.createWheelEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.onClick=function(t){if(n.context.config.useNativeClickEvent){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)}},this.onPointerCancel=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(e),n.freeEvent(e)}}return t.prototype.init=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)},t.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},t.prototype.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new _r(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},t.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new _r(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},t.prototype.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),l=yt(this.tmpMatrix,u,s),c=jt(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return Xt(c,c,l),new _r(c[0],c[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=yt(this.tmpMatrix,n,r),o=jt(this.tmpVec3,t.x,t.y,0);Xt(this.tmpVec3,this.tmpVec3,i);var a=this.context.config;return new _r((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},t.prototype.setPickHandler=function(t){this.pickHandler=t},t.prototype.addEventMapping=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}))},t.prototype.mapEvent=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))}},t.prototype.dispatchEvent=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));this.emitter.emit(e||t.type,t)},t.prototype.propagate=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(r=i+1;n.length>r;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},t.prototype.propagationPath=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++)us.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},t.prototype.hitTest=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},t.prototype.isNativeEventFromCanvas=function(t,e){var n=null==e?void 0:e.target;if((null==n?void 0:n.shadowRoot)&&(n=e.composedPath()[0]),n){if(n===t)return!0;if(t&&t.contains)return t.contains(n)}return!!(null==e?void 0:e.composedPath)&&e.composedPath().indexOf(t)>-1},t.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=s(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var o=this.nativeHTMLMap.get(i.value);if(o)return o}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},t.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},t.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(is);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var o=this.getExistedHTML(i),a=this.context.contextService.getDomElement();return i.target=null!=n?n:o||this.isNativeEventFromCanvas(a,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},t.prototype.createWheelEvent=function(t){var e=this.allocateEvent(os);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},t.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},t.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(os);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},t.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(is);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},t.prototype.copyPointerData=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},t.prototype.copyMouseData=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)},t.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},t.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=Pa.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},t.prototype.allocateEvent=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},t.prototype.freeEvent=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)},t.prototype.notifyTarget=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)},t.prototype.notifyListeners=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)},t.prototype.findMountedTarget=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||us.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=Ma(e)&&e.getAttribute("cursor");if(n)return n;e=us.isNode(e)&&e.parentNode}},t}(),cs=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||Ts.offscreenCanvas)this.canvas=t||Ts.offscreenCanvas,this.context=this.canvas.getContext("2d",r({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",r({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",r({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();!function(t){t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE"}(es||(es={}));var hs,ps=function(){function t(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Ya,initAsync:new ja,dirtycheck:new Wa,cull:new Wa,beginFrame:new Ya,beforeRender:new Ya,render:new Ya,afterRender:new Ya,endFrame:new Ya,destroy:new Ya,pick:new Ga,pickSync:new Wa,pointerDown:new Ya,pointerUp:new Ya,pointerMove:new Ya,pointerOut:new Ya,pointerOver:new Ya,pointerWheel:new Ya,pointerCancel:new Ya,click:new Ya}}return t.prototype.init=function(t){var e=this,n=r(r({},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()}))},t.prototype.getStats=function(){return this.stats},t.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(es.CAMERA_CHANGED)},t.prototype.render=function(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited){r.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var i=1===r.renderReasons.size&&r.renderReasons.has(es.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&i);o&&this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),o&&r.renderListCurrentFrame.forEach((function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e()}},t.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=o?t.renderable.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var u=a?this.hooks.cull.call(s,this.context.camera):s;u&&(this.stats.rendered++,n.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var l=t.sortable;l.dirty&&(this.sort(t,l),l.dirty=!1,l.dirtyChildren=[],l.dirtyReason=void 0),(l.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)}))},t.prototype.sort=function(t,e){e.sorted&&e.dirtyReason!==di.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var r=e.sorted.indexOf(n);0>r||e.sorted.splice(r,1)}else 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>wa(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(wa)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(es.DISPLAY_OBJECT_CHANGED)},t}(),fs=/\[\s*(.*)=(.*)\s*\]/,ds=function(){function t(){}return t.prototype.selectOne=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,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},t.prototype.selectAll=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,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},t.prototype.is=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},t.prototype.getIdOrClassname=function(t){return t.substring(1)},t.prototype.getAttribute=function(t){var e=t.match(fs),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},t.prototype.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return p(n)?"":n.toString?""+n:""},t}(),ys=function(t){function e(e,n,r,i,o,a,s,u){var l=t.call(this,null)||this;return l.relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=o,l.attrChange=a,l.prevParsedValue=s,l.newParsedValue=u,l.type=e,l}return n(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(ns);function vs(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}!function(t){t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled"}(hs||(hs={}));var gs,ms,xs,bs=new ys(hs.REPARENT,null,"","","",0,"",""),Ms=function(){function t(t){var e,n,r,i,o,a,s,u,l=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new as(hs.BOUNDS_CHANGED),this.rotate=(e=$t(),function(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof n&&(n=Ft(n,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=$t();ne(a,n[0],n[1],n[2]);var s=l.getRotation(t),u=l.getRotation(t.parentNode);ce(e,u),ee(e,e),Qt(a,e,a),Qt(o.localRotation,a,s),pe(o.localRotation,o.localRotation),l.dirtifyLocal(t,o)}else l.rotateLocal(t,n)}),this.rotateLocal=(n=$t(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=Ft(e,r,i));var o=t.transformable;ne(n,e[0],e[1],e[2]),he(o.localRotation,o.localRotation,n),l.dirtifyLocal(t,o)}),this.setEulerAngles=(r=$t(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=Ft(e,n,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){ne(o.localRotation,e[0],e[1],e[2]);var a=l.getRotation(t.parentNode);ce(r,ee($t(),a)),he(o.localRotation,o.localRotation,r),l.dirtifyLocal(t,o)}else l.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ft(e,n,r));var i=t.transformable;Ut(e,It())||(function(t,e,n){var r=n[0],i=n[1],o=n[2],a=e[0],s=e[1],u=e[2],l=i*u-o*s,c=o*a-r*u,h=r*s-i*a,p=i*h-o*c,f=o*l-r*h,d=r*c-i*l,y=2*n[3];c*=y,h*=y,f*=2,d*=2,t[0]=a+(l*=y)+(p*=2),t[1]=s+c+f,t[2]=u+h+d}(e,e,i.localRotation),Gt(i.localPosition,i.localPosition,e),l.dirtifyLocal(t,i))},this.setPosition=(i=ut(),o=It(),function(t,e){var n=t.transformable;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,Ut(l.getPosition(t),o)||(Bt(n.position,o),null!==t.parentNode&&t.parentNode.transformable?(lt(i,t.parentNode.transformable.worldTransform),ft(i,i),Xt(n.localPosition,o,i)):Bt(n.localPosition,o),l.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=It();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,Ut(r.localPosition,t)||(Bt(r.localPosition,t),l.dirtifyLocal(e,r))}}(),this.translate=(a=It(),s=It(),u=It(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=jt(s,e,n,r)),Ut(e,a)||(Gt(u,l.getPosition(t),e),l.setPosition(t,u))}),this.setRotation=function(){var t=$t();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=le(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=l.getRotation(e.parentNode);ce(t,s),ee(t,t),Qt(a.localRotation,t,n),pe(a.localRotation,a.localRotation),l.dirtifyLocal(e,a)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=ut(),e=It(),n=le(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(Pt(r.localTransform,r.localRotation,r.localPosition,Ft(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=ht(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),yt(r.localTransform,r.localTransform,i)}var o=Pt(t,n,e,r.localScale,r.origin);yt(r.localTransform,r.localTransform,o)}else Pt(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}()}return t.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},t.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},t.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},t.prototype.attach=function(t,e,n){var r,i,o=!1;t.parentNode&&(o=t.parentNode!==e,this.detach(t)),t.parentNode=e,p(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var a=e.sortable;((null===(r=null==a?void 0:a.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(-1===a.dirtyChildren.indexOf(t)&&a.dirtyChildren.push(t),a.dirty=!0,a.dirtyReason=di.ADDED);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(bs)},t.prototype.detach=function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;((null===(e=null==i?void 0:i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=di.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}},t.prototype.getOrigin=function(t){return t.transformable.origin},t.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},t.prototype.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Ft(e,n,r));var i=t.transformable;ne(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},t.prototype.scaleLocal=function(t,e){var n,r,i,o=t.transformable;n=o.localScale,r=o.localScale,i=Ft(e[0],e[1],e[2]||1),n[0]=r[0]*i[0],n[1]=r[1]*i[1],n[2]=r[2]*i[2],this.dirtifyLocal(t,o)},t.prototype.setLocalScale=function(t,e){var n=t.transformable,r=Ft(e[0],e[1],e[2]||n.localScale[2]);Ut(r,n.localScale)||(Bt(n.localScale,r),this.dirtifyLocal(t,n))},t.prototype.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=le(e,n,r,i));var o=t.transformable;ce(o.localRotation,e),this.dirtifyLocal(t,o)},t.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new at(2);return n[0]=t,n[1]=e,n}(e,n));var r,i,o=t.transformable;(r=o.localSkew)[0]=(i=e)[0],r[1]=i[1],this.dirtifyLocal(t,o)},t.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},t.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},t.prototype.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=u(t,2),r=e[0],i=e[1];i.affectChildren?r.forEach((function(t){n(t,i)})):n(r,i)})),this.clearPendingEvents(),e.clear()},t.prototype.clearPendingEvents=function(){this.pendingEvents=[]},t.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)vs(n),n=n.parentNode;e&&t.forEach((function(t){vs(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},t.prototype.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},t.prototype.informDependentDisplayObjects=function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new ys(hs.ATTR_MODIFIED,n,e,e,t,ys.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))},t.prototype.getPosition=function(t){var e=t.transformable;return Et(e.position,this.getWorldTransform(t,e))},t.prototype.getRotation=function(t){var e=t.transformable;return St(e.rotation,this.getWorldTransform(t,e))},t.prototype.getScale=function(t){var e=t.transformable;return kt(e.scaling,this.getWorldTransform(t,e))},t.prototype.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},t.prototype.getLocalPosition=function(t){return t.transformable.localPosition},t.prototype.getLocalRotation=function(t){return t.transformable.localRotation},t.prototype.getLocalScale=function(t){return t.transformable.localScale},t.prototype.getLocalSkew=function(t){return t.transformable.localSkew},t.prototype.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},t.prototype.setLocalTransform=function(t,e){var n=Et(It(),e),r=St($t(),e),i=kt(It(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},t.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},t.prototype.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(Nr.isEmpty(r))return null;var i=n||new Nr;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},t.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return(e?n.renderBounds:n.contentBounds||null)||new Nr},t.prototype.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new Nr).update(r.center,r.halfExtents))})),o||(o=new Nr),e){var a=Ea(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o.update(s.center,s.halfExtents)}}return e?(r.renderBounds=o,r.renderBoundsDirty=!1):(r.bounds=o,r.boundsDirty=!1),o},t.prototype.getLocalBounds=function(t){if(t.parentNode){var e=ut();t.parentNode.transformable&&(e=ft(ut(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Nr.isEmpty(n)){var r=new Nr;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);Nr.isEmpty(i)||(r=new Nr).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=u(r.getMin(),2),s=a[0],l=a[1],c=u(r.getMax(),2);return new Ir(s+((null==o?void 0:o.left)||0),l+((null==o?void 0:o.top)||0),c[0]-s,c[1]-l)}return new Ir((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},t.prototype.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},t.prototype.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}},t.prototype.sync=function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?yt(e.worldTransform,r.worldTransform,e.localTransform):lt(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},t.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},t}(),ws={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]},Es=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,ks=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Ss=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Ps=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!Ss.exec(n)&&!ks.exec(t))},this.trimByKinsokuShorui=function(t){var e=l([],u(t),!1),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}}return t.prototype.measureFont=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 o=ws.MetricsString+ws.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(ws.BaselineSymbol).width),u=ws.HeightMultiplier*s;s=s*ws.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var l=i.getImageData(0,0,a||1,u||1).data,c=l.length,h=4*a,p=0,f=0,d=!1;for(p=0;s>p;++p){for(var y=0;h>y;y+=4)if(255!==l[f+y]){d=!0;break}if(d)break;f+=h}for(n.ascent=s-p,f=c-h,d=!1,p=u;p>s;--p){for(y=0;h>y;y+=4)if(255!==l[f+y]){d=!0;break}if(d)break;f-=h}return n.descent=p-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},t.prototype.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,o=e.lineHeight,a=e.lineWidth,s=e.textBaseline,u=e.textAlign,l=e.letterSpacing,c=e.textPath,h=e.leading,p=void 0===h?0:h,f=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=_(e)&&"".concat(e,"px")||"16px",s=n.split(","),u=s.length-1;u>=0;u--){var l=s[u].trim();!Va.test(l)&&0>za.indexOf(l)&&(l='"'.concat(l,'"')),s[u]=l}return"".concat(r," ").concat(i," ").concat(o," ").concat(a," ").concat(s.join(","))}(e),d=this.measureFont(f,n);0===d.fontSize&&(d.fontSize=r,d.ascent=r);var y=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);y.font=f,e.isOverflowing=!1;var v=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),g=Array(v.length),m=0;if(!c){for(E=0;v.length>E;E++){var x=y.measureText(v[E]).width+(v[E].length-1)*l;g[E]=x,m=Math.max(m,x)}k=m+a;var b=o||d.fontSize+a,M=Math.max(b,d.fontSize+a)+(v.length-1)*(b+p),w=0;return"middle"===s?w=-M/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?w=-M:"top"!==s&&"hanging"!==s||(w=0),{font:f,width:k,height:M,lines:v,lineWidths:g,lineHeight:b+=p,maxLineWidth:m,fontProperties:d,lineMetrics:g.map((function(t,e){var n=0;return"center"===u||"middle"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new Ir(n-a/2,w+e*b,t+a,b)}))}}c.getTotalLength();for(var E=0;v.length>E;E++)var k=y.measureText(v[E]).width+(v[E].length-1)*l},t.prototype.setGraphemeOnPath=function(){},t.prototype.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=e.maxLines,u=void 0===s?1/0:s,l=e.textOverflow,c=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),h=o+a,p="";"ellipsis"===l?p="...":l&&"clip"!==l&&(p=l);for(var f=[],d=0,y=0,v={},g=function(t){return r.getFromCache(t,a,v,c)},m=Array.from(p).reduce((function(t,e){return t+g(e)}),0),x=Array.from(t),b=0;x.length>b;b++){var M=x[b],w=t[b-1],E=t[b+1],k=g(M);if(this.isNewline(M)){if(++d>=u){e.isOverflowing=!0;break}y=0,f[d]=""}else{if(y>0&&y+k>h){if(d+1>=u){if(e.isOverflowing=!0,m>0&&h>=m){for(var S=f[d].length,P=0,T=S,N=0;S>N;N++){var C=g(f[d][N]);if(P+C+m>h){T=N;break}P+=C}f[d]=(f[d]||"").slice(0,T)+p}break}if(y=0,f[++d]="",this.isBreakingSpace(M))continue;this.canBreakInLastChar(M)||(f=this.trimToBreakable(f),y=this.sumTextWidthByCache(f[d]||"",v)),this.shouldBreakByKinsokuShorui(M,E)&&(f=this.trimByKinsokuShorui(f),y+=g(w||""))}y+=k,f[d]=(f[d]||"")+M}}return f.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&ws.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&ws.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=l([],u(t),!1),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,o),e},t.prototype.canBreakInLastChar=function(t){return!t||!Es.test(t)},t.prototype.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},t.prototype.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!Es.test(t[e]))return e;return-1},t.prototype.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),Ts={},Ns=(ms=new Qa,xs=new Ja,(gs={})[or.CIRCLE]=new qa,gs[or.ELLIPSE]=new Za,gs[or.RECT]=ms,gs[or.IMAGE]=ms,gs[or.GROUP]=ms,gs[or.LINE]=new Ka,gs[or.TEXT]=new ts(Ts),gs[or.POLYLINE]=xs,gs[or.POLYGON]=xs,gs[or.PATH]=new $a,gs[or.HTML]=null,gs[or.MESH]=null,gs),Cs=function(){var t,e=new ta,n=new ra;return(t={})[Ti.PERCENTAGE]=null,t[Ti.NUMBER]=new ca,t[Ti.ANGLE]=new Jo,t[Ti.DEFINED_PATH]=new Qo,t[Ti.PAINT]=e,t[Ti.COLOR]=e,t[Ti.FILTER]=new ea,t[Ti.LENGTH]=n,t[Ti.LENGTH_PERCENTAGE]=n,t[Ti.LENGTH_PERCENTAGE_12]=new ia,t[Ti.LENGTH_PERCENTAGE_14]=new oa,t[Ti.COORDINATE]=new ua,t[Ti.OFFSET_DISTANCE]=new ha,t[Ti.OPACITY_VALUE]=new pa,t[Ti.PATH]=new fa,t[Ti.LIST_OF_POINTS]=new da,t[Ti.SHADOW_BLUR]=new ya,t[Ti.TEXT]=new va,t[Ti.TEXT_TRANSFORM]=new ga,t[Ti.TRANSFORM]=new Xa,t[Ti.TRANSFORM_ORIGIN]=new Ua,t[Ti.Z_INDEX]=new Ha,t[Ti.MARKER]=new la,t}();Ts.CameraContribution=Xr,Ts.AnimationTimeline=null,Ts.EasingFunction=null,Ts.offscreenCanvasCreator=new cs,Ts.sceneGraphSelector=new ds,Ts.sceneGraphService=new Ms(Ts),Ts.textService=new Ps(Ts),Ts.geometryUpdaterFactory=Ns,Ts.CSSPropertySyntaxFactory=Cs,Ts.styleValueRegistry=new $o(Ts),Ts.layoutRegistry=null,Ts.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},Ts.enableCSSParsing=!0,Ts.enableDataset=!1,Ts.enableStyleSyntax=!0,Ts.enableSizeAttenuation=!1;var As=0,Os=new ys(hs.INSERTED,null,"","","",0,"",""),Rs=new ys(hs.REMOVED,null,"","","",0,"",""),Ls=new as(hs.DESTROY),_s=function(t){function e(){var e=t.apply(this,l([],u(arguments),!1))||this;return e.entity=As++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.cullable={strategy:fi.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!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]},e.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},e.geometry={contentBounds:void 0,renderBounds:void 0},e.rBushNode={aabb:void 0},e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.destroyed=!1,e.style={},e.computedStyle=Ts.enableCSSParsing?{anchor:gi,opacity:gi,fillOpacity:gi,strokeOpacity:gi,fill:gi,stroke:gi,transform:gi,transformOrigin:gi,visibility:gi,pointerEvents:gi,lineWidth:gi,lineCap:gi,lineJoin:gi,increasedLineWidthForHitTesting:gi,fontSize:gi,fontFamily:gi,fontStyle:gi,fontWeight:gi,fontVariant:gi,textAlign:gi,textBaseline:gi,textTransform:gi,zIndex:gi,filter:gi,shadowType:gi}:null,e.parsedStyle={},e.attributes={},e}return n(e,t),Object.defineProperty(e.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classList",{get:function(){return this.className.split(" ").filter((function(t){return""!==t}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){throw Error(Dr)},e.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return Ts.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),Os.relatedNode=this,t.dispatchEvent(Os),t},e.prototype.insertBefore=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},e.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},e.prototype.removeChild=function(t){var e;return Rs.relatedNode=this,t.dispatchEvent(Rs),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),Ts.sceneGraphService.detach(t),t},e.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}},e.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},e.prototype.matches=function(t){return Ts.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return Ts.sceneGraphService.querySelector("#".concat(t),this)},e.prototype.getElementsByName=function(t){return Ts.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},e.prototype.getElementsByClassName=function(t){return Ts.sceneGraphService.querySelectorAll(".".concat(t),this)},e.prototype.getElementsByTagName=function(t){return Ts.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return Ts.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return Ts.sceneGraphService.querySelectorAll(t,this)},e.prototype.closest=function(t){var e=this;do{if(Ts.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},e.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},e.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},e.prototype.after=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);e.forEach((function(e,n){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(e,r+n+1)}))}},e.prototype.before=function(){for(var t,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this),i=u(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,l([],u(a),!1))}},e.prototype.replaceWith=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];this.after.apply(this,l([],u(t),!1)),this.remove()},e.prototype.append=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},e.prototype.prepend=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},e.prototype.replaceChildren=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,l([],u(t),!1))},e.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.prototype.destroy=function(){this.dispatchEvent(Ls),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return Ts.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return Ts.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return Ts.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return Ts.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return Ts.sceneGraphService.getBoundingClientRect(this)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},e.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},e.prototype.getAttribute=function(t){if(function(t){return"symbol"==typeof t}(t))return Ts.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=ui(t);return e=this.attributes[n],Ts.enableCSSParsing&&p(e)?null:e}return e},e.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},e.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},e.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},e.prototype.setAttribute=function(t,e,n){this.attributes[t]=e},e.prototype.getAttributeNS=function(t,e){throw Error(Dr)},e.prototype.getAttributeNode=function(t){throw Error(Dr)},e.prototype.getAttributeNodeNS=function(t,e){throw Error(Dr)},e.prototype.hasAttributeNS=function(t,e){throw Error(Dr)},e.prototype.removeAttributeNS=function(t,e){throw Error(Dr)},e.prototype.removeAttributeNode=function(t){throw Error(Dr)},e.prototype.setAttributeNS=function(t,e,n){throw Error(Dr)},e.prototype.setAttributeNode=function(t){throw Error(Dr)},e.prototype.setAttributeNodeNS=function(t){throw Error(Dr)},e.prototype.toggleAttribute=function(t,e){throw Error(Dr)},e}(us);function Is(t){return!!(null==t?void 0:t.nodeName)}var Ds,Fs=new ys(hs.ATTR_MODIFIED,null,null,null,null,ys.MODIFICATION,null,null),Bs={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},js={anchor:[0,0],fill:wi,stroke:wi,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Gs=r(r({},js),{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),Ys=l(l([],u(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),Ws="data-",zs=function(t){function e(e){var n,r=t.call(this)||this;r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.getClip=function(){return this.style.clipPath||null},r.config=e,r.config.interactive=null!==(n=r.config.capture)&&void 0!==n?n:r.config.interactive,r.id=r.config.id||"",r.name=r.config.name||"",(r.config.className||r.config.class)&&(r.className=r.config.className||r.config.class),r.nodeName=r.config.type||or.GROUP,r.config.style=r.config.style||r.config.attrs||{},Object.assign(r.config.style,r.config.attrs),null!=r.config.visible&&(r.config.style.visibility=!1===r.config.visible?"hidden":"visible"),null!=r.config.interactive&&(r.config.style.pointerEvents=!1===r.config.interactive?"none":"auto"),Object.assign(r.parsedStyle,Ts.enableCSSParsing?js:Gs,r.config.initialParsedStyle),Ts.enableCSSParsing&&Object.assign(r.attributes,Bs),r.initAttributes(r.config.style);var i=Ts.globalThis.Proxy?Ts.globalThis.Proxy:function(){};return Ts.enableDataset&&(r.dataset=new i({},{get:function(t,e){var n="".concat(Ws).concat(ii(e));return void 0!==t[n]?t[n]:r.getAttribute(n)},set:function(t,e,n){return r.setAttribute("".concat(Ws).concat(ii(e)),n),!0}})),Ts.enableStyleSyntax&&(r.style=new i({setProperty:function(t,e){r.setAttribute(t,e)},getPropertyValue:function(t){return r.getAttribute(t)},removeProperty:function(t){r.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:r.getAttribute(e)},set:function(t,e,n){return r.setAttribute(e,n),!0}})),r}return n(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},e.prototype.cloneNode=function(t,e){var n=r({},this.attributes);for(var i in n){var o=n[i];Is(o)&&"clipPath"!==i&&"offsetPath"!==i&&"textPath"!==i&&(n[i]=o.cloneNode(t)),e&&(n[i]=e(i,o))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}})),a},e.prototype.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable,n={forceUpdateGeometry:!0};Ts.enableCSSParsing&&(n.usedAttributes=Ys);var r={};for(var i in t){r[ui(i)]=t[i]}Ts.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},e.prototype.setAttribute=function(e,n,r,i){void 0===r&&(r=!1),void 0===i&&(i=!0);var o=ui(e);W(n)||(r||n!==this.attributes[o])&&(this.internalSetAttribute(o,n,{memoize:i}),t.prototype.setAttribute.call(this,o,n))},e.prototype.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];Ts.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(Fs.relatedNode=this,Fs.prevValue=o,Fs.newValue=e,Fs.attrName=t,Fs.prevParsedValue=a,Fs.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(Fs):(Fs.target=this,this.ownerDocument.defaultView.dispatchEvent(Fs,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},e.prototype.getBBox=function(){var t=this.getBounds(),e=u(t.getMin(),2),n=e[0],r=e[1],i=u(t.getMax(),2);return new Ir(n,r,i[0]-n,i[1]-r)},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ts.sceneGraphService.setOrigin(this,yr(t,e,n)),this},e.prototype.getOrigin=function(){return Ts.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ts.sceneGraphService.setPosition(this,yr(t,e,n)),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ts.sceneGraphService.setLocalPosition(this,yr(t,e,n)),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ts.sceneGraphService.translate(this,yr(t,e,n)),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ts.sceneGraphService.translateLocal(this,yr(t,e,n)),this},e.prototype.getPosition=function(){return Ts.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return Ts.sceneGraphService.getLocalPosition(this)},e.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},e.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=yr(t,e=e||t,n=n||t)),Ts.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=yr(t,e=e||t,n=n||t)),Ts.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return Ts.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return Ts.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){return gr(u(mr(It(),Ts.sceneGraphService.getWorldTransform(this)),3)[2])},e.prototype.getLocalEulerAngles=function(){return gr(u(mr(It(),Ts.sceneGraphService.getLocalRotation(this)),3)[2])},e.prototype.setEulerAngles=function(t){return Ts.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return Ts.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return p(e)&&p(n)?Ts.sceneGraphService.rotateLocal(this,0,0,t):Ts.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return p(e)&&p(n)?Ts.sceneGraphService.rotate(this,0,0,t):Ts.sceneGraphService.rotate(this,t,e,n),this},e.prototype.setRotation=function(t,e,n,r){return Ts.sceneGraphService.setRotation(this,t,e,n,r),this},e.prototype.setLocalRotation=function(t,e,n,r){return Ts.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.prototype.setLocalSkew=function(t,e){return Ts.sceneGraphService.setLocalSkew(this,t,e),this},e.prototype.getRotation=function(){return Ts.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return Ts.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return Ts.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return Ts.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return Ts.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(t){return Ts.sceneGraphService.setLocalTransform(this,t),this},e.prototype.resetLocalTransform=function(){Ts.sceneGraphService.resetLocalTransform(this)},e.prototype.getAnimations=function(){return this.activeAnimations},e.prototype.animate=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},e.prototype.isVisible=function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},Object.defineProperty(e.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),e.prototype.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},e.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},e.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,l([],u(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},e.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,l([],u(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},e.prototype.getConfig=function(){return this.config},e.prototype.attr=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];var r=u(e,2),i=r[0],o=r[1];return i?v(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===e.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},e.prototype.getMatrix=function(t){var e=t||this.getWorldTransform(),n=u(Et(It(),e),2),r=n[0],i=n[1],o=u(kt(It(),e),2),a=o[0],s=o[1],l=St($t(),e),c=u(mr(It(),l),3);return xr(c[0]||c[2],r,i,a,s)},e.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.prototype.setMatrix=function(t){var e=u(br(t),5),n=e[0],r=e[1],i=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,o)},e.prototype.setLocalMatrix=function(t){var e=u(br(t),5),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},e.prototype.show=function(){Ts.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},e.prototype.hide=function(){Ts.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))},e.prototype.getCount=function(){return this.childElementCount},e.prototype.getParent=function(){return this.parentElement},e.prototype.getChildren=function(){return this.children},e.prototype.getFirst=function(){return this.firstElementChild},e.prototype.getLast=function(){return this.lastElementChild},e.prototype.getChildByIndex=function(t){return this.children[t]||null},e.prototype.add=function(t,e){return this.appendChild(t,e)},e.prototype.setClip=function(t){this.style.clipPath=t},e.prototype.set=function(t,e){this.config[t]=e},e.prototype.get=function(t){return this.config[t]},e.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.setZIndex=function(t){return this.style.zIndex=t,this},e}(_s),Vs=function(t){Ts.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},Xs=function(t){function e(e){void 0===e&&(e={});var n=e.style,o=i(e,["style"]);return t.call(this,r({type:or.CIRCLE,style:r(Ts.enableCSSParsing?{cx:"",cy:"",r:""}:{},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:Ts.enableCSSParsing?null:[Pi,Pi]}},o))||this}return n(e,t),e}(zs),Us=(function(t){function e(e){void 0===e&&(e={});var n=this,o=e.style,a=i(e,["style"]);return(n=t.call(this,r({style:r(Ts.enableCSSParsing?{x:"",y:""}:{},o)},a))||this).isCustomElement=!0,n}n(e,t)}(zs),function(t){function e(e){void 0===e&&(e={});var n=e.style,o=i(e,["style"]);return t.call(this,r({type:or.ELLIPSE,style:r(Ts.enableCSSParsing?{cx:"",cy:"",rx:"",ry:""}:{},n),initialParsedStyle:{anchor:[.5,.5],transformOrigin:Ts.enableCSSParsing?null:[Pi,Pi]}},o))||this}return n(e,t),e}(zs)),Hs=function(t){function e(e){void 0===e&&(e={});var n=e.style,o=i(e,["style"]);return t.call(this,r({type:or.GROUP,style:r(Ts.enableCSSParsing?{x:"",y:"",width:"",height:""}:{},n)},o))||this}return n(e,t),e}(zs),qs=function(t){function e(e){void 0===e&&(e={});var n=this,o=e.style,a=i(e,["style"]);return(n=t.call(this,r({type:or.HTML,style:r(Ts.enableCSSParsing?{x:"",y:"",width:"auto",height:"auto",innerHTML:""}:{},o)},a))||this).cullable.enable=!1,n}return n(e,t),e.prototype.getDomElement=function(){return this.parsedStyle.$el},e.prototype.getBoundingClientRect=function(){if(this.parsedStyle.$el)return this.parsedStyle.$el.getBoundingClientRect();var t=this.parsedStyle;return new Ir(t.x,t.y,t.width,t.height)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(e=null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect(),i=new Nr,o=n.left-((null==r?void 0:r.left)||0),a=n.top-((null==r?void 0:r.top)||0);return i.setMinMax([o,a,0],[o+n.width,a+n.height,0]),i},e.prototype.getLocalBounds=function(){if(this.parentNode){var t=ft(ut(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Nr.isEmpty(e)){var n=new Nr;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(zs),Zs=function(t){function e(e){void 0===e&&(e={});var n=e.style,o=i(e,["style"]);return t.call(this,r({type:or.IMAGE,style:r(Ts.enableCSSParsing?{x:"",y:"",img:"",width:"",height:""}:{},n)},o))||this}return n(e,t),e}(zs),Ks=function(t){function e(e){void 0===e&&(e={});var n=this,o=e.style,a=i(e,["style"]);(n=t.call(this,r({type:or.LINE,style:r({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},o)},a))||this).markerStartAngle=0,n.markerEndAngle=0;var s=n.parsedStyle,u=s.markerStart,l=s.markerEnd;return u&&Is(u)&&(n.markerStartAngle=u.getLocalEulerAngles(),n.appendChild(u)),l&&Is(l)&&(n.markerEndAngle=l.getLocalEulerAngles(),n.appendChild(l)),n.transformMarker(!0),n.transformMarker(!1),n}return n(e,t),e.prototype.attributeChangedCallback=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&&Is(r)&&(this.markerStartAngle=0,r.remove()),i&&Is(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Is(r)&&(this.markerEndAngle=0,r.remove()),i&&Is(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,o=e.x2,a=e.y1,s=e.y2,u=e.defX,l=e.defY,c=t?e.markerStart:e.markerEnd;if(c&&Is(c)){var h,p,f,d,y,v,g;t?(d=i-u,y=a-l,p=o-i,f=s-a,v=n||0,g=this.markerStartAngle):(d=o-u,y=s-l,p=i-o,f=a-s,v=r||0,g=this.markerEndAngle),c.setLocalEulerAngles(180*(h=Math.atan2(f,p))/Math.PI+g),c.setLocalPosition(d+Math.cos(h)*v,y+Math.sin(h)*v)}},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=Hn(n.x1,n.y1,n.x2,n.y2,t),a=o.x,s=o.y,u=Xt(It(),Ft(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new _r(u[0],u[1])},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getTotalLength=function(){var t=this.parsedStyle;return Un(t.x1,t.y1,t.x2,t.y2)},e}(zs),$s=function(t){function e(e){void 0===e&&(e={});var n=this,o=e.style,a=i(e,["style"]);(n=t.call(this,r({type:or.PATH,style:r(Ts.enableCSSParsing?{path:"",miterLimit:""}:{},o),initialParsedStyle:Ts.enableCSSParsing?null:{miterLimit:4,path:r({},Ni)}},a))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var s=n.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&Is(u)&&(n.markerStartAngle=u.getLocalEulerAngles(),n.appendChild(u)),c&&Is(c)&&n.placeMarkerMid(c),l&&Is(l)&&(n.markerEndAngle=l.getLocalEulerAngles(),n.appendChild(l)),n.transformMarker(!0),n.transformMarker(!1),n}return n(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"path"===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&&Is(r)&&(this.markerStartAngle=0,r.remove()),i&&Is(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Is(r)&&(this.markerEndAngle=0,r.remove()),i&&Is(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.defX,o=e.defY,a=t?e.markerStart:e.markerEnd;if(a&&Is(a)){var s,l,c,h,p,f,d;if(t){var y=u(this.getStartTangent(),2);h=(g=y[1])[0]-i,p=g[1]-o,l=(v=y[0])[0]-g[0],c=v[1]-g[1],f=n||0,d=this.markerStartAngle}else{var v,g,m=u(this.getEndTangent(),2);h=(g=m[1])[0]-i,p=g[1]-o,l=(v=m[0])[0]-g[0],c=v[1]-g[1],f=r||0,d=this.markerEndAngle}a.setLocalEulerAngles(180*(s=Math.atan2(c,l))/Math.PI+d),a.setLocalPosition(h+Math.cos(s)*f,p+Math.sin(s)*f)}},e.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),t&&Is(t))for(var o=1;n.length-1>o;o++){var a=u(n[o].currentPoint,2),s=a[0],l=a[1],c=1===o?t:t.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(s-r,l-i)}},e.prototype.getTotalLength=function(){return lo(this)},e.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,i=n.defX,o=n.defY,a=function(t,e,n){return Qe(t,e,r(r({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),s=a.x,u=a.y,l=Xt(It(),Ft(s-i,u-o,0),e?this.getWorldTransform():this.getLocalTransform());return new _r(l[0],l[1])},e.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*lo(this),e)},e.prototype.getStartTangent=function(){var t=this.parsedStyle.path.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},e.prototype.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},e}(zs),Js=function(t){function e(e){void 0===e&&(e={});var n=this,o=e.style,a=i(e,["style"]);(n=t.call(this,r({type:or.POLYGON,style:r(Ts.enableCSSParsing?{points:"",miterLimit:"",isClosed:!0}:{},o),initialParsedStyle:Ts.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},a))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var s=n.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&Is(u)&&(n.markerStartAngle=u.getLocalEulerAngles(),n.appendChild(u)),c&&Is(c)&&n.placeMarkerMid(c),l&&Is(l)&&(n.markerEndAngle=l.getLocalEulerAngles(),n.appendChild(l)),n.transformMarker(!0),n.transformMarker(!1),n}return n(e,t),e.prototype.attributeChangedCallback=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&&Is(r)&&(this.markerStartAngle=0,r.remove()),i&&Is(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Is(r)&&(this.markerEndAngle=0,r.remove()),i&&Is(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.defX,o=e.defY,a=(e.points||{}).points,s=t?e.markerStart:e.markerEnd;if(s&&Is(s)&&a){var u,l,c,h,p,f,d;if(h=a[0][0]-i,p=a[0][1]-o,t)l=a[1][0]-a[0][0],c=a[1][1]-a[0][1],f=n||0,d=this.markerStartAngle;else{var y=a.length;this.parsedStyle.isClosed?(l=a[y-1][0]-a[0][0],c=a[y-1][1]-a[0][1]):(h=a[y-1][0]-i,p=a[y-1][1]-o,l=a[y-2][0]-a[y-1][0],c=a[y-2][1]-a[y-1][1]),f=r||0,d=this.markerEndAngle}s.setLocalEulerAngles(180*(u=Math.atan2(c,l))/Math.PI+d),s.setLocalPosition(h+Math.cos(u)*f,p+Math.sin(u)*f)}},e.prototype.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.defX,r=e.defY,i=(e.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&Is(t)&&i)for(var o=1;(this.parsedStyle.isClosed?i.length:i.length-1)>o;o++){var a=i[o][0]-n,s=i[o][1]-r,u=1===o?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(a,s)}},e}(zs),Qs=function(t){function e(e){void 0===e&&(e={});var n=e.style,o=i(e,["style"]);return t.call(this,r({type:or.POLYLINE,style:r(Ts.enableCSSParsing?{points:"",miterLimit:"",isClosed:!1}:{},n),initialParsedStyle:Ts.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},o))||this}return n(e,t),e.prototype.getTotalLength=function(){return this.parsedStyle.points.totalLength},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=n.points,a=o.points,s=0,u=0;o.segments.forEach((function(e,n){e[0]>t||t>e[1]||(s=(t-e[0])/(e[1]-e[0]),u=n)}));var l=Hn(a[u][0],a[u][1],a[u+1][0],a[u+1][1],s),c=l.x,h=l.y,p=Xt(It(),Ft(c-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new _r(p[0],p[1])},e.prototype.getStartTangent=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},e.prototype.getEndTangent=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},e}(Js),tu=function(t){function e(e){void 0===e&&(e={});var n=e.style,o=i(e,["style"]);return t.call(this,r({type:or.RECT,style:r(Ts.enableCSSParsing?{x:"",y:"",width:"",height:"",radius:""}:{},n)},o))||this}return n(e,t),e}(zs),eu=function(t){function e(e){void 0===e&&(e={});var n=e.style,o=i(e,["style"]);return t.call(this,r({type:or.TEXT,style:r(Ts.enableCSSParsing?{x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""}:{fill:"black"},n),initialParsedStyle:Ts.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0}},o))||this}return n(e,t),e.prototype.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},e.prototype.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},e.prototype.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},e}(zs),nu=function(){function t(){this.registry={},this.define(or.CIRCLE,Xs),this.define(or.ELLIPSE,Us),this.define(or.RECT,tu),this.define(or.IMAGE,Zs),this.define(or.LINE,Ks),this.define(or.GROUP,Hs),this.define(or.PATH,$s),this.define(or.POLYGON,Js),this.define(or.POLYLINE,Qs),this.define(or.TEXT,eu),this.define(or.HTML,qs)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),ru=function(t){function e(){var e=t.call(this)||this;e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new Ts.AnimationTimeline(e)}catch(t){}var n={};return Ho.forEach((function(t){var e=t.d;t.inh&&e&&(n[t.n]=oi(e)?e(or.GROUP):e)})),e.documentElement=new Hs({id:"g-root",style:n}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return n(e,t),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),e.prototype.createElement=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?eu:Hs);var r=new n(e);return r.ownerDocument=this,r},e.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},e.prototype.cloneNode=function(t){throw Error(Dr)},e.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},e.prototype.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);(!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},e.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return null;var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.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},e.prototype.elementFromPoint=function(t,e){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,h,p;return a(this,(function(a){switch(a.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,0>r||0>i||r>s||i>u?[2,null]:(l=this.defaultView.viewport2Client({x:r,y:i}),c=l.x,h=l.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:h},picked:[]})]);case 1:return[2,(p=a.sent().picked)&&p[0]||this.documentElement]}}))}))},e.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return[];var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.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},e.prototype.elementsFromPoint=function(t,e){return o(this,void 0,void 0,(function(){var n,r,i,o,s,u,l,c,h,p;return a(this,(function(a){switch(a.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,0>r||0>i||r>s||i>u?[2,[]]:(l=this.defaultView.viewport2Client({x:r,y:i}),c=l.x,h=l.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:c,clientY:h},picked:[]})]);case 1:return(p=a.sent().picked)[p.length-1]!==this.documentElement&&p.push(this.documentElement),[2,p]}}))}))},e.prototype.appendChild=function(t,e){throw Error(Fr)},e.prototype.insertBefore=function(t,e){throw Error(Fr)},e.prototype.removeChild=function(t,e){throw Error(Fr)},e.prototype.replaceChild=function(t,e,n){throw Error(Fr)},e.prototype.append=function(){throw Error(Fr)},e.prototype.prepend=function(){throw Error(Fr)},e.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},e.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},e.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},e.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},e.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},e.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},e.prototype.find=function(t){return this.documentElement.find(t)},e.prototype.findAll=function(t){return this.documentElement.findAll(t)},e}(us),iu=function(){function t(t){this.strategies=t}return t.prototype.apply=function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,o=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return e.visible=0===o.length?i.unculledEntities.indexOf(t.entity)>-1:o.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new as(hs.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="Culling",t}(),ou=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new is(null),this.rootWheelEvent=new os(null),this.onPointerMove=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView;if(!a.supportsTouchEvents||"touch"!==e.pointerType){var u=t.normalizeToPointerEvent(e,a);try{for(var l=s(u),c=l.next();!c.done;c=l.next()){var h=t.bootstrapEvent(t.rootPointerEvent,c.value,a,e);t.context.eventService.mapEvent(h)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView,u=t.normalizeToPointerEvent(e,a);try{for(var l=s(u),c=l.next();!c.done;c=l.next()){var h=t.bootstrapEvent(t.rootPointerEvent,c.value,a,e);t.context.eventService.mapEvent(h)}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}}return t.prototype.apply=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){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&o[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();try{for(var a=s(o),u=a.next();!u.done;u=a.next()){var l=n.bootstrapEvent(n.rootPointerEvent,u.value,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(o,t)?"":"outside",u=n.normalizeToPointerEvent(t,i);try{for(var l=s(u),c=l.next();!c.done;c=l.next()){var h=n.bootstrapEvent(n.rootPointerEvent,c.value,i,t);h.type+=a,n.context.eventService.mapEvent(h)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(e)throw e.error}}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,o=n.normalizeToPointerEvent(t,i);try{for(var a=s(o),u=a.next();!u.done;u=a.next()){var l=n.bootstrapEvent(n.rootPointerEvent,u.value,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}))},t.prototype.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.context.config.supportsCSSTransform||p(r)||p(i)){var s=this.context.eventService.client2Viewport(new _r(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},t.prototype.bootstrapEvent=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.getViewportXY(e),o=i.y;t.viewport.x=i.x,t.viewport.y=o;var a=this.context.eventService.viewport2Canvas(t.viewport),s=a.y;return t.canvas.x=a.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=Sa[t.type]||t.type),t},t.prototype.normalizeWheelEvent=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.getViewportXY(t),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),o=i.y;return e.canvas.x=i.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Pa.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},t.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},t.prototype.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];W(i.button)&&(i.button=0),W(i.buttons)&&(i.buttons=1),W(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),W(i.width)&&(i.width=i.radiusX||1),W(i.height)&&(i.height=i.radiusY||1),W(i.tiltX)&&(i.tiltX=0),W(i.tiltY)&&(i.tiltY=0),W(i.pointerType)&&(i.pointerType="touch"),W(i.pointerId)&&(i.pointerId=i.identifier||0),W(i.pressure)&&(i.pressure=i.force||.5),W(i.twist)&&(i.twist=0),W(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;W(o.isPrimary)&&(o.isPrimary=!0),W(o.width)&&(o.width=1),W(o.height)&&(o.height=1),W(o.tiltX)&&(o.tiltX=0),W(o.tiltY)&&(o.tiltY=0),W(o.pointerType)&&(o.pointerType="mouse"),W(o.pointerId)&&(o.pointerId=1),W(o.pressure)&&(o.pressure=.5),W(o.twist)&&(o.twist=0),W(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),au=[or.CIRCLE,or.ELLIPSE,or.IMAGE,or.RECT,or.LINE,or.POLYLINE,or.POLYGON,or.TEXT,or.PATH,or.HTML],su=function(){function t(){}return t.prototype.isVisible=function(t,e){var n,r,i=e.cullable;if(!i.enable)return!0;var o=e.getRenderBounds();if(Nr.isEmpty(o))return!1;var a=t.getFrustum(),s=null===(r=null===(n=e.parentNode)||void 0===n?void 0:n.cullable)||void 0===r?void 0:r.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,o,s||Tr.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==Tr.OUTSIDE,i.visible},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Tr.OUTSIDE||n===Tr.INSIDE)return n;for(var i=Tr.INSIDE,o=au.indexOf(t.nodeName)>-1,a=0,s=r.length;s>a;++a){var u=1<<a;if(n&u&&(!o||4!==a&&5!==a)){var l=r[a],c=l.normal,h=l.distance;if(0>zt(c,e.getPositiveFarPoint(r[a]))+h)return Tr.OUTSIDE;0>zt(c,e.getNegativeFarPoint(r[a]))+h&&(i|=u)}}return i},t}(),uu=function(){function t(){this.toSync=new Set}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument.defaultView;this.rBush=e.rBushRoot;var o=function(t){t.target.renderable.dirty=!0,r.dirtify()},a=function(t){var e=t.target;t.detail.affectChildren&&e.forEach((function(t){n.toSync.add(t)}));for(var i=e;i;)i.renderable&&n.toSync.add(i),i=i.parentElement;r.dirtify()},s=function(t){var e=t.target;Ts.enableSizeAttenuation&&Ts.styleValueRegistry.updateSizeAttenuation(e,i.getCamera().getZoom()),Ts.enableCSSParsing&&Ts.styleValueRegistry.recalc(e),Ts.sceneGraphService.dirtifyToRoot(e),r.dirtify()},u=function(t){var e=t.target,i=e.rBushNode;i.aabb&&n.rBush.remove(i.aabb),n.toSync.delete(e),Ts.sceneGraphService.dirtifyToRoot(e),r.dirtify()};r.hooks.init.tap(t.tag,(function(){i.addEventListener(hs.MOUNTED,s),i.addEventListener(hs.UNMOUNTED,u),i.addEventListener(hs.ATTR_MODIFIED,o),i.addEventListener(hs.BOUNDS_CHANGED,a)})),r.hooks.destroy.tap(t.tag,(function(){i.removeEventListener(hs.MOUNTED,s),i.removeEventListener(hs.UNMOUNTED,u),i.removeEventListener(hs.ATTR_MODIFIED,o),i.removeEventListener(hs.BOUNDS_CHANGED,a),n.toSync.clear()})),r.hooks.endFrame.tap(t.tag,(function(){n.syncRTree()}))},t.prototype.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&r.aabb&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=u(i.getMin(),2),a=o[0],s=o[1],l=u(i.getMax(),2),c=l[0],h=l[1];r.aabb||(r.aabb={}),r.aabb.displayObject=n,r.aabb.minX=a,r.aabb.minY=s,r.aabb.maxX=c,r.aabb.maxY=h}r.aabb&&(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY)||e.push(r.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()},t.tag="Prepare",t}();!function(t){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"}(Ds||(Ds={}));var lu=new as(hs.MOUNTED),cu=new as(hs.UNMOUNTED),hu=new as(Ds.BEFORE_RENDER),pu=new as(Ds.RERENDER),fu=new as(Ds.AFTER_RENDER),du=function(t){function e(e){var n=t.call(this)||this;n.Element=zs,n.inited=!1,n.context={},n.document=new ru,n.document.defaultView=n,n.customElements=new nu;var r=e.container,i=e.canvas,o=e.offscreenCanvas,a=e.width,s=e.height,u=e.devicePixelRatio,l=e.renderer,c=e.background,h=e.cursor,p=e.document,f=e.requestAnimationFrame,d=e.cancelAnimationFrame,y=e.createImage,v=e.supportsPointerEvents,g=e.supportsTouchEvents,m=e.supportsCSSTransform,x=e.useNativeClickEvent,b=e.alwaysTriggerPointerEventOnCanvas,M=e.isTouchEvent,w=e.isMouseEvent;e.supportsMutipleCanvasesInOneContainer||function(t,e){if(t){var n="string"==typeof t?t:t.id||xa++;ma[n]&&ma[n].destroy(),ma[n]=e}}(r,n);var E=a,k=s,S=u;return i&&(S=1>(S=u||ba&&window.devicePixelRatio||1)?1:Math.ceil(S),E=a||function(t){var e=ka(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/S,k=s||function(t){var e=ka(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/S),o&&(Ts.offscreenCanvas=o),n.devicePixelRatio=S,n.requestAnimationFrame=null!=f?f:Fa.bind(Ts.globalThis),n.cancelAnimationFrame=null!=d?d:Ba.bind(Ts.globalThis),n.supportsTouchEvents=null!=g?g:"ontouchstart"in Ts.globalThis,n.supportsPointerEvents=null!=v?v:!!Ts.globalThis.PointerEvent,n.isTouchEvent=null!=M?M:function(t){return n.supportsTouchEvents&&t instanceof Ts.globalThis.TouchEvent},n.isMouseEvent=null!=w?w:function(t){return!Ts.globalThis.MouseEvent||t instanceof Ts.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Ts.globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:E,height:k,renderer:l,offscreenCanvas:o,devicePixelRatio:S,cursor:h||"default",background:c||"transparent",createImage:y,document:p,supportsCSSTransform:m,useNativeClickEvent:x,alwaysTriggerPointerEventOnCanvas:b}),n.initDefaultCamera(E,k,l.clipSpaceNearZ),n.initRenderer(l,!0),n}return n(e,t),e.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},e.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new Ts.CameraContribution;i.clipSpaceNearZ=n,i.setType(Ar.EXPLORING,Or.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(zr,(function(){r.context.renderingContext.renderReasons.add(es.CAMERA_CHANGED),Ts.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()})),this.context.camera=i},e.prototype.updateSizeAttenuation=function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){Ts.styleValueRegistry.updateSizeAttenuation(e,t)}))},e.prototype.getConfig=function(){return this.context.config},e.prototype.getRoot=function(){return this.document.documentElement},e.prototype.getCamera=function(){return this.context.camera},e.prototype.getContextService=function(){return this.context.contextService},e.prototype.getEventService=function(){return this.context.eventService},e.prototype.getRenderingService=function(){return this.context.renderingService},e.prototype.getRenderingContext=function(){return this.context.renderingContext},e.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(e.prototype,"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},enumerable:!1,configurable:!0}),e.prototype.destroy=function(t,e){(void 0===t&&(t=!0),void 0===e&&(e=!1),e||this.dispatchEvent(new as(Ds.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new as(Ds.AFTER_DESTROY))},e.prototype.changeSize=function(t,e){this.resize(t,e)},e.prototype.resize=function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===Rr.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new as(Ds.RESIZE,{width:t,height:e}))},e.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},e.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},e.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.prototype.render=function(){var t=this;this.dispatchEvent(hu),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(pu)})),this.dispatchEvent(fu)},e.prototype.run=function(){var t=this,e=function(){t.render(),t.frameId=t.requestAnimationFrame(e)};e()},e.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new sr,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new ou,new uu,new iu([new su])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(r(r({},Ts),this.context)),this.context.renderingService=new ps(Ts,this.context),this.context.eventService=new ls(Ts,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then((function(){n.initRenderingService(t,e)}))},e.prototype.initRenderingService=function(t,e,n){var r=this;void 0===e&&(e=!1),void 0===n&&(n=!1),this.context.renderingService.init((function(){r.inited=!0,e?(n?r.requestAnimationFrame((function(){r.dispatchEvent(new as(Ds.READY))})):r.dispatchEvent(new as(Ds.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new as(Ds.RENDERER_CHANGED)),e||r.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()}))},e.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(Ts)}))},e.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),l([],u(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy(Ts)})),this.initRenderer(t)}},e.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},e.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(cu):(cu.target=t,this.dispatchEvent(cu,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},e.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(lu):(lu.target=t,this.dispatchEvent(lu,!0))):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)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},e.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},e.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},e.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},e.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},e.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},e.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},e}(ss),yu=function(t,e,n,r){return{x:t+n*Math.cos(r),y:e+n*Math.sin(r)}};var vu=function(t){function e(e){var n=t.call(this,e)||this;return n.updatePath(),n}return n(e,t),e.prototype.setAttribute=function(e,n,r){t.prototype.setAttribute.call(this,e,n,r),["cx","cy","startAngle","endAngle","r","anticlockwise"].indexOf(e)>-1&&this.updatePath()},e.prototype.updatePath=function(){var e=this.parsedStyle,n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.startAngle,s=e.endAngle,u=e.r,l=e.anticlockwise;if(p(a)||p(s)||a===s||p(u)||u<=0)t.prototype.setAttribute.call(this,"path","");else{var c=this.createPath(r,o,vr(a),vr(s),u,l);t.prototype.setAttribute.call(this,"path",c)}},e.prototype.createPath=function(t,e,n,r,i,o){var a=yu(t,e,i,n),s=yu(t,e,i,r),u=Math.abs(r-n);if(u>=2*Math.PI||I(u,2*Math.PI)){var l=yu(t,e,i,n+Math.PI);return[["M",a.x,a.y],["A",i,i,0,1,o?0:1,l.x,l.y],["A",i,i,0,1,o?0:1,a.x,a.y],["Z"]]}var c=function(t,e,n){return n?t>e?e-t>-Math.PI?0:1:e-t>Math.PI?0:1:t>e?e-t>-Math.PI?1:0:e-t>Math.PI?1:0}(n,r,o);return[["M",a.x,a.y],["A",i,i,0,c,o?0:1,s.x,s.y]]},e}($s),gu={circle:function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e]]},square:function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]},arrow:function(t,e,n){return[["M",t-n,e+2*n/Math.sqrt(3)],["L",t+n,e+2*n/Math.sqrt(3)],["L",t,e-2*n/Math.sqrt(3)],["Z"]]}},mu=function(t){function e(e){var n=t.call(this,e)||this;return n.updatePath(),n}return n(e,t),e.prototype.setAttribute=function(e,n,r){t.prototype.setAttribute.call(this,e,n,r),["x","y","symbol","radius"].indexOf(e)>-1&&this.updatePath()},e.prototype.updatePath=function(){var e=this.parsedStyle,n=e.x,r=e.y,i=this.attributes,o=i.symbol;if(o){var a=gu[o];if(a){var s=a(void 0===n?0:n,void 0===r?0:r,i.radius);t.prototype.setAttribute.call(this,"path",s)}}},e}($s),xu=Math.PI,bu=2*xu,Mu=Math.sin,wu=Math.cos,Eu=Math.acos,ku=Math.atan2,Su=Math.sqrt,Pu=Math.max,Tu=Math.min,Nu=1e-4;function Cu(t,e,n,r,i,o,a){var s=t-n,u=e-r,l=(a?o:-o)/Su(s*s+u*u),c=l*u,h=-l*s,p=t+c,f=e+h,d=n+c,y=r+h,v=(p+d)/2,g=(f+y)/2,m=d-p,x=y-f,b=m*m+x*x,M=i-o,w=p*y-d*f,E=(0>x?-1:1)*Su(Pu(0,M*M*b-w*w)),k=(w*x-m*E)/b,S=(-w*m-x*E)/b,P=(w*x+m*E)/b,T=(-w*m+x*E)/b,N=k-v,C=S-g,A=P-v,O=T-g;return N*N+C*C>A*A+O*O&&(k=P,S=T),{cx:k,cy:S,x0:-c,y0:-h,x1:k*(i/M-1),y1:S*(i/M-1)}}function Au(t,e,n){if(void 0===n&&(n=!0),!n){var r=e;e=t,t=r}return Math.abs((e=0>e-t?e+bu:e)-t)%bu>xu?1:0}var Ou=function(t){function e(e){var n=t.call(this,e)||this;return n.updatePath(),n}return n(e,t),e.prototype.setAttribute=function(e,n,r){t.prototype.setAttribute.call(this,e,n,r),["startAngle","endAngle","r","r0","radius","cx","cy"].indexOf(e)>-1&&this.updatePath()},e.prototype.updatePath=function(){var e=this.parsedStyle,n=e.cx,r=e.cy,i=e.startAngle,o=e.endAngle,a=e.r,s=e.r0,u=e.radius,l=e.anticlockwise,c=void 0!==l&&l;if(p(i)||p(o)||i===o||p(a)||a<=0)t.prototype.setAttribute.call(this,"path","");else{var h=this.createPath(n,r,vr(i),vr(o),a,s||0,u||[0,0,0,0],c);t.prototype.setAttribute.call(this,"path",h)}},e.prototype.createPath=function(t,e,n,r,i,o,a,s){var u=yu(t,e,i,n),l=yu(t,e,i,r),c=yu(t,e,o,n),h=yu(t,e,o,r),p=!s,f=p?r-n:n-r;if(Math.abs(f)>=bu||I(Math.abs(f),bu)){var d=yu(t,e,i,n+Math.PI),y=yu(t,e,o,n+Math.PI),v=[["M",u.x,u.y],["A",i,i,0,1,p?1:0,d.x,d.y],["A",i,i,0,1,p?1:0,l.x,l.y]];return o>0&&(v.push(["M",c.x,c.y]),v.push(["A",o,o,0,1,p?0:1,y.x,y.y]),v.push(["A",o,o,0,1,p?0:1,h.x,h.y])),v.push(["M",u.x,u.y]),v.push(["Z"]),v}var g=i*wu(n),m=i*Mu(n),x=o*wu(r),b=o*Mu(r),M=i*wu(r),w=i*Mu(r),E=o*wu(n),k=o*Mu(n),S=a[0],P=a[1],T=a[2],N=a[3],C=(i-o)/2,A=Tu(C,S),O=Tu(C,P),R=Tu(C,T),L=Tu(C,N),_=Pu(A,O),D=Pu(R,L),F=_,B=D;if((_>Nu||D>Nu)&&xu>f){var j=function(t,e,n,r,i,o,a,s){var u=n-t,l=r-e,c=a-i,h=s-o,p=h*u-c*l;if(p*p>=Nu)return[t+(p=(c*(e-o)-h*(t-i))/p)*u,e+p*l]}(g,m,E,k,M,w,x,b);if(j){var G=g-j[0],Y=m-j[1],W=M-j[0],z=w-j[1],V=1/Mu(Eu((G*W+Y*z)/(Su(G*G+Y*Y)*Su(W*W+z*z)))/2),X=Su(j[0]*j[0]+j[1]*j[1]);F=Tu(_,(i-X)/(V+1)),B=Tu(D,(o-X)/(V-1))}}var U=Au(n,r,p),H=[];if(F>Nu){var q=Tu(S,F),Z=Tu(P,F),K=Cu(E,k,g,m,i,q,p),$=Cu(M,w,x,b,i,Z,p);if(H.push(["M",t+K.cx+K.x0,e+K.cy+K.y0]),_>F&&q===Z){var J=ku(K.cy+K.y0,K.cx+K.x0),Q=ku($.cy+$.y0,$.cx+$.x0);H.push(["A",F,F,0,Au(J,Q,!p),p?1:0,t+$.cx+$.x0,e+$.cy+$.y0])}else{if(q>0){J=ku(K.y0,K.x0),Q=ku(K.y1,K.x1);var tt=yu(t,e,i,Q);H.push(["A",q,q,0,Au(J,Q,p),p?1:0,tt.x,tt.y])}var et=ku(K.cy+K.y1,K.cx+K.x1),nt=ku($.cy+$.y1,$.cx+$.x1),rt=yu(t,e,i,nt);if(H.push(["A",i,i,1,Au(et,nt,p),p?1:0,rt.x,rt.y]),Z>0){var it=ku($.y1,$.x1),ot=ku($.y0,$.x0);H.push(["A",Z,Z,0,Au(it,ot,p),p?1:0,t+$.cx+$.x0,e+$.cy+$.y0])}}}else H.push(["M",u.x,u.y]),H.push(["A",i,i,0,U,p?1:0,l.x,l.y]);if(Nu>o)H.push(["L",h.x,h.y]);else if(B>Nu){q=Tu(N,B),K=Cu(0,0,x,b,o,-(Z=Tu(T,B)),p),$=Cu(E,k,0,0,o,-q,p);if(H.push(["L",t+K.cx+K.x0,e+K.cy+K.y0]),D>B&&q===Z){var at=ku(K.y0,K.x0),st=ku($.y0,$.x0);H.push(["A",B,B,0,Au(at,st),1,t+$.cx+$.x0,e+$.cy+$.y0])}else{if(Z>0){at=ku(K.y0,K.x0),st=ku(K.y1,K.x1);H.push(["A",Z,Z,0,Au(at,st,p),p?1:0,t+K.cx+K.x1,e+K.cy+K.y1])}var ut=ku(K.cy+K.y1,K.cx+K.x1),lt=ku($.cy+$.y1,$.cx+$.x1),ct=yu(t,e,o,lt);if(H.push(["A",o,o,0,Au(lt,ut,p),p?0:1,ct.x,ct.y]),q>0){var ht=ku($.y1,$.x1),pt=ku($.y0,$.x0);H.push(["A",q,q,0,Au(ht,pt,p),p?1:0,t+$.cx+$.x0,e+$.cy+$.y0])}}}else H.push(["L",h.x,h.y]),H.push(["A",o,o,0,U,p?0:1,c.x,c.y]);return H.push(["Z"]),H},e}($s);function Ru(t){return[t.x,t.y]}function Lu(t,e,n){for(var r,i,o,a=!!e,s=function(t,e,n,r){var i,o,a,s,u,l,c,h,p=[],f=!!r;if(f){for(a=[1/0,1/0],s=[-1/0,-1/0],h=0,c=t.length;c>h;h++)de(a,a,u=Ru(t[h])),ye(s,s,u);de(a,a,r[0]),ye(s,s,r[1])}for(h=0,l=t.length;l>h;h++){if(u=Ru(t[h]),n)i=Ru(t[h?h-1:l-1]),o=Ru(t[(h+1)%l]);else{if(0===h||h===l-1){p.push([u[0],u[1]]);continue}i=Ru(t[h-1]),o=Ru(t[h+1])}var d=xe([],o,i);ve(d,d,e);var y=ge(u,i),v=ge(u,o),g=y+v;0!==g&&(y/=g,v/=g);var m=ve([],d,-y),x=ve([],d,v),b=fe([],u,m),M=fe([],u,x);f&&(ye(b,b,a),de(b,b,s),ye(M,M,a),de(M,M,s)),p.push([b[0],b[1]]),p.push([M[0],M[1]])}return n&&p.push(p.shift()),p}(t,.4,a,n),u=t.length,l=[],c=0;u-1>c;c++)l.push(["C",(r=s[2*c])[0],r[1],(i=s[2*c+1])[0],i[1],(o=t[c+1]).x,o.y]);return a&&l.push(["C",(r=s[u])[0],r[1],(i=s[u+1])[0],i[1],(o=t[0]).x,o.y]),l}var _u=Object.freeze({__proto__:null,smooth:Lu}),Iu=function(t){function e(e){var n=t.call(this,e)||this;return n.updatePath(),n}return n(e,t),e.prototype.setAttribute=function(e,n,r){t.prototype.setAttribute.call(this,e,n,r),["smooth","points","step"].indexOf(e)>-1&&this.updatePath()},e.prototype.updatePath=function(){var e=this.parsedStyle,n=e.step,r=e.points.points,i=[["M",r[0][0],r[0][1]]];if(e.smooth)for(var o=Lu(r.map((function(t){return{x:t[0],y:t[1]}})),!1,[[0,0],[1,1]]),a=0,s=o.length;s>a;a++){var u=o[a];i.push(["C",u[1],u[2],u[3],u[4],u[5],u[6]])}else if(n){a=void 0;var l=void 0;switch(n){case"start":for(a=1,l=r.length;l>a;a++){i.push(["L",c=r[a-1][0],r[a-1][1]]),i.push(["L",c,r[a][1]]),i.push(["L",r[a][0],r[a][1]])}break;case"middle":for(a=1,l=r.length;l>a;a++){i.push(["L",c=(r[a][0]+r[a-1][0])/2,r[a-1][1]]),i.push(["L",c,r[a][1]]),i.push(["L",r[a][0],r[a][1]])}break;case"end":for(a=1,l=r.length;l>a;a++){var c;i.push(["L",c=r[a][0],r[a-1][1]]),i.push(["L",c,r[a][1]]),i.push(["L",r[a][0],r[a][1]])}}}else{a=void 0,l=void 0;for(a=1,l=r.length-1;l>a;a++)i.push(["L",r[a][0],r[a][1]]);i.push(["L",r[l][0],r[l][1]])}t.prototype.setAttribute.call(this,"path",i)},e.tag="smooth-polyline",e}($s),Du=function(){function t(t){this.el=t}return t.prototype.on=function(t,e){t&&this.el.addEventListener(t,e)},t.prototype.off=function(t,e){t&&this.el.removeEventListener(t,e)},t}(),Fu={},Bu=function(t,e){Fu[t]=e},ju=[["click","onClick"],["touchstart","onTouchStart"],["touchmove","onTouchMove"],["touchend","onTouchEnd"],["touchendoutside","onTouchEndOutside"],["dragenter","onDragEnter"],["dragleave","onDragLeave"],["dragover","onDragOver"],["drop","onDrop"],["dragstart","onDragStart"],["drag","onDrag"],["dragend","onDragEnd"],["panstart","onPanStart"],["pan","onPan"],["panend","onPanEnd"],["pressstart","onPressStart"],["press","onPress"],["pressend","onPressEnd"],["swipe","onSwipe"],["pinchstart","onPinchStart"],["pinch","onPinch"],["pinchend","onPinchEnd"]];function Gu(t,e){if(!t)return null;var n=function(t){return Fu[t]}(t);if(!n)return null;var r=new n(e);return r.gesture=function(t,e){var n=new Du(t);return ju.forEach((function(t){var r=t[1];e[r]&&n.on(t[0],e[r])})),n}(r,e),r}function Yu(t){return Yu="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},Yu(t)}function Wu(t){return Object.prototype.toString.call(t)}function zu(t){return Object.keys(t)}function Vu(t,e){if(t===e)return!0;if(Yu(t)!==Yu(e))return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(Wu(t)!==Wu(e))return!1;if(h(t))return!1;if("object"!==Yu(t))return!1;if(y(t)){if(t.length!==e.length)return!1;for(var n=t.length-1;n>=0;n--)if(!Vu(t[n],e[n]))return!1;return!0}if(!b(t))return!1;var r=zu(t),i=zu(e);if(r.length!==i.length)return!1;r.sort(),i.sort();for(n=r.length-1;n>=0;n--)if(r[n]!=i[n])return!1;for(n=r.length-1;n>=0;n--){var o=r[n];if(!Vu(t[o],e[o]))return!1}return!0}[["group",tu],["text",eu],["circle",Xs],["path",$s],["ellipse",Us],["rect",tu],["image",Zs],["line",Ks],["polyline",Iu],["polygon",Js],["arc",vu],["marker",mu],["sector",Ou]].map((function(t){Bu(t[0],t[1])})),[{name:"r0",inherits:!1,interpolable:!0,syntax:Ti.LENGTH_PERCENTAGE},{name:"startAngle",inherits:!1,interpolable:!0,syntax:Ti.ANGLE},{name:"endAngle",inherits:!1,interpolable:!0,syntax:Ti.ANGLE}].forEach((function(t){Vs(t)}));function Xu(t){return P(t)?2:t.prototype&&t.prototype.isF2Component?1:0}function Uu(t){var e;return 2===t.tag?t:(sn.map(t.children,(function(t){e||(e=Uu(t))})),e)}var Hu=ln((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 o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),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 a(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,o=Array(i);i>r;r++)o[r]=e[r].fn;return o},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,o,a){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,o),!0;case 6:return c.fn.call(c.context,e,r,i,o,a),!0}for(l=1,u=Array(h-1);h>l;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var p,f=c.length;for(l=0;f>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(p=1,u=Array(h-1);h>p;p++)u[p-1]=arguments[p];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);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[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(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}));function qu(t,e){e&&Object.keys(e).forEach((function(n){if("clip"===n||"offset"===n){var r=e[n];if(Is(null==r?void 0:r.current))return void t.setAttribute("".concat(n,"Path"),r.current);var i=h(r)?r(e):r;if(i){var o=Gu(i.type,{style:i.style});t.setAttribute("".concat(n,"Path"),o)}}else t.setAttribute(n,e[n])}))}var Zu=function(t){function e(){return t.call(this)||this}return n(e,t),e.prototype.animate=function(t,e,n,r){this.shape=t,this.start=e,this.end=n,this.effect=r},e.prototype.run=function(){var t=this,e=t.vNode,n=t.shape,i=t.start,o=t.end,a=t.effect,s=t.children,u=[];if(a){var l=a.property,c=void 0===l?[]:l,p=a.easing,f=a.duration,d=a.delay,y=a.iterations,v=a.clip,g=a.direction,m=void 0===g?"normal":g,x=a.onFrame,b=a.onEnd;if((c.length||x)&&f>0){var M=r(r({},rt(i,c)),rt(o,c));qu(n,M);var w=c.reduce((function(t,e){return t[e]=i[e],t}),{}),E=nt(o,c),k=n.animate([w,E],{fill:"both",easing:p,duration:f,delay:d,iterations:y,direction:m});if(k){var S=x?function(t){var e=t.target,n=e.effect,r=n.getTiming(),a=r.delay,s=t.currentTime>a?(t.currentTime-a)/r.duration:0,u=n.target;qu(u,x(s,{t:s,start:i,end:o,animation:e,shape:u}))}:null;k.onframe=S,k.onfinish=S||b?function(t){S&&S(t),b&&b(t)}:null,y!==1/0&&u.push(k)}else qu(n,o)}else qu(n,o);if(v){var P=h(v)?v(o):v;if(P){var T=P.type,N=P.deleteAfterComplete,C=void 0===N||N,A=P.style,O=P.property,R=void 0===O?[]:O,L=P.easing,_=P.duration,I=P.delay,D=P.iterations,F=P.start,B=P.end,j=P.direction;if(R.length&&(_||f)>0){var G=r(r({},A),F),Y=r(r({},A),B),W=R.reduce((function(t,e){return t[e]=G[e],t}),{}),z=nt(Y,R),V=Gu(T,{style:G});n.setAttribute("clipPath",V),n.ownerDocument.documentElement.appendChild(V);var X=V.animate([W,z],{fill:"both",easing:L||p,duration:_||f,delay:I||d,iterations:D||y,direction:j||m});if(X)C&&X.finished.then((function(){n.setAttribute("clipPath",null),V.destroy()})),(D||y)!==1/0&&u.push(X);else n.setAttribute("clipPath",null),V.destroy()}}}}if(s&&s.length&&s.forEach((function(t){if(t){var e=t.run();e&&u.push.apply(u,e)}})),this.animations=u,e){var U=e.component;e&&e.component&&U.animationWillPlay&&U.animationWillPlay()}return this.endEmit(u),u},e.prototype.play=function(){var t=this.animations;t&&t.length&&t.forEach((function(t){t.play()}))},e.prototype.pause=function(){var t=this.animations;t&&t.length&&t.forEach((function(t){t.pause()}))},e.prototype.goTo=function(t){var e=this.animations;e&&e.length&&e.forEach((function(e){e.currentTime=t}))},e.prototype.finish=function(){var t=this.animations;t&&t.length&&t.forEach((function(t){t.finish()}))},e.prototype.setPlaybackRate=function(t){var e=this.animations;e&&e.length&&e.forEach((function(e){e.playbackRate=t}))},e.prototype.endEmit=function(t){var e=this;if(!t.length)return this.emit("end"),null;Promise.all(t.map((function(t){return t.finished}))).then((function(){e.emit("end")}))},e.prototype.reset=function(t){this.shape=t,this.start=null,this.end=null,this.effect=null,this.children=null},e.prototype.clone=function(){var t=new e;return t.shape=this.shape,t.start=this.start,t.end=this.end,t.effect=this.effect,t.children=this.children,t.vNode=this.vNode,t},e}(Hu);function Ku(t){var e=[];return sn.map(t,(function(t){if(t){var n=t.children;2===t.tag&&"group"!==t.type&&e.push(t),n&&e.push.apply(e,Ku(n))}})),e}function $u(t,e,n){var i=e.props,o=e.shape,a=e.style,s=t.shape,u=t.style,l=t.animator;s.destroy();var c=i.animation,h=c?c.update:null;if(!1===i.animate||!h)return n;n=n||new Zu;var p=h.start,f=h.end,d=h.property,y=void 0===d?[]:d,v=o.parsedStyle,g=s.parsedStyle,m=wo(s),x=wo(o),b=r(r(r({},u),p),{path:m}),M=r(r(r({},a),f),{path:x}),w=Gu("path",{style:r(r({},b),{path:""})}),E=y.filter((function(t){return v.hasOwnProperty(t)&&g.hasOwnProperty(t)})).concat("path");n.animate(w,b,M,r(r({},h),{property:E}));var k=(null==e?void 0:e.context).timeline;return k&&k.delete(l),n.once("end",(function(){o.destroyed||(qu(o,M),w.replaceWith(o))})),n}function Ju(t,e){var n=t.tag,i=t.type,o=t.style,a=t.children,s=t.props,u=t.shape,l=t.animator,c=t.animate,h=e.tag,p=e.type,f=e.style,d=e.children,y=e.shape;l.reset(u),l.children=el(t,a,d);var v=s.animation,g=v?v.update:null;if(i===p){var m=f?Object.keys(f).reduce((function(t,e){return t[e]="",t}),{}):null,x=r(r({},m),o);if(2!==n)return qu(u,x),l;if($(o,f))return l;if(!1===c||!g)return qu(u,x),l;var b=g.start,M=g.end,w=r(r({},f),b),E=r(r({},x),M);return l.animate(u,w,E,g),l}return 2!==n||2!==h?(y.destroy(),l):"group"===i?Ku(t.children).map((function(t){return $u(e,t)})):"group"===p?Ku(e.children).map((function(e){return $u(e,t)})):!1!==c&&g?$u(e,t,l):(qu(u,o),l)}function Qu(t){return sn.map(t,(function(t){if(!t)return null;var e=t.tag,n=t.shape,i=t.children,o=t.animate,a=t.style,s=t.props,u=t.animator,l=t.context.timeline;if(n.destroyed)return null;u.reset(n);var c=i?sn.toArray(i).map((function(t){return Qu(t)})).filter(Boolean):null;if(!1===o)return n.destroy(),u;var h=s.animation,p=h?h.leave:null;if(!(c&&c.length||p))return n.destroy(),u;if(u.children=c,p&&2===e){var f=p.start,d=p.end,y=void 0===d?{}:d,v=r(r({},a),f);u.animate(n,v,y,p),l&&l.delete(u.animations)}return u.once("end",(function(){n.destroy()})),u}))}function tl(t,e){if(!t&&!e)return null;if(!t&&e)return Qu(e);var n=t.transform;if(n){var i=Uu(t);t.transform=null,i.transform=n}return t.transform?e?[Ju(t,t.transform),Qu(e)]:Ju(t,t.transform):t&&!e?sn.map(t,(function(t){if(t){var e=t.tag,n=t.shape,i=t.style,o=t.children,a=t.animate,s=t.props,u=t.animator;if(u.reset(n),u.children=o?el(t,o,null):null,!1===a||2!==e)return qu(n,i),u;var l=s.animation,c=l?l.appear:null;if(!c)return qu(n,i),u;var h=c.start,p=void 0===h?{}:h,f=c.end,d=r(r({},i),f);return u.animate(n,p,d,c),u}})):Ju(t,e)}function el(t,e,n){if(!e&&!n)return[];var r,i=t.shape,o=[];return sn.compare(e,n,(function(t,e){var n=tl(t,e);sn.map(n,(function(t){if(t){o.push(t);var e,n=t.shape;if(n&&!n.destroyed)(e=r?r.nextSibling:i.firstChild)!==n&&function(t,e,n){n?t.insertBefore(e,n):t.appendChild(e)}(i,n,e),r=n}}))})),o}function nl(t,e,n){if(!t)return{animators:null,time:0};var i=[],o=0;return sn.map(t,(function(t){if(t){var a=t.clone(),s=a.vNode,u=a.children,l=e[null==s?void 0:s.key]||{},c=V(n||{},{duration:l.duration,delay:l.delay}),h=r(r({},a.effect),c);a.effect=h;var p=h.duration,f=void 0===p?0:p,d=h.delay,y=void 0===d?0:d,v=nl(u,e,c);o=Math.max(o,f+y,v.time),a.children=v.animators,i.push(a)}})),{animators:i,time:o}}var rl,il=function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},ol={rect:il,line:function(t){var e=t.left,n=t.top;return{x1:e,y1:n,x2:e+t.width,y2:n+t.height}},text:function(t){return{x:t.left,y:t.top+t.height/2,textBaseline:"middle"}},circle:function(t){var e=t.width/2;return{cx:t.left+e,cy:t.top+e,r:e}},marker:function(t){var e=t.width/2;return{x:t.left+e,y:t.top,radius:e}},group:il},al="inherit",sl="row",ul="row-reverse",ll="column",cl="column-reverse",hl="flex-start",pl="center",fl="flex-start",dl="center",yl="flex-end",vl="stretch",gl="relative",ml="absolute",xl={row:"left","row-reverse":"right",column:"top","column-reverse":"bottom"},bl={row:"right","row-reverse":"left",column:"bottom","column-reverse":"top"},Ml={row:"left","row-reverse":"right",column:"top","column-reverse":"bottom"},wl={row:"width","row-reverse":"width",column:"height","column-reverse":"height"};function El(t){return t.layout&&!t.isDirty||(t.layout={width:void 0,height:void 0,top:0,left:0,right:0,bottom:0}),t.style||(t.style={}),t.children||(t.children=[]),t.children.forEach(El),t}function kl(t){return void 0===t}function Sl(t){return t===sl||t===ul}function Pl(t,e){if(void 0!==t.style.marginStart&&Sl(e))return t.style.marginStart;var n=null;switch(e){case"row":n=t.style.marginLeft;break;case"row-reverse":n=t.style.marginRight;break;case"column":n=t.style.marginTop;break;case"column-reverse":n=t.style.marginBottom}return void 0!==n?n:void 0!==t.style.margin?t.style.margin:0}function Tl(t,e){if(void 0!==t.style.marginEnd&&Sl(e))return t.style.marginEnd;var n=null;switch(e){case"row":n=t.style.marginRight;break;case"row-reverse":n=t.style.marginLeft;break;case"column":n=t.style.marginBottom;break;case"column-reverse":n=t.style.marginTop}return null!=n?n:void 0!==t.style.margin?t.style.margin:0}function Nl(t,e){if(void 0!==t.style.borderStartWidth&&t.style.borderStartWidth>=0&&Sl(e))return t.style.borderStartWidth;var n=null;switch(e){case"row":n=t.style.borderLeftWidth;break;case"row-reverse":n=t.style.borderRightWidth;break;case"column":n=t.style.borderTopWidth;break;case"column-reverse":n=t.style.borderBottomWidth}return null==n||0>n?void 0===t.style.borderWidth||0>t.style.borderWidth?0:t.style.borderWidth:n}function Cl(t,e){if(void 0!==t.style.borderEndWidth&&t.style.borderEndWidth>=0&&Sl(e))return t.style.borderEndWidth;var n=null;switch(e){case"row":n=t.style.borderRightWidth;break;case"row-reverse":n=t.style.borderLeftWidth;break;case"column":n=t.style.borderBottomWidth;break;case"column-reverse":n=t.style.borderTopWidth}return null==n||0>n?void 0===t.style.borderWidth||0>t.style.borderWidth?0:t.style.borderWidth:n}function Al(t,e){return function(t,e){if(void 0!==t.style.paddingStart&&t.style.paddingStart>=0&&Sl(e))return t.style.paddingStart;var n=null;switch(e){case"row":n=t.style.paddingLeft;break;case"row-reverse":n=t.style.paddingRight;break;case"column":n=t.style.paddingTop;break;case"column-reverse":n=t.style.paddingBottom}return null==n||0>n?void 0===t.style.padding||0>t.style.padding?0:t.style.padding:n}(t,e)+Nl(t,e)}function Ol(t,e){return function(t,e){if(void 0!==t.style.paddingEnd&&t.style.paddingEnd>=0&&Sl(e))return t.style.paddingEnd;var n=null;switch(e){case"row":n=t.style.paddingRight;break;case"row-reverse":n=t.style.paddingLeft;break;case"column":n=t.style.paddingBottom;break;case"column-reverse":n=t.style.paddingTop}return null==n||0>n?void 0===t.style.padding||0>t.style.padding?0:t.style.padding:n}(t,e)+Cl(t,e)}function Rl(t,e){return Nl(t,e)+Cl(t,e)}function Ll(t,e){return Pl(t,e)+Tl(t,e)}function _l(t,e){return Al(t,e)+Ol(t,e)}function Il(t,e){return e.style.alignSelf?e.style.alignSelf:t.style.alignItems?t.style.alignItems:"stretch"}function Dl(t,e){if("rtl"===e){if(t===sl)return ul;if(t===ul)return sl}return t}function Fl(t,e){return function(t){return t===ll||t===cl}(t)?Dl(sl,e):ll}function Bl(t){return t.style.position?t.style.position:"relative"}function jl(t){return Bl(t)===gl&&t.style.flex>0}function Gl(t,e){return t.layout[wl[e]]+Ll(t,e)}function Yl(t,e){return void 0!==t.style[wl[e]]&&t.style[wl[e]]>=0}function Wl(t,e){return void 0!==t.style[e]}function zl(t,e){return void 0!==t.style[e]?t.style[e]:0}function Vl(t,e,n){var r={row:t.style.minWidth,"row-reverse":t.style.minWidth,column:t.style.minHeight,"column-reverse":t.style.minHeight}[e],i={row:t.style.maxWidth,"row-reverse":t.style.maxWidth,column:t.style.maxHeight,"column-reverse":t.style.maxHeight}[e],o=n;return void 0!==i&&i>=0&&o>i&&(o=i),void 0!==r&&r>=0&&r>o&&(o=r),o}function Xl(t,e){return t>e?t:e}function Ul(t,e){void 0===t.layout[wl[e]]&&Yl(t,e)&&(t.layout[wl[e]]=Xl(Vl(t,e,t.style[wl[e]]),_l(t,e)))}function Hl(t,e,n){e.layout[bl[n]]=t.layout[wl[n]]-e.layout[wl[n]]-e.layout[Ml[n]]}function ql(t,e){return void 0!==t.style[xl[e]]?zl(t,xl[e]):-zl(t,bl[e])}function Zl(t,e,n){var r=function(t,e){var n;return(n=t.style.direction?t.style.direction:al)===al&&(n=void 0===e?"ltr":e),n}(t,n),i=Dl(function(t){return t.style.flexDirection?t.style.flexDirection:ll}(t),r),o=Fl(i,r),a=Dl(sl,r);Ul(t,i),Ul(t,o),t.layout.direction=r,t.layout[xl[i]]+=Pl(t,i)+ql(t,i),t.layout[bl[i]]+=Tl(t,i)+ql(t,i),t.layout[xl[o]]+=Pl(t,o)+ql(t,o),t.layout[bl[o]]+=Tl(t,o)+ql(t,o);var s=t.children.length,u=_l(t,a);if(function(t){return void 0!==t.style.measure}(t)){var l=!kl(t.layout[wl[a]]),c=rl;c=Yl(t,a)?t.style.width:l?t.layout[wl[a]]:e-Ll(t,a),c-=u;var h=!Yl(t,a)&&!l,p=!Yl(t,ll)&&kl(t.layout[wl[ll]]);if(h||p){var f=t.style.measure(c);h&&(t.layout.width=f.width+u),p&&(t.layout.height=f.height+_l(t,ll))}if(0===s)return}var d,y,v,g,m=function(t){return"wrap"===t.style.flexWrap}(t),x=function(t){return t.style.justifyContent?t.style.justifyContent:"flex-start"}(t),b=Al(t,i),M=Al(t,o),w=_l(t,i),E=_l(t,o),k=!kl(t.layout[wl[i]]),S=!kl(t.layout[wl[o]]),P=Sl(i),T=null,N=null,C=rl;k&&(C=t.layout[wl[i]]-w);for(var A=0,O=0,R=0,L=0,_=0,I=0;s>O;){var D,F=0,B=0,j=0,G=0,Y=k&&x===hl||!k&&x!==pl,W=Y?s:A,z=!0,V=s,X=null,U=null,H=b,q=0;for(d=A;s>d;++d){if((v=t.children[d]).lineIndex=I,v.nextAbsoluteChild=null,v.nextFlexChild=null,(rt=Il(t,v))===vl&&Bl(v)===gl&&S&&!Yl(v,o))v.layout[wl[o]]=Xl(Vl(v,o,t.layout[wl[o]]-E-Ll(v,o)),_l(v,o));else if(Bl(v)===ml)for(null===T&&(T=v),null!==N&&(N.nextAbsoluteChild=v),N=v,y=0;2>y;y++)!kl(t.layout[wl[g=0!==y?sl:ll]])&&!Yl(v,g)&&Wl(v,xl[g])&&Wl(v,bl[g])&&(v.layout[wl[g]]=Xl(Vl(v,g,t.layout[wl[g]]-_l(t,g)-Ll(v,g)-zl(v,xl[g])-zl(v,bl[g])),_l(v,g)));var Z=0;if(k&&jl(v)?(B++,j+=v.style.flex,null===X&&(X=v),null!==U&&(U.nextFlexChild=v),U=v,Z=_l(v,i)+Ll(v,i)):(D=rl,P||(D=Yl(t,a)?t.layout[wl[a]]-u:e-Ll(t,a)-u),0===R&&$l(v,D,r),Bl(v)===gl&&(G++,Z=Gl(v,i))),m&&k&&F+Z>C&&d!==A){G--,R=1;break}Y&&(Bl(v)!==gl||jl(v))&&(Y=!1,W=d),z&&(Bl(v)!==gl||rt!==vl&&rt!==fl||kl(v.layout[wl[o]]))&&(z=!1,V=d),Y&&(v.layout[Ml[i]]+=H,k&&Hl(t,v,i),H+=Gl(v,i),q=Xl(q,Vl(v,o,Gl(v,o)))),z&&(v.layout[Ml[o]]+=L+M,S&&Hl(t,v,o)),R=0,F+=Z,O=d+1}var K=0,$=0,J=0;if(J=k?C-F:Xl(F,0)-F,0!==B){var Q,tt,et=J/j;for(U=X;null!==U;)(Q=et*U.style.flex+_l(U,i))!==(tt=Vl(U,i,Q))&&(J-=tt,j-=U.style.flex),U=U.nextFlexChild;for(0>(et=J/j)&&(et=0),U=X;null!==U;)U.layout[wl[i]]=Vl(U,i,et*U.style.flex+_l(U,i)),D=rl,Yl(t,a)?D=t.layout[wl[a]]-u:P||(D=e-Ll(t,a)-u),$l(U,D,r),v=U,U=U.nextFlexChild,v.nextFlexChild=null}else x!==hl&&(x===pl?K=J/2:"flex-end"===x?K=J:"space-between"===x?(J=Xl(J,0),$=B+G-1!=0?J/(B+G-1):0):"space-around"===x&&(K=($=J/(B+G))/2));for(H+=K,d=W;O>d;++d)Bl(v=t.children[d])===ml&&Wl(v,xl[i])?v.layout[Ml[i]]=zl(v,xl[i])+Nl(t,i)+Pl(v,i):(v.layout[Ml[i]]+=H,k&&Hl(t,v,i),Bl(v)===gl&&(H+=$+Gl(v,i),q=Xl(q,Vl(v,o,Gl(v,o)))));var nt=t.layout[wl[o]];for(S||(nt=Xl(Vl(t,o,q+E),E)),d=V;O>d;++d)if(Bl(v=t.children[d])===ml&&Wl(v,xl[o]))v.layout[Ml[o]]=zl(v,xl[o])+Nl(t,o)+Pl(v,o);else{var rt,it=M;if(Bl(v)===gl)if((rt=Il(t,v))===vl)kl(v.layout[wl[o]])&&(v.layout[wl[o]]=Xl(Vl(v,o,nt-E-Ll(v,o)),_l(v,o)));else if(rt!==fl){var ot=nt-E-Gl(v,o);it+=rt===dl?ot/2:ot}v.layout[Ml[o]]+=L+it,S&&Hl(t,v,o)}L+=q,_=Xl(_,H),I+=1,A=O}if(I>1&&S){var at=t.layout[wl[o]]-E,st=at-L,ut=0,lt=M,ct=function(t){return t.style.alignContent?t.style.alignContent:"flex-start"}(t);ct===yl?lt+=st:ct===dl?lt+=st/2:ct===vl&&at>L&&(ut=st/I);var ht=0;for(d=0;I>d;++d){var pt=ht,ft=0;for(y=pt;s>y;++y)if(Bl(v=t.children[y])===gl){if(v.lineIndex!==d)break;kl(v.layout[wl[o]])||(ft=Xl(ft,v.layout[wl[o]]+Ll(v,o)))}for(ht=y,ft+=ut,y=pt;ht>y;++y)if(Bl(v=t.children[y])===gl){var dt=Il(t,v);if(dt===fl)v.layout[Ml[o]]=lt+Pl(v,o);else if(dt===yl)v.layout[Ml[o]]=lt+ft-Tl(v,o)-v.layout[wl[o]];else if(dt===dl){v.layout[Ml[o]]=lt+(ft-v.layout[wl[o]])/2}else dt===vl&&(v.layout[Ml[o]]=lt+Pl(v,o))}lt+=ft}}var yt=!1,vt=!1;if(k||(t.layout[wl[i]]=Xl(Vl(t,i,_+Ol(t,i)),w),i!==ul&&i!==cl||(yt=!0)),S||(t.layout[wl[o]]=Xl(Vl(t,o,L+E),E),o!==ul&&o!==cl||(vt=!0)),yt||vt)for(d=0;s>d;++d)v=t.children[d],yt&&Hl(t,v,i),vt&&Hl(t,v,o);for(N=T;null!==N;){for(y=0;2>y;y++)!kl(t.layout[wl[g=0!==y?sl:ll]])&&!Yl(N,g)&&Wl(N,xl[g])&&Wl(N,bl[g])&&(N.layout[wl[g]]=Xl(Vl(N,g,t.layout[wl[g]]-Rl(t,g)-Ll(N,g)-zl(N,xl[g])-zl(N,bl[g])),_l(N,g))),Wl(N,bl[g])&&!Wl(N,xl[g])&&(N.layout[xl[g]]=t.layout[wl[g]]-N.layout[wl[g]]-zl(N,bl[g]));v=N,N=N.nextAbsoluteChild,v.nextAbsoluteChild=null}}function Kl(t){var e=t.margin,n=t.layout;Object.keys(e).forEach((function(t){var r,i=Number((r=e[t]).substr(0,r.length-1))/100;"marginLeft"!==t&&"marginRight"!==t||!n.width?"marginTop"!==t&&"marginBottom"!==t||!n.height||(n.top+=n.height*i):n.left+=n.width*i}))}function $l(t,e,n){t.shouldUpdate=!0,function(t){var e=t.style,n={};["marginTop","marginRight","marginBottom","marginLeft"].forEach((function(t){var r=e[t];r&&/^-?\d+%$/.test(r)&&(n[t]=r,e[t]=0)})),t.margin=n}(t);var r=t.style.direction||"ltr";!t.isDirty&&t.lastLayout&&t.lastLayout.requestedHeight===t.layout.height&&t.lastLayout.requestedWidth===t.layout.width&&t.lastLayout.parentMaxWidth===e&&t.lastLayout.direction===r?(t.layout.width=t.lastLayout.width,t.layout.height=t.lastLayout.height,t.layout.top=t.lastLayout.top,t.layout.left=t.lastLayout.left):(t.lastLayout||(t.lastLayout={}),t.lastLayout.requestedWidth=t.layout.width,t.lastLayout.requestedHeight=t.layout.height,t.lastLayout.parentMaxWidth=e,t.lastLayout.direction=r,t.children.forEach((function(t){t.layout.width=void 0,t.layout.height=void 0,t.layout.top=0,t.layout.left=0})),Zl(t,e,n),t.lastLayout.width=t.layout.width,t.lastLayout.height=t.layout.height,t.lastLayout.top=t.layout.top,t.lastLayout.left=t.layout.left),Kl(t)}function Jl(t){return t?(El(t),$l(t,null,null),t):t}function Ql(t,e){return function(){var n=t.text,r=t.width,i=t.height,o=r,a=i;if(!_(r)||!_(i)){var s=e(n,t),u=s.width,l=s.height;_(r)||(o=u),_(i)||(a=l)}return{width:o,height:a}}}var tc=function(){function t(e){var n=e.className,r=e.children,i=e.layout,o=r&&r.length?r.map((function(e){return new t(e)})):void 0,a=i||function(t){if(t){var e=0,n=0,r=0,i=0,o=0,a=0;return t.forEach((function(t){var s=t.layout;s&&(e=Math.min(e,s.left),n=Math.min(n,s.top),r=Math.min(r,s.left+s.width),i=Math.min(i,s.top+s.height),o=Math.max(o,s.width),a=Math.max(a,s.height))})),{left:e,top:n,right:r,bottom:i,width:o,height:a}}}(o);this.children=o,this.layout=a,this.className=n}return t.prototype.getElementsByClassName=function(t){var e=[],n=this.children;return this.className===t&&e.push(this),n&&n.forEach((function(n){e.push.apply(e,n.getElementsByClassName(t))})),e},t}();function ec(t,e){if(!t)return t;var n=[];if(!y(t))return(o=e(t))?(y(o)?n=n.concat(o):n.push(o),n):n;for(var r=0;t.length>r;r++){var i=t[r];if(y(i))n=n.concat(ec(i,e));else if(i){var o;if(!(o=e(i)))continue;y(o)?n=n.concat(o):n.push(o)}}return n}function nc(t,e,n){if(!t)return t;var i=e.px2hd,o=e.measureText,a=t.type,s=t.props;if(0===Xu(a))return nc(a(t.props,e,n),e,n);var u=s.className,l=s.style,c=s.attrs,h=s.children,p=i(r(r({},void 0===l?{}:l),c));return"text"===a&&(p.measure=Ql(p,o)),{type:a,className:u,children:(h?sn.toArray(h).map((function(t){return nc(t,e,n)})):[]).filter(Boolean),style:p}}function rc(t,e){var n=nc(e,t.context,t.updater);return Jl(n),new tc(n)}function ic(t,e){var n=t.tag;return ec(e,(function(t){var e=t.tag;return 2!==n&&2===e&&"flex"!==t.style.display?null:2!==e?ic(t,t.children):oc(t)}))}function oc(t){var e=t.tag,n=t.type,r=t.style,i=t.context.measureText,o=ic(t,t.children);return"text"===n&&(r.measure=Ql(r,i)),{tag:e,type:n,style:r,children:o,vNode:t}}function ac(t){var e=t.style,n=t.vNode,i=t.children,o=t.layout,a=function(t,e){return e?(ol[t]||il)(e):null}(t.type,o);if(e.measure&&delete e.measure,n.layout=o,n.style=r(r({},a),e),i&&i.length)for(var s=0,u=i.length;u>s;s++){ac(i[s])}}function sc(t){var e=t.layout;sn.map(t.children,(function(t){if(t){var n=t.style;2!==t.tag&&e&&!t.layout&&(t.layout=e,t.style=r({width:e.width,height:e.height},n)),sc(t)}}))}function uc(t,e,n){var i=e.style,o=e.attrs,a=e.zIndex;return 2===t?n.px2hd(r(r({},void 0===i?{}:i),o)):_(a)?{zIndex:a}:{}}function lc(t,e){return t.contextInjecter?r({},e):e}function cc(t,e){var n=t.contextType;if(!n)return e;var r=n._currentValue;return r||e}function hc(t,e){var n=t.canvas,o=t.context,a=t.updater,s=t.animate,u=e.ref,l=e.type,c=e.props,h=c.animate,p=c.transformFrom,f=i(c,["animate","transformFrom"]),d=Xu(l),y=lc(l,o),v=new Zu,g=uc(d,f,y);if(v.vNode=e,e.parent=t,e.tag=d,e.style=g,e.context=y,e.updater=a,e.canvas=n,e.animate=j(h)?h:s,e.animator=v,2===d){var m=Gu(l,r(r({},f),{style:g}));u&&(u.current=m),m._vNode=e,e.shape=m}else{var x=cc(l,y),b=void 0;1===d?b=new l(f,x,a):(b=new on(f,x,a)).render=function(){return l(this.props,this.context,a)};var M=new Hs;b.container=M,u&&(u.current=b),b.context=x,b.updater=a,b.animator=v,b._vNode=e,e.shape=M,e.component=b}p&&p.current&&(e.transform=Uu(p.current._vNode),e.transform&&(e.transform.parent.children=null));return e}function pc(t,e,n){var r=t.canvas,i=t.context,o=t.updater,a=t.animate,s=n.tag,u=n.animator,l=n.component,c=n.shape,h=n.children,p=n.props,f=e.type,d=e.props,y=d.animate;return u.vNode=e,e.parent=t,e.tag=s,e.canvas=r,e.context=lc(f,i),e.updater=o,e.component=l,e.shape=function(t,e,n){var r=t.gesture;return r&&(ju.forEach((function(t){var e=t[1];n[e]&&r.off(t[0],n[e])})),ju.forEach((function(t){var n=t[1];e[n]&&r.on(t[0],e[n])}))),t}(c,d,p),e.parent=t,e.children=h,e.animate=j(y)?y:a,e.animator=u,e.style=uc(s,d,i),l?l._vNode=e:c._vNode=e,e}function fc(t){sn.map(t,(function(t){if(t){var e=t.component,n=t.children;e?(e.willUnmount(),fc(n),e.didUnmount(),e.destroy()):fc(n)}}))}function dc(t,e,n){return e||n?!e&&n?(fc(n),null):e&&!n?function(t,e){return sn.map(e,(function(e){return e?hc(t,e):e}))}(t,e):function(t,e,n){var r=e.props,i=n.props;if(e.type===n.type){var o=pc(t,e,n);return Vu(r,i)&&t.context===n.context?null:o}var a=hc(t,e);return fc(n),a}(t,e,n):null}function yc(t,e,n){var r,i=t.component,o=(r=e)?sn.map(r,(function(t){return t?nt(t,["key","ref","type","props"]):t})):r;t.children=o,i&&(i.children=o);var a=[];return sn.compare(o,n,(function(e,n){var r=dc(t,e,n);sn.map(r,(function(t){if(t){var e=[];e=2===t.tag?yc(t,t.props.children,t.children):[t],a=a.concat(e)}}))})),a}function vc(t,e,n){var r=yc(t,e,n),i=oc(t);Jl(i),ac(i),sc(t);var o=t.children;return r.length?(function(t){if(t&&t.length){var e=t.filter((function(t){var e=t.type,n=t.component,r=t.props,i=t.context;if(n.layout=t.layout,!n.isMounted)return!0;if(!1===n.shouldUpdate(r))return!1;var o=cc(e,i);return n.willReceiveProps(r,o),n.props=r,n.context=i,!0}));e.length&&(e.forEach((function(t){var e=t.component;e.isMounted?e.willUpdate():e.willMount()})),e.forEach((function(t){var e=t.component,n=t.children;vc(t,t.canvas.toRawChildren(e.render()),n),e.isMounted?e.didUpdate():(e.didMount(),e.isMounted=!0)})))}}(r),o):o}function gc(t,e,n){var r=t.preNode,i=r.children;if(!1===t.shouldUpdate(r.props))return!1;t.willUpdate();var o=vc(r,e,i);t.preNode.children=o;var a=el(r,o,i);return t.didUpdate(),nl(a,n)}function mc(t,e){var n=e.r;t.arc(n,n,n,0,2*Math.PI,!1)}function xc(t,e){var n=e.rx,r=e.ry;if(t.ellipse)t.ellipse(n,r,n,r,0,0,2*Math.PI,!1);else{var i=n>r?n:r,o=n>r?1:n/r,a=n>r?r/n:1;t.save(),t.scale(o,a),t.arc(i,i,i,0,2*Math.PI)}}function bc(t,e){var n=e.x1,r=e.y1,i=e.x2,o=e.y2,a=e.defX,s=void 0===a?0:a,u=e.defY,l=void 0===u?0:u,c=e.markerStart,h=e.markerEnd,p=e.markerStartOffset,f=e.markerEndOffset,d=0,y=0,v=0,g=0,m=0;c&&Is(c)&&p&&(d=Math.cos(m=Math.atan2(o-r,i-n))*(p||0),y=Math.sin(m)*(p||0)),h&&Is(h)&&f&&(v=Math.cos(m=Math.atan2(r-o,n-i))*(f||0),g=Math.sin(m)*(f||0)),t.moveTo(n-s+d,r-l+y),t.lineTo(i-s+v,o-l+g)}function Mc(t,e){var n=e.defX,r=void 0===n?0:n,i=e.defY,o=void 0===i?0:i,a=e.markerStart,s=e.markerEnd,l=e.markerStartOffset,c=e.markerEndOffset,h=e.path,p=h.absolutePath,f=h.segments,d=0,y=0,v=0,g=0,m=0;if(a&&Is(a)&&l){var x=u(a.parentNode.getStartTangent(),2);d=Math.cos(m=Math.atan2((b=x[0])[1]-(M=x[1])[1],b[0]-M[0]))*(l||0),y=Math.sin(m)*(l||0)}if(s&&Is(s)&&c){var b,M,w=u(s.parentNode.getEndTangent(),2);v=Math.cos(m=Math.atan2((b=w[0])[1]-(M=w[1])[1],b[0]-M[0]))*(c||0),g=Math.sin(m)*(c||0)}for(var E=0;p.length>E;E++){var k=p[E],S=p[E+1],P=0===E&&(0!==d||0!==y),T=(E===p.length-1||S&&("M"===S[0]||"Z"===S[0]))&&0!==v&&0!==g;switch(k[0]){case"M":P?(t.moveTo(k[1]-r+d,k[2]-o+y),t.lineTo(k[1]-r,k[2]-o)):t.moveTo(k[1]-r,k[2]-o);break;case"L":T?t.lineTo(k[1]-r+v,k[2]-o+g):t.lineTo(k[1]-r,k[2]-o);break;case"Q":t.quadraticCurveTo(k[1]-r,k[2]-o,k[3]-r,k[4]-o),T&&t.lineTo(k[3]-r+v,k[4]-o+g);break;case"C":t.bezierCurveTo(k[1]-r,k[2]-o,k[3]-r,k[4]-o,k[5]-r,k[6]-o),T&&t.lineTo(k[5]-r+v,k[6]-o+g);break;case"A":var N=f[E].arcParams,C=N.cx,A=N.cy,O=N.rx,R=N.ry,L=N.startAngle,_=N.endAngle,I=N.xRotation,D=N.sweepFlag;if(t.ellipse)t.ellipse(C-r,A-o,O,R,I,L,_,!!(1-D));else{var F=O>R?O:R,B=O>R?1:O/R,j=O>R?R/O:1;t.translate(C-r,A-o),t.rotate(I),t.scale(B,j),t.arc(0,0,F,L,_,!!(1-D)),t.scale(1/B,1/j),t.rotate(-I),t.translate(-(C-r),-(A-o))}T&&t.lineTo(k[6]-r+v,k[7]-o+g);break;case"Z":t.closePath()}}}function wc(t,e){var n=e.defX,r=void 0===n?0:n,i=e.defY,o=void 0===i?0:i,a=e.markerStart,s=e.markerEnd,u=e.markerStartOffset,l=e.markerEndOffset,c=e.points.points,h=c.length,p=c[0][0]-r,f=c[0][1]-o,d=c[h-1][0]-r,y=c[h-1][1]-o,v=0,g=0,m=0,x=0,b=0;a&&Is(a)&&u&&(v=Math.cos(b=Math.atan2(c[1][1]-c[0][1],c[1][0]-c[0][0]))*(u||0),g=Math.sin(b)*(u||0)),s&&Is(s)&&l&&(m=Math.cos(b=Math.atan2(c[h-1][1]-c[0][1],c[h-1][0]-c[0][0]))*(l||0),x=Math.sin(b)*(l||0)),t.moveTo(p+(v||m),f+(g||x));for(var M=1;h-1>M;M++){var w=c[M];t.lineTo(w[0]-r,w[1]-o)}t.lineTo(d,y)}function Ec(t,e){var n=e.defX,r=void 0===n?0:n,i=e.defY,o=void 0===i?0:i,a=e.markerStart,s=e.markerEnd,u=e.markerStartOffset,l=e.markerEndOffset,c=e.points.points,h=c.length,p=c[0][0]-r,f=c[0][1]-o,d=c[h-1][0]-r,y=c[h-1][1]-o,v=0,g=0,m=0,x=0,b=0;a&&Is(a)&&u&&(v=Math.cos(b=Math.atan2(c[1][1]-c[0][1],c[1][0]-c[0][0]))*(u||0),g=Math.sin(b)*(u||0)),s&&Is(s)&&l&&(m=Math.cos(b=Math.atan2(c[h-2][1]-c[h-1][1],c[h-2][0]-c[h-1][0]))*(l||0),x=Math.sin(b)*(l||0)),t.moveTo(p+v,f+g);for(var M=1;h-1>M;M++){var w=c[M];t.lineTo(w[0]-r,w[1]-o)}t.lineTo(d+m,y+x)}function kc(t,e){var n=e.radius,r=e.width,i=e.height,o=r,a=i;if(n&&n.some((function(t){return 0!==t}))){var s=r>0?1:-1,l=i>0?1:-1,c=s+l===0,h=u(n.map((function(t){return L(t,0,Math.min(Math.abs(o)/2,Math.abs(a)/2))})),4),p=h[0],f=h[1],d=h[2],y=h[3];t.moveTo(s*p,0),t.lineTo(o-s*f,0),0!==f&&t.arc(o-s*f,l*f,f,-l*Math.PI/2,s>0?0:Math.PI,c),t.lineTo(o,a-l*d),0!==d&&t.arc(o-s*d,a-l*d,d,s>0?0:Math.PI,l>0?Math.PI/2:1.5*Math.PI,c),t.lineTo(s*y,a),0!==y&&t.arc(s*y,a-l*y,y,l>0?Math.PI/2:-Math.PI/2,s>0?Math.PI:0,c),t.lineTo(0,l*p),0!==p&&t.arc(s*p,l*p,p,s>0?Math.PI:0,l>0?1.5*Math.PI:Math.PI/2,c)}else t.rect(0,0,o,a)}var Sc=function(t){function e(){var e=t.apply(this,l([],u(arguments),!1))||this;return e.name="canvas-path-generator",e}return n(e,t),e.prototype.init=function(){var t,e=((t={})[or.CIRCLE]=mc,t[or.ELLIPSE]=xc,t[or.RECT]=kc,t[or.LINE]=bc,t[or.POLYLINE]=Ec,t[or.POLYGON]=wc,t[or.PATH]=Mc,t[or.TEXT]=void 0,t[or.GROUP]=void 0,t[or.IMAGE]=void 0,t[or.HTML]=void 0,t[or.MESH]=void 0,t);this.context.pathGeneratorFactory=e},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(ur),Pc=It(),Tc=It(),Nc=It(),Cc=ut(),Ac=function(){function t(){var t=this;this.isHit=function(e,n,r,i){var o=t.context.pointInPathPickerFactory[e.nodeName];if(o){var a=ft(Cc,r),s=Xt(Tc,jt(Nc,n[0],n[1],0),a),u=e.getGeometryBounds().halfExtents,l=e.parsedStyle.anchor;if(s[0]+=(l&&l[0]||0)*u[0]*2,s[1]+=(l&&l[1]||0)*u[1]*2,o(e,new _r(s[0],s[1]),i,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(e,n){var r=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),i=t.context.pathGeneratorFactory[e.nodeName];return i&&(r.beginPath(),i(r,e.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return t.prototype.apply=function(e,n){var r,i=this,s=e.renderingService,u=e.renderingContext;this.context=e,this.runtime=n;var l=null===(r=u.root)||void 0===r?void 0:r.ownerDocument;s.hooks.pick.tapPromise(t.tag,(function(t){return o(i,void 0,void 0,(function(){return a(this,(function(e){return[2,this.pick(l,t)]}))}))})),s.hooks.pickSync.tap(t.tag,(function(t){return i.pick(l,t)}))},t.prototype.pick=function(t,e){var n,r,i=e.topmost,o=e.position,a=jt(Pc,o.x,o.y,0),u=t.elementsFromBBox(a[0],a[1],a[0],a[1]),l=[];try{for(var c=s(u),h=c.next();!h.done;h=c.next()){var p=h.value,f=p.getWorldTransform();if(this.isHit(p,a,f,!1)){var d=Ea(p);if(d){var y=d.parsedStyle.clipPath;if(this.isHit(y,a,y.getWorldTransform(),!0)){if(i)return e.picked=[p],e;l.push(p)}}else{if(i)return e.picked=[p],e;l.push(p)}}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return e.picked=l,e},t.tag="CanvasPicker",t}();function Oc(t,e,n){var r=t.parsedStyle,i=r.r,o=r.fill,a=r.stroke,s=r.pointerEvents,l=((r.lineWidth||0)+(r.increasedLineWidthForHitTesting||0))/2,c=Gn(i,i,e.x,e.y),h=u(Ta(s,o,a),2),p=h[0],f=h[1];return p&&f||n?i+l>=c:p?i>=c:!!f&&(c>=i-l&&i+l>=c)}function Rc(t,e,n,r){return t/(n*n)+e/(r*r)}function Lc(t,e,n){var r=t.parsedStyle,i=r.rx,o=r.ry,a=r.lineWidth,s=r.increasedLineWidthForHitTesting,l=e.x,c=e.y,h=u(Ta(r.pointerEvents,r.fill,r.stroke),2),p=h[0],f=h[1],d=((a||0)+(s||0))/2,y=(l-i)*(l-i),v=(c-o)*(c-o);return p&&f||n?1>=Rc(y,v,i+d,o+d):p?1>=Rc(y,v,i,o):!!f&&(Rc(y,v,i-d,o-d)>=1&&1>=Rc(y,v,i+d,o+d))}function _c(t,e,n,r,i,o){return!(t>i||i>t+n||e>o||o>e+r)}function Ic(t,e,n,r,i,o,a,s){var u=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(u),y:e+n*Math.sin(u)};return Gn(l.x,l.y,a,s)<=o/2}function Dc(t,e,n,r,i,o,a){var s=i/2;return!(Math.min(t,n)-s>o||o>Math.max(t,n)+s||Math.min(e,r)-s>a||a>Math.max(e,r)+s)&&qn(t,e,n,r,o,a)<=i/2}function Fc(t,e,n,r,i){var o=t.length;if(2>o)return!1;for(var a=0;o-1>a;a++){if(Dc(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],u=t[o-1];if(Dc(s[0],s[1],u[0],u[1],e,n,r))return!0}return!1}function Bc(t){return 1e-6>Math.abs(t)?0:0>t?-1:1}function jc(t,e,n){return!((n[0]-t[0])*(e[1]-t[1])!=(e[0]-t[0])*(n[1]-t[1])||Math.min(t[0],e[0])>n[0]||n[0]>Math.max(t[0],e[0])||Math.min(t[1],e[1])>n[1]||n[1]>Math.max(t[1],e[1]))}function Gc(t,e,n){var r=!1,i=t.length;if(2>=i)return!1;for(var o=0;i>o;o++){var a=t[o],s=t[(o+1)%i];if(jc(a,s,[e,n]))return!0;Bc(a[1]-n)>0!=Bc(s[1]-n)>0&&0>Bc(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])&&(r=!r)}return r}function Yc(t,e,n){for(var r=!1,i=0;t.length>i;i++){if(r=Gc(t[i],e,n))break}return r}function Wc(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,l=r.lineWidth,c=r.increasedLineWidthForHitTesting,h=r.defX,p=void 0===h?0:h,f=r.defY,d=void 0===f?0:f;return!(!u(Ta(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!l)&&Dc(i,o,a,s,(l||0)+(c||0),e.x+p,e.y+d)}function zc(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,l=a.increasedLineWidthForHitTesting,c=a.defX,h=void 0===c?0:c,p=a.defY,f=void 0===p?0:p,d=a.path,y=d.segments,v=d.hasArc,g=d.polylines,m=d.polygons,x=u(Ta(a.pointerEvents,(null==m?void 0:m.length)&&a.fill,a.stroke),2),b=x[0],M=x[1],w=lo(t),E=!1;return b||n?E=v?r(t,e):Yc(m,e.x+h,e.y+f)||Yc(g,e.x+h,e.y+f):((M||n)&&(E=function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;t.length>s;s++){var u=t[s],l=u.currentPoint,c=u.params,h=u.prePoint,p=u.box;if(!p||_c(p.x-a,p.y-a,p.width+e,p.height+e,n,r))switch(u.command){case"L":case"Z":if(o=Dc(h[0],h[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(o=e/2>=rr(h[0],h[1],c[1],c[2],c[3],c[4],n,r))return!0;break;case"C":if(o=e/2>=Jn(h[0],h[1],c[1],c[2],c[3],c[4],c[5],c[6],n,r,i))return!0;break;case"A":u.cubicParams||(u.cubicParams=je(h[0],h[1],c[1],c[2],c[3],c[4],c[5],c[6],c[7],void 0));for(var f=u.cubicParams,d=h,y=0;f.length>y;y+=6){var v=Jn(d[0],d[1],f[y],f[y+1],f[y+2],f[y+3],f[y+4],f[y+5],n,r,i);if(d=[f[y+4],f[y+5]],o=e/2>=v)return!0}}}return o}(y,(s||0)+(l||0),e.x+h,e.y+f,w)),E)}function Vc(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=r.increasedLineWidthForHitTesting,a=r.points,s=r.defX,l=void 0===s?0:s,c=r.defY,h=void 0===c?0:c,p=u(Ta(r.pointerEvents,r.fill,r.stroke),2),f=p[0],d=!1;return(p[1]||n)&&(d=Fc(a.points,(i||0)+(o||0),e.x+l,e.y+h,!0)),d||!f&&!n||(d=Gc(a.points,e.x+l,e.y+h)),d}function Xc(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=r.increasedLineWidthForHitTesting,a=r.points,s=r.defX,l=void 0===s?0:s,c=r.defY,h=void 0===c?0:c;return!(!u(Ta(r.pointerEvents,r.fill,r.stroke),2)[1]&&!n||!i)&&Fc(a.points,(i||0)+(o||0),e.x+l,e.y+h,!1)}function Uc(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.lineWidth,l=o.increasedLineWidthForHitTesting,c=o.width,h=o.height,p=u(Ta(o.pointerEvents,o.fill,o.stroke),2),f=p[0],d=p[1],y=(s||0)+(l||0);if(a&&a.some((function(t){return 0!==t}))){var v=!1;return(d||n)&&(v=function(t,e,n,r,i,o,a,s){var l=u(i,4),c=l[0],h=l[1],p=l[2],f=l[3];return Dc(t+c,e,t+n-h,e,o,a,s)||Dc(t+n,e+h,t+n,e+r-p,o,a,s)||Dc(t+n-p,e+r,t+f,e+r,o,a,s)||Dc(t,e+r-f,t,e+c,o,a,s)||Ic(t+n-h,e+h,h,0,0,o,a,s)||Ic(t+n-p,e+r-p,p,0,0,o,a,s)||Ic(t+f,e+r-f,f,0,0,o,a,s)||Ic(t+c,e+c,c,0,0,o,a,s)}(0,0,c,h,a.map((function(t){return L(t,0,Math.min(Math.abs(c)/2,Math.abs(h)/2))})),y,e.x,e.y)),v||!f&&!n||(v=r(t,e)),v}var g=y/2;return f&&d||n?_c(0-g,0-g,c+g,h+g,e.x,e.y):f?_c(0,0,c,h,e.x,e.y):!!d&&function(t,e,n,r,i,o,a){var s=i/2;return _c(t-s,e-s,n,i,o,a)||_c(t+n-s,e-s,i,r,o,a)||_c(t+s,e+r-s,n,i,o,a)||_c(t-s,e+s,i,r,o,a)}(0,0,c,h,y,e.x,e.y)}function Hc(t,e,n,r,i,o){var a=t.parsedStyle,s=a.width,u=a.height;if("non-transparent-pixel"===a.pointerEvents){var l=i.config.offscreenCanvas,c=o.offscreenCanvasCreator.getOrCreateCanvas(l),h=o.offscreenCanvasCreator.getOrCreateContext(l,{willReadFrequently:!0});return c.width=s,c.height=u,i.defaultStyleRendererFactory[or.IMAGE].render(h,t.parsedStyle,t,void 0,void 0,void 0),h.getImageData(e.x,e.y,1,1).data.every((function(t){return 0!==t}))}return!0}var qc=function(t){function e(){var e=t.apply(this,l([],u(arguments),!1))||this;return e.name="canvas-picker",e}return n(e,t),e.prototype.init=function(){var t,e=((t={})[or.CIRCLE]=Oc,t[or.ELLIPSE]=Lc,t[or.RECT]=Uc,t[or.LINE]=Wc,t[or.POLYLINE]=Xc,t[or.POLYGON]=Vc,t[or.PATH]=zc,t[or.TEXT]=function(){return!0},t[or.GROUP]=null,t[or.IMAGE]=Hc,t[or.HTML]=null,t[or.MESH]=null,t);this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new Ac)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(ur),Zc=function(){function t(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreen=!1,this.vpMatrix=ut(),this.dprMatrix=ut(),this.tmpMat4=ut(),this.vec3a=It(),this.vec3b=It(),this.vec3c=It(),this.vec3d=It()}return t.prototype.apply=function(e,n){var r=this;this.context=e;var i=e.config,o=e.camera,a=e.renderingService,s=e.renderingContext,c=e.pathGeneratorFactory;this.rBush=e.rBushRoot,this.pathGeneratorFactory=c;var h=e.contextService,p=s.root.ownerDocument.defaultView,f=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},d=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};a.hooks.init.tap(t.tag,(function(){p.addEventListener(hs.UNMOUNTED,f),p.addEventListener(hs.CULLED,d);var t=h.getDPR(),e=i.width,n=i.height,o=h.getContext();r.clearRect(o,0,0,e*t,n*t,i.background)})),a.hooks.destroy.tap(t.tag,(function(){p.removeEventListener(hs.UNMOUNTED,f),p.removeEventListener(hs.CULLED,d),r.renderQueue=[],r.removedRBushNodeAABBs=[],r.restoreStack=[]})),a.hooks.beginFrame.tap(t.tag,(function(){var t=h.getContext(),e=h.getDPR(),n=i.width,o=i.height,s=r.canvasRendererPluginOptions,u=s.dirtyObjectNumThreshold,l=s.dirtyObjectRatioThreshold,c=a.getStats(),p=c.rendered,f=p/c.total;r.clearFullScreen=a.disableDirtyRectangleRendering()||p>u&&f>l,t&&(t.resetTransform?t.resetTransform():t.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(t,0,0,n*e,o*e,i.background))}));var y=function(t,e){t.isVisible()&&!t.isCulled()&&(r.renderDisplayObject(t,e,r.context,r.restoreStack,n),r.saveDirtyAABB(t)),(t.sortable.sorted||t.childNodes).forEach((function(t){y(t,e)}))};a.hooks.endFrame.tap(t.tag,(function(){var t=h.getContext(),e=h.getDPR();if(Mt(r.dprMatrix,[e,e,1]),yt(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)y(s.root,t);else{var a=r.safeMergeAABB.apply(r,l([r.mergeDirtyAABBs(r.renderQueue)],u(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new Nr;return o.setMinMax([e,n,0],[r,i,0]),o}))),!1));if(r.removedRBushNodeAABBs=[],Nr.isEmpty(a))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(a),f=c.x,d=c.y,v=c.width,g=c.height,m=Xt(r.vec3a,[f,d,0],r.vpMatrix),x=Xt(r.vec3b,[f+v,d,0],r.vpMatrix),b=Xt(r.vec3c,[f,d+g,0],r.vpMatrix),M=Xt(r.vec3d,[f+v,d+g,0],r.vpMatrix),w=Math.min(m[0],x[0],M[0],b[0]),E=Math.min(m[1],x[1],M[1],b[1]),k=Math.max(m[0],x[0],M[0],b[0]),S=Math.max(m[1],x[1],M[1],b[1]),P=Math.floor(w),T=Math.floor(E),N=Math.ceil(k-w),C=Math.ceil(S-E);t.save(),r.clearRect(t,P,T,N,C,i.background),t.beginPath(),t.rect(P,T,N,C),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),i.renderer.getConfig().enableDirtyRectangleRenderingDebug&&p.dispatchEvent(new as(Ds.DIRTY_RECTANGLE,{dirtyRect:{x:P,y:T,width:N,height:C}})),r.searchDirtyObjects(a).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,r.restoreStack,n)})),t.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){t.restore()})),r.restoreStack=[]})),a.hooks.render.tap(t.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},t.prototype.clearRect=function(t,e,n,r,i,o){t.clearRect(e,n,r,i),o&&(t.fillStyle=o,t.fillRect(e,n,r,i))},t.prototype.renderDisplayObject=function(t,e,n,r,i){var o=t.nodeName,a=r[r.length-1];!a||t.compareDocumentPosition(a)&us.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop());var s=this.context.styleRendererFactory[o],u=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var c=this.pathGeneratorFactory[l.nodeName];c&&(e.save(),r.push(t),e.beginPath(),c(e,l.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),u&&(e.beginPath(),u(e,t.parsedStyle),t.nodeName!==or.LINE&&t.nodeName!==or.PATH&&t.nodeName!==or.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},t.prototype.convertAABB2Rect=function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},t.prototype.mergeDirtyAABBs=function(t){var e=new Nr;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)})),e},t.prototype.searchDirtyObjects=function(t){var e=u(t.getMin(),2),n=e[0],r=e[1],i=u(t.getMax(),2);return this.rBush.search({minX:n,minY:r,maxX:i[0],maxY:i[1]}).map((function(t){return t.displayObject}))},t.prototype.saveDirtyAABB=function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new Nr);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)},t.prototype.applyAttributesToContext=function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,o=n.opacity,a=n.lineDash,s=n.lineDashOffset;a&&t.setLineDash(a),p(s)||(t.lineDashOffset=s),p(o)||(t.globalAlpha*=o),p(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),p(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},t.prototype.applyWorldTransform=function(t,e,n){var r=0,i=0,o=(e.parsedStyle||{}).anchor,a=o&&o[0]||0,s=o&&o[1]||0;if(0!==a||0!==s){var u=e.geometry.contentBounds;r=-a*(u&&2*u.halfExtents[0]||0),i=-s*(u&&2*u.halfExtents[1]||0)}n?(lt(this.tmpMat4,e.getLocalTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,vt(this.tmpMat4,this.tmpMat4,this.vec3a),yt(this.tmpMat4,n,this.tmpMat4),yt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(lt(this.tmpMat4,e.getWorldTransform()),this.vec3a[0]=r,this.vec3a[1]=i,this.vec3a[2]=0,vt(this.tmpMat4,this.tmpMat4,this.vec3a),yt(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},t.prototype.safeMergeAABB=function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];var n=new Nr;return t.forEach((function(t){n.add(t)})),n},t.tag="CanvasRenderer",t}(),Kc=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n,r,i,o){var a=e.fill,s=e.fillRule,u=e.opacity,l=e.fillOpacity,c=e.stroke,h=e.strokeOpacity,f=e.lineWidth,d=e.lineCap,y=e.lineJoin,v=e.shadowType,g=e.shadowColor,m=e.shadowBlur,x=e.filter,b=e.miterLimit,M=!p(a)&&!a.isNone,w=!p(c)&&!c.isNone&&f>0,E=0===a.alpha,k=!(!x||!x.length),S=!p(g)&&m>0,P=n.nodeName,T="inner"===v,N=w&&S&&(P===or.PATH||P===or.LINE||P===or.POLYLINE||E||T);M&&(t.globalAlpha=u*l,N||$c(n,t,S),this.fill(t,n,a,s,r,i,o),N||this.clearShadowAndFilter(t,k,S)),w&&(t.globalAlpha=u*h,t.lineWidth=f,p(b)||(t.miterLimit=b),p(d)||(t.lineCap=d),p(y)||(t.lineJoin=y),N&&(T&&(t.globalCompositeOperation="source-atop"),$c(n,t,!0),T&&(this.stroke(t,n,c,r,i,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,k,!0))),this.stroke(t,n,c,r,i,o))},t.prototype.clearShadowAndFilter=function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!p(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},t.prototype.fill=function(t,e,n,r,i,o,a){var s=this;Array.isArray(n)?n.forEach((function(n){t.fillStyle=s.getColor(n,e,t),r?t.fill(r):t.fill()})):(ji(n)&&(t.fillStyle=this.getPattern(n,e,t,i,o,a)),r?t.fill(r):t.fill())},t.prototype.stroke=function(t,e,n,r,i,o){var a=this;Array.isArray(n)?n.forEach((function(n){t.strokeStyle=a.getColor(n,e,t),t.stroke()})):(ji(n)&&(t.strokeStyle=this.getPattern(n,e,t,r,i,o)),t.stroke())},t.prototype.getPattern=function(t,e,n,r,i,o){var a,s;if("rect"===t.image.nodeName){var u=t.image.parsedStyle,l=u.width,c=u.height;s=r.contextService.getDPR();var h=r.config.offscreenCanvas;(a=o.offscreenCanvasCreator.getOrCreateCanvas(h)).width=l*s,a.height=c*s;var p=o.offscreenCanvasCreator.getOrCreateContext(h),f=[];t.image.forEach((function(t){i.renderDisplayObject(t,p,r,f,o)})),f.forEach((function(){p.restore()}))}return this.imagePool.getOrCreatePatternSync(t,n,a,s,(function(){e.renderable.dirty=!0,r.renderingService.dirtify()}))},t.prototype.getColor=function(t,e,n){var i;if(t.type===Zr.LinearGradient||t.type===Zr.RadialGradient){var o=e.getGeometryBounds(),a=o&&2*o.halfExtents[0]||1,s=o&&2*o.halfExtents[1]||1;i=this.imagePool.getOrCreateGradient(r(r({type:t.type},t.value),{width:a,height:s}),n)}return i},t}();function $c(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,u=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=""+o,e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=u||0)}var Jc=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n){var r,i=e.img,o=e.shadowColor,a=e.shadowBlur,s=e.width,u=e.height;if(P(i)?r=this.imagePool.getImageSync(i):(s||(s=i.width),u||(u=i.height),r=i),r){$c(n,t,!p(o)&&a>0);try{t.drawImage(r,0,0,s,u)}catch(t){}}},t}(),Qc=function(){function t(){}return t.prototype.render=function(t,e,n,r,i,o){var a=e.lineWidth,s=e.textAlign,u=e.textBaseline,l=e.lineJoin,c=e.miterLimit,h=e.letterSpacing,f=e.stroke,d=e.fill,y=e.fillOpacity,v=e.strokeOpacity,g=e.opacity,m=e.metrics,x=e.dx,b=e.dy,M=e.shadowColor,w=e.shadowBlur,E=m.lines,k=m.height,S=m.lineHeight,P=m.lineMetrics;t.font=m.font,t.lineWidth=a,t.textAlign="middle"===s?"center":s;var T=u;o.enableCSSParsing||"alphabetic"!==T||(T="bottom"),t.lineJoin=l,p(c)||(t.miterLimit=c);var N=0;"middle"===u?N=-k/2-S/2:"bottom"===u||"alphabetic"===u||"ideographic"===u?N=-k:"top"!==u&&"hanging"!==u||(N=-S);var C=x||0;N+=b||0,1===E.length&&("bottom"===T?(T="middle",N-=.5*k):"top"===T&&(T="middle",N+=.5*k)),t.textBaseline=T,$c(n,t,!p(M)&&w>0);for(var A=0;E.length>A;A++){var O=a/2+C;N+=S,p(f)||f.isNone||!a||this.drawLetterSpacing(t,E[A],P[A],s,O,N,h,y,v,g,!0),p(d)||this.drawLetterSpacing(t,E[A],P[A],s,O,N,h,y,v,g)}},t.prototype.drawLetterSpacing=function(t,e,n,r,i,o,a,s,u,l,c){if(void 0===c&&(c=!1),0!==a){var h=t.textAlign;t.textAlign="left";var p=i;"center"===r||"middle"===r?p=i-n.width/2:"right"!==r&&"end"!==r||(p=i-n.width);for(var f=Array.from(e),d=t.measureText(e).width,y=0,v=0;f.length>v;++v){var g=f[v];c?this.strokeText(t,g,p,o,u):this.fillText(t,g,p,o,s,l),p+=d-(y=t.measureText(e.substring(v+1)).width)+a,d=y}t.textAlign=h}else c?this.strokeText(t,e,i,o,u):this.fillText(t,e,i,o,s,l)},t.prototype.fillText=function(t,e,n,r,i,o){var a,s=!p(i)&&1!==i;s&&(a=t.globalAlpha,t.globalAlpha=i*o),t.fillText(e,n,r),s&&(t.globalAlpha=a)},t.prototype.strokeText=function(t,e,n,r,i){var o,a=!p(i)&&1!==i;a&&(o=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),a&&(t.globalAlpha=o)},t}(),th=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(Kc),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(Kc),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(Kc),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(Kc),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(Kc),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(Kc),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}n(e,t)}(Kc),function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="canvas-renderer",n}return n(e,t),e.prototype.init=function(){var t,e=r({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,i=new Kc(n),o=((t={})[or.CIRCLE]=i,t[or.ELLIPSE]=i,t[or.RECT]=i,t[or.IMAGE]=new Jc(n),t[or.TEXT]=new Qc,t[or.LINE]=i,t[or.POLYLINE]=i,t[or.POLYGON]=i,t[or.PATH]=i,t[or.GROUP]=void 0,t[or.HTML]=void 0,t[or.MESH]=void 0,t);this.context.defaultStyleRendererFactory=o,this.context.styleRendererFactory=o,this.addRenderingPlugin(new Zc(e))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(ur)),eh=function(){function t(t){this.dragndropPluginOptions=t}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,s=i.defaultView,u=function(t){var e=t.target,r=e===i,u=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(u){var l=!1,c=t.timeStamp,h=[t.clientX,t.clientY],p=null,f=[t.clientX,t.clientY],d=function(t){return o(n,void 0,void 0,(function(){var n,o,s,d,y,v;return a(this,(function(a){switch(a.label){case 0:if(!l){if(n=t.timeStamp-c,o=Ve([t.clientX,t.clientY],h),this.dragndropPluginOptions.dragstartTimeThreshold>=n||this.dragndropPluginOptions.dragstartDistanceThreshold>=o)return[2];t.type="dragstart",u.dispatchEvent(t),l=!0}return t.type="drag",t.dx=t.clientX-f[0],t.dy=t.clientY-f[1],u.dispatchEvent(t),f=[t.clientX,t.clientY],r?[3,2]:(s="pointer"===this.dragndropPluginOptions.overlap?[t.canvasX,t.canvasY]:e.getBounds().center,[4,i.elementsFromPoint(s[0],s[1])]);case 1:d=a.sent(),y=d[d.indexOf(e)+1],v=(null==y?void 0:y.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?i:null),p!==v&&(p&&(t.type="dragleave",t.target=p,p.dispatchEvent(t)),v&&(t.type="dragenter",t.target=v,v.dispatchEvent(t)),(p=v)&&(t.type="dragover",t.target=p,p.dispatchEvent(t))),a.label=2;case 2:return[2]}}))}))};s.addEventListener("pointermove",d);var y=function(t){if(l){t.detail={preventClick:!0};var e=t.clone();p&&(e.type="drop",e.target=p,p.dispatchEvent(e)),e.type="dragend",u.dispatchEvent(e),l=!1}s.removeEventListener("pointermove",d)};e.addEventListener("pointerup",y,{once:!0}),e.addEventListener("pointerupoutside",y,{once:!0})}};r.hooks.init.tap(t.tag,(function(){s.addEventListener("pointerdown",u)})),r.hooks.destroy.tap(t.tag,(function(){s.removeEventListener("pointerdown",u)}))},t.tag="Dragndrop",t}(),nh=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="dragndrop",n}return n(e,t),e.prototype.init=function(){this.addRenderingPlugin(new eh(r({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)},e}(ur),rh=function(){function t(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}return t.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e(this.imageCache[t]):this.getOrCreateImage(t).then((function(t){e&&e(t)})),this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var e=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(r,i){var o;n?o=n(t):ba&&(o=new window.Image),o&&(o.onload=function(){e.imageCache[t]=o,r(o)},o.onerror=function(t){i(t)},o.crossOrigin="Anonymous",o.src=t)}))},t.prototype.getOrCreatePatternSync=function(t,e,n,r,i){var o=this.generatePatternKey(t);if(o&&this.patternCache[o])return this.patternCache[o];var a,s=t.image,u=t.repetition,l=t.transform,c=!1;P(s)?a=this.getImageSync(s,i):n?(a=n,c=!0):a=s;var h=a&&e.createPattern(a,u);if(h){var p=void 0;p=l?sa(Lo(l),new zs({})):ht(ut()),c&>(p,p,[1/r,1/r,1]),h.setTransform({a:p[0],b:p[1],c:p[4],d:p[5],e:p[12],f:p[13]})}return o&&h&&(this.patternCache[o]=h),h},t.prototype.getOrCreateGradient=function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,o=t.width,a=t.height,s=t.cx,u=t.cy,l=t.size;if(this.gradientCache[n])return this.gradientCache[n];var c=null;if(r===Zr.LinearGradient){var h=function(t,e,n){var r=vr(n.value),i=0+t/2,o=0+e/2,a=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}}(o,a,t.angle);c=e.createLinearGradient(h.x1,h.y1,h.x2,h.y2)}else if(r===Zr.RadialGradient){var p=function(t,e,n,r,i){var o=n.value,a=r.value;n.unit===Br.kPercentage&&(o=n.value/100*t),r.unit===Br.kPercentage&&(a=r.value/100*e);var s=Math.max(Ve([0,0],[o,a]),Ve([0,e],[o,a]),Ve([t,e],[o,a]),Ve([t,0],[o,a]));return i&&(i instanceof hi?s=i.value:i instanceof ni&&("closest-side"===i.value?s=Math.min(o,t-o,a,e-a):"farthest-side"===i.value?s=Math.max(o,t-o,a,e-a):"closest-corner"===i.value&&(s=Math.min(Ve([0,0],[o,a]),Ve([0,e],[o,a]),Ve([t,e],[o,a]),Ve([t,0],[o,a]))))),{x:o,y:a,r:s}}(o,a,s,u,l),f=p.x,d=p.y;c=e.createRadialGradient(f,d,0,f,d,p.r)}return c&&(i.forEach((function(t){var e=t.offset;e.unit===Br.kPercentage&&(null==c||c.addColorStop(e.value/100,""+t.color))})),this.gradientCache[n]=c),this.gradientCache[n]},t.prototype.generateGradientKey=function(t){var e=t.width,n=t.height,r=t.steps,i=t.angle,o=t.cx,a=t.cy,s=t.size;return"gradient-".concat(t.type,"-").concat((null==i?void 0:""+i)||0,"-").concat((null==o?void 0:""+o)||0,"-").concat((null==a?void 0:""+a)||0,"-").concat((null==s?void 0:""+s)||0,"-").concat(e,"-").concat(n,"-").concat(r.map((function(t){var e=t.color;return"".concat(t.offset).concat(e)})).join("-"))},t.prototype.generatePatternKey=function(t){var e=t.image,n=t.repetition;return P(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0},t}(),ih=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService,r=e.imagePool,i=e.renderingContext.root.ownerDocument.defaultView,o=function(t,e,n){var r=t.parsedStyle,i=r.width,o=r.height;i&&!o?t.setAttribute("height",n/e*i):!i&&o&&t.setAttribute("width",e/n*o)},a=function(t){var e=t.target,i=e.attributes;if(e.nodeName===or.IMAGE){var a=i.img,s=i.keepAspectRatio;P(a)&&r.getImageSync(a,(function(t){s&&o(e,t.width,t.height),e.renderable.dirty=!0,n.dirtify()}))}},s=function(t){var e=t.target,i=t.newValue;e.nodeName===or.IMAGE&&"img"===t.attrName&&P(i)&&r.getOrCreateImage(i).then((function(t){e.attributes.keepAspectRatio&&o(e,t.width,t.height),e.renderable.dirty=!0,n.dirtify()}))};n.hooks.init.tap(t.tag,(function(){i.addEventListener(hs.MOUNTED,a),i.addEventListener(hs.ATTR_MODIFIED,s)})),n.hooks.destroy.tap(t.tag,(function(){i.removeEventListener(hs.MOUNTED,a),i.removeEventListener(hs.ATTR_MODIFIED,s)}))},t.tag="LoadImage",t}(),oh=function(t){function e(){var e=t.apply(this,l([],u(arguments),!1))||this;return e.name="image-loader",e}return n(e,t),e.prototype.init=function(){this.context.imagePool=new rh(this.context.config),this.addRenderingPlugin(new ih)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ur),ah=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService,r=e.config,i=e.contextService.getDomElement(),o=function(t){n.hooks.pointerDown.call(t)},a=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",o,!0),i.addEventListener("touchend",a,!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",o,!0),i.removeEventListener("touchend",a,!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)}))},t.tag="MobileInteraction",t}(),sh=function(t){function e(){var e=t.apply(this,l([],u(arguments),!1))||this;return e.name="mobile-interaction",e}return n(e,t),e.prototype.init=function(){this.addRenderingPlugin(new ah)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ur),uh="object"==typeof performance&&performance.now?performance:Date,lh=function(t,e){var n=e.x-t.x,r=e.y-t.y;return Math.abs(n)>Math.abs(r)?n>0?"right":"left":r>0?"down":"up"},ch=function(t,e){var n=Math.abs(e.x-t.x),r=Math.abs(e.y-t.y);return Math.sqrt(n*n+r*r)},hh=function(){function t(t){var e=this;this.options=t,this.evCache=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this._start=function(t,n){var r;e.reset(),e.startTime=uh.now();var i=e.evCache,o=e.startPoints;if(t){var a=t.pointerId,s=t.x,c=t.y,h=i.findIndex((function(t){return a===t.pointerId}));-1!==h&&i.splice(h,1),i.push({pointerId:a,x:s,y:c,ev:t});for(var p=l([],u((null===(r=t.nativeEvent)||void 0===r?void 0:r.touches)||[]),!1),f=function(t){if(p.find((function(e){return i[t].pointerId===e.identifier})))return"continue";i.splice(t,1)},d=i.length-1;d>-1;d--)f(d)}o.length=i.length;for(d=0;i.length>d;d++){var y=i[d];o[d]={x:s=y.x,y:c=y.y}}if(1!==o.length){var v,g;e.startDistance=ch(o[0],o[1]),e.center={x:(v=o[0]).x+((g=o[1]).x-v.x)/2,y:v.y+(g.y-v.y)/2}}else{var m=i[0].ev;e.pressTimeout=setTimeout((function(){var t="press",r="none";m.direction=r,m.deltaX=0,m.deltaY=0,m.points=o,e.emitStart(t,m,n),m.type=t,n.dispatchEvent(m),e.eventType=t,e.direction=r,e.movingTarget=n}),250)}},this._move=function(t,n){e.clearPressTimeout();var r=e.startPoints,i=e.evCache;if(r.length){for(var o=t.x,a=t.y,s=t.pointerId,u=0,l=i.length;l>u;u++)if(s===i[u].pointerId){i[u]={pointerId:s,x:o,y:a,ev:t};break}var c={x:o,y:a},h=i.map((function(t){return{x:t.x,y:t.y}})),p=uh.now();if(e.prevMoveTime=e.lastMoveTime,e.prevMovePoint=e.lastMovePoint,e.lastMoveTime=p,e.lastMovePoint=c,1===r.length){var f=r[0],d=o-f.x,y=a-f.y,v=e.direction||lh(f,c);e.direction=v;var g=e.getEventType(c,n,t);return t.direction=v,t.deltaX=d,t.deltaY=y,t.points=h,e.emitStart(g,t,n),t.type=g,void e.refreshAndGetTarget(n).dispatchEvent(t)}var m=e.startDistance,x=ch(h[0],h[1]);t.zoom=x/m,t.center=e.center,t.points=h,e.emitStart("pinch",t,n),e._throttleEmit("pinch",t,n)}},this._end=function(t,n){var r=e.evCache,i=e.startPoints,o=r.map((function(t){return{x:t.x,y:t.y}}));if(t.points=o,e.emitEnd(t,e.refreshAndGetTarget(n)),1===r.length){var a=uh.now(),s=e.lastMoveTime;if(100>a-s){var u=s-(e.prevMoveTime||e.startTime);if(u>0){var l=e.prevMovePoint||i[0],c=e.lastMovePoint||i[0],h=ch(l,c)/u;h>.3&&(t.velocity=h,t.direction=lh(l,c),t.type="swipe",n.dispatchEvent(t))}}}for(var p=0,f=r.length;f>p;p++)if(r[p].pointerId===t.pointerId){r.splice(p,1),i.splice(p,1);break}e.reset(),r.length>0&&e._start(void 0,n)},this._cancel=function(t,n){var r=e.evCache.map((function(t){return{x:t.x,y:t.y}}));t.points=r,e.emitEnd(t,e.refreshAndGetTarget(n)),e.evCache=[],e.reset()}}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,o=i.defaultView;this.canvas=o;var a=function(t){return t===i&&n.options.isDocumentGestureEnabled?i:t},s=function(t){var e=a(t.target);e&&n._move(t,e)},u=function(t){var e=a(t.target);e&&n._start(t,e)},l=function(t){var e=a(t.target);e&&n._end(t,e)},c=function(t){var e=a(t.target);e&&n._cancel(t,e)},h=function(t){var e=a(t.target);e&&n._end(t,e)};r.hooks.init.tap(t.tag,(function(){o.addEventListener("pointermove",s),o.addEventListener("pointerdown",u),o.addEventListener("pointerup",l),o.addEventListener("pointercancel",c),o.addEventListener("pointerupoutside",h)})),r.hooks.destroy.tap(t.tag,(function(){o.removeEventListener("pointermove",s),o.removeEventListener("pointerdown",u),o.removeEventListener("pointerup",l),o.removeEventListener("pointercancel",c),o.removeEventListener("pointerupoutside",h)}))},t.prototype.getEventType=function(t,e,n){var r,i=this,o=i.eventType,a=i.startTime,s=i.startPoints;if(o)return o;(this.movingTarget=e,this.isPanListenerInPath=n.path.some((function(t){var e,n;return!!(null===(n=null===(e=t.emitter)||void 0===e?void 0:e.eventNames())||void 0===n?void 0:n.includes("pan"))})),this.isPanListenerInPath)?r=uh.now()-a>250&&10>ch(s[0],t)?"press":"pan":r="press";return this.eventType=r,r},t.prototype.enable=function(t){this.processEvent[t]=!0},t.prototype.isProcess=function(t){return this.processEvent[t]},t.prototype.emitStart=function(t,e,n){this.isProcess(t)||(this.enable(t),e.type="".concat(t,"start"),n.dispatchEvent(e))},t.prototype._throttleEmit=function(t,e,n){var r=this;this.pushEvent(t,e);var i=this,o=i.emitThrottles,a=i.processEvent;i.throttleTimer||(this.throttleTimer=this.canvas.requestAnimationFrame((function(){for(var t=0,e=o.length;e>t;t++){var i=o[t],s=i.type,u=i.ev;a[s]&&(u.type=s,n.dispatchEvent(u))}r.throttleTimer=0,r.emitThrottles.length=0})))},t.prototype.emitEnd=function(t,e){var n=this.processEvent;Object.keys(n).forEach((function(r){t.type="".concat(r,"end"),e.dispatchEvent(t),delete n[r]}))},t.prototype.pushEvent=function(t,e){for(var n=this.emitThrottles,r={type:t,ev:e},i=0,o=n.length;o>i;i++)if(n[i].type===t)return void n.splice(i,1,r);n.push(r)},t.prototype.clearPressTimeout=function(){this.pressTimeout&&(clearTimeout(this.pressTimeout),this.pressTimeout=null)},t.prototype.refreshAndGetTarget=function(t){return this.movingTarget?(this.movingTarget&&!this.movingTarget.isConnected&&(this.movingTarget=t),this.movingTarget):t},t.prototype.reset=function(){this.clearPressTimeout(),this.startTime=0,this.startDistance=0,this.direction=null,this.eventType=null,this.prevMoveTime=0,this.prevMovePoint=null,this.lastMoveTime=0,this.lastMovePoint=null,this.movingTarget=null,this.isPanListenerInPath=null},t.tag="Gesture",t}(),ph=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="gesture",n}return n(e,t),e.prototype.init=function(){this.addRenderingPlugin(new hh(r({isDocumentGestureEnabled:!1},this.options)))},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ur);var fh=function(){function t(t){this.canvasConfig=t.config}return t.prototype.init=function(){return o(this,void 0,void 0,(function(){var t,e,n;return a(this,(function(r){return e=(t=this.canvasConfig).devicePixelRatio,this.$canvas=t.canvas,this.context=this.$canvas.getContext("2d"),this.dpr=n=1>(n=e||1)?1:Math.ceil(n),this.resize(this.canvasConfig.width,this.canvasConfig.height),[2]}))}))},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.context=null,this.$canvas=null},t.prototype.resize=function(t,e){var n,r=this.canvasConfig.devicePixelRatio,i=this.$canvas;i.style&&(i.style.width=t+"px",i.style.height=e+"px"),(n=i)&&"object"==typeof n&&(1===n.nodeType&&n.nodeName||n.isCanvasElement)&&(i.width=t*r,i.height=e*r,1!==r&&this.context.scale(r,r))},t.prototype.applyCursorStyle=function(t){},t.prototype.toDataURL=function(t){return o(this,void 0,void 0,(function(){return a(this,(function(e){return[2,this.context.canvas.toDataURL(t.type,t.encoderOptions)]}))}))},t}(),dh=function(t){function e(){var e=t.apply(this,l([],u(arguments),!1))||this;return e.name="mobile-canvas-context-register",e}return n(e,t),e.prototype.init=function(){this.context.ContextService=fh},e.prototype.destroy=function(){delete this.context.ContextService},e}(ur),yh=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new dh),n.registerPlugin(new oh),n.registerPlugin(new Sc),n.registerPlugin(new th),n.registerPlugin(new sh),n.registerPlugin(new qc),n.registerPlugin(new nh({isDocumentDraggable:!!p(null==e?void 0:e.isDocumentDraggable)||e.isDocumentDraggable,isDocumentDroppable:!!p(null==e?void 0:e.isDocumentDroppable)||e.isDocumentDroppable,dragstartDistanceThreshold:p(null==e?void 0:e.dragstartDistanceThreshold)?10:e.dragstartDistanceThreshold,dragstartTimeThreshold:p(null==e?void 0:e.dragstartTimeThreshold)?50:e.dragstartTimeThreshold})),n.registerPlugin(new ph({isDocumentGestureEnabled:!0})),n}return n(e,t),e}(lr);function vh(t,e){for(var n=[],r=2;arguments.length>r;r++)n[r-2]=arguments[r];var o=e||{},a=o.key,s=o.ref,u=i(o,["key","ref"]);return n.length&&(u.children=1===n.length?n[0]:n),{key:a,ref:s,type:t,props:u}}var gh=function(){function t(t){this.isCanvasElement=!0,this.emitter=new cn,this.context=t;var e=t.canvas||{};this.width=e.width||0,this.height=e.height||0}return t.prototype.getContext=function(t,e){return this.context},t.prototype.getBoundingClientRect=function(){var t=this.width,e=this.height;return{top:0,right:t,bottom:e,left:0,width:t,height:e,x:0,y:0}},t.prototype.addEventListener=function(t,e,n){this.emitter.on(t,e)},t.prototype.removeEventListener=function(t,e,n){this.emitter.off(t,e)},t.prototype.dispatchEvent=function(t){return this.emitter.emit(t.type,t),!0},t}();function mh(t){return t?function(t){if(!t)return!1;if(1!==t.nodeType||!t.nodeName||"canvas"!==t.nodeName.toLowerCase())return!1;var e=!1;try{t.addEventListener("eventTest",(function(){e=!0})),t.dispatchEvent(new Event("eventTest"))}catch(t){e=!1}return e}(t.canvas)?t.canvas:new gh(t):null}var xh,bh={fontSize:"24px",fontFamily:'"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif',pixelRatio:1,padding:[0,0,0,0]},Mh={fillStyle:"String",font:"String",globalAlpha:"Number",lineCap:"String",lineWidth:["Number","String"],lineJoin:"String",miterLimit:"Number",shadowBlur:"Number",shadowColor:"String",shadowOffsetX:"Number",shadowOffsetY:"Number",strokeStyle:"String",textAlign:"String",textBaseline:"String",lineDash:["Array","Number"],shadow:"String",matrix:"Array",stroke:"String",fill:["String","Object"],opacity:"Number",fillOpacity:"Number",strokeOpacity:"Number"},wh={group:r({},Mh),text:r(r({},Mh),{x:"Number",y:"Number",text:"String",width:"Number",height:"Number",fontSize:["Number","String"],fontFamily:"String",fontStyle:"String",fontWeight:["Number","String"],fontVariant:"String"}),circle:r(r({},Mh),{cx:"Number",cy:"Number",r:"Number"}),path:r({},Mh),ellipse:r(r({},Mh),{cy:"Number",cx:"Number",ry:"Number",rx:"Number"}),rect:r(r({},Mh),{width:"Number",height:"Number",x:"Number",y:"Number",radius:["Array","Number"]}),image:r(r({},Mh),{width:"Number",height:"Number",x:"Number",y:"Number",img:"String",src:"String"}),line:r(r({},Mh),{x1:"Number",x2:"Number",y1:"Number",y2:"Number"}),polyline:r(r({},Mh),{points:"Array",smooth:"Boolean"}),polygon:r(r({},Mh),{points:"Array"}),arc:r(r({},Mh),{x:"Number",y:"Number",r:"Number",startAngle:["Number","String"],endAngle:["Number","String"],anticlockwise:"Boolean"}),marker:r(r({},Mh),{x:"Number",y:"Number",radius:"Number",symbol:"String"}),sector:r(r({},Mh),{x:"Number",y:"Number",startAngle:["Number","String"],endAngle:["Number","String"],r:"Number",r0:"Number",anticlockwise:"Boolean"})};try{xh=parseInt(document.documentElement.style.fontSize,10)||50}catch(Nu){xh=50}var Eh=xh/100;function kh(t){if(_(t))return[t,t,t,t];var e=t[0],n=_(t[1])?t[1]:t[0];return[e,n,_(t[2])?t[2]:e,_(t[3])?t[3]:n]}function Sh(t){var e=function(n){if(P(n)&&/^-?\d+(\.\d+)?px$/.test(n)){var r=n.substr(0,n.length-2);return t(Number(r))}if(y(n))return n.map((function(t){return e(t)}));if(b(n)){var i={};for(var o in n)if(n.hasOwnProperty(o)){var a=e(n[o]);if(!a){i[o]=a;continue}if("padding"===o||"margin"===o){var s=kh(a);i[o]=s,i["".concat(o,"Top")]=s[0],i["".concat(o,"Right")]=s[1],i["".concat(o,"Bottom")]=s[2],i["".concat(o,"Left")]=s[3];continue}i[o]=a}return i}return n};return e}var Ph=Sh((function(t){return t?Number((t*Eh).toFixed(1)):0})),Th=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return n(e,t),e}(ns),Nh=0,Ch=function(){function t(t,e){var n;this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id="".concat(Nh++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(n=this.effect)||void 0===n?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return Object.defineProperty(t.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(Error())}})),this.pending||this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"finished",{get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(Error())}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;isNaN(t=Number(t))||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"startTime",{get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),isNaN(t=Number(t)))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isFinished",{get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),t.prototype.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},t.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},t.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},t.prototype.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},t.prototype.cancel=function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new Th(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}},t.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},t.prototype.updatePlaybackRate=function(t){this.playbackRate=t},t.prototype.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},t.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},t.prototype.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},t.prototype.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},t.prototype.rewind=function(){if(this.playbackRate<0){if(this._totalDuration>=1/0)throw Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}else this.currentTime=0},t.prototype.persist=function(){throw Error(Dr)},t.prototype.addEventListener=function(t,e,n){throw Error(Dr)},t.prototype.removeEventListener=function(t,e,n){throw Error(Dr)},t.prototype.dispatchEvent=function(t){throw Error(Dr)},t.prototype.commitStyles=function(){throw Error(Dr)},t.prototype.ensureAlive=function(){var t,e;this._inEffect=0>this.playbackRate&&0===this.currentTime?!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},t.prototype.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},t.prototype.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Th(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new Th(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),Ah=.1,Oh="function"==typeof Float32Array,Rh=function(t,e){return 1-3*e+3*t},Lh=function(t,e){return 3*e-6*t},_h=function(t){return 3*t},Ih=function(t,e,n){return((Rh(e,n)*t+Lh(e,n))*t+_h(e))*t},Dh=function(t,e,n){return 3*Rh(e,n)*t*t+2*Lh(e,n)*t+_h(e)},Fh=function(t,e,n,r){if(0>t||t>1||0>n||n>1)throw Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Oh?new Float32Array(11):[,,,,,,,,,,,],o=0;11>o;++o)i[o]=Ih(o*Ah,t,n);var a=function(e){for(var r=0,o=1;10!==o&&e>=i[o];++o)r+=Ah;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*Ah,s=Dh(a,t,n);return.001>s?0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=Ih(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&10>++s);return a}(e,r,r+Ah,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var o=Dh(e,n,r);if(0===o)return e;e-=(Ih(e,n,r)-t)/o}return e}(e,a,t,n)};return function(t){return 0===t||1===t?t:Ih(a(t),e,r)}},Bh=function(t){return Math.pow(t,2)},jh=function(t){return Math.pow(t,3)},Gh=function(t){return Math.pow(t,4)},Yh=function(t){return Math.pow(t,5)},Wh=function(t){return Math.pow(t,6)},zh=function(t){return 1-Math.cos(t*Math.PI/2)},Vh=function(t){return 1-Math.sqrt(1-t*t)},Xh=function(t){return t*t*(3*t-2)},Uh=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},Hh=function(t,e){void 0===e&&(e=[]);var n=u(e,2),r=n[0],i=n[1],o=void 0===i?.5:i,a=L(Number(void 0===r?1:r),1,10),s=L(Number(o),.1,2);return 0===t||1===t?t:-a*Math.pow(2,10*(t-1))*Math.sin(2*Math.PI*(t-1-s/(2*Math.PI)*Math.asin(1/a))/s)},qh=function(t,e,n){void 0===e&&(e=[]);var r=u(e,4),i=r[0],o=void 0===i?1:i,a=r[1],s=void 0===a?100:a,l=r[2],c=void 0===l?10:l,h=r[3],p=void 0===h?0:h;o=L(o,.1,1e3),s=L(s,.1,1e3),c=L(c,.1,1e3),p=L(p,.1,1e3);var f=Math.sqrt(s/o),d=c/(2*Math.sqrt(s*o)),y=1>d?f*Math.sqrt(1-d*d):0,v=1>d?(d*f-p)/y:-p+f,g=n?n*t/1e3:t;return g=1>d?Math.exp(-g*d*f)*(1*Math.cos(y*g)+v*Math.sin(y*g)):(1+v*g)*Math.exp(-g*f),0===t||1===t?t:1-g},Zh=function(t,e){void 0===e&&(e=[]);var n=u(e,2),r=n[0],i=void 0===r?10:r;return("start"==n[1]?Math.ceil:Math.floor)(L(t,0,1)*i)/i},Kh=function(t,e){void 0===e&&(e=[]);var n=u(e,4);return Fh(n[0],n[1],n[2],n[3])(t)},$h=Fh(.42,0,1,1),Jh=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},Qh=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},tp=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},ep={steps:Zh,"step-start":function(t){return Zh(t,[1,"start"])},"step-end":function(t){return Zh(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Kh,ease:function(t){return Kh(t,[.25,.1,.25,1])},in:$h,out:Jh($h),"in-out":Qh($h),"out-in":tp($h),"in-quad":Bh,"out-quad":Jh(Bh),"in-out-quad":Qh(Bh),"out-in-quad":tp(Bh),"in-cubic":jh,"out-cubic":Jh(jh),"in-out-cubic":Qh(jh),"out-in-cubic":tp(jh),"in-quart":Gh,"out-quart":Jh(Gh),"in-out-quart":Qh(Gh),"out-in-quart":tp(Gh),"in-quint":Yh,"out-quint":Jh(Yh),"in-out-quint":Qh(Yh),"out-in-quint":tp(Yh),"in-expo":Wh,"out-expo":Jh(Wh),"in-out-expo":Qh(Wh),"out-in-expo":tp(Wh),"in-sine":zh,"out-sine":Jh(zh),"in-out-sine":Qh(zh),"out-in-sine":tp(zh),"in-circ":Vh,"out-circ":Jh(Vh),"in-out-circ":Qh(Vh),"out-in-circ":tp(Vh),"in-back":Xh,"out-back":Jh(Xh),"in-out-back":Qh(Xh),"out-in-back":tp(Xh),"in-bounce":Uh,"out-bounce":Jh(Uh),"in-out-bounce":Qh(Uh),"out-in-bounce":tp(Uh),"in-elastic":Hh,"out-elastic":Jh(Hh),"in-out-elastic":Qh(Hh),"out-in-elastic":tp(Hh),spring:qh,"spring-in":qh,"spring-out":Jh(qh),"spring-in-out":Qh(qh),"spring-out-in":tp(qh)},np=function(t){return t};function rp(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var ip="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",op=RegExp("cubic-bezier\\("+ip+","+ip+","+ip+","+ip+"\\)"),ap=/steps\(\s*(\d+)\s*\)/,sp=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function up(t){var e=op.exec(t);if(e)return Fh.apply(void 0,l([],u(e.slice(1).map(Number)),!1));var n=ap.exec(t);if(n)return rp(Number(n[1]),0);var r=sp.exec(t);return r?rp(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):ep[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||ep.linear}function lp(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function cp(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return Math.min(n.delay,r)>e?1:Math.min(n.delay+t+n.endDelay,r)>e?3:2}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?1!==e&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),u=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),l=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=l,n.easingFunction(l)}function hp(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(pp(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:up(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;i.length-1>o;o++){var a=o,s=o+1,u=i[a].computedOffset,l=i[s].computedOffset,c=u,h=l;0===o&&(c=-1/0,0===l&&(s=a)),o===i.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:c,applyTo:h,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:dp(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var r=n.endOffset-n.startOffset,i=0===r?0:n.easingFunction((e-n.startOffset)/r);t.setAttribute(n.property,n.interpolation(i),!1,!1)}));else for(var n in r)pp(n)&&t.setAttribute(n,null)}}function pp(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var fp=function(t,e,n){return function(r){var i=yp(t,e,r);return!Ts.enableCSSParsing&&_(i)?i:n(i)}};function dp(t,e,n,r){var i=Zo[t];if(i&&i.syntax&&i.int){var o=Ts.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(Ts.enableCSSParsing){var c=Ts.styleValueRegistry.parseProperty(t,e,r,!1),h=Ts.styleValueRegistry.parseProperty(t,n,r,!1);a=Ts.styleValueRegistry.computeProperty(t,c,r,!1),s=Ts.styleValueRegistry.computeProperty(t,h,r,!1)}else{var p=o.parserWithCSSDisabled;a=p?p(e,r):e,s=p?p(n,r):n}var f=o.mixer(a,s,r);if(f){var d=fp.apply(void 0,l([],u(f),!1));return function(t){return 0===t?e:1===t?n:d(t)}}}}return fp(!1,!0,(function(t){return t?n:e}))}function yp(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return.5>n?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,o=Math.max(r,i),a=[],s=0;o>s;s++)a.push(yp(t[r>s?s:r-1],e[i>s?s:i-1],n));return a}throw Error("Mismatched interpolation arguments "+t+":"+e)}var vp=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=np,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return Object.defineProperty(t.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=up(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function gp(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;i>o;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}null!=r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(!isFinite(i=Number(i)))throw Error("Keyframe offsets must be numbers.");if(0>i||i>1)throw Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;n.length>o;o++){var a=n[o].offset;if(p(a))r=!1;else{if(i>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter((function(t){return Number(t.offset)>=0&&1>=Number(t.offset)})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;r>a;a++){var s=n[a].computedOffset;if(!p(s)&&!p(o)){for(var u=1;a-i>u;u++)n[i+u].computedOffset=o+(Number(s)-o)*u/(a-i);i=a,o=Number(s)}}}(),n}var mp="backwards|forwards|both|none".split("|"),xp="reverse|alternate|alternate-reverse".split("|");function bp(t,e){return function(t,e){var n=new vp;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(null!=t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===mp.indexOf(t[e]))return;if("direction"===e&&-1===xp.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),e)}var Mp=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=bp(n,!1),this.timing.effect=this,this.timing.activeDuration=lp(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=gp(e,this.timing),this.interpolations=hp(this.normalizedKeyframes,this.timing,this.target);var i=Ts.globalThis.Proxy;this.computedTiming=i?new i(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}return t.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},t.prototype.update=function(t){return null!==t&&(this.timeFraction=cp(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=gp(t)},t.prototype.getComputedTiming=function(){return this.computedTiming},t.prototype.getTiming=function(){return this.timing},t.prototype.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))},t}();function wp(t,e){return Number(t.id)-Number(e.id)}var Ep=function(){function t(t){var e=this;this.document=t,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],Number(e.currentTime)>t&&(t=Number(e.currentTime)),e.animations.sort(wp),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()}}return t.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},t.prototype.isTicking=function(){return this.inTick},t.prototype.play=function(t,e,n){var r=new Mp(t,e,n),i=new Ch(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i},t.prototype.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(wp),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},t.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},t.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},t.prototype.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},t.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},t.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},t.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},t.prototype.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},t.prototype.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},t.prototype.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],c=[],h=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?c.push(n):h.push(n)})),(r=this.pendingEffects).push.apply(r,l([],u(a),!1)),(i=this.pendingEffects).push.apply(i,l([],u(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,h]},t}();function kp(t,e,n){return function(r,i){var o=i||{},a=o.fontSize,s=o.fontFamily,u=void 0===s?n.fontFamily:s,l=o.fontWeight,c=void 0===l?n.fontWeight:l,h=o.fontVariant,f=void 0===h?n.fontVariant:h,d=o.fontStyle,v=void 0===d?n.fontStyle:d,g=o.textAlign,m=void 0===g?n.textAlign:g,x=o.textBaseline,b=void 0===x?n.textBaseline:x,M=o.lineWidth,w=void 0===M?1:M,E=function(t,e){if(!e)return e;var n={};return Object.keys(e).forEach((function(r){var i=e[r];if(!p(i)){var o=wh[t]&&wh[t][r];if(o){var a=Object.prototype.toString.call(i);if(y(o)){for(var s=0,u=o.length;u>s;s++)if(a==="[object ".concat(o[s],"]"))return void(n[r]=i)}else a==="[object ".concat(o,"]")&&(n[r]=i)}else n[r]=i}})),n}("text",{x:0,y:0,fontSize:e(void 0===a?n.fontSize:a),fontFamily:u,fontStyle:v,fontWeight:c,fontVariant:f,text:r,textAlign:m,textBaseline:b,lineWidth:w,visibility:"hidden"}),k=new eu({style:E});t.appendChild(k);var S=k.getBBox(),P=S.width,T=S.height;return k.remove(),{width:P,height:T}}}Ts.EasingFunction=up,Ts.AnimationTimeline=Ep;var Sp=function(){function t(e){var n=e.context,i=e.renderer,o=void 0===i?new yh:i,a=e.width,s=e.height,u=e.theme,l=e.px2hd,c=e.pixelRatio,p=e.landscape,f=e.container,d=e.animate,y=void 0===d||d,v=e.createImage,g=e.requestAnimationFrame,m=e.cancelAnimationFrame,x=e.offscreenCanvas,b=e.isTouchEvent,M=e.isMouseEvent,w=e.useNativeClickEvent,E=void 0===w||w,k=e.onRender,S=h(l)?Sh(l):Ph,P=S(r(r({},bh),u)),T=P.fontSize,N=P.fontFamily,C=c||P.pixelRatio,A=function(t){var e=[];function n(){for(var n,r=[],i=[];n=e.shift();){var o=n.state,a=n.component,s=n.callback;a.destroyed||(a.prevState||(a.prevState=Object.assign({},a.state)),Object.assign(a.state,"function"==typeof o?o(a.prevState,a.props):o),a.prevState=a.state,"function"==typeof s&&i.push({callback:s,component:a}),0>r.indexOf(a)&&r.push(a))}t.updateComponents(r),function(t){for(var e=0;t.length>e;e++){var n=t[e];n.callback.call(n.component)}}(i)}function r(t,r,i){0===e.length&&setTimeout(n,0),e.push({component:t,state:r,callback:i})}return{enqueueForceUpdate:r,enqueueSetState:r}}(this),O=mh(n),R=new du({container:f,canvas:O,devicePixelRatio:C,renderer:o,width:a,height:s,supportsTouchEvents:!0,supportsPointerEvents:!!Ts.globalThis.PointerEvent,alwaysTriggerPointerEventOnCanvas:!0,createImage:v,requestAnimationFrame:g,cancelAnimationFrame:m,useNativeClickEvent:E,offscreenCanvas:x,isTouchEvent:b,isMouseEvent:M});k&&R.addEventListener("rerender",(function(){return k(R)}),{once:!0});var L=R.getRoot(),_=R.getConfig(),I=_.width,D=_.height;L.setAttribute("fontSize",T),L.setAttribute("fontFamily",N);var F=new Du(L),B={ctx:n,root:this,canvas:R,px2hd:S,theme:P,gesture:F,measureText:kp(L,S,P),timeline:null},j={key:void 0,tag:1,type:t,props:e,shape:L,animate:y,component:this,canvas:this,context:B,updater:A};this._ee=new Hu,this.props=e,this.context=B,this.updater=A,this.gesture=F,this.theme=P,this.canvas=R,this.container=L,this.el=O,this.vNode=j,this.landscape=p,this.updateLayout(r(r({},e),{width:I,height:D}))}return t.prototype.updateComponents=function(t){!function(t){t.length&&t.forEach((function(t){var e=t._vNode,n=t.children,r=t.animator;if(!1===t.shouldUpdate(t.props))return!1;t.willUpdate();var i=vc(e,e.canvas.toRawChildren(t.render()),n);t.children=i,e.children=i;var o=el(e,i,n);o.length&&(r.children=o),r.run(),t.didUpdate()}))}(t)},t.prototype.update=function(t){return o(this,void 0,void 0,(function(){var e,n,r,i,o;return a(this,(function(a){switch(a.label){case 0:return r=(e=this).vNode,Vu(t,n=e.props)?[2]:(o=void 0===(i=n.animate)||i,this.props=t,r.props=t,r.animate=o,[4,this.render()]);case 1:return a.sent(),[2]}}))}))},t.prototype.render=function(){return o(this,void 0,void 0,(function(){var t,e;return a(this,(function(n){switch(n.label){case 0:return e=(t=this).vNode,[4,t.canvas.ready];case 1:return n.sent(),function(t){var e=t.children,n=el(t,vc(t,t.props.children,e),e);n.length&&n.forEach((function(t){t.run()}))}(e),[2]}}))}))},t.prototype.emit=function(t,e){this._ee.emit(t,e)},t.prototype.on=function(t,e){this._ee.on(t,e)},t.prototype.off=function(t,e){this._ee.off(t,e)},t.prototype.getCanvasEl=function(){return this.el},t.prototype.resize=function(t,e){return o(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return this.canvas.resize(t,e),this.updateLayout(r(r({},this.props),{width:t,height:e})),[4,this.render()];case 1:return n.sent(),[2]}}))}))},t.prototype.toDataURL=function(t,e){return o(this,void 0,void 0,(function(){var n;return a(this,(function(r){return n=this.canvas,[2,new Promise((function(r){n.addEventListener("rerender",(function(){n.getContextService().toDataURL({type:t,encoderOptions:e}).then(r)}),{once:!0})}))]}))}))},t.prototype.updateLayout=function(t){var e=this.context,n=function(t){var e=t.padding,n=e[0],r=e[3];return{left:t.left+r,top:t.top+n,width:t.width-r-e[1],height:t.height-n-e[2]}}((0,e.px2hd)(r({left:0,top:0,width:t.width,height:t.height,padding:e.theme.padding},t.style))),i=n.left,o=n.top;this.container.setAttribute("x",i),this.container.setAttribute("y",o),this.context=r(r({},this.context),{left:i,top:o,width:n.width,height:n.height}),this.vNode=r(r({},this.vNode),{style:n,context:this.context})},t.prototype.toRawChildren=function(t){return t},t.prototype.destroy=function(){var t=this,e=t.canvas,n=t.el;fc(t.children),n.width=0,n.height=0,this.props=null,this.context=null,this.updater=null,this.theme=null,this.canvas=null,this.container=null,this.el=null,this.vNode=null,e.ready.then((function(){e.destroy()}))},t}();function Pp(){return{current:null}}var Tp=function(t){function e(e){var n=t.call(this,e)||this;n.next=function(){var t=n.state,e=t.index,r=t.count;if(!1!==t.autoPlay){var i=n.props.loop?(e+1)%r:e+1;r>i&&(n.timer=setTimeout((function(){n.setState({index:i})}),t.delay||0))}};var r=e.delay,i=e.start,o=void 0===i?0:i,a=e.autoPlay,s=sn.toArray(e.children).length;return n.state={delay:r,count:s,index:o,autoPlay:a},n}return n(e,t),e.prototype.didMount=function(){this.animator.on("end",this.next)},e.prototype.willReceiveProps=function(t){var e=t.start,n=t.delay,r=t.autoPlay,i=this.state,o=i.index,a=i.delay,s=i.autoPlay;(_(e)||n!==a||r!==s)&&(clearTimeout(this.timer),this.setState({delay:n,index:_(e)?e:o,autoPlay:r}))},e.prototype.didUnmount=function(){this.animator.off("end",this.next)},e.prototype.render=function(){var t=this.state.index;return sn.toArray(this.props.children)[t]},e}(on),Np=function(t){function e(e){var n=t.call(this)||this;n.animUnits=[],n.frame=0,n.playState="play",n.next=function(){var t=n.frame,e=n.endFrame,r=n.speed;"play"===n.playState&&(n.frame=t+1,e>t?(n.drawFrame(),n.animator.run(),n.setPlaybackRate(r)):(n.emit("end"),n.playState="finish"))};var r=e.animUnits,i=e.playState,o=e.root,a=e.speed,s=void 0===a?1:a,u=e.time;n.animator=new Zu;var l=new Hs;return n.animator.reset(l),o.appendChild(l),n.animUnits=r,n.playState=i,n.endFrame=r.length-1,n.speed=s,n.time=u,n.totalDuration=r.reduce((function(t,e){return t+e.time}),0),n}return n(e,t),e.prototype.start=function(){var t=this,e=t.frame,n=t.playState,r=t.endFrame,i=t.time,o=t.speed;t.animator.on("end",this.next),r>e&&"finish"===n?this.setFinishState():(this.drawFrame(),this.animator.run(),this.setPlayState(n),i&&this.goTo(i),this.setPlaybackRate(o))},e.prototype.drawFrame=function(){var t=this,e=t.animator,n=t.animUnits[t.frame].animators;e.shape.removeChildren(),n.map((function(t){e.shape.appendChild(null==t?void 0:t.shape)})),e.children=n},e.prototype.setPlayState=function(t){var e=this.animator;switch(t){case"play":e.play();break;case"pause":e.pause();break;case"finish":e.finish()}},e.prototype.setPlaybackRate=function(t){var e=this.animator;this.speed=t,e.setPlaybackRate(t)},e.prototype.getPlayState=function(){return this.playState},e.prototype.updateState=function(t){"finish"!==t?(this.playState=t,this.setPlayState(t)):this.setFinishState()},e.prototype.clear=function(){this.animator=null,this.animUnits=[],this.playState=null,this.endFrame=null},e.prototype.goTo=function(t){var e=this,n=e.frame,r=e.animUnits,i=e.playState;if(e.totalDuration<t&&"finish"!==i)this.setFinishState();else{var o;for(o=0;r.length>o;o++){var a=r[o];if(a.time>=t)break;t-=a.time}n!==o&&(this.frame=o,this.drawFrame(),this.setPlayState("finish"),this.animator.run(),this.setPlayState(i)),this.animator.goTo(t)}},e.prototype.setFinishState=function(){var t=this.endFrame;this.frame=t,this.drawFrame(),this.animator.run(),this.setPlayState("finish"),this.playState="finish",this.frame=t+1,this.animator.animations=[]},e}(Hu);function Cp(t,e){if(e)return sn.map(e,(function(e){var n=e.key,i=t[n]?t[n].to:{},o=Cp(t,e.props.children);return sn.cloneElement(e,r(r({},i),{children:o}))}))}function Ap(t){return sn.map(t,(function(t){if(t){var e=t.children,n=t.animator.end,i=void 0===n?{}:n,o=t.shape.cloneNode();return qu(o,i),r(r({},t),{shape:o,children:Ap(e)})}}))}var Op=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.didMount=function(){var t=this,e=this.props,n=e.keyFrames,r=e.children,i=e.state,o=e.onend,a=e.goTo,s=e.speed;this.playerFrames=n.reduce((function(t,e){var n=Cp(e,t[t.length-1]||r);return t.push(n),t}),[]);var u=this.playerFrames.map((function(e,r){var i=n[r];return t.preNode=Ap(t.preNode||t._vNode),gc(t,e,i)||{}}));this.timeline=new Np({animUnits:u,playState:i,root:this.context.canvas,speed:s,time:a}),this.timeline.start(),o&&this.timeline.on("end",o)},e.prototype.willReceiveProps=function(t,e){var n=this.props,r=this.timeline,i=t.state,o=t.goTo,a=t.speed,s=n.goTo,u=n.speed;$(i,r.getPlayState())||"finish"!==r.getPlayState()?($(i,r.getPlayState())||r.updateState(i),$(o,s)||r.goTo(o),$(a,u)||r.setPlaybackRate(a)):r.totalDuration>o&&(r.updateState(i),r.goTo(o))},e.prototype.setPlayState=function(t){this.timeline.updateState(t)},e.prototype.goTo=function(t){this.timeline.goTo(t)},e.prototype.setPlaybackRate=function(t){this.timeline.setPlaybackRate(t)},e.prototype.render=function(){return null},e}(on);function Rp(t){return{xMin:t.yMin,xMax:t.yMax,yMin:t.xMin,yMax:t.xMax}}function Lp(t){var e,n,r,i,o=t.x,a=t.y,s=t.size,u=t.y0;return y(o)?(e=o[0],n=o[1]):(e=o-s/2,n=o+s/2),y(a)?a[0]===a[1]?(r=a[0],i=a[1]):(r=Math.min(a[0],a[1]),i=Math.max(a[0],a[1])):(r=Math.min(u,a),i=Math.max(u,a)),{xMin:e,xMax:n,yMin:r,yMax:i}}var _p=function(){function t(t){this.left=0,this.top=0,this.width=0,this.height=0,this.transposed=!1,this.x=[0,1],this.y=[0,1],this.update(t)}return t.prototype.update=function(t){V(this,t);var e=this,n=e.left,r=e.top,i=e.width,o=e.height;return this.right=n+i,this.bottom=r+o,this.center={x:n+i/2,y:r+o/2},this},t.prototype.isCyclic=function(){return!1},t.prototype._zoomVal=function(t,e){return y(t)?t.map((function(t){return e(t)})):e(t)},t.prototype.convert=function(t){var e=this,n=e.transposed,r=e.x,i=e.y,o=n?"y":"x",a=n?"x":"y",s=t[o],u=t[a];return 0>s||s>1||0>u||u>1?{x:NaN,y:NaN}:{x:this._zoomVal(t[o],(function(t){return r[0]+(r[1]-r[0])*t})),y:this._zoomVal(t[a],(function(t){return i[0]+(i[1]-i[0])*t}))}},t.prototype.invert=function(t){var e,n=this,r=n.transposed,i=n.x,o=n.y,a=r?"x":"y";return(e={})[r?"y":"x"]=this._zoomVal(t.x,(function(t){return(t-i[0])/(i[1]-i[0])})),e[a]=this._zoomVal(t.y,(function(t){return(t-o[0])/(o[1]-o[0])})),e},t.prototype.convertPoint=function(t){return this.convert(t)},t.prototype.invertPoint=function(t){return this.invert(t)},t.prototype.convertRect=function(t){var e=this,n=e.x,r=e.y,i=e.transposed,o=n[0],a=n[1],s=r[0],u=r[1],l=Lp(t),c=i?Rp(l):l,h=o+(a-o)*c.xMin,p=o+(a-o)*c.xMax,f=s+(u-s)*c.yMin,d=s+(u-s)*c.yMax;return{xMin:Math.min(h,p),xMax:Math.max(h,p),yMin:Math.min(f,d),yMax:Math.max(f,d)}},t.prototype.transformToRect=function(t){var e=t.x,n=t.y,r=t.size,i=this.convertPoint({x:0,y:t.y0}),o=this.transposed,a=Lp({size:r,x:o?n:e,y:o?e:n,y0:o?i.x:i.y}),s=o?Rp(a):a;return{xMin:s.xMin,xMax:s.xMax,yMin:s.yMin,yMax:s.yMax}},t}(),Ip=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="rect",e}return n(e,t),e.prototype.update=function(e){t.prototype.update.call(this,e);var n=this,r=n.left,i=n.top,o=[i+n.height,i];return this.x=[r,r+n.width],this.y=o,this},e}(_p),Dp=function(t,e,n){var r,i,o,a,s,u,l,c=(s=(i=e)[0],u=i[1],Math.acos(Math.min(Math.max((l=Math.sqrt((o=(r=t)[0])*o+(a=r[1])*a)*Math.sqrt(s*s+u*u))&&(o*s+a*u)/l,-1),1))),h=function(t,e){return t[0]*e[1]-e[0]*t[1]}(t,e)>=0;return n?h?2*Math.PI-c:c:h?c:2*Math.PI-c},Fp=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="polar",e.isPolar=!0,e}return n(e,t),e.prototype.update=function(e){t.prototype.update.call(this,e),this.option||(this.option=e);var n=this.option,r=n.radius,i=n.innerRadius,o=void 0===i?0:i,a=this,s=a.startAngle,u=void 0===s?-Math.PI/2:s,l=a.endAngle,c=void 0===l?3*Math.PI/2:l,h=(void 0===r?1:r)*(Math.min(a.width,a.height)/2),p=[o*h,h];return this.x=[u,c],this.y=p,this.startAngle=u,this.endAngle=c,this.radius=h,this.innnerRadius=o*h,this},e.prototype.isCyclic=function(){return 2*Math.PI<=this.endAngle-this.startAngle},e.prototype.convertPoint=function(t){var e=this,n=e.center,r=e.transposed,i=e.x,o=e.y,a=i[0],s=o[0],u=a+(i[1]-a)*t[r?"y":"x"],l=s+(o[1]-s)*t[r?"x":"y"];return{x:n.x+Math.cos(u)*l,y:n.y+Math.sin(u)*l}},e.prototype.invertPoint=function(t){var e,n,r,i,o,a,s,u,l,c,h,p=this,f=p.center,d=p.transposed,y=p.x,v=p.y,g=d?"y":"x",m=d?"x":"y",x=y[0],b=y[1],M=v[0],w=v[1],E=[1,0,0,1,0,0];e=E,i=(n=E)[0],o=n[1],a=n[2],s=n[3],u=n[4],l=n[5],c=Math.sin(r=x),e[0]=i*(h=Math.cos(r))+a*c,e[1]=o*h+s*c,e[2]=i*-c+a*h,e[3]=o*-c+s*h,e[4]=u,e[5]=l;var k=[1,0];!function(t,e,n){var r=e[0],i=e[1];t[0]=n[0]*r+n[2]*i+n[4],t[1]=n[1]*r+n[3]*i+n[5]}(k,k,E);var S,P=[t.x-f.x,t.y-f.y];if(0===(S=P)[0]&&0===S[1])return{x:0,y:0};var T=Dp(k=[k[0],k[1]],P,x>b);.001>Math.abs(T-2*Math.PI)&&(T=0);var N=T/(b-x),C=(me(P)-M)/(w-M),A={};return A[g]=N=b-x>0?N:-N,A[m]=C,A},e}(_p),Bp={rect:Ip,polar:Fp},jp=function(){function t(){}return t.prototype.getOption=function(t){if(P(t))return{type:Bp[t]||Ip};if(h(t))return{type:t};var e=(t||{}).type;return r(r({},t),{type:h(e)?e:Bp[e]||Ip})},t.prototype.create=function(t){var e=this.layout,n=this.getOption(t),i=new(0,n.type)(r(r({},n),e));return this.coord=i,i},t.prototype.updateLayout=function(t){var e=this.coord,n=t.padding||[0,0,0,0],r=n[0],i=n[3];this.layout={left:t.left+i,top:t.top+r,width:t.width-i-n[1],height:t.height-r-n[2]},e&&e.update(this.layout)},t.prototype.useLayout=function(t){var e=this.coord,n=t.width,r=t.height,i=e.left,o=e.top,a=e.width,s=e.height;switch(t.position){case"left":i+=n,a=Math.max(0,a-n);break;case"right":a=Math.max(0,a-n);break;case"top":o+=r,s=Math.max(0,s-r);break;case"bottom":s=Math.max(0,s-r)}e.update({left:i,top:o,width:a,height:s})},t.prototype.update=function(){},t.prototype.getCoord=function(){return this.coord},t}(),Gp={};function Yp(t){return Gp[t]}function Wp(t,e){Gp[t]=e}var zp=function(){function t(t){this.type="base",this.isCategory=!1,this.isLinear=!1,this.isContinuous=!1,this.isIdentity=!1,this.values=[],this.range=[0,1],this.ticks=[],this.__cfg__=t,this.initCfg(),this.init()}return t.prototype.translate=function(t){return t},t.prototype.change=function(t){V(this.__cfg__,t),this.init()},t.prototype.clone=function(){return this.constructor(this.__cfg__)},t.prototype.getTicks=function(){var t=this;return J(this.ticks,(function(e,n){return v(e)?e:{text:t.getText(e,n),tickValue:e,value:t.scale(e)}}))},t.prototype.getText=function(t,e){var n=this.formatter,r=n?n(t,e):t;return p(r)||!h(r.toString)?"":""+r},t.prototype.getConfig=function(t){return this.__cfg__[t]},t.prototype.init=function(){V(this,this.__cfg__),this.setDomain(),K(this.getConfig("ticks"))&&(this.ticks=this.calculateTicks())},t.prototype.initCfg=function(){},t.prototype.setDomain=function(){},t.prototype.calculateTicks=function(){var t=this.tickMethod,e=[];if(P(t)){var n=Yp(t);if(!n)throw Error("There is no method to to calculate ticks!");e=n(this)}else h(t)&&(e=t(this));return e},t.prototype.rangeMin=function(){return this.range[0]},t.prototype.rangeMax=function(){return this.range[1]},t.prototype.calcPercent=function(t,e,n){return _(t)?(t-e)/(n-e):NaN},t.prototype.calcValue=function(t,e,n){return e+t*(n-e)},t}(),Vp=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="cat",e.isCategory=!0,e}return n(e,t),e.prototype.buildIndexMap=function(){if(!this.translateIndexMap){this.translateIndexMap=new Map;for(var t=0;this.values.length>t;t++)this.translateIndexMap.set(this.values[t],t)}},e.prototype.translate=function(t){this.buildIndexMap();var e=this.translateIndexMap.get(t);return void 0===e&&(e=_(t)?t:NaN),e},e.prototype.scale=function(t){var e=this.translate(t),n=this.calcPercent(e,this.min,this.max);return this.calcValue(n,this.rangeMin(),this.rangeMax())},e.prototype.invert=function(t){var e=this.max-this.min,n=this.calcPercent(t,this.rangeMin(),this.rangeMax()),r=Math.round(e*n)+this.min;return this.min>r||r>this.max?NaN:this.values[r]},e.prototype.getText=function(e){for(var n=[],r=1;arguments.length>r;r++)n[r-1]=arguments[r];var i=e;return _(e)&&!this.values.includes(e)&&(i=this.values[i]),t.prototype.getText.apply(this,l([i],n,!1))},e.prototype.initCfg=function(){this.tickMethod="cat"},e.prototype.setDomain=function(){if(p(this.getConfig("min"))&&(this.min=0),p(this.getConfig("max"))){var t=this.values.length;this.max=t>1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(zp),Xp=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Up=/\[([^]*?)\]/gm;function Hp(t,e){for(var n=[],r=0,i=t.length;i>r;r++)n.push(t[r].substr(0,e));return n}function qp(t){for(var e=[],n=1;arguments.length>n;n++)e[n-1]=arguments[n];for(var r=0,i=e;i.length>r;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var Zp=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Kp=["January","February","March","April","May","June","July","August","September","October","November","December"],$p=Hp(Kp,3),Jp=qp({},{dayNamesShort:Hp(Zp,3),dayNames:Zp,monthNamesShort:$p,monthNames:Kp,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),Qp=function(t,e){for(void 0===e&&(e=2),t+="";e>t.length;)t="0"+t;return t},tf={D:function(t){return t.getDate()+""},DD:function(t){return Qp(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return t.getDay()+""},dd:function(t){return Qp(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1+""},MM:function(t){return Qp(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return Qp(t.getFullYear()+"",4).substr(2)},YYYY:function(t){return Qp(t.getFullYear(),4)},h:function(t){return(t.getHours()%12||12)+""},hh:function(t){return Qp(t.getHours()%12||12)},H:function(t){return t.getHours()+""},HH:function(t){return Qp(t.getHours())},m:function(t){return t.getMinutes()+""},mm:function(t){return Qp(t.getMinutes())},s:function(t){return t.getSeconds()+""},ss:function(t){return Qp(t.getSeconds())},S:function(t){return Math.round(t.getMilliseconds()/100)+""},SS:function(t){return Qp(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return Qp(t.getMilliseconds(),3)},a:function(t,e){return 12>t.getHours()?e.amPm[0]:e.amPm[1]},A:function(t,e){return 12>t.getHours()?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Qp(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Qp(Math.floor(Math.abs(e)/60),2)+":"+Qp(Math.abs(e)%60,2)}},ef={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};function nf(t,e){return function(t,e,n){if(void 0===e&&(e=ef.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw Error("Invalid Date pass to format");var r=[];e=(e=ef[e]||e).replace(Up,(function(t,e){return r.push(e),"@@@"}));var i=qp(qp({},Jp),n);return(e=e.replace(Xp,(function(e){return tf[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))}(t,e)}function rf(t){return P(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),G(t)&&(t=t.getTime()),t}var of=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="timeCat",e}return n(e,t),e.prototype.translate=function(t){t=rf(t);var e=this.values.indexOf(t);return-1===e&&(e=_(t)&&this.values.length>t?t:NaN),e},e.prototype.getText=function(t,e){var n=this.translate(t);if(n>-1){var r=this.values[n],i=this.formatter;return r=i?i(r,e):nf(r,this.mask)}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var e=this.values;g(e,(function(t,n){e[n]=rf(t)})),e.sort((function(t,e){return t-e})),t.prototype.setDomain.call(this)},e}(Vp),af=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isContinuous=!0,e}return n(e,t),e.prototype.scale=function(t){if(p(t))return NaN;var e=this.rangeMin(),n=this.rangeMax();return this.max===this.min?e:e+this.getScalePercent(t)*(n-e)},e.prototype.init=function(){t.prototype.init.call(this);var e=this.ticks,n=N(e),r=C(e);this.min>n&&(this.min=n),r>this.max&&(this.max=r),p(this.minLimit)||(this.min=n),p(this.maxLimit)||(this.max=r)},e.prototype.setDomain=function(){var t=S(this.values),e=t.min,n=t.max;p(this.min)&&(this.min=e),p(this.max)&&(this.max=n),this.min>this.max&&(this.min=e,this.max=n)},e.prototype.calculateTicks=function(){var e=this,n=t.prototype.calculateTicks.call(this);return this.nice||(n=function(t,e){if(!c(t))return t;for(var n=[],r=0;t.length>r;r++){var i=t[r];e(i,r)&&n.push(i)}return n}(n,(function(t){return t>=e.min&&e.max>=t}))),n},e.prototype.getScalePercent=function(t){var e=this.min;return(t-e)/(this.max-e)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(zp),sf=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="linear",e.isLinear=!0,e}return n(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t);return this.min+e*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(af);function uf(t,e){var n=Math.E;return 0>e?-1*Math.pow(n,Math.log(-e)/t):Math.pow(n,Math.log(e)/t)}function lf(t,e){return 1===t?1:Math.log(e)/Math.log(t)}var cf=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="log",e}return n(e,t),e.prototype.invert=function(t){var e,n=this.base,r=lf(n,this.max),i=this.rangeMin(),o=this.rangeMax()-i,a=this.positiveMin;if(a){if(0===t)return 0;var s=1/(r-(e=lf(n,a/n)))*o;if(s>t)return t/s*a}else e=lf(n,this.min);return Math.pow(n,(t-i)/o*(r-e)+e)},e.prototype.initCfg=function(){this.tickMethod="log",this.base=10,this.tickCount=6,this.nice=!0},e.prototype.setDomain=function(){t.prototype.setDomain.call(this);var e=this.min;if(0>e)throw Error("When you use log scale, the minimum value must be greater than zero!");0===e&&(this.positiveMin=function(t,e,n){p(n)&&(n=Math.max.apply(null,t));var r=n;return g(t,(function(t){t>0&&r>t&&(r=t)})),r===n&&(r=n/e),r>1&&(r=1),r}(this.values,this.base,this.max))},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;if(0>=t)return 0;var r=this.base,i=this.positiveMin;return i&&(n=1*i/r),i>t?t/i/(lf(r,e)-lf(r,n)):(lf(r,t)-lf(r,n))/(lf(r,e)-lf(r,n))},e}(af),hf=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="pow",e}return n(e,t),e.prototype.invert=function(t){var e=this.getInvertPercent(t),n=this.exponent,r=uf(n,this.max),i=uf(n,this.min),o=e*(r-i)+i,a=0>o?-1:1;return Math.pow(o,n)*a},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var e=this.max,n=this.min;if(e===n)return 0;var r=this.exponent;return(uf(r,t)-uf(r,n))/(uf(r,e)-uf(r,n))},e}(af),pf=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="time",e}return n(e,t),e.prototype.getText=function(t,e){var n=this.translate(t),r=this.formatter;return r?r(n,e):nf(n,this.mask)},e.prototype.scale=function(e){var n=e;return(P(n)||G(n))&&(n=this.translate(n)),t.prototype.scale.call(this,n)},e.prototype.translate=function(t){return rf(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,e=this.getConfig("min"),n=this.getConfig("max");if(p(e)&&_(e)||(this.min=this.translate(this.min)),p(n)&&_(n)||(this.max=this.translate(this.max)),t&&t.length){var r=[],i=1/0,o=i,a=0;g(t,(function(t){var e=rf(t);if(isNaN(e))throw new TypeError("Invalid Time: ".concat(t," in time scale!"));i>e?(o=i,i=e):o>e&&(o=e),e>a&&(a=e),r.push(e)})),t.length>1&&(this.minTickInterval=o-i),p(e)&&(this.min=i),p(n)&&(this.max=a)}},e}(sf),ff=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantize",e}return n(e,t),e.prototype.invert=function(t){var e=this.ticks,n=e.length,r=this.getInvertPercent(t),i=Math.floor(r*(n-1));if(i>=n-1)return C(e);if(0>i)return N(e);var o=e[i],a=i/(n-1);return o+(r-a)/((i+1)/(n-1)-a)*(e[i+1]-o)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var e=t.prototype.calculateTicks.call(this);return this.nice||(C(e)!==this.max&&e.push(this.max),N(e)!==this.min&&e.unshift(this.min)),e},e.prototype.getScalePercent=function(t){var e=this.ticks;if(t<N(e))return 0;if(t>C(e))return 1;var n=0;return g(e,(function(e,r){if(e>t)return!1;n=r})),n/(e.length-1)},e}(af),df=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="quantile",e}return n(e,t),e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(ff),yf={};function vf(t){return yf[t]}function gf(t,e){if(vf(t))throw Error("type '".concat(t,"' existed."));yf[t]=e}var mf=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.type="identity",e.isIdentity=!0,e}return n(e,t),e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&_(t)?t:this.range[0]},e.prototype.invert=function(t){var e=this.range;return e[0]>t||t>e[1]?NaN:this.values[0]},e}(zp),xf=function(t){var e=t.values,n=t.tickCount;if(!n)return e;if(1>=e.length)return e;for(var r=Math.floor(e.length/(n-1))||1,i=[],o=0;e.length>o;o+=r)i.push(e[o]);var a=e[e.length-1];return i[i.length-1]!==a&&(n>i.length?i.push(a):i[i.length-1]=a),i},bf=[1,1.2,1.5,2,2.2,2.4,2.5,3,4,5,6,7.5,8,10],Mf=12;function wf(t){var e=1;if(0===(t=Math.abs(t)))return e;if(1>t){for(var n=0;1>t;)e/=10,t*=10,n++;return(""+e).length>Mf&&(e=parseFloat(e.toFixed(n))),e}for(;t>10;)e*=10,t/=10;return e}function Ef(t,e,n,r){for(var i=!1,o=bf[t],a=t;bf.length>a;a++)if(kf({interval:bf[a],tickCount:e,max:r,min:n})){o=bf[a],i=!0;break}return i?o:10*Ef(0,e,n/10,r/10)}function kf(t){var e=t.interval,n=t.tickCount;return t.max<=Math.floor(t.min/e)*e+(n-1)*e}function Sf(t){var e=""+t,n=e.indexOf("."),r=e.indexOf("e-"),i=0>r?e.substr(n+1).length:parseInt(e.substr(r+2),10);return i>20&&(i=20),i}function Pf(t,e){return parseFloat(t.toFixed(e))}gf("cat",Vp),gf("category",Vp),gf("identity",mf),gf("linear",sf),gf("log",cf),gf("pow",hf),gf("time",pf),gf("timeCat",of),gf("quantize",ff),gf("quantile",df),Wp("cat",xf),Wp("time-cat",xf),Wp("wilkinson-extended",(function(t){var e=t||{},n=e.tickCount,r=e.tickInterval,i=t||{},o=i.min,a=i.max;o=isNaN(o)?0:o,a=isNaN(a)?0:a;var s=n&&n>=2?n:5,u=r||function(t){var e=t.tickCount,n=t.min,r=t.max;if(n===r)return 1*wf(r);for(var i=(r-n)/(e-1),o=wf(i),a=i/o,s=r/o,u=n/o,l=0,c=0;bf.length>c;c++){if(bf[c]>=a){l=c;break}}var h=0>n&&r>0&&2===e?bf[l]:Ef(l,e,u,s),p=Sf(h)+Sf(o);return Pf(h*o,p)}({tickCount:s,max:a,min:o}),l=Math.floor(o/u)*u;r&&(s=Math.max(s,Math.abs(Math.ceil((a-l)/r))+1));var c=0,h=Sf(u);if(0>o&&a>0&&2===s)return[Pf(l,h),Pf(Math.ceil(a/u)*u,h)];for(var p=[];s>c;)p.push(Pf(l+c*u,h)),c++;return p}));var Tf=function(){function t(t){this.data=t,this.options={},this.scales={}}return t.prototype._getType=function(t){var e=t.type,n=t.values,r=t.field;return e||(_(r)||p(n[0])&&r?"identity":"number"==typeof n[0]?"linear":"cat")},t.prototype._getOption=function(t){var e=t.values,n=t.field,r=t.justifyContent,i=this._getType(t);if(t.type=i,"identity"===i)return t.field=""+n,t.values=[n],t;if("linear"===i){"boolean"!=typeof t.nice&&(t.nice=!0);var o=S(e),a=o.min,s=o.max;return p(t.min)&&(t.min=a),p(t.max)&&(t.max=s),t.values=e.sort((function(t,e){return t-e})),t}if("cat"===i||"timeCat"===i){if(t.range)return t;var u=e.length,l=[0,1];if(1===u)l=[.5,1];else if(r){l=[c=1/u*.5,1-c]}else{var c;l=[0,1-(c=1/u)]}t.range=l}return t},t.prototype.createScale=function(t){var e=t.type;return h(e)?new e(t):new(vf(e))(t)},t.prototype.setScale=function(t,e){var n=this.options,r=this.scales;n[t]=V({},n[t],e),r[t]&&r[t].change(n[t])},t.prototype.create=function(t){this.update(t)},t.prototype.update=function(t){var e=this;t&&g(t,(function(t,n){e.setScale(n,t)}))},t.prototype.changeData=function(t){this.data=t,this.scales={}},t.prototype.getData=function(){return this.data},t.prototype.getScale=function(t){var e=this,n=e.scales,i=e.options,o=e.data,a=n[t];if(a){var s=this._getOption(r(r({},i[t]),{values:a.values}));return s.range&&(a.range=s.range),a}var u=i[t];if(!u)return null;var l=u.values?u.values:o?T(o,t):[],c=this._getOption(r(r({},u),{field:t,values:l})),h=this.createScale(c);return n[t]=h,h},t.prototype.getScales=function(){var t=this,e=this.scales;return g(this.options,(function(e,n){t.getScale(n)})),e},t.prototype.getOptions=function(){var t={};return g(this.scales,(function(e,n){t[n]=r({},e.__cfg__)})),t},t.prototype.adjustStartZero=function(t){var e=t.max,n=this.options[t.field];n&&n.min||(t.min>0?t.change({min:0}):0>e&&t.change({max:0}))},t.prototype.adjustPieScale=function(t){var e=this.options[t.field];if(e&&!p(e.nice))return null;t.change({nice:!1})},t.prototype._updateStackRange=function(t,e){for(var n=t.field,r=this.options[n],i=1/0,o=-1/0,a=0,s=e.length;s>a;a++){var u=e[a],l=Math.min.apply(null,u[n]),c=Math.max.apply(null,u[n]);i>l&&(i=l),c>o&&(o=c)}var h=(null==r?void 0:r.min)||i,p=(null==r?void 0:r.max)||o;h===t.min&&p===t.max||t.change({min:h,max:p})},t.prototype.getZeroValue=function(t){var e=t.min,n=t.max;return t.scale(0>e?n>0?0:n:e)},t}(),Nf={chart:{padding:["30px","30px","30px","30px"]},colors:["#1890FF","#2FC25B","#FACC14","#223273","#8543E0","#13C2C2","#3436C7","#F04864"],shapes:{line:["line","dash","smooth"],point:["circle","hollowCircle","rect"],area:["area","smooth"],interval:["rect","pyramid","funnel"]},sizes:["4px","6px","8px","10px","12px"],shape:{line:{default:{lineWidth:"4px",lineJoin:"round",lineCap:"round"},smooth:{smooth:!0},"step-start":{step:"start"},"step-middle":{step:"middle"},"step-end":{step:"end"},dash:{lineDash:["8px","8px"]}},point:{default:{size:"6px"},hollowCircle:{lineWidth:"2px"}},area:{default:{fillOpacity:.1}},interval:{default:{}}},axis:{labelOffset:"15px",line:{stroke:"#E8E8E8",lineWidth:"1px"},symbol:{fill:"#E8E8E8",radius:"10px"},tickLine:{stroke:"#E8E8E8"},label:{fill:"#808080",fontSize:"20px"},grid:{stroke:"#E8E8E8",lineWidth:"1px",lineDash:["4px"]}},guide:{line:{style:{stroke:"#a3a3a3",lineWidth:1},offsetX:0,offsetY:0},text:{style:{fill:"#787878",textBaseline:"middle"},offsetX:0,offsetY:0},rect:{style:{fill:"#fafafa"}},arc:{style:{stroke:"#a3a3a3"}},html:{offsetX:0,offsetY:0,alignX:"center",alignY:"middle"},tag:{offsetX:0,offsetY:0,side:4,background:{padding:5,radius:2,fill:"#1890FF"},textStyle:{fontSize:12,fill:"#fff",textAlign:"center",textBaseline:"middle"}},point:{offsetX:0,offsetY:0,style:{fill:"#fff",r:3,lineWidth:2,stroke:"#1890ff"}},polyline:{style:{lineWidth:"4px",lineJoin:"round",lineCap:"round"},offsetX:0,offsetY:0}}},Cf=function(t){function e(e,n){var r=t.call(this,e)||this;r.componentsPosition=[];var i=n.theme;return n.theme=q((0,n.px2hd)(Nf),i),r.scale=new Tf(e.data),r.coord=new jp,r.coordRef={current:null},r.state={filters:{}},r}return n(e,t),e.prototype.getStyle=function(t){var e=this.context,n=this.layout,i=t.style;return(0,e.px2hd)(r(r({left:n.left,top:n.top,width:n.width,height:n.height},e.theme.chart),i))},e.prototype.willMount=function(){var t=this,e=t.props,n=t.coord,r=t.scale,i=e.scale,o=e.coord;this.resetCoordLayout(),r.create(i),n.create(o)},e.prototype.willReceiveProps=function(t,e){var n=this,r=n.scale,i=n.coord,o=n.props,a=t.data,s=t.scale,u=o.data,l=o.scale;if(!Vu(t.style,o.style)||e!==this.context){var c=this.getStyle(t);i.updateLayout(c)}a!==u&&r.changeData(a),Vu(s,l)||r.update(s)},e.prototype.willUpdate=function(){this.coord.create(this.props.coord)},e.prototype.on=function(t,e){var n=this.coordRef.current;n&&n.gesture&&n.gesture.on(t,e)},e.prototype.off=function(t,e){var n=this.coordRef.current;n&&n.gesture&&n.gesture.off(t,e)},e.prototype.layoutCoord=function(t){this.coord.useLayout(t)},e.prototype.resetCoordLayout=function(){var t=this.coord,e=this.getStyle(this.props);t.updateLayout(e)},e.prototype.updateCoordLayout=function(t){var e=this;y(t)?t.forEach((function(t){e.layoutCoord(t)})):this.layoutCoord(t)},e.prototype.updateCoordFor=function(t,e){var n=this;if(e){var r=this.componentsPosition,i={component:t,layout:e},o=function(t,e,n){void 0===n&&(n=0);for(var r=n;t.length>r;r++)if(e(t[r],r))return r;return-1}(r,(function(e){return e.component===t}));if(o>-1)return r.splice(o,1,i),this.resetCoordLayout(),this.removeComponentsPositionCache(),void r.forEach((function(t){n.updateCoordLayout(t.layout)}));r.push(i),this.updateCoordLayout(e)}},e.prototype.removeComponentsPositionCache=function(){var t;if(null===(t=this.componentsPosition)||void 0===t?void 0:t.length)for(var e=this.componentsPosition.length;e>-1;e--){var n=this.componentsPosition[e];n&&n.component&&n.component.destroyed&&this.componentsPosition.splice(e,1)}},e.prototype.getGeometrys=function(){var t=[];return sn.toArray(this.children.children).forEach((function(e){if(!e)return!1;var n=e.component;n&&n.isGeometry&&t.push(n)})),t},e.prototype.getPosition=function(t){for(var e=this.getCoord(),n=this.getXScales()[0],r=n.field,i=this.getYScales(),o=i[0],a=o.field,s=0,u=i.length;u>s;s++){var l=i[s],c=l.field;if(t[c]){o=l,a=c;break}}var h=n.scale(t[r]),p=o.scale(t[a]);return e.convertPoint({x:h,y:p})},e.prototype.getSnapRecords=function(t,e){var n=this.getGeometrys();if(n.length)return n[0].getSnapRecords(t,e)},e.prototype.getRecords=function(t,e){var n=this.getGeometrys();if(n.length)return n[0].getRecords(t,e)},e.prototype.getLegendItems=function(t){var e=this.getGeometrys();if(e.length)return e[0].getLegendItems(t)},e.prototype.setScale=function(t,e){this.scale.setScale(t,e)},e.prototype.getScale=function(t){return this.scale.getScale(t)},e.prototype.getScales=function(){return this.scale.getScales()},e.prototype.getXScales=function(){return this.getGeometrys().map((function(t){return t.getXScale()}))},e.prototype.getYScales=function(){return this.getGeometrys().map((function(t){return t.getYScale()}))},e.prototype.getLayout=function(){return this.coord.layout},e.prototype.getCoord=function(){return this.coord.coord},e.prototype.filter=function(t,e){var n;this.setState({filters:r(r({},this.state.filters),(n={},n[t]=e,n))})},e.prototype._getRenderData=function(){var t=this.props.data,e=this.state.filters;if(!e||!Object.keys(e).length)return t;var n=t;return g(e,(function(t,e){t&&(n=n.filter((function(n){return t(n[e],n)})))})),n},e.prototype.render=function(){var t=this,e=this,n=e.props,r=e.scale,i=e.layout,o=n.children;if(!n.data)return null;var a=this._getRenderData(),s=this.getLayout(),u=this.getCoord(),l=r.getOptions();return vh("group",{ref:this.coordRef,style:{width:i.width,height:i.height,fill:"transparent"}},sn.map(o,(function(e){return sn.cloneElement(e,{data:a,chart:t,layout:s,coord:u,scaleOptions:l})})))},e}(on);function Af(t,e,n){if(t===e)return!0;for(var r=0,i=n.length;i>r;r++){var o=n[r];if(t[o]!==e[o])return!1}return!0}var Of=function(t){function e(e,n){var r=t.call(this,e,n)||this,i=e.selection;return i?(r.state.selected=i.defaultSelected,r):r}return n(e,t),e.prototype.didMount=function(){var t=this,e=this.props,n=this.state,r=e.selection,i=e.chart;if(r){var o=r.triggerOn,a=void 0===o?"click":o,s=r.onChange;i.on(a,(function(e){var o=t.getSnapRecords("click"===a?{x:e.canvasX,y:e.canvasY}:e.points[0]),u=r.type,l=void 0===u?"single":u,c=r.cancelable,h=void 0===c||c;if(o&&o.length){var p=n.selected,f=o.map((function(t){return t.origin}));if(p&&p.length||(s&&s({selected:f}),t.setState({selected:f})),"single"===l){if(!h)return s&&s({selected:f}),void t.setState({selected:f});var d=[];return o.forEach((function(e){t.isSelected(e)||d.push(e.origin)})),s&&s({selected:d}),void t.setState({selected:d})}var y=i.getScales(),v=Object.keys(y),g={};p.forEach((function(t){var e=v.map((function(e){return t[e]})).join("-");g[e]=t})),o.forEach((function(t){var e=t.origin,n=v.map((function(t){return e[t]})).join("-");g[n]=g[n]?null:e}));var m=Object.keys(g).map((function(t){return g[t]})).filter(Boolean);s&&s({selected:m}),t.setState({selected:m})}else h&&(s&&s({selected:null}),t.setState({selected:null}))}))}},e.prototype.willReceiveProps=function(t){var e=t.selection,n=this.props.selection;if(e&&n){var r=e.defaultSelected;Vu(r,n.defaultSelected)||(this.state.selected=r)}},e.prototype.getSnapRecords=function(t){return null},e.prototype.isSelected=function(t){var e=this.state.selected;if(!e||!e.length)return!1;for(var n=this.props.chart.getScales(),r=Object.keys(n),i=0,o=e.length;o>i;i++){if(Af(t.origin,e[i],r))return!0}return!1},e.prototype.getSelectionStyle=function(t){var e=this.state.selected;if(!e||!e.length)return null;var n=this.props.selection,r=n.selectedStyle,i=n.unSelectedStyle;return this.isSelected(t)?h(r)?r(t):r:h(i)?i(t):i},e}(on),Rf=function(){function t(t){var e=t.xField,n=t.yField,r=t.adjustNames,i=t.dimValuesMap;this.adjustNames=void 0===r?["x","y"]:r,this.xField=e,this.yField=n,this.dimValuesMap=i}return t.prototype.isAdjust=function(t){return this.adjustNames.indexOf(t)>=0},t.prototype.getAdjustRange=function(t,e,n){var r,i,o=this.yField,a=n.indexOf(e),s=n.length;return!o&&this.isAdjust("y")?(r=0,i=1):s>1?(r=n[0===a?0:a-1],i=n[a===s-1?s-1:a+1],0!==a?r+=(e-r)/2:r-=(i-e)/2,a!==s-1?i-=(i-e)/2:i+=(e-n[s-2])/2):(r=0===e?0:e-.5,i=0===e?1:e+.5),{pre:r,next:i}},t.prototype.adjustData=function(t,e){var n=this,r=this.getDimValues(e);g(t,(function(t,e){g(r,(function(r,i){n.adjustDim(i,r,t,e)}))}))},t.prototype.groupData=function(t,e){return g(t,(function(t){void 0===t[e]&&(t[e]=0)})),O(t,e)},t.prototype.adjustDim=function(t,e,n,r){},t.prototype.getDimValues=function(t){var e=this.xField,n=this.yField,r=V({},this.dimValuesMap),i=[];if(e&&this.isAdjust("x")&&i.push(e),n&&this.isAdjust("y")&&i.push(n),i.forEach((function(e){r&&r[e]||(r[e]=T(t,e).sort((function(t,e){return t-e})).filter((function(t){return!isNaN(t)})))})),!n&&this.isAdjust("y")){r.y=[0,1]}return r},t}(),Lf=function(t){function e(e){var n=t.call(this,e)||this;n.cacheMap={},n.adjustDataArray=[],n.mergeData=[];var r=e.marginRatio,i=e.dodgeRatio,o=void 0===i?.5:i,a=e.dodgeBy,s=e.intervalPadding,u=e.dodgePadding,l=e.xDimensionLength,c=e.groupNum,h=e.defaultSize,p=e.maxColumnWidth,f=e.minColumnWidth,d=e.columnWidthRatio,y=e.customOffset;return n.marginRatio=void 0===r?.5:r,n.dodgeRatio=o,n.dodgeBy=a,n.intervalPadding=s,n.dodgePadding=u,n.xDimensionLegenth=l,n.groupNum=c,n.defaultSize=h,n.maxColumnWidth=p,n.minColumnWidth=f,n.columnWidthRatio=d,n.customOffset=y,n}return n(e,t),e.prototype.process=function(t){var e=X(t),n=w(e),r=this.dodgeBy,i=r?function(t,e){if(!e)return[t];var n=R(t,e),r=[];for(var i in n)r.push(n[i]);return r}(n,r):e;return this.cacheMap={},this.adjustDataArray=i,this.mergeData=n,this.adjustData(i,n),this.adjustDataArray=[],this.mergeData=[],e},e.prototype.adjustDim=function(t,e,n,r){var i=this,o=this.customOffset,a=this.getDistribution(t);return g(this.groupData(n,t),(function(n,s){var u;u=1===e.length?{pre:e[0]-1,next:e[0]+1}:i.getAdjustRange(t,parseFloat(s),e),g(n,(function(e){var n=a[e[t]],s=n.indexOf(r);if(p(o))e[t]=i.getDodgeOffset(u,s,n.length);else{var l=u.pre,c=u.next;e[t]=h(o)?o(e,u):(l+c)/2+o}}))})),[]},e.prototype.getDodgeOffset=function(t,e,n){var r,i=this,o=i.dodgeRatio,a=i.marginRatio,s=i.intervalPadding,u=i.dodgePadding,l=t.pre,c=t.next,h=c-l;if(p(s)||!p(u)||0>s)if(p(u)||!p(s)||u<0)if(p(s)||p(u)||0>s||0>u){var f=h*o/n,d=a*f;r=(l+c)/2+(.5*(h-n*f-(n-1)*d)+((e+1)*f+e*d)-.5*f-.5*h)}else{r=l+this.getIntervalAndDodgeOffset(n,e)}else{r=l+this.getDodgeOnlyOffset(n,e)}else r=l+this.getIntervalOnlyOffset(n,e);return r},e.prototype.getIntervalOnlyOffset=function(t,e){var n=this,r=n.defaultSize,i=n.xDimensionLegenth,o=n.groupNum,a=n.maxColumnWidth,s=n.minColumnWidth,u=n.columnWidthRatio,l=n.intervalPadding/i,c=(1-(o-1)*l)/o*n.dodgeRatio/(t-1),h=((1-l*(o-1))/o-c*(t-1))/t;(h=p(u)?h:1/o/t*u,p(a))||(h=Math.min(h,a/i));p(s)||(h=Math.max(h,s/i));return((.5+e)*(h=r?r/i:h)+e*(c=((1-(o-1)*l)/o-t*h)/(t-1))+.5*l)*o-l/2},e.prototype.getDodgeOnlyOffset=function(t,e){var n=this,r=n.defaultSize,i=n.xDimensionLegenth,o=n.groupNum,a=n.maxColumnWidth,s=n.minColumnWidth,u=n.columnWidthRatio,l=n.dodgePadding/i,c=1*n.marginRatio/(o-1),h=((1-c*(o-1))/o-l*(t-1))/t;(h=u?1/o/t*u:h,p(a))||(h=Math.min(h,a/i));p(s)||(h=Math.max(h,s/i));return((.5+e)*(h=r?r/i:h)+e*l+.5*(c=(1-(h*t+l*(t-1))*o)/(o-1)))*o-c/2},e.prototype.getIntervalAndDodgeOffset=function(t,e){var n=this,r=n.xDimensionLegenth,i=n.groupNum,o=n.intervalPadding/r,a=n.dodgePadding/r;return((.5+e)*(((1-o*(i-1))/i-a*(t-1))/t)+e*a+.5*o)*i-o/2},e.prototype.getDistribution=function(t){var e=this.cacheMap,n=e[t];return n||(n={},g(this.adjustDataArray,(function(e,r){var i=T(e,t);i.length||i.push(0),g(i,(function(t){n[t]||(n[t]=[]),n[t].push(r)}))})),e[t]=n),n},e}(Rf);var _f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.process=function(t){var e=X(t),n=w(e);return this.adjustData(e,n),e},e.prototype.adjustDim=function(t,e,n){var r=this;return g(this.groupData(n,t),(function(n,i){return r.adjustGroup(n,t,parseFloat(i),e)}))},e.prototype.getAdjustOffset=function(t){var e=t.pre,n=t.next,r=.05*(n-e);return function(t,e){return(e-t)*Math.random()+t}(e+r,n-r)},e.prototype.adjustGroup=function(t,e,n,r){var i=this,o=this.getAdjustRange(e,n,r);return g(t,(function(t){t[e]=i.getAdjustOffset(o)})),t},e}(Rf),If=function(t){function e(e){var n=t.call(this,e)||this,r=e.adjustNames,i=e.height,o=void 0===i?NaN:i,a=e.size,s=void 0===a?10:a,u=e.reverseOrder,l=void 0!==u&&u;return n.adjustNames=void 0===r?["y"]:r,n.height=o,n.size=s,n.reverseOrder=l,n}return n(e,t),e.prototype.process=function(t){var e=this.reverseOrder,n=this.yField?this.processStack(t):this.processOneDimStack(t);return e?this.reverse(n):n},e.prototype.reverse=function(t){return t.slice(0).reverse()},e.prototype.processStack=function(t){var e=this,n=e.xField,i=e.yField,o=e.reverseOrder?this.reverse(t):t,a=new it,s=new it;return o.map((function(t){return t.map((function(t){var e,o=tt(t,n,0),u=tt(t,[i]),l=""+o;if(u=y(u)?u[1]:u,!p(u)){var c=0>u?s:a;c.has(l)||c.set(l,0);var h=c.get(l),f=u+h;return c.set(l,f),r(r({},t),((e={})[i]=[h,f],e))}return t}))}))},e.prototype.processOneDimStack=function(t){var e=this,n=this,i=n.xField,o=n.height,a=n.reverseOrder?this.reverse(t):t,s=new it;return a.map((function(t){return t.map((function(t){var n,a=t[i],u=2*e.size/o;s.has(a)||s.set(a,u/2);var l=s.get(a);return s.set(a,l+u),r(r({},t),((n={}).y=l,n))}))}))},e}(Rf),Df=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.process=function(t){var e=w(t),n=this.xField,i=this.yField,o=this.getXValuesMaxMap(e),a=Math.max.apply(Math,Object.keys(o).map((function(t){return o[t]})));return J(t,(function(t){return J(t,(function(t){var e,s,u=t[i],l=t[n];if(y(u)){var c=(a-o[l])/2;return r(r({},t),((e={})[i]=J(u,(function(t){return c+t})),e))}var h=(a-u)/2;return r(r({},t),((s={})[i]=[h,u+h],s))}))}))},e.prototype.getXValuesMaxMap=function(t){var e=this,n=this.xField,r=this.yField,i=O(t,(function(t){return t[n]}));return function(t,e){void 0===e&&(e=Q);var n={};return v(t)&&!p(t)&&Object.keys(t).forEach((function(r){n[r]=e(t[r],r)})),n}(i,(function(t){return e.getDimMaxValue(t,r)}))},e.prototype.getDimMaxValue=function(t,e){var n=J(t,(function(t){return tt(t,e,[])})),r=w(n);return Math.max.apply(Math,r)},e}(Rf);function Ff(t){return P(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),G(t)&&(t=t.getTime()),t}var Bf=function(){function t(t){V(this,t);var e=this,n=e.field,r=e.data;if(!e.scale&&r){var i=T(r,n);this.scale=this.createScale({values:i,field:n})}}return t.prototype.createScale=function(t){return null},t.prototype._mapping=function(t){return t},t.prototype.update=function(t){V(this,t)},t.prototype.setRange=function(t){this.range=t},t.prototype.normalize=function(t){var e=this.scale;return y(t)?t.map((function(t){return e.scale(t)})):e.scale(t)},t.prototype.convert=function(t){return t},t.prototype.mapping=function(t,e){void 0===e&&(e=null);var n=h(this.callback)?this.callback(t,e):null;return p(n)?this._mapping(t):n},t}(),jf=ln((function(t){function e(n){return t.exports=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},t.exports.__esModule=!0,t.exports.default=t.exports,e(n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}));function Gf(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Yf(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Wf(){}var zf=.7,Vf=1/zf,Xf="\\s*([+-]?\\d+)\\s*",Uf="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Hf="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qf=/^#([0-9a-f]{3,8})$/,Zf=RegExp("^rgb\\("+[Xf,Xf,Xf]+"\\)$"),Kf=RegExp("^rgb\\("+[Hf,Hf,Hf]+"\\)$"),$f=RegExp("^rgba\\("+[Xf,Xf,Xf,Uf]+"\\)$"),Jf=RegExp("^rgba\\("+[Hf,Hf,Hf,Uf]+"\\)$"),Qf=RegExp("^hsl\\("+[Uf,Hf,Hf]+"\\)$"),td=RegExp("^hsla\\("+[Uf,Hf,Hf,Uf]+"\\)$"),ed={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 nd(){return this.rgb().formatHex()}function rd(){return this.rgb().formatRgb()}function id(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=qf.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?od(e):3===n?new ud(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?ad(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?ad(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=Zf.exec(t))?new ud(e[1],e[2],e[3],1):(e=Kf.exec(t))?new ud(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=$f.exec(t))?ad(e[1],e[2],e[3],e[4]):(e=Jf.exec(t))?ad(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Qf.exec(t))?pd(e[1],e[2]/100,e[3]/100,1):(e=td.exec(t))?pd(e[1],e[2]/100,e[3]/100,e[4]):ed.hasOwnProperty(t)?od(ed[t]):"transparent"===t?new ud(NaN,NaN,NaN,0):null}function od(t){return new ud(t>>16&255,t>>8&255,255&t,1)}function ad(t,e,n,r){return r>0||(t=e=n=NaN),new ud(t,e,n,r)}function sd(t,e,n,r){return 1===arguments.length?((i=t)instanceof Wf||(i=id(i)),i?new ud((i=i.rgb()).r,i.g,i.b,i.opacity):new ud):new ud(t,e,n,null==r?1:r);var i}function ud(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ld(){return"#"+hd(this.r)+hd(this.g)+hd(this.b)}function cd(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function hd(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function pd(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new dd(t,e,n,r)}function fd(t){if(t instanceof dd)return new dd(t.h,t.s,t.l,t.opacity);if(t instanceof Wf||(t=id(t)),!t)return new dd;if(t instanceof dd)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new dd(a,s,u,t.opacity)}function dd(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function yd(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}Gf(Wf,id,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:nd,formatHex:nd,formatHsl:function(){return fd(this).formatHsl()},formatRgb:rd,toString:rd}),Gf(ud,sd,Yf(Wf,{brighter:function(t){return new ud(this.r*(t=null==t?Vf:Math.pow(Vf,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new ud(this.r*(t=null==t?zf:Math.pow(zf,t)),this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){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:ld,formatHex:ld,formatRgb:cd,toString:cd})),Gf(dd,(function(t,e,n,r){return 1===arguments.length?fd(t):new dd(t,e,n,null==r?1:r)}),Yf(Wf,{brighter:function(t){return new dd(this.h,this.s,this.l*(t=null==t?Vf:Math.pow(Vf,t)),this.opacity)},darker:function(t){return new dd(this.h,this.s,this.l*(t=null==t?zf:Math.pow(zf,t)),this.opacity)},rgb:function(){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 ud(yd(240>t?t+120:t-240,r,n),yd(t,r,n),yd(120>t?t+240:t-120,r,n),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var vd=function(t){return function(){return t}};function gd(t){return 1==(t=+t)?md:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):vd(isNaN(e)?n:e)}}function md(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):vd(isNaN(t)?e:t)}var xd=function t(e){var n=gd(e);function r(t,e){var r=n((t=sd(t)).r,(e=sd(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=md(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);var bd=function(t){function e(e){var n=t.call(this,e)||this;return n._updateInterpolate(),n}return n(e,t),e.prototype.createScale=function(t){return new sf(t)},e.prototype._updateInterpolate=function(){var t,e,n=this.range;this.interpolate=(t=n[0],_(e=n[1])?function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}(t,e):xd(t,e))},e.prototype.update=function(e){t.prototype.update.call(this,e),this._updateInterpolate()},e.prototype._mapping=function(t){var e=this.scale,n=this.interpolate;return y(t)?t.map((function(t){return n(e.scale(t))})):n(e.scale(t))},e.prototype.normalize=function(t){var e=this.scale;return y(t)?t.map((function(t){return e.scale(t)})):e.scale(t)},e.prototype.convert=function(t){var e=this.range,n=e[0],r=e[1];return y(t)?t.map((function(t){return n+(r-n)*t})):n+(r-n)*t},e}(Bf),Md=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.createScale=function(t){return new Vp(t)},e.prototype._mapping=function(t){var e=this.scale,n=this.range;if("cat"===e.type)return n[e.translate(t)%n.length];var r=e.scale(t);return n[Math.round(r*(n.length-1))]},e}(Bf),wd=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.createScale=function(t){return new mf(t)},e.prototype._mapping=function(){var t=this.range;return this.field||t&&t[0]},e}(Bf),Ed=Object.freeze({__proto__:null,Attr:Bf,Linear:bd,Category:Md,Identity:wd}),kd=wd,Sd=bd,Pd=Md,Td=["x","y","color","size","shape"],Nd=["color","size","shape"];function Cd(t,e){return new t.constructor(r(r({},t.__cfg__),e))}var Ad=function(){function t(t,e){this.scaleController=t,this.attrsRange=e,this.options={},this.attrs={}}return t.prototype.parseOption=function(t,e){return t?P(t)?{field:t,type:"category"}:_(t)&&"size"===e?{type:"identity",field:t}:y(t)?{field:t[0],range:t[1]}:t:{type:"identity"}},t.prototype.getAttrOptions=function(t,e){var n=this;if(!t.x||!t.y)throw Error("x, y are required !");var r={},i=this.attrsRange;Td.forEach((function(e){if(t[e]){var o=n.parseOption(t[e],e);o.range||(o.range=i[e]),r[e]=o}}));var o=r.x,a=r.y;return o.justifyContent=e,o.type=Sd,a.type=Sd,r},t.prototype.getDefaultAttrValues=function(){var t=this.attrsRange,e=t.shape;return{color:t.color[0],shape:e&&e[0]}},t.prototype.getGroupScales=function(){var t=this.attrs,e=[];return g(Nd,(function(n){var r=t[n];if(r){var i=r.scale;i&&i.isCategory&&-1===e.indexOf(i)&&e.push(i)}})),e},t.prototype.createAttr=function(t){var e=t.type,n=t.field,i=t.scale;if(p(n)||e===kd)return new kd(t);var o=this.scaleController.getScale(n),a=r(r({},t),{data:this.scaleController.getData(),scale:i?Cd(o,i):o});if(o&&"identity"===o.type)return new kd(a);var s=o.isLinear?Sd:Pd;return h(e)&&(s=e),P(e)&&Ed[F(e)]&&(s=Ed[F(e)]),new s(a)},t.prototype.create=function(t){this.update(t)},t.prototype.update=function(t){var e=this,n=e.scaleController,r=e.options,i=e.attrs,o={};g(t,(function(t,e){Vu(t,r[e])&&(o[e]=i[e]);var a=t.field;a&&n.setScale(a,{justifyContent:t.justifyContent})})),this.options=t,this.attrs=o},t.prototype.getAttr=function(t){var e=this.attrs,n=e[t];if(n)return n;var r=this.options[t];if(!r)return null;var i=this.createAttr(r);return e[t]=i,i},t.prototype.getAttrs=function(){var t=this,e=this.attrs;return g(this.options,(function(e,n){t.getAttr(n)})),e},t.prototype.isGroupAttr=function(t){return-1!==Nd.indexOf(t)},t.prototype.getAttrsByLinear=function(){var t=this.attrs,e=[],n=[];return Object.keys(t).forEach((function(r){if("x"!==r&&"y"!==r){var i=t[r].scale;i&&"linear"===i.type?e.push(r):n.push(r)}else e.push(r)})),{linearAttrs:e,nonlinearAttrs:n}},t}(),Od={Stack:If,Dodge:Lf,Jitter:_f,Symmetric:Df},Rd="origin",Ld=function(t){function e(e,n){var r=t.call(this,e,n)||this;r.isGeometry=!0,r.justifyContent=!1,r.startOnZero=!1,r.connectNulls=!1,r.sortable=!1,V(r,r.getDefaultCfg());var i=e.chart,o=r._getThemeAttrsRange();r.attrController=new Ad(i.scale,o);var a=r.attrController,s=r.getAttrOptions(e);return a.create(s),r}return n(e,t),e.prototype.getDefaultCfg=function(){return{}},e.prototype.getAttrOptions=function(t){var e=this.attrController,n=this.justifyContent,r=!t.coord.isCyclic()||n,i={};return Td.forEach((function(e){return i[e]=t[e]})),e.getAttrOptions(this.context.px2hd(i),r)},e.prototype.willReceiveProps=function(e){var n=this.props,r=this.attrController,i=e.data,o=e.adjust,a=e.selection,s=n.data,u=n.adjust,l=n.selection,c=this.getAttrOptions(n);r.attrsRange=this._getThemeAttrsRange();var h=this.getAttrOptions(e);Vu(h,c)||(r.update(h),this.dataRecords=null),i!==s&&(this.dataRecords=null),o!==u&&(this.dataRecords=null),Vu(a,l)||t.prototype.willReceiveProps.call(this,e)},e.prototype.willMount=function(){this._createAttrs(),this.dataRecords||this._processData()},e.prototype.willUpdate=function(){this._createAttrs(),this.dataRecords?this._readjustData(this.dataRecords):this._processData()},e.prototype.didMount=function(){this._initEvent(),t.prototype.didMount.call(this),this.attrController.attrsRange=this._getThemeAttrsRange()},e.prototype._initEvent=function(){var t=this,e=this.props,n=e.chart;["onPressStart","onPress","onPressEnd","onPan","onPanStart","onPanEnd"].forEach((function(r){e[r]&&n.on(r.substr(2).toLowerCase(),(function(n){n.geometry=t,e[r](n)}))}))},e.prototype._createAttrs=function(){var t=this.attrController;t.attrs={},this.attrs=t.getAttrs()},e.prototype._getThemeAttrsRange=function(){var t=this,e=t.props.coord,n=t.context.theme;return{x:e.x,y:e.y,color:n.colors,size:n.sizes,shape:n.shapes[t.geomType]}},e.prototype._createAdjust=function(){var t=this.attrs,e=this.props.adjust;if(!e)return null;var n="string"==typeof e?{type:e}:e,r=F(n.type),i=Od[r];if(!i)throw Error("not support such adjust : "+e);"Dodge"===r&&(n.adjustNames=["x"]);var o=t.y;n.xField=t.x.field,n.yField=o.field;var a=new i(n);return this.adjust={type:n.type,adjust:a},this.adjust},e.prototype._adjustScales=function(){var t=this,e=t.props,n=e.chart,r=e.startOnZero,i=e.coord,o=e.adjust,a=i.isPolar,s=i.transposed,u=t.attrs.y;(void 0===r?t.startOnZero:r)&&n.scale.adjustStartZero(u.scale),a&&s&&("stack"===o||"stack"===(null==o?void 0:o.type))&&n.scale.adjustPieScale(u.scale),"stack"!==o&&"stack"!==(null==o?void 0:o.type)||n.scale._updateStackRange(u.scale,w(this.dataArray))},e.prototype._groupData=function(t){var e=this.attrController.getGroupScales();if(!e.length)return[{children:t}];var n=[];e.forEach((function(t){n.push(t.field)}));var r=R(t,n),i=[];for(var o in r)i.push({key:o.replace(/^_/,""),children:r[o]});return i},e.prototype._saveOrigin=function(t){for(var e,n=t.length,i=Array(n),o=0;n>o;o++){var a=t[o];i[o]=r(r({},a),((e={})[Rd]=a,e))}return i},e.prototype._numberic=function(t){for(var e=this.attrs,n=[e.x.scale,e.y.scale],r=0,i=t.length;i>r;r++)for(var o=t[r],a=n.length,s=0;a>s;s++){var u=n[s];if(u.isCategory){var l=u.field,c=u.translate(o.origin[l]);o[l]=c}}},e.prototype._adjustData=function(t){var e=this.adjust,n=t.map((function(t){return t.children}));if(!e)return n;for(var r=this.attrs,i=[r.x.scale,r.y.scale],o=0,a=n.length;a>o;o++)for(var s=n[o],u=0,l=s.length;l>u;u++)for(var c=s[u],h=i.length,p=0;h>p;p++){var f=i[p].field;c[f]=c.origin[f]}if("dodge"===e.type)for(o=0,a=n.length;a>o;o++)this._numberic(n[o]);var d=e.adjust.process(n);return t.forEach((function(t,e){t.children=d[e]})),d},e.prototype._processData=function(){var t=this._saveOrigin(this.props.data),e=this._groupData(t);this._createAdjust();var n=this._adjustData(e);this.dataArray=n,this._adjustScales(),this.sortable&&this._sortData(e),this.dataRecords=e},e.prototype._readjustData=function(t){if(this.adjust){var e=this._adjustData(t);this.dataArray=e}},e.prototype._sortData=function(t){var e=this.getXScale(),n=e.field,r=e.type;"identity"!==r&&e.values.length>1&&g(t,(function(t){t.children.sort((function(t,i){if("timeCat"===r)return Ff(t[Rd][n])-Ff(i[Rd][n]);var o=e.translate(t[Rd][n]),a=e.translate(i[Rd][n]);return isNaN(o)?1:isNaN(a)?-1:o-a}))}))},e.prototype.getY0Value=function(){var t=this.props.chart,e=t.getScale(this.attrs.y.field);return t.scale.getZeroValue(e)},e.prototype._getShapeStyle=function(t,e){var n=this,o=n.context.theme.shape[n.geomType]||{},a=o[t],s=n.props.style,u=r(r({},o.default),a);if(!s||!v(s))return u;var l=s.field,c=i(s,["field"]),p=l?e[l]:e;return g(c,(function(t,e){if(h(t)){var n=t(p);if(!n)return;u[e]=n}else u[e]=t})),u},e.prototype._mapping=function(t){for(var e=this,n=e.attrs,i=e.attrController,o=e.props.coord,a=i.getAttrsByLinear(),s=a.linearAttrs,u=a.nonlinearAttrs,l=i.getDefaultAttrValues(),c=[],h=0,p=t.length;p>h;h++){var f=t[h],d=f.children,y=r({},l),v=d[0];if(0!==d.length){for(var g=0,m=u.length;m>g;g++){y[k=u[g]]=(S=n[k]).mapping(v[S.field],v.origin)}for(var x=[],b=0,M=d.length;M>b;b++){var w=d[b],E={};for(g=0;s.length>g;g++){var k,S,P=w[(S=n[k=s[g]]).field];i.isGroupAttr(k)?y[k]=S.mapping(P,w):E[k]=S.normalize(P)}var T=o.convertPoint({x:E.x,y:E.y}),N=T.x,C=T.y,A=y.shape,O=this._getShapeStyle(A,w.origin),R=this.isSelected(w);x.push(r(r(r({},w),y),{normalized:E,x:N,y:C,shapeName:A,shape:O,selected:R}))}c.push(r(r({},f),{children:x}))}else c.push(r({},f))}return c},e.prototype.mapping=function(){return this.records=this._mapping(this.dataRecords),this.records},e.prototype.getClip=function(){var t=this.props,e=t.coord;return t.viewClip?{type:"rect",style:{x:e.left,y:e.top,width:e.width,height:e.height}}:null},e.prototype.getAttr=function(t){return this.attrController.getAttr(t)},e.prototype.getXScale=function(){return this.getAttr("x").scale},e.prototype.getYScale=function(){return this.getAttr("y").scale},e.prototype._getXSnap=function(t){var e=this.getXScale();if(e.isCategory)return e.invert(t);var n=e.invert(t),r=e.values,i=r.length;if(1===i)return r[0];if((r[0]+r[1])/2>n)return r[0];if(n>=(r[i-2]+r[i-1])/2)return r[i-1];for(var o=1;i>o;o++)if(n>=(r[o-1]+r[o])/2&&(r[o+1]+r[o])/2>n)return r[o];return null},e.prototype._getYSnapRecords=function(t,e){var n=this.getYScale(),r=n.field,i=n.invert(t);return e.filter(n.isCategory?function(t){return t[Rd][r]===i}:function(t){var e=t[r];return i>=e[0]&&e[1]>=i})},e.prototype._getXSnapRecords=function(t,e){var n=this.getXScale(),r=n.field,i=n.invert(t);return e.filter(n.isCategory?function(t){return t[Rd][r]===i}:function(t){var e=t[r];return i>=e[0]&&e[1]>=i})},e.prototype.flatRecords=function(){return this.records.reduce((function(t,e){return t.concat(e.children)}),[])},e.prototype.getSnapRecords=function(t,e){var n=this.props,i=n.coord,o=n.adjust,a=i.invertPoint(t),s=this.getXScale(),u=this.getYScale();if(e){var l=s.range,c=u.range;a.x=Math.min(Math.max(a.x,l[0]),l[1]),a.y=Math.min(Math.max(a.y,c[0]),c[1])}var h=this.flatRecords(),p=s.invert(a.x),f=u.invert(a.y),d=i.convertPoint(a),y={x:d.x,y:d.y,xValue:p,yValue:f,xText:s.getText(p),yText:u.getText(f)};if("stack"===o&&i.isPolar)if(i.transposed){if(a.x>=0&&1>=a.x)return this._getYSnapRecords(a.y,h)}else if(a.y>=0&&1>=a.y)return this._getXSnapRecords(a.x,h);var v=[],g=this._getXSnap(a.x);if(function(t){return null===t}(g))return v;for(var m=s.field,x=u.field,b=0,M=h.length;M>b;b++){var w=r(r({},h[b]),{xField:m,yField:x,coord:y}),E=w[Rd][m];("timeCat"===s.type&&Ff(E)===g||E===g)&&v.push(w)}return v},e.prototype.getRecords=function(t,e){void 0===e&&(e="xfield");for(var n=this.flatRecords(),i=this.getXScale(),o=this.getYScale(),a=i.field,s=o.field,u=t[a],l=[],c=0,h=n.length;h>c;c++){var p=r(r({},n[c]),{xField:a,yField:s});p[Rd]["xfield"===e?a:s]===u&&l.push(p)}return l},e.prototype.getLegendItems=function(){var t=this.records,e=this.attrController.getAttr("color");if(!e)return null;var n=e.scale,r=n.field;if(!n.isCategory)return null;var i=t?this.flatRecords():[],o=n.getTicks().map((function(t){var o=t.text,a=t.tickValue,s=M(i,(function(t){return!!t&&t.origin[r]===a})),u=s?s.color:e.mapping(a);return{field:n.field,color:u,name:o,tickValue:a}}));return o},e}(Of),_d=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.getDefaultCfg=function(){return{geomType:"line",sortable:!0}},i.prototype.splitPoints=function(t){for(var e=[],n=[],i=0,o=t.length;o>i;i++){var a=t[i],s=a.x,u=a.y;e.push(r(r({},a),{x:s,y:u[1]})),n.push(r(r({},a),{x:s,y:u[0]}))}return[e,n]},i.prototype.splitNulls=function(t,e){if(e){for(var n=[],r=0,i=t.length;i>r;r++){var o=(u=t[r]).y;if(!isNaN(u.x))if(y(o)){if(isNaN(o[0]))continue;n.push(u)}else isNaN(o)||n.push(u)}return n.length?[n]:[]}var a=[],s=[];for(r=0,i=t.length;i>r;r++){var u;o=(u=t[r]).y;if(!isNaN(u.x))if(y(o)){if(isNaN(o[0])){s.length&&(a.push(s),s=[]);continue}s.push(u)}else isNaN(o)?s.length&&(a.push(s),s=[]):s.push(u)}return s.length&&a.push(s),a},i.prototype.mapping=function(){var t=this,n=e.prototype.mapping.call(this),i=this,o=i.props,a=i.context,s=o.coord,u=o.connectNulls,c=void 0===u?i.connectNulls:u,p=o.sizeZoom;return n.map((function(e){var n,i=e.children,o=i[0]||{},u=o.size,f=o.color,d=o.shape,v=o.y,g=o.origin,m=s.isPolar?l(l([],i,!0),[i[0]],!1):i,x=null!==(n=h(p)?p(g):p)&&void 0!==n?n:1,b=t.splitNulls(m,c).map((function(e){var n=y(v)?t.splitPoints(e):[e,void 0],r=n[0],i=n[1];return{size:a.px2hd(u||d.lineWidth)*x,color:f,shape:d,points:[].concat(r),topPoints:r,bottomPoints:i}}));return r(r({},e),{children:b})}))},i.prototype.concatPoints=function(t,e){if(!e||!e.length)return t;var n=this.adjust;if(n&&"stack"===n.type)return t;var r=t.concat(e.reverse());return r.push(t[0]),r},i.prototype.render=function(){for(var e=this.props,n=e.coord,i=this.mapping(),o=this.getClip(),a=0,s=i.length;s>a;a++)for(var u=i[a].children,l=0,c=u.length;c>l;l++){var h=u[l];h.points=this.concatPoints(h.points,h.bottomPoints)}return vh(t,r({},e,{coord:n,records:i,clip:o}))},i}(Ld)};var Id=function(t){var e=t.records,n=t.coord,i=t.animation,o=t.endView,a=t.clip,s=n.left,u=n.top,l=n.width,c=n.height,h=n.center,p=n.startAngle,f=n.endAngle,d=n.radius,y=n.isPolar?{easing:"quadraticOut",duration:450,clip:{type:"sector",property:["endAngle"],style:{cx:h.x,cy:h.y,startAngle:"".concat(p,"rad"),r:d},start:{endAngle:"".concat(p,"rad")},end:{endAngle:"".concat(f,"rad")}}}:{easing:"quadraticOut",duration:450,clip:{type:"rect",property:["width"],style:{x:s,y:u,height:c},start:{width:0},end:{width:l}}};return vh("group",{style:{clip:a}},e.map((function(t){var e,n=t.key,a=t.children,s=function(t){for(var e=[],n=0;t.length>n;n++)e=e.concat(t[n].points);return e}(a),u={current:null};return vh("group",{key:n},a.map((function(t){var e=t.color,o=t.size,a=t.shape,s=t.points.filter((function(t){return!isNaN(t.x)&&!isNaN(t.y)}));if(0!==s.length)return vh("polyline",{key:n,ref:u,style:r(r({points:s.map((function(t){return[t.x,t.y]})),stroke:e},a),{lineWidth:o||a.lineWidth}),animation:q({update:{easing:"linear",duration:450,property:["points"]},appear:y},i)})})),o?vh("group",{style:{offset:u},animation:q({appear:{easing:"quadraticOut",duration:450,property:["offsetDistance"],start:{offsetDistance:0},end:{offsetDistance:1}}},i)},vh(o,{origin:null===(e=s[0])||void 0===e?void 0:e.origin})):null)})))},Dd=_d(Id),Fd=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.getDefaultCfg=function(){return{geomType:"area",startOnZero:!0,sortable:!0}},i.prototype.getBaseY=function(){var t=this.getY0Value(),e=this.props,n=e.coord,r=e.startOnZero;return(void 0===r?this.startOnZero:r)?n.convertPoint({x:0,y:t}).y:n.y[0]},i.prototype.mapping=function(){for(var t=e.prototype.mapping.call(this),n=this.getBaseY(),r=0,i=t.length;i>r;r++)for(var o=t[r].children,a=0,s=o.length;s>a;a++){var u=o[a],l=u.points,c=u.bottomPoints;c&&c.length?(c.reverse(),u.points=l.concat(c)):(l.unshift({x:l[0].x,y:n}),l.unshift({x:l[l.length-1].x,y:n}))}return t},i.prototype.render=function(){var e=this.props,n=e.coord,i=this.mapping(),o=this.getClip(),a=this.getBaseY();return vh(t,r({},e,{baseY:a,coord:n,records:i,clip:o}))},i}(_d(t))},Bd=function(t){var e=t.coord,n=t.records,i=t.baseY,o=t.animation,a="smooth"===t.shape,s=e.left,u=e.top,l=e.width,c=e.height,h=e.center,p=e.startAngle,f=e.endAngle,d=e.radius,y=e.isPolar?{easing:"quadraticOut",duration:450,clip:{type:"sector",property:["endAngle"],style:{cx:h.x,cy:h.y,startAngle:"".concat(p,"rad"),r:d},start:{endAngle:"".concat(p,"rad")},end:{endAngle:"".concat(f,"rad")}}}:{easing:"quadraticOut",duration:450,clip:{type:"rect",property:["width"],style:{x:s,y:u,height:c},start:{width:0},end:{width:l}}};return vh("group",null,n.map((function(t){return vh("group",{key:t.key},t.children.map((function(t){var e=t.points,n=t.topPoints,s=t.bottomPoints,u=t.color,l=t.shape;if(a){return vh("path",{style:r({path:function(){var t=[],e=[[0,0],[1,1]],r=Lu(n,!1,e);t.push(["M",n[0].x,n[0].y]);for(var o=0,a=r.length;a>o;o++){t.push(["C",(l=r[o])[1],l[2],l[3],l[4],l[5],l[6]])}if(s&&s.length){var u=Lu(s,!1,e);t.push(["L",s[0].x,s[0].y]);for(o=0,a=u.length;a>o;o++){var l;t.push(["C",(l=u[o])[1],l[2],l[3],l[4],l[5],l[6]])}}else t.push(["L",n[n.length-1].x,i]),t.push(["L",n[0].x,i]);return t}(),lineWidth:"2px",fill:u},l)})}return vh("polygon",{style:r({points:e.map((function(t){return[t.x,t.y]})),lineWidth:"2px",fill:u},l),animation:q({appear:y,update:{easing:"linear",duration:450,property:["points"]}},o)})})))})))},jd=Fd(Bd);function Gd(t,e){return{x:(e.x-t.x)/2+t.x,y:(e.y-t.y)/2+t.y}}var Yd={textBaseline:"middle",fill:"#808080"};function Wd(t){var e,n,r,i,o=t.record,a=t.offsetX,s=t.offsetY,u=t.points,l=t.label,c=t.guide,p=o.origin,f=o.color;h(l)&&(n=V({x:(i=4===u.length?Gd(u[1],u[2]):Gd(u[0],u[1])).x+a,y:i.y+s},Yd,l(p,f)));h(c)&&(r=V({x:(i=Gd(4===u.length?Gd(u[0],u[1]):u[0],Gd(u[2],null!==(e=u[3])&&void 0!==e?e:u[1]))).x,y:i.y,textBaseline:"middle",textAlign:"center"},Yd,c(p,f)));return vh("group",null,n&&vh("text",{attrs:n}),r&&vh("text",{attrs:r}))}var zd=Object.freeze({__proto__:null,pyramid:Wd,funnel:Wd}),Vd=function(t){return function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),r.prototype.getDefaultCfg=function(){return{geomType:"interval",justifyContent:!0,startOnZero:!0}},r.prototype.getDefaultSize=function(){var t=this,e=t.props,n=t.adjust,r=e.coord,i=e.sizeRatio,o=t.attrs.x.scale.values;if(i)return 1/o.length*i;var a=1/o.length*(r.isPolar?r.transposed&&o.length>1?3/4:.999999:.5);return n&&"dodge"===n.type?a/t.records.length:a},r.prototype.mapping=function(){for(var t,n=e.prototype.mapping.call(this),r=this.props,i=r.coord,o=r.sizeZoom,a=this.getY0Value(),s=this.getDefaultSize(),u=0,l=n.length;l>u;u++)for(var c=n[u].children,f=0,d=c.length;d>f;f++){var y=c[f],v=y.normalized,g=y.size,m=y.origin;if(p(g)){var x=v.x,b=v.y,M=v.size,w=void 0===M?s:M,E=null!==(t=h(o)?o(m):o)&&void 0!==t?t:1;V(y,i.convertRect({x:x,y:b,y0:a,size:w*E}))}else{V(y,i.transformToRect({size:g,x:x=y.x,y:b=y.y,y0:a}))}V(y.shape,this.getSelectionStyle(y))}return n},r.prototype.getPointY0=function(){var t=this.props.coord,e=this.getY0Value(),n=t.convertPoint({y:e,x:0});return null==n?void 0:n.y},r.prototype.render=function(){var e=this.props,n=this.state,r=e.coord,i=e.shape,o=void 0===i?"rect":i,a=e.animation,s=e.showLabel,u=e.labelCfg,l=h(t)?t:t[o],c=zd[o],p=q({label:null,offsetX:0,offsetY:0},u);if(!l)return null;var f=n.selected;return vh(l,{coord:r,records:this.mapping(),selected:f,shape:o,animation:a,showLabel:s,labelCfg:p,LabelView:c,y0:this.getPointY0(),clip:this.getClip()})},r}(Ld)},Xd=function(t){var e=t.animation,n=t.y0,i=t.onClick;return vh("group",{attrs:{clip:t.clip}},t.records.map((function(t){return vh("group",{key:t.key},t.children.map((function(t){var o=t.key,a=t.xMin,s=t.xMax,u=t.yMin,l=t.yMax,c=t.color,h=t.shape;return isNaN(a)||isNaN(s)||isNaN(u)||isNaN(l)?null:vh("rect",{key:o,attrs:r({x:a,y:u,width:s-a,height:l-u,fill:c},h),onClick:i,animation:q({appear:{easing:"linear",duration:450,property:["y","height"],start:{y:n,height:0}},update:{easing:"linear",duration:450,property:["x","y","width","height"]}},e)})})))})))},Ud=function(t){var e=t.coord,n=t.records,i=t.animation,o=t.onClick,a=e.center,s=e.startAngle,u=e.endAngle,l=e.radius;return vh("group",{animation:{appear:r({easing:"quadraticOut",duration:450,clip:{type:"sector",property:["endAngle"],style:{cx:a.x,cy:a.y,startAngle:"".concat(s,"rad"),r:l},start:{endAngle:"".concat(s,"rad")},end:{endAngle:"".concat(u,"rad")}}},i&&i.appear)}},n.map((function(t){return vh("group",{key:t.key},t.children.map((function(t){var e=t.xMax,n=t.yMin,s=t.yMax,u=t.shape;return vh("sector",{key:t.key,attrs:r({cx:a.x,cy:a.y,fill:t.color,lineWidth:1,startAngle:"".concat(t.xMin,"rad"),endAngle:"".concat(e,"rad"),r0:n,r:s},u),onClick:o,animation:q({update:{easing:"linear",duration:450,property:["x","y","startAngle","endAngle","r0","r"]}},i)})})))})))},Hd=function(t){return vh("rect"===t.coord.type?Xd:Ud,r({},t))};function qd(t){var e=t.xMin,n=t.xMax,r=t.yMin,i=t.yMax;return[{x:e,y:r},{x:n,y:r},{x:n,y:i},{x:e,y:i}]}var Zd=function(t){var e=t.records,n=t.shape,i=t.showLabel,o=t.labelCfg,a=t.LabelView,s=!1;return vh("group",null,e.map((function(t,u){var l=t.key,c=t.children,h=u===e.length-1,p=(h?t:e[u+1]).children,f=qd(p[0]),d=qd(p[p.length-1]);return s||(s=p[0].yMax>c[0].yMax),s&&(f.reverse(),d.reverse()),vh("group",{key:l},c.map((function(t,e){var i=qd(t);return s&&i.reverse(),h?"pyramid"===n&&(i=[Gd(i[0],i[1]),i[2],i[3]]):(0===e&&(i[0]=f[3]),e===c.length-1&&(i[1]=d[2])),r(r({},t),{points:i})})).map((function(t){var e=t.points,n=t.color,s=t.shape;return vh("group",null,vh("polygon",{attrs:r({points:e.map((function(t){return[t.x,t.y]})),fill:n},s)}),i&&a?vh(a,r({record:t,points:e},o)):null)})))})))},Kd=Vd(Object.freeze({__proto__:null,rect:Hd,pyramid:Zd,funnel:Zd})),$d=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.getDefaultCfg=function(){return{geomType:"point"}},i.prototype.render=function(){var e=this.props,n=e.coord,i=this.mapping(),o=this.getClip();return vh(t,r({},e,{coord:n,records:i,clip:o}))},i}(Ld)},Jd=function(t){var e=t.animation;return vh("group",{attrs:{clip:t.clip}},t.records.map((function(t){var n=t.key;return vh("group",{key:n},t.children.map((function(t){var i=t.x,o=t.y,a=t.size,s=t.color,u=t.shapeName,l=t.shape;if(isNaN(i)||isNaN(o))return null;if("rect"===u){var c=p(a)?l.size:a;return vh("rect",{key:n,attrs:r(r({x:i-c,y:o-c,fill:s,stroke:s},l),{width:2*c,height:2*c}),animation:q({appear:{easing:"linear",duration:450},update:{easing:"linear",duration:450,property:["x","y","width","height","fill"]}},e)})}return vh("circle",{key:n,style:r(r({cx:i,cy:o,fill:"circle"===u?s:null,stroke:"hollowCircle"===u?s:null},l),{r:p(a)?l.size:a}),animation:q({appear:{easing:"linear",duration:450},update:{easing:"linear",duration:450,property:["cx","cy","r","fill"]}},e)})})))})))},Qd=$d(Jd),ty=function(t){return function(e){function i(t){var n=e.call(this,t)||this;n.axisStyle={};var r=t.chart,i=t.field,o=n.getScaleOption(t);return r.setScale(i,o),n}return n(i,e),i.prototype.willReceiveProps=function(t){var e=this.props,n=t.chart,r=t.field,i=this.getScaleOption(t);Vu(i,this.getScaleOption(e))||n.setScale(r,i)},i.prototype.willMount=function(){this.updateCoord()},i.prototype.willUpdate=function(){this.updateCoord()},i.prototype.getScaleOption=function(t){return{type:t.type,tickCount:t.tickCount,range:t.range,mask:t.mask,formatter:t.formatter,min:t.min,max:t.max,nice:t.nice,ticks:t.ticks}},i.prototype._getDimType=function(){var t=this.props,e=t.field,n=t.chart.getXScales().filter((function(t){return t.field===e}));return n.length>0?"x":"y"},i.prototype.getMaxBBox=function(t,e){var n=this.context.measureText,i=e.label,o=e.labelOffset,a=0,s=0;return t.forEach((function(t){if(i){var e=t.labelStyle,o=void 0===e?{}:e,u=n(o.text||t.text,r(r({},i),o));a=Math.max(a,u.width),s=Math.max(s,u.height)}})),a||s?{width:a+o,height:s+o}:{width:a,height:s}},i.prototype._getPosition=function(){var t=this.props,e=t.position,n=t.coord;if(e)return e;var r=this._getDimType();return n.transposed?"x"===r?"left":"bottom":"x"===r?"bottom":"left"},i.prototype.getTicks=function(){var t=this.props,e=t.chart.getScale(t.field).getTicks();return e=this._setTicksStyle(e),e=this._generateGridPoints(e)},i.prototype._generateGridPoints=function(t){var e=this.props,n=e.chart,r=e.coord;if(!r.isPolar)return t;if("y"!==this._getDimType())return t;var i=n.getXScales()[0].getTicks();return t.forEach((function(t){var e=i.map((function(e){return r.convertPoint({x:e.value,y:t.value})}));e.push(e[0]),t.gridPoints=e})),t},i.prototype._setTicksStyle=function(t){var e=this,n=this.context,r=n.px2hd,i=this.props.style,o=void 0===i?{}:i,a=n.theme.axis;return g(a,(function(t,n){if(null!==o[n]){var i=h(o[n])?void 0:o[n];e.axisStyle[n]=P(t)||_(t)?r(i)||t:y(i)?i.map((function(e){return r(q(X(t),e))})):r(q(X(t),i))}})),t.map((function(e,n){var i=o.label,s=o.grid,u=a.label,l=a.grid;return h(i)&&(e.labelStyle=r(V({},u,i(e.text,n,t)))),h(s)&&(e.gridStyle=r(V({},l,s(e.text,n,t.length)))),e}))},i.prototype.convertTicks=function(t){var e=this.props.coord,n=this._getDimType(),i="x"===n?"y":"x";return t.map((function(t){var o,a,s=e.convertPoint(((o={})[n]=t.value,o[i]=0,o)),u=e.convertPoint(((a={})[n]=t.value,a[i]=1,a));return r(r({},t),{points:[s,u]})}))},i.prototype.measureLayout=function(){var t=this.props,e=this.context,n=t.coord;if(!1===t.visible)return null;var r=t.style||{},i=r.width,o=r.height,a=this.getTicks(),s=this.getMaxBBox(a,this.axisStyle),u=n.isPolar,l=this._getDimType(),c=p(i)?s.width:e.px2hd(i),h=p(o)?s.height:e.px2hd(o);return u?"y"===l?null:["top","right","bottom","left"].map((function(t){return{position:t,width:c,height:h}})):{position:this._getPosition(),width:c,height:h}},i.prototype.updateCoord=function(){var t=this.props.chart,e=this.measureLayout();t.updateCoordFor(this,e)},i.prototype.render=function(){var e=this.props,n=this.axisStyle,i=e.coord;if(!1===e.visible)return null;var o=this.getTicks(),a=this._getPosition(),s=this._getDimType();return vh(t,r({},e,{style:n,ticks:this.convertTicks(o),coord:i,position:a,dimType:s}))},i}(on)};function ey(t,e,n){var r=e.x-t.x,i=e.y-t.y,o=me([r,i]),a=o+n;return{x:t.x+r/o*a,y:t.y+i/o*a}}function ny(t,e){var n=[e.x-t.x,e.y-t.y];return{textAlign:n[0]>0?"left":0>n[0]?"right":"center",textBaseline:n[1]>0?"top":0>n[1]?"bottom":"middle"}}var ry=function(t){var e=t.line,n=t.center,i=t.ticks;if(!e)return null;if("line"!==t.gridType)return vh("arc",{attrs:r({cx:n.x,cy:n.y,r:t.radius,startAngle:0,endAngle:360},e)});var o=i.map((function(t){var e=t.points;return e[e.length-1]}));return o.push(o[0]),vh("polyline",{attrs:r({points:o.map((function(t){return[t.x,t.y]}))},e)})},iy=function(t){var e=t.style,n=t.grid,i=t.coord.center,o=e.grid,a=e.tickLine,s=e.line,u=e.labelOffset,l=e.label,c=t.ticks.filter((function(t){return!isNaN(t.value)})),h=c[0].points,p=h[h.length-1],f=me([p.x-i.x,p.y-i.y]);return vh("group",null,o?c.map((function(t){var e=t.points,n=t.gridStyle,a=e[e.length-1];return vh("line",{attrs:r(r({x1:i.x,y1:i.y,x2:a.x,y2:a.y},o),n)})})):null,a&&a.length?c.map((function(t){var e=t.points,n=e[e.length-1],o=ey(i,n,a.length);return vh("line",{attrs:r({x1:n.x,y1:n.y,x2:o.x,y2:o.y},a)})})):null,vh(ry,{line:s,gridType:n,center:i,radius:f,ticks:c}),l?c.map((function(t){var e=t.points,n=t.text,o=t.labelStyle,a=e[e.length-1],s=ey(i,a,u);return vh("text",{attrs:r(r(r({x:s.x,y:s.y,text:n},ny(i,a)),l),o)})})):null)},oy=function(t){var e=t.style,n=t.grid,i=t.coord.center,o=e.grid,a=e.tickLine,s=e.line,u=e.labelOffset,l=e.label,c=t.ticks.filter((function(t){return!isNaN(t.value)}));return vh("group",null,o?c.map((function(t){var e=t.points,a=t.gridStyle,s=t.gridPoints,u=e[e.length-1];return"line"!==n?vh("arc",{style:r(r({cx:i.x,cy:i.y,startAngle:0,endAngle:360,r:me([u.x-i.x,u.y-i.y])},o),a)}):vh("polyline",{attrs:r(r({points:s.map((function(t){return[t.x,t.y]}))},o),a)})})):null,a&&a.length?c.map((function(t){var e=t.points,n=e[e.length-1];return vh("line",{attrs:r({x1:n.x,y1:n.y,x2:n.x-a.length,y2:n.y},a)})})):null,s?vh("line",{attrs:r({x1:c[0].points[0].x,y1:c[0].points[0].y,x2:c[c.length-1].points[0].x,y2:c[c.length-1].points[0].y},s)}):null,l?c.map((function(t){var e=t.points,n=t.labelStyle,i=e[e.length-1];return vh("text",{attrs:r(r({x:i.x-u,y:i.y,text:t.text,textAlign:"right",textBaseline:"middle"},l),n)})})):null)},ay=function(t,e){var n=t.coord,o=t.style,a=e.px2hd,s=n.left,u=n.top,l=n.right,c=o.grid,h=o.tickLine,p=o.line,f=o.labelOffset,d=o.label,v=o.symbol,g=t.ticks.filter((function(t){return!isNaN(t.value)})),m=y(v)?v:[v],x=h||{},b=x.length,M=i(x,["length"]);return vh("group",null,c?g.map((function(t){var e=t.points,n=t.gridStyle,i=e[0],o=e[e.length-1];return vh("line",{key:"grid-".concat(t.tickValue),style:r(r({x1:i.x,y1:i.y,x2:o.x,y2:o.y},c),n)})})):null,h&&h.length?g.map((function(t){var e=t.points,n=e[e.length-1];return vh("line",{key:"tickLine-".concat(t.tickValue),style:r({x1:n.x,y1:n.y,x2:n.x,y2:n.y-a(b)},M)})})):null,m[0]?vh("marker",{style:r(r({x:l,y:u,transform:"rotate(90deg)",transformOrigin:"50% 50%"},m[0]),{symbol:m[0].type})}):null,p?vh("line",{style:r({x1:s,y1:u,x2:l,y2:u},p)}):null,m[1]?vh("marker",{style:r(r({x:s,y:u,transform:"rotate(-90deg)",transformOrigin:"50% 50%"},m[0]),{symbol:m[1].type})}):null,d?g.map((function(t,e){var n=t.points,i=t.text,o=t.labelStyle,a=n[n.length-1];return vh("text",{key:"text-".concat(t.tickValue),style:r(r({x:a.x,y:a.y-f,textAlign:"center",textBaseline:"bottom",text:i},d),o)})})):null)},sy=function(t,e){var n=t.ticks,o=t.coord,a=t.style,s=t.animation,u=e.px2hd,l=e.measureText,c=o.left,h=o.right,p=o.bottom,f=a.grid,d=a.tickLine,v=a.line,g=a.labelOffset,m=a.label,x=a.symbol,b=n.filter((function(t){return!isNaN(t.value)})),M=y(x)?x:[x],w=d||{},E=w.length,k=i(w,["length"]);return vh("group",null,f?b.map((function(t){var e=t.points,n=t.gridStyle,i=e[0],o=e[e.length-1];return vh("line",{key:"grid-".concat(t.tickValue),style:r(r({x1:i.x,y1:i.y,x2:o.x,y2:o.y},f),n)})})):null,E?b.map((function(t){var e=t.points[0];return vh("line",{key:"tickLine-".concat(t.tickValue),style:r({x1:e.x,y1:e.y,x2:e.x,y2:e.y+u(E)},k)})})):null,M[0]?vh("marker",{style:r(r({x:h,y:p,transform:"rotate(90deg)",transformOrigin:"50% 50%"},M[0]),{symbol:M[0].type})}):null,v?vh("line",{style:r({x1:c,y1:p,x2:h,y2:p},v)}):null,M[1]?vh("marker",{style:r(r({x:c,y:p,transform:"rotate(-90deg)",transformOrigin:"50% 50%"},M[0]),{symbol:M[1].type})}):null,m?b.map((function(t,e){var i=t.text,o=t.tickValue,a=t.labelStyle,u=t.points[0],p=u.x,f=(a||m||{}).align,d=void 0===f?"center":f,y=r(r({x:p,y:u.y+g,textBaseline:"top",text:i},m),a);if("between"===d)y.textAlign=0===e?"start":e===n.length-1?"end":"center";else if("auto"===d){y.textAlign="center";var v=l(i,y).width,x=v/2;c>p-x?y.x=c+v/2:p+x>h&&(y.x=h-v/2)}else y.textAlign=d;return vh("text",{key:"text-".concat(o),style:y,animation:s||{appear:{easing:"linear",duration:300,delay:0,property:["fillOpacity"],start:{fillOpacity:0},end:{fillOpacity:1}},update:{easing:"linear",duration:450,delay:0,property:["x","y"]},leave:{easing:"linear",duration:450,delay:0,property:["fillOpacity"],start:{fillOpacity:1},end:{fillOpacity:0}}}})})):null)},uy=function(t,e){var n=t.coord,o=t.style,a=e.px2hd,s=n.top,u=n.right,l=n.bottom,c=o.grid,h=o.tickLine,p=o.line,f=o.labelOffset,d=o.label,v=o.symbol,g=t.ticks.filter((function(t){return!isNaN(t.value)})),m=y(v)?v:[v],x=h||{},b=x.length,M=i(x,["length"]);return vh("group",null,c?g.map((function(t){var e=t.points,n=t.gridStyle,i=e[0],o=e[e.length-1];return vh("line",{key:"grid-".concat(t.tickValue),style:r(r({x1:i.x,y1:i.y,x2:o.x,y2:o.y},c),n)})})):null,b?g.map((function(t){var e=t.points,n=e[e.length-1];return vh("line",{key:"tickLine-".concat(t.tickValue),style:r({x1:n.x,y1:n.y,x2:n.x+a(b),y2:n.y},M)})})):null,m[0]?vh("marker",{style:r(r({x:u,y:s},m[0]),{symbol:m[0].type})}):null,p?vh("line",{style:r({x1:u,y1:s,x2:u,y2:l},p)}):null,m[1]?vh("marker",{style:r(r({x:u,y:l,transform:"rotate(180deg)",transformOrigin:"50% 50%"},m[1]),{symbol:m[1].type})}):null,d?g.map((function(t,e){var n=t.points,i=t.text,o=t.labelStyle,a=n[n.length-1];return vh("text",{key:"text-".concat(t.tickValue),style:r(r({x:a.x+f,y:a.y,textAlign:"left",textBaseline:"middle",text:i},d),o)})})):null)},ly=function(t,e){var n=t.coord,o=t.style,a=t.animation,s=e.px2hd,u=n.left,l=n.top,c=n.bottom,h=o.grid,p=o.tickLine,f=o.line,d=o.labelOffset,v=o.label,g=o.symbol,m=t.ticks.filter((function(t){return!isNaN(t.value)})),x=y(g)?g:[g],b=p||{},M=b.length,w=i(b,["length"]);return vh("group",null,h?m.map((function(t){var e=t.points,n=t.gridStyle,i=e[0],o=e[e.length-1];return vh("line",{key:"grid-".concat(t.tickValue),style:r(r({x1:i.x,y1:i.y,x2:o.x,y2:o.y},h),n)})})):null,M?m.map((function(t){var e=t.points[0];return vh("line",{key:"tickLine-".concat(t.tickValue),style:r({x1:e.x,y1:e.y,x2:e.x-s(M),y2:e.y},w)})})):null,x[0]?vh("marker",{style:r(r({x:u,y:l},x[0]),{symbol:x[0].type})}):null,f?vh("line",{style:r({x1:u,y1:l,x2:u,y2:c},f)}):null,x[1]?vh("marker",{style:r(r({x:u,y:c,transform:"rotate(180deg)",transformOrigin:"50% 50%"},x[1]),{symbol:x[1].type})}):null,v?m.map((function(t,e){var n=t.text,i=t.labelStyle,o=t.points[0];return vh("text",{key:"text-".concat(t.tickValue),style:r(r({x:o.x-d,y:o.y,textAlign:"right",textBaseline:"middle",text:n},v),i),animation:a||{appear:{easing:"linear",duration:300,delay:0,property:["fillOpacity"],start:{fillOpacity:0},end:{fillOpacity:1}},update:{easing:"linear",duration:450,delay:0,property:["x","y"]},leave:{easing:"linear",duration:450,delay:0,property:["fillOpacity"],start:{fillOpacity:1},end:{fillOpacity:0}}}})})):null)};var cy=function(t){if(function(t){return t.coord.isPolar}(t))return vh("x"===t.dimType?iy:oy,r({},t));var e=t.position;return vh("right"===e?uy:"left"===e?ly:"top"===e?ay:sy,r({},t))},hy=ty(cy),py=function(t){return function(e){function i(t){var n=e.call(this,t)||this;return n._onclick=function(t){var e,i=n.props,o=i.chart,a=i.clickable,s=i.onClick;if(void 0===a||a){var u=t.currentTarget;if(u){var l=u.config["data-item"];if(l){h(s)&&s(l);var c=l.field,p=l.tickValue,f=n.state.filtered,d=r(r({},f),((e={})[p]=!f[p],e));n.setState({filtered:d}),o.filter(c,(function(t){return!d[t]}))}}}},n.state={filtered:{},items:[]},n}return n(i,e),i.prototype.getOriginItems=function(){return this.props.chart.getLegendItems()},i.prototype.getItems=function(){var t,e=this.props,n=this.state.filtered,i=(null===(t=e.items)||void 0===t?void 0:t.length)?e.items:this.getOriginItems();return i?i.map((function(t){var e=t.tickValue;return r(r({},t),{filtered:n[e]})})):null},i.prototype.setItems=function(t){this.setState({items:t})},i.prototype.getMaxItemBox=function(t){var e=0,n=0;return(t.children||[]).forEach((function(t){var r=t.layout,i=r.height;e=Math.max(e,r.width),n=Math.max(n,i)})),{width:e,height:n}},i.prototype._init=function(){var t=this.props,e=this.context,n=t.layout,r=t.width,i=t.height,o=t.position,a=void 0===o?"top":o,s=this.getItems();if(s&&s.length){var u=n.left,l=n.top,c=n.width,h=n.height,p=e.px2hd(r)||c,f=rc(this,this.render()),d=this.getMaxItemBox(f),y=d.width,v=d.height,g=Math.max(1,Math.floor(p/y)),m=Math.ceil(s.length/g),x=p/g,b=v*m,M={left:u,top:l,width:p,height:void 0,flexDirection:"row",flexWrap:"wrap",alignItems:"center",justifyContent:"flex-start"};1===m&&(M.justifyContent="space-between"),"top"===a&&(M.height=i||b),"left"===a&&(M.flexDirection="column",M.justifyContent="center",M.width=y,M.height=i||h),"right"===a&&(M.flexDirection="column",M.alignItems="flex-start",M.justifyContent="center",M.width=y,M.height=i||h,M.left=u+(p-y)),"bottom"===a&&(M.top=l+(h-b),M.height=i||b),this.itemWidth=x,this.legendStyle=M}},i.prototype.updateCoord=function(){var t=this,e=t.props,n=t.legendStyle,r=e.position,i=void 0===r?"top":r,o=e.margin,a=e.chart,s=n.width,u=n.height,l=t.context.px2hd(void 0===o?"30px":o);a.updateCoordFor(this,{position:i,width:s+l,height:u+l})},i.prototype.willMount=function(){var t=this.getItems();t&&t.length&&(this._init(),this.updateCoord())},i.prototype.didMount=function(){},i.prototype.willUpdate=function(){var t=this.getItems();t&&t.length&&(this._init(),this.updateCoord())},i.prototype.render=function(){var e=this,n=e.props,i=e.itemWidth,o=e.legendStyle,a=this.getItems();return a&&a.length?vh(t,r({},n,{items:a,itemWidth:i,style:r(r({},o),n.style),onClick:this._onclick})):null},i}(on)},fy=function(t){var e=t.items,n=t.itemWidth,i=t.itemFormatter,o=t.marker,a=void 0===o?"circle":o,s=t.itemStyle,u=t.nameStyle,l=t.valueStyle,c=t.valuePrefix,p=t.onClick,f=function(t,e){return void 0===e&&(e=": "),"".concat(e).concat(t)};return vh("group",{style:r({display:"flex"},t.style)},e.map((function(t){var e=t.color,o=t.name,d=t.value,y=t.filtered,v=t.tickValue,g=h(i)?i(d,v):d;return vh("group",{className:"legend-item",style:r({width:n,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",padding:["6px","6px","6px",0]},s),"data-item":t,onClick:p},function(t){var e=t.type,n=t.color;return"square"===e?vh("rect",{style:{width:"12px",height:"12px",marginRight:"10px"},attrs:{fill:n}}):"line"===e?vh("line",{style:{width:"19px",marginRight:"10px"},attrs:{stroke:n,lineCap:"round",lineWidth:"4px"}}):vh("circle",{style:{width:"12px",height:"12px",marginRight:"10px",fill:n}})}({color:y?"#bfbfbf":e,type:a}),vh("text",{attrs:r({fill:y?"#bfbfbf":"#808080",text:o},u)}),g?vh("text",{attrs:r({fill:"#808080",text:f(g,c)},l)}):null)})))},dy=py(fy);function yy(t){return function(e){function i(t){return e.call(this,t)||this}return n(i,e),i.prototype.getGuideBBox=function(){var t=rc(this,this.render()).layout;if(t)return t},i.prototype.parseReplaceStr=function(t,e){var n={min:0,max:1,median:.5};return p(n[t])?P(t)&&-1!=t.indexOf("%")&&!isNaN(Number(t.slice(0,-1)))?Number(t.slice(0,-1))/100:e.scale(t):n[t]},i.prototype.parsePoint=function(t){var e=this.props,n=e.chart,r=e.coord,i=n.getXScales()[0],o=n.getYScales()[0],a=this.parseReplaceStr(t[i.field],i),s=this.parseReplaceStr(t[o.field],o);return r.convertPoint({x:a,y:s})},i.prototype.convertPoints=function(t){var e=this;return t.map((function(t){return e.parsePoint(t)}))},i.prototype.getGuideTheme=function(){return this.context.theme.guide},i.prototype.render=function(){var e=this.props,n=this.context,i=e.coord,o=e.records,a=e.animation,s=e.chart,u=e.style,l=e.onClick,c=e.visible;if(void 0===c||c){var p=n.width,f=n.height,d=this.convertPoints(void 0===o?[]:o),y=this.getGuideTheme();return vh("group",{onClick:function(t){l&&l(t)}},vh(t,r({points:d,theme:y,coord:i},e,{canvasWidth:p,canvasHeight:f,style:h(u)?u(d,s):u,animation:h(a)?a(d,s):a})))}},i}(on)}var vy={offsetX:0,offsetY:0,points:[],src:""},gy={offsetX:0,offsetY:0,points:[],direct:"tl",side:"8px",autoAdjust:!0},my={container:{fill:"#1677FF",radius:"4px",padding:["4px","8px"]},text:{fontSize:"22px",fill:"#fff"},arrow:{fill:"#1677FF"}},xy=function(t){var e=t.content,n=t.textStyle,i=t.animation,o=void 0===i?{}:i;return vh("rect",{style:r({display:"flex",fill:my.container.fill,padding:my.container.padding,radius:my.container.radius},t.background),animation:o},vh("text",{style:r({text:e,fontSize:my.text.fontSize,fill:my.text.fill},n),animation:o}))},by=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.render=function(){var t=this.props,e=this.context,n=(0,e.px2hd)(r(r({},gy),t)),i=n.points,o=n.content,a=n.offsetX,s=n.offsetY,u=n.direct,l=n.side,c=n.autoAdjust,h=n.canvasWidth,p=n.canvasHeight,f=n.background,d=n.textStyle,y=n.animation,v=i[0]||{},g=v.x,m=v.y;if(isNaN(g)||isNaN(m))return null;var x=e.px2hd(a),b=e.px2hd(s),M=g+(x||0),w=m+(b||0),E=rc(this,vh(xy,{content:o,background:f,textStyle:d})).layout,k=E.width,S=E.height,P=c?function(t){var e=u,n=t.x,r=t.y,i=e[0],o=e[1];"t"===i&&0>r-l-S?i="b":"b"===i&&r+l+S>p&&(i="t");var a="c"===i?l:0;return"l"===o&&0>n-a-k?o="r":"r"===o&&n+a+k>h?o="l":"c"===o&&(k/2+n+a>h?o="l":0>n-k/2-a&&(o="r")),e=i+o}(i[0]):u,T=function(t){var e=[];return"tl"===t?(e=[{x:k,y:S-1},{x:k,y:S+l},{x:k-l,y:S-1}],M-=k||0,w=w-(S||0)-l):"cl"===t?(e=[{x:k,y:S/2-l},{x:k,y:S/2+l},{x:k+l,y:S/2}],M=M-(k||0)-l,w-=S/2||0):"bl"===t?(e=[{x:k,y:-l},{x:k,y:1},{x:k-l,y:1}],M-=k||0,w+=l):"bc"===t?(e=[{x:k/2,y:-l},{x:k/2-l,y:1},{x:k/2+l,y:1}],M-=k/2||0,w+=l):"br"===t?(e=[{x:0,y:-l},{x:0,y:1},{x:+l,y:1}],w+=l):"cr"===t?(e=[{x:-l,y:S/2},{x:0,y:S/2-l},{x:0,y:S/2+l}],M+=l,w-=S/2||0):"tr"===t?(e=[{x:0,y:S+l},{x:0,y:S-1},{x:l,y:S-1}],w=w-(S||0)-l):"tc"===t&&(e=[{x:k/2,y:S+l},{x:k/2-l,y:S-1},{x:k/2+l,y:S-1}],M-=k/2||0,w=w-S-l),e}(P);return vh("group",{style:{x:M,y:w}},vh(xy,{content:o,background:f,textStyle:d,animation:y}),vh("polygon",{style:{points:T.map((function(t){return[t.x,t.y]})),fill:(null==f?void 0:f.fill)||my.arrow.fill},animation:y}))},e}(on),My=1e-4,wy=function(){function t(t,e,n,r){var i=this;this.width=t,this.height=e,this.elements=n,this.context=r,this.keyframeAnimationMap=new WeakMap,this.displayObjectElementMap=new WeakMap,this.animations=[],this.isPaused=!1,this.direction=1,this.displayObjects=n.map((function(t){return i.buildHierachy(t)}))}return t.prototype.generateTransform=function(t,e,n,r,i){var o="";return 0===t&&0===e||(o+="translate(".concat(t,", ").concat(e,")")),1===n&&1===r||(o+=" scale(".concat(0===n?My:n,", ").concat(0===r?My:r,")")),0!==i&&(o+=" rotate(".concat(i,"deg)")),o},t.prototype.buildHierachy=function(t){var e,n=this,r=t.type,i=t.name,o=t.anchorX,a=void 0===o?0:o,s=t.anchorY,c=void 0===s?0:s,h=t.rotation,p=t.scaleX,f=t.scaleY,d=t.x,y=t.y,v=t.children,g=t.shape,m=t.style,x=t.keyframeAnimation,b=this.generateTransform((void 0===d?0:d)-a,(void 0===y?0:y)-c,void 0===p?1:p,void 0===f?1:f,void 0===h?0:h);if(r===or.GROUP)e=new Hs({style:{transformOrigin:"".concat(a,"px ").concat(c,"px"),transform:b}});else if(r===or.ELLIPSE){var M=g.rx,w=g.ry;e=new Us({style:{cx:k=g.cx,cy:S=g.cy,rx:M,ry:w,transformOrigin:"".concat(a-k+M,"px ").concat(c-S+w,"px"),transform:b}})}else if(r===or.PATH){var E=this.generatePathFromShape(g);e=new $s({style:{d:E,transformOrigin:"".concat(a,"px ").concat(c,"px"),transform:b}})}else if(r===or.RECT){var k,S;e=new tu({style:{x:k=g.x,y:S=g.y,width:P=g.width,height:T=g.height,anchor:[.5,.5],radius:g.r,transformOrigin:"".concat(a-k+P/2,"px ").concat(c-S+T/2,"px"),transform:b}})}else if(r===or.IMAGE){var P,T;e=new Zs({style:{x:0,y:0,width:P=g.width,height:T=g.height,src:g.src,transformOrigin:"".concat(a,"px ").concat(c,"px"),transform:b}})}if(i&&(e.name=i),m&&e.attr(m),x&&this.keyframeAnimationMap.set(e,x),v){var N=v.map((function(t){return n.buildHierachy(t)}));e.append.apply(e,l([],u(N),!1))}return this.displayObjectElementMap.set(e,t),e},t.prototype.getAnimations=function(){return this.animations},t.prototype.getDuration=function(t){return void 0===t&&(t=!1),(t?this.fps():1)*(this.context.endFrame-this.context.startFrame)*this.context.frameTime/1e3},t.prototype.fps=function(){return this.context.fps},t.prototype.isSameKeyframeOptions=function(t,e){return t.delay===e.delay&&t.duration===e.duration&&t.easing===e.easing},t.prototype.isSameKeyframes=function(t,e){return t.offset===e.offset&&t.easing===e.easing},t.prototype.generatePathFromShape=function(t){var e=t.close,n=t.v,r=t.in,i=t.out,o=[];o.push(["M",n[0][0],n[0][1]]);for(var a=1;n.length>a;a++)o.push(["C",i[a-1][0],i[a-1][1],r[a][0],r[a][1],n[a][0],n[a][1]]);return e&&(o.push(["C",i[n.length-1][0],i[n.length-1][1],r[0][0],r[0][1],n[0][0],n[0][1]]),o.push(["Z"])),o},t.prototype.render=function(t){var e=this,n=new Hs;if(n.append.apply(n,l([],u(this.displayObjects),!1)),t.document)t.appendChild(n);else{if(!Is(t))throw Error("[g-lottie-player]: We should render Lottie to a mounted DisplayObject or Canvas.");if(!t.isConnected)throw Error("[g-lottie-player]: Cannot render Lottie to an unmounted DisplayObject.");t.appendChild(n)}return this.displayObjects.forEach((function(t){t.forEach((function(t){var n,r=e.keyframeAnimationMap.get(t),o=e.displayObjectElementMap.get(t);if(o&&o.clipPath){var a=o.clipPath,s=a.shape,c=a.keyframeAnimation,h=new $s;if(t.parentElement.appendChild(h),t.style.clipPath=h,s&&(h.style.d=e.generatePathFromShape(s)),c&&c.length){var f=c[0],d=f.delay,y=f.duration,v=f.easing,g=h.animate(f.keyframes.map((function(t){var n=t.easing;return{offset:t.offset,d:be(e.generatePathFromShape(t.shape)),easing:n}})),{delay:d,duration:y,easing:v,iterations:e.context.iterations});e.animations.push(g)}}var m=o.visibilityStartOffset,x=o.visibilityEndOffset,b=o.visibilityFrame;if(!b||r&&r.length||(r=[{duration:e.context.frameTime*b,keyframes:[{offset:0,style:{opacity:1}},{offset:1,style:{opacity:1}}]}]),r&&r.length){var M=[];r.map((function(t){var n=t.delay,r=void 0===n?0:n,i=t.duration,o=t.easing,a=t.keyframes.map((function(t){return ai(t)})),s=ai({delay:r,duration:i,easing:o,iterations:e.context.iterations,fill:e.context.fill});M.push([a,s])}));for(var w=[M[0]],E=function(t){var n=u(M[t],2),r=n[0],o=n[1],a=w.find((function(t){var n=u(t,2);return n[0].length===r.length&&e.isSameKeyframeOptions(o,n[1])}));a?r.forEach((function(t){var n=a[0].find((function(n){return e.isSameKeyframes(t,n)}));if(n){var r=i(t,["offset","easing"]);Object.assign(n,r)}else a[0].push(t)})):w.push(M[t])},k=1;M.length>k;k++)E(k);(n=e.animations).push.apply(n,l([],u(w.map((function(n){var r=u(n,2),i=r[1],o=e.formatKeyframes(r[0],t);if(o.length){var a=t.animate(o,i);return p(m)||p(x)||(t.style.visibility="hidden",a.onframe=function(){var e=a.effect.getComputedTiming().progress;t.style.visibility=e>=m&&x>e?"visible":"hidden"}),e.context.autoplay||a.pause(),a}})).filter((function(t){return!!t}))),!1))}}))})),n},t.prototype.formatKeyframes=function(t,e){return t.forEach((function(t){t.transform=e.style.transform||"","scaleX"in t&&(t.transform=(t.transform||"")+" scaleX(".concat(0===t.scaleX?My:t.scaleX,")"),delete t.scaleX),"scaleY"in t&&(t.transform=(t.transform||"")+" scaleY(".concat(0===t.scaleY?My:t.scaleY,")"),delete t.scaleY),"rotation"in t&&(t.transform=(t.transform||"")+" rotate(".concat(t.rotation,"deg)"),delete t.rotation),"x"in t&&(t.transform=(t.transform||"")+" translateX(".concat(t.x,"px)"),delete t.x),"y"in t&&(t.transform=(t.transform||"")+" translateY(".concat(t.y,"px)"),delete t.y),"style"in t&&(Object.keys(t.style).forEach((function(e){t[e]=t.style[e]})),delete t.style)})),(t=t.filter((function(t){var e=t.offset,n=i(t,["ignore","easing","offset"]);return e>=0&&Object.keys(n).length>0}))).length&&1!==t[t.length-1].offset&&t.push(r(r({},t[t.length-1]),{offset:1})),t.sort((function(t,e){return t.offset-e.offset})),t.forEach((function(t){Object.keys(t).forEach((function(e){""===t[e]&&delete t[e]}))})),t},t.prototype.destroy=function(){this.displayObjects.forEach((function(t){t.destroy()}))},t.prototype.size=function(t){return{width:this.width,height:this.height}},t.prototype.version=function(){return this.context.version},t.prototype.play=function(){this.isPaused=!1,this.animations.forEach((function(t){t.play()}))},t.prototype.playSegments=function(t){var e=this,n=u(t,2),r=n[0],i=n[1];this.isPaused=!1,this.animations.forEach((function(t){t.currentTime=r/e.fps()*1e3;var n=t.onframe;t.onframe=function(r){n&&n(r),t.currentTime<i/e.fps()*1e3||(t.finish(),t.onframe=n||null)},t.play()}))},t.prototype.pause=function(){this.isPaused=!0,this.animations.forEach((function(t){t.pause()}))},t.prototype.togglePause=function(){this.isPaused?this.play():this.pause()},t.prototype.goTo=function(t,e){var n=this;void 0===e&&(e=!1),this.animations.forEach(e?function(e){e.currentTime=t/n.fps()*1e3}:function(e){e.currentTime=1e3*t})},t.prototype.stop=function(){this.animations.forEach((function(t){t.finish()}))},t.prototype.setSpeed=function(t){var e=this;this.animations.forEach((function(n){n.playbackRate=t*e.direction}))},t.prototype.setDirection=function(t){this.direction=t,this.animations.forEach((function(e){e.playbackRate*=t}))},t}();function Ey(t,e){var n,r,i,o,a,s,u=t.length;for(r=0;u>r;r+=1)if("ks"in(n=t[r])&&!n.completed){if(n.completed=!0,n.tt&&(t[r-1].td=n.tt),n.hasMask){var l=n.masksProperties;for(o=l.length,i=0;o>i;i+=1)if(l[i].pt.k.i)Py(l[i].pt.k);else for(s=l[i].pt.k.length,a=0;s>a;a+=1)l[i].pt.k[a].s&&Py(l[i].pt.k[a].s[0]),l[i].pt.k[a].e&&Py(l[i].pt.k[a].e[0])}0===n.ty?(n.layers=ky(n.refId,e),Ey(n.layers,e)):4===n.ty?Sy(n.shapes):5===n.ty&&ev(n)}}function ky(t,e){var n=function(t,e){for(var n=0,r=e.length;r>n;){if(e[n].id===t)return e[n];n+=1}return null}(t,e);return n?n.layers.__used?JSON.parse(JSON.stringify(n.layers)):(n.layers.__used=!0,n.layers):null}function Sy(t){var e,n,r;for(e=t.length-1;e>=0;e-=1)if("sh"===t[e].ty)if(t[e].ks.k.i)Py(t[e].ks.k);else for(r=t[e].ks.k.length,n=0;r>n;n+=1)t[e].ks.k[n].s&&Py(t[e].ks.k[n].s[0]),t[e].ks.k[n].e&&Py(t[e].ks.k[n].e[0]);else"gr"===t[e].ty&&Sy(t[e].it)}function Py(t){var e,n=t.i.length;for(e=0;n>e;e+=1)t.i[e][0]+=t.v[e][0],t.i[e][1]+=t.v[e][1],t.o[e][0]+=t.v[e][0],t.o[e][1]+=t.v[e][1]}function Ty(t,e){var n=e?e.split("."):[100,100,100];return t[0]>n[0]||t[0]>=n[0]&&(t[1]>n[1]||t[1]>=n[1]&&(t[2]>n[2]||t[2]>=n[2]&&null))}var Ny,Cy,Ay,Oy,Ry,Ly,_y,Iy,Dy,Fy,By,jy,Gy,Yy,Wy,zy,Vy,Xy,Uy,Hy,qy,Zy=function(){var t=[4,4,14];function e(t){var e,n,r=t.length;for(e=0;r>e;e+=1)5===t[e].ty&&((n=t[e]).t.d={k:[{s:n.t.d,t:0}]})}return function(n){if(Ty(t,n.v)&&(e(n.layers),n.assets)){var r=void 0,i=n.assets.length;for(r=0;i>r;r+=1)n.assets[r].layers&&e(n.assets[r].layers)}}}(),Ky=(Ny=[4,7,99],function(t){if(t.chars&&!Ty(Ny,t.v)){var e=void 0,n=t.chars.length;for(e=0;n>e;e+=1){var r=t.chars[e];r.data&&r.data.shapes&&(Sy(r.data.shapes),r.data.ip=0,r.data.op=99999,r.data.st=0,r.data.sr=1,r.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},t.chars[e].t||(r.data.shapes.push({ty:"no"}),r.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}),$y=function(){var t=[5,7,15];function e(t){var e,n,r=t.length;for(e=0;r>e;e+=1)5===t[e].ty&&(n=void 0,"number"==typeof(n=t[e].t.p).a&&(n.a={a:0,k:n.a}),"number"==typeof n.p&&(n.p={a:0,k:n.p}),"number"==typeof n.r&&(n.r={a:0,k:n.r}))}return function(n){if(Ty(t,n.v)&&(e(n.layers),n.assets)){var r=void 0,i=n.assets.length;for(r=0;i>r;r+=1)n.assets[r].layers&&e(n.assets[r].layers)}}}(),Jy=function(){var t=[4,1,9];function e(t){var n,r,i,o=t.length;for(n=0;o>n;n+=1)if("gr"===t[n].ty)e(t[n].it);else if("fl"===t[n].ty||"st"===t[n].ty)if(t[n].c.k&&t[n].c.k[0].i)for(i=t[n].c.k.length,r=0;i>r;r+=1)t[n].c.k[r].s&&(t[n].c.k[r].s[0]/=255,t[n].c.k[r].s[1]/=255,t[n].c.k[r].s[2]/=255,t[n].c.k[r].s[3]/=255),t[n].c.k[r].e&&(t[n].c.k[r].e[0]/=255,t[n].c.k[r].e[1]/=255,t[n].c.k[r].e[2]/=255,t[n].c.k[r].e[3]/=255);else t[n].c.k[0]/=255,t[n].c.k[1]/=255,t[n].c.k[2]/=255,t[n].c.k[3]/=255}function n(t){var n,r=t.length;for(n=0;r>n;n+=1)4===t[n].ty&&e(t[n].shapes)}return function(e){if(Ty(t,e.v)&&(n(e.layers),e.assets)){var r=void 0,i=e.assets.length;for(r=0;i>r;r+=1)e.assets[r].layers&&n(e.assets[r].layers)}}}(),Qy=function(){var t=[4,4,18];function e(t){var n,r,i;for(n=t.length-1;n>=0;n-=1)if("sh"===t[n].ty)if(t[n].ks.k.i)t[n].ks.k.c=t[n].closed;else for(i=t[n].ks.k.length,r=0;i>r;r+=1)t[n].ks.k[r].s&&(t[n].ks.k[r].s[0].c=t[n].closed),t[n].ks.k[r].e&&(t[n].ks.k[r].e[0].c=t[n].closed);else"gr"===t[n].ty&&e(t[n].it)}function n(t){var n,r,i,o,a,s,u=t.length;for(r=0;u>r;r+=1){if((n=t[r]).hasMask){var l=n.masksProperties;for(o=l.length,i=0;o>i;i+=1)if(l[i].pt.k.i)l[i].pt.k.c=l[i].cl;else for(s=l[i].pt.k.length,a=0;s>a;a+=1)l[i].pt.k[a].s&&(l[i].pt.k[a].s[0].c=l[i].cl),l[i].pt.k[a].e&&(l[i].pt.k[a].e[0].c=l[i].cl)}4===n.ty&&e(n.shapes)}}return function(e){if(Ty(t,e.v)&&(n(e.layers),e.assets)){var r=void 0,i=e.assets.length;for(r=0;i>r;r+=1)e.assets[r].layers&&n(e.assets[r].layers)}}}();function tv(t){t.__complete||(Jy(t),Zy(t),Ky(t),$y(t),Qy(t),Ey(t.layers,t.assets),function(t,e){if(t){var n=0,r=t.length;for(n=0;r>n;n+=1)1===t[n].t&&(t[n].data.layers=ky(t[n].data.refId,e),Ey(t[n].data.layers,e))}}(t.chars,t.assets),t.__complete=!0)}function ev(t){}!function(t){t[t.Normal=0]="Normal",t[t.Multiply=1]="Multiply",t[t.Screen=2]="Screen",t[t.Overlay=3]="Overlay",t[t.Darken=4]="Darken",t[t.Lighten=5]="Lighten",t[t.ColorDodge=6]="ColorDodge",t[t.ColorBurn=7]="ColorBurn",t[t.HardLight=8]="HardLight",t[t.SoftLight=9]="SoftLight",t[t.Difference=10]="Difference",t[t.Exclusion=11]="Exclusion",t[t.Hue=12]="Hue",t[t.Saturation=13]="Saturation",t[t.Color=14]="Color",t[t.Luminosity=15]="Luminosity",t[t.Add=16]="Add",t[t.HardMix=17]="HardMix"}(Cy||(Cy={})),function(t){t[t.Normal=0]="Normal",t[t.Alpha=1]="Alpha",t[t.InvertedAlpha=2]="InvertedAlpha",t[t.Luma=3]="Luma",t[t.InvertedLuma=4]="InvertedLuma"}(Ay||(Ay={})),function(t){t[t.Off=0]="Off",t[t.On=1]="On"}(Oy||(Oy={})),function(t){t[t.Off=0]="Off",t[t.On=1]="On"}(Ry||(Ry={})),function(t){t[t.Number=0]="Number",t[t.Color=2]="Color",t[t.MultiDimensional=3]="MultiDimensional",t[t.Boolean=7]="Boolean"}(Ly||(Ly={})),function(t){t[t.Transform=5]="Transform",t[t.DropShadow=25]="DropShadow"}(_y||(_y={})),function(t){t.No="n",t.Add="a",t.Subtract="s",t.Intersect="i",t.Lighten="l",t.Darken="d",t.Difference="f"}(Iy||(Iy={})),function(t){t[t.precomp=0]="precomp",t[t.solid=1]="solid",t[t.image=2]="image",t[t.null=3]="null",t[t.shape=4]="shape",t[t.text=5]="text",t[t.audio=6]="audio",t[t.pholderVideo=7]="pholderVideo",t[t.imageSeq=8]="imageSeq",t[t.video=9]="video",t[t.pholderStill=10]="pholderStill",t[t.guide=11]="guide",t[t.adjustment=12]="adjustment",t[t.camera=13]="camera",t[t.light=14]="light",t[t.data=15]="data"}(Dy||(Dy={})),function(t){t[t.Left=0]="Left",t[t.Right=1]="Right",t[t.Center=2]="Center"}(Fy||(Fy={})),function(t){t[t.Top=0]="Top",t[t.Center=1]="Center",t[t.Bottom=2]="Bottom"}(By||(By={})),function(t){t[t.Characters=1]="Characters",t[t.CharactersExcludingSpaces=2]="CharactersExcludingSpaces",t[t.Words=3]="Words",t[t.Lines=4]="Lines"}(jy||(jy={})),function(t){t[t.Square=1]="Square",t[t.RampUp=2]="RampUp",t[t.RampDown=3]="RampDown",t[t.Triangle=4]="Triangle",t[t.Round=5]="Round",t[t.Smooth=6]="Smooth"}(Gy||(Gy={})),function(t){t[t.Percentage=1]="Percentage",t[t.Index=2]="Index"}(Yy||(Yy={})),function(t){t[t.Add=1]="Add",t[t.Subtract=2]="Subtract",t[t.Intersect=3]="Intersect",t[t.Min=4]="Min",t[t.Max=5]="Max",t[t.Difference=6]="Difference"}(Wy||(Wy={})),function(t){t.Rectangle="rc",t.Ellipse="el",t.PolyStar="sr",t.Path="sh",t.Fill="fl",t.Stroke="st",t.GradientFill="gf",t.GradientStroke="gs",t.NoStyle="no",t.Group="gr",t.Transform="tr",t.Repeater="rp",t.Trim="tm",t.RoundedCorners="rd",t.PuckerOrBloat="pb",t.Merge="mm",t.Twist="tw",t.OffsetPath="op",t.ZigZag="zz"}(zy||(zy={})),function(t){t[t.NonZero=1]="NonZero",t[t.EvenOdd=2]="EvenOdd"}(Vy||(Vy={})),function(t){t[t.Miter=1]="Miter",t[t.Round=2]="Round",t[t.Bevel=3]="Bevel"}(Xy||(Xy={})),function(t){t[t.Butt=1]="Butt",t[t.Round=2]="Round",t[t.Square=3]="Square"}(Uy||(Uy={})),function(t){t[t.Linear=1]="Linear",t[t.Radial=2]="Radial"}(Hy||(Hy={})),function(t){t[t.CssUrl=1]="CssUrl",t[t.ScriptUrl=2]="ScriptUrl",t[t.FontUrl=3]="FontUrl"}(qy||(qy={}));var nv=function(){this.frameTime=1e3/30,this.startFrame=0,this.autoplay=!1,this.fill="auto",this.iterations=0,this.assetsMap=new Map};function rv(t){return Array.isArray(t)&&"number"==typeof t[0]}function iv(t){return rv(null==t?void 0:t.k)}function ov(t){var e=null==t?void 0:t.k;return Array.isArray(e)&&void 0!==e[0].t&&rv(e[0].s)}function av(t){var e=sv(t,3);return"rgba(".concat([Math.round(255*sv(t,0)),Math.round(255*sv(t,1)),Math.round(255*sv(t,2)),p(e)?1:e].join(","),")")}function sv(t,e){return null!=t?"number"==typeof t?t:t[e||0]:NaN}function uv(t,e,n){var r,i,o,a,s=[];if(s.push((null===(r=t.o)||void 0===r?void 0:r.x)&&(sv(t.o.x,n)||sv(t.o.x,0))||0,(null===(i=t.o)||void 0===i?void 0:i.y)&&(sv(t.o.y,n)||sv(t.o.y,0))||0,(null===(o=t.i)||void 0===o?void 0:o.x)&&(sv(t.i.x,n)||sv(t.i.x,0))||1,(null===(a=t.i)||void 0===a?void 0:a.y)&&(sv(t.i.y,n)||sv(t.i.y,0))||1),0!==s[0]||0!==s[1]||1!==s[2]||1!==s[3])return"cubic-bezier(".concat(s.join(","),")")}function lv(t,e,n,r){for(var i,o=t.length,a=n.endFrame-n.startFrame,s={duration:0,delay:0,keyframes:[]},u=0;o>u;u++){var l=t[u],c=t[u+1],h=1===l.h,p={offset:(l.t+n.layerOffsetTime-n.startFrame)/a};h||(p.easing=uv(l,0,e));var f=l.s||(null==i?void 0:i.e);if(f&&r(p,f),p.offset>0&&0===u){var d={offset:0};f&&r(d,f),s.keyframes.push(d)}if(s.keyframes.push(p),h&&c){var y={offset:Math.max((c.t+n.layerOffsetTime-n.startFrame)/a,0)};r(y,f),s.keyframes.push(y)}i=l}return o&&(s.duration=n.frameTime*a),s}function cv(t,e,n,r,i,o){for(var a=function(a){var s=n[a],u=lv(t,a,i,(function(t,n){var r=sv(n,a);o&&(r=o(r)),(e?t[e]={}:t)[s]=r}));if(t.some((function(t){return t.ti&&t.to}))){var l=[];t.forEach((function(t,e){u.keyframes[e].offsetPath=l,t.ti&&t.to&&(0===e&&l.push(["M",t.s[0],t.s[1]]),u.keyframes[e].segmentLength=tn(l),l.push(["C",t.s[0]+t.to[0],t.s[1]+t.to[1],t.s[0]+t.ti[0],t.s[1]+t.ti[1],t.e[0],t.e[1]]))}));var c=tn(l);u.keyframes.forEach((function(t){t.offsetDistance=p(t.segmentLength)?1:t.segmentLength/c,delete t.segmentLength}))}u.keyframes.length&&r.push(u)},s=0;n.length>s;s++)a(s)}function hv(t,e,n,r,i){var o=lv(t,0,i,(function(t,r){(e?t[e]={}:t)[n]=av(r)}));o.keyframes.length&&r.push(o)}function pv(t,e,n,r,i,o,a){n&&(e[n]=e[n]||{});var s=n?e[n]:e;if(function(t){return"number"==typeof(null==t?void 0:t.k)}(t)){var u=t.k;s[r[0]]=a?a(u):u}else if(function(t){var e=null==t?void 0:t.k;return Array.isArray(e)&&void 0!==e[0].t&&"number"==typeof e[0].s}(t))cv(t.k,n,r,i,o,a);else if(iv(t))for(var l=0;r.length>l;l++){u=sv(t.k,l);s[r[l]]=a?a(u):u}else ov(t)&&cv(t.k,n,r,i,o,a)}function fv(t,e,n,r,i,o){void 0===i&&(i=""),void 0===o&&(o={x:"x",y:"y",rotation:"rotation",scaleX:"scaleX",scaleY:"scaleY",anchorX:"anchorX",anchorY:"anchorY",skew:"skew",skewAxis:"skewAxis"}),t.p.s?(pv(t.p.x,e,i,[o.x],n,r),pv(t.p.y,e,i,[o.y],n,r)):pv(t.p,e,i,[o.x,o.y],n,r),pv(t.s,e,i,[o.scaleX,o.scaleY],n,r,(function(t){return t/100})),pv(t.r,e,i,[o.rotation],n,r),pv(t.a,e,i,[o.anchorX,o.anchorY],n,r),pv(t.sk,e,i,[o.skew],n,r),pv(t.sa,e,i,[o.skewAxis],n,r)}function dv(t){return t.g&&t.s&&t.e}function yv(t){return"".concat(t.map((function(t){var e=t.offset;return"".concat(t.color," ").concat(100*e,"%")})).join(", "))}function vv(t){var e=function(t,e){for(var n=[],r=0;4*e>r;){var i=t[r++],o=Math.round(255*t[r++]),a=Math.round(255*t[r++]),s=Math.round(255*t[r++]);n.push({offset:i,color:"rgb(".concat(o,", ").concat(a,", ").concat(s,")")})}return n}(t.g.k.k,t.g.p);if(t.t===Hy.Linear){var n=gr(Math.atan2(t.e.k[1]-t.s.k[1],t.e.k[0]-t.s.k[0]));return"linear-gradient(".concat(n,"deg, ").concat(yv(e),")")}if(t.t===Hy.Radial){var r=Ve(t.e.k,t.s.k);return"radial-gradient(circle ".concat(r,"px at ").concat(t.s.k[0],"px ").concat(t.s.k[1],"px, ").concat(yv(e),")")}return"#000"}function gv(t,e,n){var r,i={type:or.PATH,style:{fill:"none",stroke:"none"}};if((r=t.ks.k)&&r.i&&r.o&&r.v)i.shape={in:t.ks.k.i,out:t.ks.k.o,v:t.ks.k.v,close:t.ks.k.c};else if(Array.isArray(t.ks.k)){var o=lv(t.ks.k,0,n,(function(t,e){t.shape={in:e[0].i,out:e[0].o,v:e[0].v,close:e[0].c}}));o.keyframes.length&&e.push(o)}return i}function mv(t,e){var n={type:or.IMAGE,style:{},shape:{width:0,height:0,src:""}},r=e.assetsMap.get(t.refId);return r&&(n.shape.width=r.w,n.shape.height=r.h,n.shape.src=r.p),n}function xv(t,e){function n(t,n){var r;switch(t.ty){case zy.Path:r=gv(t,n,e);break;case zy.Ellipse:r=function(t,e,n){var r={type:or.ELLIPSE,style:{fill:"none",stroke:"none"},shape:{}};return pv(t.p,r,"shape",["cx","cy"],e,n),pv(t.s,r,"shape",["rx","ry"],e,n,(function(t){return t/2})),r}(t,n,e);break;case zy.Rectangle:r=function(t,e,n){var r={type:or.RECT,style:{fill:"none",stroke:"none"},shape:{}};return pv(t.p,r,"shape",["x","y"],e,n),pv(t.s,r,"shape",["width","height"],e,n),pv(t.r,r,"shape",["r"],e,n),r}(t,n,e)}return r}return{type:or.GROUP,children:function t(i,o){var a=[],s={},c=[];return function(t,n){t.forEach((function(t){if(!t.hd)switch(t.ty){case zy.Repeater:pv(t.c,n.attrs,"shape",["repeat"],n.keyframeAnimations,e),fv(t.tr,n.attrs,n.keyframeAnimations,e,"shape",{x:"repeatX",y:"repeatY",rotation:"repeatRot",scaleX:"repeatScaleX",scaleY:"repeatScaleY",anchorX:"repeatAnchorX",anchorY:"repeatAnchorY",skew:"repeatSkew",skewAxis:"repeatSkewAxis"});break;case zy.Trim:pv(t.s,n.attrs,"shape",["trimStart"],n.keyframeAnimations,e),pv(t.e,n.attrs,"shape",["trimEnd"],n.keyframeAnimations,e)}}))}(i=i.slice().reverse(),o),i.forEach((function(r){if(!r.hd){var i;switch(r.ty){case zy.Group:i={type:or.GROUP,children:t(r.it,o)};break;case zy.Fill:case zy.GradientFill:!function(t,e,n,r){e.style=e.style||{},dv(t)?e.style.fill=vv(t):iv(t.c)?e.style.fill=av(t.c.k):ov(t.c)&&hv(t.c.k,"style","fill",n,r),e.style.fillRule=t.r===Vy.EvenOdd?"evenodd":"nonzero",pv(t.o,e,"style",["fillOpacity"],n,r,(function(t){return t/100}))}(r,s,c,e);break;case zy.Stroke:case zy.GradientStroke:!function(t,e,n,r){switch(e.style=e.style||{},dv(t)?e.style.stroke=vv(t):iv(t.c)?e.style.stroke=av(t.c.k):ov(t.c)&&hv(t.c.k,"style","stroke",n,r),pv(t.o,e,"style",["strokeOpacity"],n,r,(function(t){return t/100})),pv(t.w,e,"style",["lineWidth"],n,r),t.lj){case Xy.Bevel:e.style.lineJoin="bevel";break;case Xy.Round:e.style.lineJoin="round";break;case Xy.Miter:e.style.lineJoin="miter"}switch(t.lc){case Uy.Butt:e.style.lineCap="butt";break;case Uy.Round:e.style.lineCap="round";break;case Uy.Square:e.style.lineCap="square"}var i=[],o=0;t.d&&(t.d.forEach((function(t){"o"!==t.n?i.push(t.v.k):o=t.v.k})),e.style.lineDash=i,e.style.lineDashOffset=o)}(r,s,c,e);break;case zy.Transform:fv(r,s,c,e);break;default:i=n(r,c)}i&&(i.name=r.nm,a.push(i))}})),a.forEach((function(t,e){t=r(r(r({},t),ai(o.attrs)),s),(c.length||o.keyframeAnimations.length)&&(t.keyframeAnimation=l(l([],u(o.keyframeAnimations),!1),u(c),!1)),a[e]=t})),a}(t.shapes,{attrs:{},keyframeAnimations:[]})}}function bv(t,e){var n;e(t),t.type===or.GROUP&&(null===(n=t.children)||void 0===n||n.forEach((function(t){bv(t,e)})))}function Mv(t,e,n){var r,i,o={},a=[];(null===(r=t.ks)||void 0===r?void 0:r.o)&&(pv(t.ks.o,o,"style",["opacity"],a,n,(function(t){return t/100})),((null===(i=o.style)||void 0===i?void 0:i.opacity)||a.length)&&bv(e,(function(t){t.type!==or.GROUP&&t.style&&(Object.assign(t.style,o.style),a.length&&(t.keyframeAnimation=(t.keyframeAnimation||[]).concat(a)))})))}function wv(t,e,n){var i=[];t=t.slice().reverse();var o=new Map,a=(null==n?void 0:n.st)||0;return null==t||t.forEach((function(t){var n,s,u,l=a+t.ip,c=a+t.op,h=a+t.st;switch(e.layerOffsetTime=a,t.ty){case Dy.shape:u=xv(t,e);break;case Dy.null:u={type:or.GROUP,children:[]};break;case Dy.solid:u={type:or.GROUP,children:[]},t.sc&&u.children.push(function(t){return{type:or.RECT,shape:{x:0,y:0,width:t.sw,height:t.sh},style:{fill:t.sc}}}(t));break;case Dy.precomp:u={type:or.GROUP,children:wv((null===(n=e.assetsMap.get(t.refId))||void 0===n?void 0:n.layers)||[],e,{st:h})};break;case Dy.text:break;case Dy.image:u=u={type:or.GROUP,children:[mv(t,e)]}}if(u){var p=[],f={name:t.nm};if(t.ks&&fv(t.ks,f,p,e),Object.assign(u,f),null!=t.ind&&o.set(t.ind,u),u.extra={layerParent:t.parent},t.hasMask&&(null===(s=t.masksProperties)||void 0===s?void 0:s.length)){var d=[],y=gv({ks:t.masksProperties[0].pt},d,e);u.clipPath=r({type:or.PATH},y),d.length&&(u.clipPath.keyframeAnimation=d)}if(Mv(t,u,e),null!=l&&null!=c&&(l>e.startFrame||e.endFrame>c)){var v=e.endFrame-e.startFrame,g=(c-e.startFrame)/v;u.visibilityStartOffset=(l-e.startFrame)/v,u.visibilityEndOffset=g,u.visibilityFrame=v}p.length&&(u.keyframeAnimation=p),i.push(u)}})),i.filter((function(t){var e,n,r=o.get(null===(e=t.extra)||void 0===e?void 0:e.layerParent);return!r||(null===(n=r.children)||void 0===n||n.push(t),!1)}))}var Ev={loop:!0,autoplay:!1,fill:"both"};function kv(t,e){var n=function(t,e){var n;tv(t);var i=r(r({},Ev),e),o=i.loop,a=i.autoplay,s=i.fill,u=new nv;u.fps=t.fr||30,u.frameTime=1e3/u.fps,u.startFrame=t.ip,u.endFrame=t.op,u.version=t.v,u.autoplay=!!a,u.fill=s,u.iterations=_(o)?o:o?1/0:1,null===(n=t.assets)||void 0===n||n.forEach((function(t){u.assetsMap.set(t.id,t)}));var l=wv(t.layers||[],u);return{width:t.w,height:t.h,elements:l,context:u}}(t,e);return new wy(n.width,n.height,n.elements,n.context)}var Sv=function(t){function e(e){var n=t.call(this,e)||this;return n.addLottie=function(){var t=n.props,e=t.data,r=t.options,i=t.play;e&&n.context.canvas.ready.then((function(){if(n.animation=n.animation?n.animation:kv(e,r),n.animation.render(n.ref.current),n.size=n.animation.size(),n.updateSize(),i){var t=i.speed,o=void 0===t?1:t,a=i.start,s=void 0===a?0:a,u=i.end,l=void 0===u?n.animation.getDuration(!0):u;n.animation.setSpeed(o),n.animation.playSegments([s,l])}}))},n.updateSize=function(){var t=n.size,e=t.width,r=t.height,i=n.props.style;if(i){var o=i.width,a=void 0===o?e:o,s=i.height,u=void 0===s?r:s;n.ref.current.scale(a/e,u/r),n.size={width:a,height:u}}},n.ref={current:null},n}return n(e,t),e.prototype.didMount=function(){this.addLottie()},e.prototype.willUpdate=function(){this.addLottie()},e.prototype.render=function(){var t=this.props;return vh("group",{ref:this.ref,style:t.style,animation:t.animation})},e}(on),Pv={offsetX:0,offsetY:0,points:[],data:"",animation:null,options:{loop:!0,autoplay:!0}},Tv=yy((function(t,e){var n=t.theme,i=q(r({},(void 0===n?{}:n).text),t),o=i.style,a=i.offsetX,s=i.offsetY,u=i.content,l=i.animation,c=i.points[0]||{},h=c.x,p=c.y;if(isNaN(h)||isNaN(p))return null;var f=h+(e.px2hd(a)||0),d=p+(e.px2hd(s)||0);return vh("text",{attrs:r({text:"".concat(u),x:f,y:d},o),animation:q({update:{easing:"linear",duration:450,property:["x","y"]}},l)})})),Nv=yy((function(t,e){var n=q(r({},t.theme.point),t),i=n.style,o=n.offsetX,a=n.offsetY,s=n.animation,u=n.points[0]||{},l=u.x,c=u.y;if(isNaN(l)||isNaN(c))return null;var h=e.px2hd(o),p=e.px2hd(a);return vh("group",null,vh("circle",{style:r({cx:l+(h||0),cy:c+(p||0)},i),animation:s}))})),Cv=yy((function(t,e){var n=t.theme,i=q(r({},(void 0===n?{}:n).line),t),o=i.points,a=i.style,s=i.offsetX,u=i.offsetY,l=i.animation;if(!o.some((function(t){return isNaN(t.x)||isNaN(t.y)}))){var c=o[0]||{},h=c.x,p=c.y,f=o[1]||{},d=f.x,v=f.y,g=e.px2hd(s),m=e.px2hd(u),x=h+(y(g)?g[0]||0:g||0),b=p+(y(m)?m[0]||0:m||0),M=d+(y(g)?g[1]||0:g||0),w=v+(y(m)?m[1]||0:m||0);return vh("group",null,vh("line",{style:r({x1:x,y1:b,x2:M,y2:w},a),animation:l}))}})),Av=yy((function(t){var e=t.theme,n=q(r({},(void 0===e?{}:e).line),t),i=n.coord,o=n.points,a=n.style,s=n.animation;if(o.some((function(t){return isNaN(t.x)||isNaN(t.y)})))return null;var u=o[0]||{},l=o[1]||{},c=i.center,h=Math.sqrt((u.x-c.x)*(u.x-c.x)+(u.y-c.y)*(u.y-c.y)),p=Math.atan2(u.y-c.y,u.x-c.x),f=Math.atan2(l.y-c.y,l.x-c.x);return vh("group",null,vh("arc",{style:r({cx:c.x,cy:c.y,r:h,startAngle:"".concat(p,"rad"),endAngle:"".concat(f,"rad")},a),animation:s}))})),Ov=yy((function(t,e){var n=t.theme,i=q(r({},(void 0===n?{}:n).rect),t),o=i.points,a=i.style,s=i.animation,u=i.offsetX,l=i.offsetY;if(o.some((function(t){return isNaN(t.x)||isNaN(t.y)})))return null;var c=o[0]||{},h=o[1]||{},p=e.px2hd(u),f=e.px2hd(l);return vh("group",null,vh("rect",{style:r({x:Math.min(c.x,h.x)+(p||0),y:Math.min(c.y,h.y)+(f||0),width:Math.abs(h.x-c.x),height:Math.abs(c.y-h.y)},a),animation:s}))})),Rv=yy((function(t,e){var n=q({},vy,t),i=n.style,o=n.attrs,a=n.offsetX,s=n.offsetY,u=n.src,l=n.animation,c=n.points[0]||{},h=c.x,p=c.y;if(isNaN(h)||isNaN(p))return null;var f=r(r({},o),i),d=f.height,y=void 0===d?0:d,v=f.width,g=void 0===v?0:v,m=_(y)?e.px2hd(y+"px"):e.px2hd(y),x=_(g)?e.px2hd(g+"px"):e.px2hd(g),b=h+(e.px2hd(a)||0)-x/2,M=p+(e.px2hd(s)||0)-m/2;return vh("group",null,vh("image",{style:r(r(r({},o),i),{height:m,width:x,x:b,y:M,src:u}),animation:q({update:{easing:"linear",duration:450,property:["x","y"]}},l)}))})),Lv=yy(by),_v=yy((function(t,e){var n=q({},Pv,t),r=n.style,i=n.offsetX,o=n.offsetY,a=n.lottieJson,s=n.animation,u=n.options,l=n.points[0]||{},c=l.x,h=l.y;if(isNaN(c)||isNaN(h))return null;var p=r.height,f=void 0===p?0:p,d=r.width,y=void 0===d?0:d,v=e.px2hd(i),g=e.px2hd(o);return vh(Sv,{data:a,options:u,style:{x:c+(v||0)-y/2,y:h+(g||0)-f/2,width:y,height:f},animation:q({update:{easing:"linear",duration:450,property:["x","y"]}},s)})})),Iv=yy((function(t,e){var n=t.theme,i=q(r({},(void 0===n?{}:n).polyline),t),o=i.points,a=i.style,s=i.offsetX,u=i.offsetY,l=i.animation;if(!o.some((function(t){return isNaN(t.x)||isNaN(t.y)}))){var c=e.px2hd(s),h=e.px2hd(u);return vh("group",null,vh("polyline",{style:r({points:o.map((function(t){return[t.x+c,t.y+h]}))},a),animation:l}))}})),Dv=yy((function(){return null})),Fv=function(t){return function(e){function i(t){var n=e.call(this,t)||this;return n._triggerOn=function(t){n.show({x:t.x,y:t.y},t)},n._triggerOff=function(){var t=n.props.alwaysShow;void 0!==t&&t||n.hide()},n.state={records:null},n}return n(i,e),i.prototype.updateCoord=function(){var t=this.props,e=t.padding;t.chart.updateCoordFor(this,{position:"top",width:0,height:this.context.px2hd(void 0===e?"10px":e)})},i.prototype.willMount=function(){this.updateCoord()},i.prototype.didMount=function(){this._initShow(),this._initEvent()},i.prototype._initEvent=function(){var t=this.props,e=t.chart,n=t.triggerOn,r=t.triggerOff,i=void 0===r?"pressend":r;e.on(void 0===n?"press":n,this._triggerOn),e.on(i,this._triggerOff)},i.prototype.willReceiveProps=function(t){var e=t.defaultItem,n=t.coord,r=this.props,i=r.coord;Vu(e,r.defaultItem)&&Vu(n,i)||this._showByData(e)},i.prototype._initShow=function(){this._showByData(this.props.defaultItem)},i.prototype._showByData=function(t){var e=this;if(t){var n=this.props.chart;setTimeout((function(){var r=n.getRecords(t,"xfield");e.showSnapRecords(r)}),0)}},i.prototype.show=function(t,e){var n=this.props.chart.getSnapRecords(t,!0);n&&n.length&&this.showSnapRecords(n)},i.prototype.showSnapRecords=function(t){var e=this.props,n=e.chart,i=e.onChange,o=n.getLegendItems(),a=t[0],s=a.yField,u=n.getScale(a.xField),l=n.getScale(s),c=t.map((function(t){var e=t.origin,n=t.xField,i=t.yField,a=y(e[i])?e[i].map((function(t){return l.getText(t)})):l.getText(e[i]),s=l.alias;if(!s&&(s=u.getText(e[n]),o&&o.length)){var c=M(o,(function(t){return e[t.field]===t.tickValue}));c&&c.name&&(s=c.name)}return r(r({},t),{name:s,value:"".concat(a)})}));y(c)&&c.length&&(this.setState({records:c}),h(i)&&i(c))},i.prototype.hide=function(){this.setState({records:null})},i.prototype.render=function(){var e=this.props;if(!1===e.visible)return null;var n=this.state.records;return n&&n.length&&vh(t,r({},e,{records:n}))},i}(on)},Bv={showTitle:!1,showCrosshairs:!1,crosshairsType:"y",crosshairsStyle:{stroke:"rgba(0, 0, 0, 0.25)",lineWidth:"2px"},showTooltipMarker:!1,markerBackgroundStyle:{fill:"#CCD6EC",opacity:.3,padding:"6px"},tooltipMarkerStyle:{fill:"#fff",lineWidth:"3px"},background:{radius:"4px",fill:"rgba(0, 0, 0, 0.65)",padding:["6px","10px"]},titleStyle:{fontSize:"24px",fill:"#fff",textAlign:"start",textBaseline:"top"},nameStyle:{fontSize:"24px",fill:"rgba(255, 255, 255, 0.65)",textAlign:"start",textBaseline:"middle"},valueStyle:{fontSize:"24px",fill:"#fff",textAlign:"start",textBaseline:"middle"},joinString:": ",showItemMarker:!0,itemMarkerStyle:{width:"12px",radius:"6px",symbol:"circle",lineWidth:"2px",stroke:"#fff"},layout:"horizontal",snap:!1,xTipTextStyle:{fontSize:"24px",fill:"#fff"},yTipTextStyle:{fontSize:"24px",fill:"#fff"},xTipBackground:{radius:"4px",fill:"rgba(0, 0, 0, 0.65)",padding:["6px","10px"],marginLeft:"-50%",marginTop:"6px"},yTipBackground:{radius:"4px",fill:"rgba(0, 0, 0, 0.65)",padding:["6px","10px"],marginLeft:"-100%",marginTop:"-50%"}};function jv(t,e){return void 0===t||"string"==typeof t&&-1!==t.indexOf(e)}var Gv=function(t){var e=t.records,n=t.coord,i=t.context,o=t.markerBackgroundStyle,a=n.convertPoint({x:1,y:1}),s=i.px2hd(o.padding||"6px"),u=l(l([],e.map((function(t){return t.xMin})),!0),e.map((function(t){return t.xMax})),!0),c=l(l([],e.map((function(t){return t.yMin})),!0),e.map((function(t){return t.yMax})),!0);n.transposed?u.push(a.x):c.push(a.y);var h=Math.min.apply(null,u),p=Math.max.apply(null,u),f=Math.min.apply(null,c),d=Math.max.apply(null,c);return vh("rect",{style:r({x:n.transposed?h:h-s,y:n.transposed?f-s:f,width:n.transposed?p-h:p-h+2*s,height:n.transposed?d-f+2*s:d-f},o)})},Yv=function(t){var e=t.coord,n=t.crosshairsType,i=t.crosshairsStyle,o=t.xPositionType,a=t.yPositionType,s=e.left,u=e.top,l=e.right,c=e.bottom,h=e.center,p=t.records[0],f=p.x,d=p.y,y=p.origin,v=p.xField,g=p.coord;if(e.isPolar){var m=M(t.chart.getScale(v).getTicks(),(function(t){return y[v]===t.tickValue})),x=e.convertPoint({x:m.value,y:1});return vh("line",{style:r({x1:h.x,y1:h.y,x2:x.x,y2:x.y},i)})}return vh("group",null,jv(n,"x")?vh("line",{style:r({x1:s,y1:"coord"===a?g.y:d,x2:l,y2:"coord"===a?g.y:d},i)}):null,jv(n,"y")?vh("line",{style:r({x1:"coord"===o?g.x:f,y1:u,x2:"coord"===o?g.x:f,y2:c},i)}):null)},Wv=function(t){var e=t.xTip,n=t.xPositionType,i=t.xTipTextStyle,o=t.records[0],a=o.coord,s=o.name;return vh("rect",{style:r({display:"flex",left:"coord"===n?a.x:o.x,top:t.coord.bottom},t.xTipBackground)},vh("text",{style:r(r({},i),{text:"coord"===n?a.xText:h(e)?e(s,o):s})}))},zv=function(t){var e=t.yTip,n=t.yPositionType,i=t.yTipTextStyle,o=t.records[0],a=o.coord,s=o.value;return vh("rect",{style:r({display:"flex",left:t.coord.left,top:"coord"===n?a.y:o.y},t.yTipBackground)},vh("text",{style:r(r({},i),{text:"coord"===n?a.yText:h(e)?e(s,o):s})}))},Vv=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.style={},e}return n(e,t),e.prototype.getMaxItemBox=function(t){var e=0,n=0;return(t.children||[]).forEach((function(t){var r=t.layout,i=r.height;e=Math.max(e,r.width),n=Math.max(n,i)})),{width:e,height:n}},e.prototype._getContainerLayout=function(){var t=this.props,e=t.records;if(e&&e.length){var n=t.coord.width,r=rc(this,this.render()),i=this.getMaxItemBox(null==r?void 0:r.children[0]).width;e.length>Math.max(1,Math.floor(n/i))&&(this.style={width:n})}},e.prototype.willMount=function(){this._getContainerLayout()},e.prototype.render=function(){var t=this,e=this.props,n=e.records,i=e.background,o=e.showItemMarker,a=e.itemMarkerStyle,s=e.customText,u=e.nameStyle,l=e.valueStyle,c=e.joinString,p=e.arrowWidth,f=e.x,d=e.coord,y=e.itemWidth,v=function(e,d){return vh("group",{style:{display:"flex"}},vh("group",{style:r(r({display:"flex",flexDirection:"row",flexWrap:"wrap",padding:[0,0,0,"6px"],left:e,top:d},t.style),i)},n.map((function(t){var e=t.name,n=t.value;return vh("group",{style:{display:"flex",flexDirection:"row",alignItems:"center",padding:[0,"6px",0,0],width:y}},o?vh("marker",{style:r(r({width:a.width,marginRight:"6px"},a),{fill:t.color})}):null,s&&h(s)?s(t):vh("group",{style:{display:"flex",flexDirection:"row"}},vh("text",{style:r(r({},u),{text:n?"".concat(e).concat(c):e})}),vh("text",{style:r(r({},l),{text:n})})))}))),vh("group",null,vh("polygon",{style:{points:[[f-p,d],[f+p,d],[f,d+p]],fill:i.fill}})))},g=rc(this,v(0,0)).layout,m=d.left,x=d.right,b=g.width,M=f-b/2,w=d.top-g.height;return v(m>M?m:M>x-b?x-b:M,0>w?0:w)},e}(on),Xv=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.render=function(){var t=this.props,e=this.context,n=t.records,i=t.coord,o=n[0],a=o.x,s=o.coord,u=t.chart,l=t.background,c=t.showTooltipMarker,h=void 0===c?Bv.showTooltipMarker:c,p=t.markerBackgroundStyle,f=void 0===p?Bv.markerBackgroundStyle:p,d=t.showItemMarker,y=void 0===d?Bv.showItemMarker:d,v=t.nameStyle,g=t.valueStyle,m=t.joinString,x=void 0===m?Bv.joinString:m,b=t.showCrosshairs,M=void 0===b?Bv.showCrosshairs:b,w=t.crosshairsStyle,E=t.crosshairsType,k=void 0===E?Bv.crosshairsType:E,S=t.snap,P=void 0===S?Bv.snap:S,T=t.tooltipMarkerStyle,N=void 0===T?Bv.tooltipMarkerStyle:T,C=t.showXTip,A=t.xPositionType,O=t.showYTip,R=t.yPositionType,L=t.xTip,_=t.yTip,I=t.xTipTextStyle,D=void 0===I?Bv.xTipTextStyle:I,F=t.yTipTextStyle,B=void 0===F?Bv.yTipTextStyle:F,j=t.xTipBackground,G=void 0===j?Bv.xTipBackground:j,Y=t.yTipBackground,W=void 0===Y?Bv.yTipBackground:Y,z=t.custom,V=void 0!==z&&z,X=t.customText,U=t.itemWidth,H=r(r({},t.itemMarkerStyle),Bv.itemMarkerStyle),q=r(r({},Bv.background),l),Z=e.px2hd("6px");return vh("group",null,h?vh(Gv,{coord:i,context:e,records:n,markerBackgroundStyle:f}):null,M?vh(Yv,{chart:u,coord:i,records:n,xPositionType:A,yPositionType:R,crosshairsType:k,crosshairsStyle:r(r({},Bv.crosshairsStyle),w)}):null,P?n.map((function(t){var e=t.color;return vh("circle",{style:r(r({cx:"coord"===A?s.x:t.x,cy:"coord"===R?s.y:t.y,r:"6px",stroke:e,fill:e},t.shape),N)})})):null,C&&vh(Wv,{records:n,coord:i,xTip:L,xPositionType:A,xTipTextStyle:r(r({},Bv.xTipTextStyle),D),xTipBackground:r(r({},Bv.xTipBackground),G)}),O&&vh(zv,{records:n,coord:i,yTip:_,yPositionType:R,yTipTextStyle:r(r({},Bv.yTipTextStyle),B),yTipBackground:r(r({},Bv.yTipBackground),W)}),!V&&vh(Vv,{records:n,coord:i,itemMarkerStyle:H,customText:X,showItemMarker:y,x:a,arrowWidth:Z,background:q,nameStyle:r(r({},Bv.nameStyle),v),valueStyle:r(r({},Bv.valueStyle),g),joinString:x,itemWidth:U}))},e}(on),Uv=Fv(Xv),Hv=ln((function(t){var e=jf.default;t.exports=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.exports.__esModule=!0,t.exports.default=t.exports})),qv=ln((function(t){var e=jf.default;t.exports=function(t){var n=Hv(t,"string");return"symbol"==e(n)?n:n+""},t.exports.__esModule=!0,t.exports.default=t.exports})),Zv=ln((function(t){t.exports=function(t,e,n){return(e=qv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports})),Kv=un(Zv);function $v(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}var Jv=ln((function(t){t.exports=function(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},t.exports.__esModule=!0,t.exports.default=t.exports})),Qv=ln((function(t){t.exports=function(t,e){if(t){if("string"==typeof t)return Jv(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)?Jv(t,e):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports})),tg=ln((function(t){t.exports=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Qv(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 o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}},t.exports.__esModule=!0,t.exports.default=t.exports})),eg=un(tg);var ng=ln((function(t){var e=jf.default;function n(){t.exports=n=function(){return i},t.exports.__esModule=!0,t.exports.default=t.exports;var r,i={},o=Object.prototype,a=o.hasOwnProperty,s=Object.defineProperty||function(t,e,n){t[e]=n.value},u="function"==typeof Symbol?Symbol:{},l=u.iterator||"@@iterator",c=u.asyncIterator||"@@asyncIterator",h=u.toStringTag||"@@toStringTag";function p(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{p({},"")}catch(r){p=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var i=Object.create((e&&e.prototype instanceof b?e:b).prototype),o=new L(r||[]);return s(i,"_invoke",{value:C(t,n,o)}),i}function d(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}i.wrap=f;var y="suspendedStart",v="suspendedYield",g="executing",m="completed",x={};function b(){}function M(){}function w(){}var E={};p(E,l,(function(){return this}));var k=Object.getPrototypeOf,S=k&&k(k(_([])));S&&S!==o&&a.call(S,l)&&(E=S);var P=w.prototype=b.prototype=Object.create(E);function T(t){["next","throw","return"].forEach((function(e){p(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,n){function r(i,o,s,u){var l=d(t[i],t,o);if("throw"!==l.type){var c=l.arg,h=c.value;return h&&"object"==e(h)&&a.call(h,"__await")?n.resolve(h.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):n.resolve(h).then((function(t){c.value=t,s(c)}),(function(t){return r("throw",t,s,u)}))}u(l.arg)}var i;s(this,"_invoke",{value:function(t,e){function o(){return new n((function(n,i){r(t,e,n,i)}))}return i=i?i.then(o,o):o()}})}function C(t,e,n){var i=y;return function(o,a){if(i===g)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:r,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=A(s,n);if(u){if(u===x)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===y)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=g;var l=d(t,e,n);if("normal"===l.type){if(i=n.done?m:v,l.arg===x)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i=m,n.method="throw",n.arg=l.arg)}}}function A(t,e){var n=e.method,i=t.iterator[n];if(i===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=r,A(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),x;var o=d(i,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,x;var a=o.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=r),e.delegate=null,x):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,x)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[l];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function e(){for(;++i<t.length;)if(a.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=r,e.done=!0,e};return o.next=o}}throw new TypeError(e(t)+" is not iterable")}return M.prototype=w,s(P,"constructor",{value:w,configurable:!0}),s(w,"constructor",{value:M,configurable:!0}),M.displayName=p(w,h,"GeneratorFunction"),i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===M||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,p(t,h,"GeneratorFunction")),t.prototype=Object.create(P),t},i.awrap=function(t){return{__await:t}},T(N.prototype),p(N.prototype,c,(function(){return this})),i.AsyncIterator=N,i.async=function(t,e,n,r,o){void 0===o&&(o=Promise);var a=new N(f(t,e,n,r),o);return i.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},T(P),p(P,h,"Generator"),p(P,l,(function(){return this})),p(P,"toString",(function(){return"[object Generator]"})),i.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},i.values=_,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(R),!t)for(var e in this)"t"===e.charAt(0)&&a.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=r)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,i){return s.type="throw",s.arg=t,e.next=n,i&&(e.method="next",e.arg=r),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(this.prev>=o.tryLoc){var u=a.call(o,"catchLoc"),l=a.call(o,"finallyLoc");if(u&&l){if(o.catchLoc>this.prev)return n(o.catchLoc,!0);if(o.finallyLoc>this.prev)return n(o.finallyLoc)}else if(u){if(o.catchLoc>this.prev)return n(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(this.prev>=r.tryLoc&&a.call(r,"finallyLoc")&&r.finallyLoc>this.prev){var i=r;break}}i&&("break"===t||"continue"===t)&&e>=i.tryLoc&&i.finallyLoc>=e&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,x):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),x},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),R(n),x}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;R(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:_(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=r),x}},i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),rg=ng(),ig=rg;try{regeneratorRuntime=rg}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=rg:Function("r","regeneratorRuntime = r")(rg)}var og=ig.mark(ag);function ag(){var t,e,n,r,i,o;return ig.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n=[t=this];case 1:e=n.reverse(),n=[];case 2:if(!(t=e.pop())){a.next=8;break}return a.next=5,t;case 5:if(r=t.children)for(i=0,o=r.length;o>i;++i)n.push(r[i]);a.next=2;break;case 8:if(n.length){a.next=1;break}case 9:case"end":return a.stop()}}),og,this)}function sg(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=lg)):void 0===e&&(e=ug);for(var n,r,i,o,a,s=new pg(t),u=[s];n=u.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)u.push(r=i[o]=new pg(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(hg)}function ug(t){return t.children}function lg(t){return Array.isArray(t)?t[1]:null}function cg(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function hg(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function pg(t){this.data=t,this.depth=this.height=0,this.parent=null}function fg(){return 0}function dg(t){return function(){return t}}function yg(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function vg(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,l=t.value&&(r-e)/t.value;++s<u;)(o=a[s]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*l}function gg(){var t=1,e=1,n=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=n,i.x1=t,i.y1=e/o,i.eachBefore(function(t,e){return function(r){r.children&&vg(r,r.x0,t*(r.depth+1)/e,r.x1,t*(r.depth+2)/e);var i=r.x0,o=r.y0,a=r.x1-n,s=r.y1-n;i>a&&(i=a=(i+a)/2),o>s&&(o=s=(o+s)/2),r.x0=i,r.y0=o,r.x1=a,r.y1=s}}(e,o)),r&&i.eachBefore(yg),i}return i.round=function(t){return arguments.length?(r=!!t,i):r},i.size=function(n){return arguments.length?(t=+n[0],e=+n[1],i):[t,e]},i.padding=function(t){return arguments.length?(n=+t,i):n},i}function mg(t,e,n,r,i){for(var o,a=t.children,s=-1,u=a.length,l=t.value&&(i-n)/t.value;++s<u;)(o=a[s]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*l}pg.prototype=sg.prototype=Kv({constructor:pg,count:function(){return this.eachAfter($v)},each:function(t,e){var n,r=-1,i=eg(this);try{for(i.s();!(n=i.n()).done;){t.call(e,n.value,++r,this)}}catch(t){i.e(t)}finally{i.f()}return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],u=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;i>r;++r)a.push(n[r]);for(;o=s.pop();)t.call(e,o,++u,this);return this},eachBefore:function(t,e){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(t.call(e,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(t,e){var n,r=-1,i=eg(this);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(t.call(e,o,++r,this))return o}}catch(t){i.e(t)}finally{i.f()}},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)r.push(e=e.parent);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return sg(this).eachBefore(cg)}},Symbol.iterator,ag);var xg=function t(e){function n(t,n,r,i,o){!function(t,e,n,r,i,o){for(var a,s,u,l,c,h,p,f,d,y,v,g=[],m=e.children,x=0,b=0,M=m.length,w=e.value;M>x;){u=i-n,l=o-r;do{c=m[b++].value}while(!c&&M>b);for(h=p=c,d=Math.max(p/(v=c*c*(y=Math.max(l/u,u/l)/(w*t))),v/h);M>b;++b){if(c+=s=m[b].value,h>s&&(h=s),s>p&&(p=s),(f=Math.max(p/(v=c*c*y),v/h))>d){c-=s;break}d=f}g.push(a={value:c,dice:l>u,children:m.slice(x,b)}),a.dice?vg(a,n,r,i,w?r+=l*c/w:o):mg(a,n,r,w?n+=u*c/w:i,o),w-=c,x=b}}(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(1.618033988749895);function bg(){var t=xg,e=!1,n=1,r=1,i=[0],o=fg,a=fg,s=fg,u=fg,l=fg;function c(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(h),i=[0],e&&t.eachBefore(yg),t}function h(e){var n=i[e.depth],r=e.x0+n,c=e.y0+n,h=e.x1-n,p=e.y1-n;r>h&&(r=h=(r+h)/2),c>p&&(c=p=(c+p)/2),e.x0=r,e.y0=c,e.x1=h,e.y1=p,e.children&&(n=i[e.depth+1]=o(e)/2,r+=l(e)-n,c+=a(e)-n,r>(h-=s(e)-n)&&(r=h=(r+h)/2),c>(p-=u(e)-n)&&(c=p=(c+p)/2),t(e,r,c,h,p))}return c.round=function(t){return arguments.length?(e=!!t,c):e},c.size=function(t){return arguments.length?(n=+t[0],r=+t[1],c):[n,r]},c.tile=function(e){return arguments.length?(t=function(t){if("function"!=typeof t)throw Error();return t}(e),c):t},c.padding=function(t){return arguments.length?c.paddingInner(t).paddingOuter(t):c.paddingInner()},c.paddingInner=function(t){return arguments.length?(o="function"==typeof t?t:dg(+t),c):o},c.paddingOuter=function(t){return arguments.length?c.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):c.paddingTop()},c.paddingTop=function(t){return arguments.length?(a="function"==typeof t?t:dg(+t),c):a},c.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:dg(+t),c):s},c.paddingBottom=function(t){return arguments.length?(u="function"==typeof t?t:dg(+t),c):u},c.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:dg(+t),c):l},c}function Mg(t,e,n,r,i){var o,a,s=t.children,u=s.length,l=Array(u+1);for(l[0]=a=o=0;u>o;++o)l[o+1]=a+=s[o].value;!function t(e,n,r,i,o,a,u){if(e>=n-1){var c=s[e];return c.x0=i,c.y0=o,c.x1=a,void(c.y1=u)}var h=l[e],p=r/2+h,f=e+1,d=n-1;for(;d>f;){var y=f+d>>>1;p>l[y]?f=y+1:d=y}l[f]-p>p-l[f-1]&&f>e+1&&--f;var v=l[f]-h,g=r-v;if(a-i>u-o){var m=r?(i*g+a*v)/r:a;t(e,f,v,i,o,m,u),t(f,n,g,m,o,a,u)}else{var x=r?(o*g+u*v)/r:u;t(e,f,v,i,o,a,x),t(f,n,g,i,x,a,u)}}(0,u,t.value,e,n,r,i)}var wg=function(t){return function(e){function i(t,n){var i=e.call(this,t,n)||this,o=t.color,a=t.data,s=t.theme,u=t.selection,l=void 0===u?{}:u;n.theme=q((0,n.px2hd)(Nf),s),i.coord=new jp,i.color=new Md(r(r({range:n.theme.colors},o),{data:a}));var c=l.defaultSelected;return i.state.selected=void 0===c?null:c,i.coordRef={current:null},i.records=[],i}return n(i,e),i.prototype.isSelected=function(t){var e=this.state.selected;if(!e||!e.length)return!1;for(var n=0,r=e.length;r>n;n++){if(Vu(t,e[n]))return!0}return!1},i.prototype.getSelectionStyle=function(t){var e=this.state.selected;if(!e||!e.length)return null;var n=this.props.selection,r=n.selectedStyle,i=n.unSelectedStyle;return this.isSelected(t)?h(r)?r(t):r:h(i)?i(t):i},i.prototype.willMount=function(){var t=this,e=t.coord,n=t.props.coord;e.updateLayout(t.layout),e.create(n)},i.prototype.willReceiveProps=function(t){var e=t.selection,n=this.props.selection;if(e&&n){var r=e.defaultSelected;Vu(r,n.defaultSelected)||(this.state.selected=r)}},i.prototype.treemapLayout=function(){var t=this,e=this,n=e.props,i=e.color,o=e.coord.getCoord(),a=o.width,s=o.height,u=n.value,l=n.space,c=void 0===l?0:l,h=sg({children:n.data}).sum((function(t){return t[u]})).sort((function(t,e){return e[u]-t[u]}));return bg().tile(Mg).round(!1).size([a,s]).paddingInner(c)(h).children.map((function(e){var n=e.data,o=e.x0,a=e.y0,s=e.x1,u=e.y1,l=i.mapping(n[i.field]),c={xMin:o,xMax:s,yMin:a,yMax:u},h=t.getSelectionStyle(n);return r(r({key:n.key,origin:n,color:l},c),{style:h})}))},i.prototype.select=function(t,e){var n=this,r=this.props.selection,i=void 0===r?{}:r,o=i.triggerOn,a=i.type,s=void 0===a?"single":a,u=i.cancelable,c=void 0===u||u;if(o&&e===o){var h="click"===o?{x:t.canvasX,y:t.canvasY}:t.points[0],p=this.state.selected,f=[];if(g(this.records,(function(t){t.xMin>h.x||h.x>t.xMax||t.yMin>h.y||h.y>t.yMax||f.push(null==t?void 0:t.origin)})),f)if(p){var d=[];f.forEach((function(t){n.isSelected(t)||d.push(t)})),this.setState("single"!==s?{selected:l(l([],d,!0),p,!0)}:{selected:c?d:f})}else this.setState({selected:f});else this.setState({selected:null})}},i.prototype.render=function(){var e=this,n=this.treemapLayout();this.records=n;var i=this.props,o=this.coord,a=o.getCoord();return vh("group",{style:{width:a.width,height:a.height,fill:"transparent"},onClick:function(t){return e.select(t,"click")},onPress:function(t){return e.select(t,"press")}},vh(t,r({nodes:n},i,{coord:o.getCoord()})))},i}(on)},Eg=function(t){var e=t.nodes,n=t.coord,i=t.onClick,o=t.label,a=void 0!==o&&o;if(n.isPolar){var s=n.center,u=s.x,l=s.y;return vh("group",null,e.map((function(t){return vh("sector",{style:r({cx:u,cy:l,lineWidth:"1px",stroke:"#fff",startAngle:t.xMin,endAngle:t.xMax,r0:t.yMin,r:t.yMax,fill:t.color},t.style),onClick:i?function(){return i(t)}:null})})))}return vh("group",null,e.map((function(t){var e=t.xMin,n=t.xMax,o=t.yMin,s=t.yMax;return vh("group",null,vh("rect",{key:t.key,style:r({x:e,y:o,width:n-e,height:s-o,fill:t.color,lineWidth:"4px",stroke:"#fff",radius:"8px"},t.style),animation:{appear:{easing:"linear",duration:450,property:["fillOpacity","strokeOpacity"],start:{fillOpacity:0,strokeOpacity:0}},update:{easing:"linear",duration:450,property:["x","y","width","height","radius","lineWidth","fillOpacity","strokeOpacity"]}},onClick:i?function(){return i(t)}:null}),a&&vh("text",{style:r({x:(e+n)/2,y:(o+s)/2,text:t.origin.name,fill:"white",textAlign:"center",textBaseline:"middle"},a)}))})))},kg=wg(Eg);function Sg(t){for(var e=t;e.depth>1;)e=e.parent;return e}var Pg=function(t){return function(e){function i(t,n){var i=e.call(this,t,n)||this,o=t.color,a=t.data;return i.coord=new jp,i.color=new Md(r(r({range:Nf.colors},o),{data:a})),i}return n(i,e),i.prototype.willMount=function(){var t=this,e=t.coord,n=t.props.coord;e.updateLayout(t.layout),e.create(n)},i.prototype.didMount=function(){},i.prototype._mapping=function(t){for(var e=this.color,n=this.coord,r=0,i=t.length;i>r;r++){var o=t[r],a=Sg(o),s=e.mapping(a.data[e.field]);o.color=s;var u=o.x0,l=o.x1,c=o.y0,h=o.y1;V(o,n.getCoord().convertRect({x:[u,l],y:[c,h]})),o.children&&o.children.length&&this._mapping(o.children)}},i.prototype.sunburst=function(){var t=this.props,e=t.value,n=t.sort,r=void 0===n||n,i=sg({children:t.data}).sum((function(t){return t[e]}));if(!0===r||h(r)){var o=h(r)?r:function(t,n){return n[e]-t[e]};i.sort(o)}var a=gg()(i);return this._mapping(a.children),a},i.prototype.render=function(){var e=this.sunburst();return vh(t,r({},this.props,{coord:this.coord.getCoord(),node:e,triggerRef:this.triggerRef}))},i}(on)},Tg=function(t){var e=t.onClick,n=t.coord.center,r=n.x,i=n.y,o=function(t){return vh("group",null,t.map((function(t){var n=t.xMax,a=t.yMin,s=t.yMax,u=t.color,l=t.children;return vh("group",{onClick:e},vh("sector",{attrs:{cx:r,cy:i,lineWidth:"1px",stroke:"#fff",startAngle:"".concat(t.xMin," rad"),endAngle:"".concat(n," rad"),r0:a,r:s,fill:u}}),l&&l.length?o(l):null)})))};return o(t.node.children)},Ng=function(t){var e=t.onClick,n=function(t){return vh("group",null,t.map((function(t){var r=t.xMin,i=t.yMin,o=t.children;return vh("group",{onClick:e},vh("rect",{attrs:{x:r,y:i,width:t.xMax-r,height:t.yMax-i,lineWidth:"1px",stroke:"#fff",fill:t.color}}),o&&o.length?n(o):null)})))};return n(t.node.children)},Cg=Pg((function(t){return vh("polar"===t.coord.type?Tg:Ng,r({},t))})),Ag={anchorOffset:"10px",inflectionOffset:"30px",sidePadding:"15px",height:"64px",adjustOffset:"30",triggerOn:"click",label1OffsetY:"-4px",label2OffsetY:"4px"};function Og(t,e,n){return{x:t.x+n*Math.cos(e),y:t.y+n*Math.sin(e)}}function Rg(t,e,n,r){var i=r.x,o=t.sort((function(t,e){var n=Math.abs(t.x-i);return Math.abs(e.x-i)-n}));return[o.slice(0,o.length-n),o.slice(o.length-n).concat(e)]}function Lg(t){return t>=-Math.PI/2&&0>t}function _g(t){return t>=0&&Math.PI/2>t}function Ig(t){return t>=Math.PI/2&&Math.PI>t}function Dg(t){return t>=Math.PI&&3*Math.PI/2>t}var Fg=function(t){return function(e){function i(t){return e.call(this,t)||this}return n(i,e),i.prototype.willMount=function(){},i.prototype.didMount=function(){},i.prototype.getLabels=function(t){var e=t.chart,n=t.coord,r=t.anchorOffset,i=t.inflectionOffset,o=t.label1,a=t.label2,s=t.sidePadding,u=n.center,l=n.radius,c=n.width,p=n.height,f=n.left,d=n.right,y=n.top,v=Math.floor(p/t.height),g=2*v,m=e.getGeometrys()[0].flatRecords().sort((function(t,e){return e.xMax-e.xMin-(t.xMax-t.xMin)})).slice(0,g),x=[[],[]];if(m.forEach((function(t){var e,n,s=t.color,c=t.origin,p=((e=t.xMin)>(n=t.xMax)&&(n+=2*Math.PI),(n+e)/2),f=Og(u,p,l+r),d=Og(u,p,l+i),y=u.x>f.x?"left":"right",v={origin:c,angle:p,anchor:f,inflection:d,side:y,x:d.x,y:d.y,r:l+i,color:s,label1:h(o)?o(c,t):o,label2:h(a)?a(c,t):a};"left"===y?x[0].push(v):x[1].push(v)})),x[0].length>v)x=Rg(x[0],x[1],x[0].length-v,u);else if(x[1].length>v){var b=Rg(x[1],x[0],x[1].length-v,u);x=[b[1],b[0]]}var M=c/2-l-r-i-2*s,w=[];return x.forEach((function(t,e){var n=0===e?"left":"right";t.sort((function(t,e){var r=t.angle,i=e.angle;return"left"===n?(r=Lg(r)?r+2*Math.PI:r,(i=Lg(i)?i+2*Math.PI:i)-r):(r=Dg(r)?r-2*Math.PI:r)-(i=Dg(i)?i-2*Math.PI:i)}));var r=t.map((function(t){return t.y})),i=Math.max.apply(null,r),o=Math.min.apply(null,r),a=t.length,u=p/a,l=u/2;t.forEach("left"===n?function(t,e){var r=t.angle,c=t.x,h=t.y,p=[t.anchor,t.inflection],d=f+s,v=y+l+u*e,g={x:d+M+2*e,y:v},m={x:d,y:v};if(Lg(r))p.push({x:c,y:x=o-2*(a-e)}),p.push({x:g.x,y:x});else if(Ig(r)||Dg(r))p.push({x:g.x,y:h});else if(_g(r)){var x;p.push({x:c,y:x=i+2*e}),p.push({x:g.x,y:x})}p.push(g),p.push(m),t.points=p,t.side=n,w.push(t)}:function(t,e){var r=t.angle,c=t.x,h=t.y,p=[t.anchor,t.inflection],f=d-s,v=y+l+u*e,g={x:f-M-2*e,y:v},m={x:f,y:v};if(Dg(r))p.push({x:c,y:x=o-2*(a-e)}),p.push({x:g.x,y:x});else if(Lg(r)||_g(r))p.push({x:g.x,y:h});else if(Ig(r)){var x;p.push({x:c,y:x=i+2*e}),p.push({x:g.x,y:x})}p.push(g),p.push(m),t.points=p,t.side=n,w.push(t)})})),w},i.prototype.render=function(){var e=this.context.px2hd(q({},Ag,this.props)),n=this.getLabels(e);return vh(t,r({labels:n},e))},i}(on)},Bg=function(t){var e=t.lineStyle,n=t.anchorStyle,i=t.label1OffsetY,o=t.label2OffsetY,a=t.onClick;return vh("group",{ref:t.triggerRef},t.labels.map((function(t){var s=t.origin,u=t.anchor,l=t.side,c=t.color,h=t.label1,p=t.label2,f=t.points,d=f[f.length-1];return vh("group",{onClick:a?function(){a(t)}:null},vh("circle",{attrs:r({r:"4px",cx:u.x,cy:u.y,fill:c},n)}),vh("polyline",{attrs:r({points:f.map((function(t){return[t.x,t.y]})),lineWidth:"2px",stroke:c},e)}),vh("text",{className:"click",attrs:r({x:d.x,y:d.y+i,fontSize:"24px",lineHeight:"24px",fill:c,textBaseline:"bottom",textAlign:"left"===l?"left":"right"},h),data:s}),vh("text",{className:"click",attrs:r({x:d.x,y:d.y+o,fontSize:"24px",lineHeight:"24px",fill:"#808080",textBaseline:"top",textAlign:"left"===l?"left":"right"},p),data:s}))})))},jg=Fg(Bg),Gg=function(t,e,n){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}},Yg=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.render=function(){var e=this.props,n=this.context,i=e.tickOffset,o=e.tickLength,a=function(t,e,n,r,i,o,a){for(var s=[],u=e-t,l=0;n>=l;l++){var c=t+u*l/n,h=Gg(r,c,i+o-a),p=Gg(r,c,i+o);s.push({tickValue:c,start:h,end:p})}return s}(e.startAngle,e.endAngle,e.tickCount,e.center,n.px2hd(e.r),n.px2hd(i),n.px2hd(o));return vh(t,r({},e,{ticks:a}))},i}(on)},Wg=function(t){var e=t.center,n=t.startAngle,r=t.endAngle,i=t.r,o=t.percent,a=t.ticks,s=e.x,u=e.y,l=r-n;return vh("group",null,vh("arc",{attrs:{cx:s,cy:u,r:i,startAngle:"".concat(n," rad"),endAngle:"".concat(r," rad"),lineWidth:"20px",lineCap:"round",stroke:"#e7e7e7"}}),vh("arc",{attrs:{cx:s,cy:u,r:i,startAngle:"".concat(n," rad"),endAngle:"".concat(n," rad"),lineWidth:"40px",lineCap:"round",stroke:"#0075ff"},animation:{appear:{easing:"linear",duration:500,property:["endAngle"],start:{endAngle:"".concat(n," rad")},end:{endAngle:"".concat(n+l*o," rad")}}}}),a.map((function(t){var e=t.start,n=t.end;return vh("line",{attrs:{x1:e.x,y1:e.y,x2:n.x,y2:n.y,lineWidth:"6px",lineCap:"round",stroke:"#e7e7e7"}})})))},zg=Yg(Wg);function Vg(t,e){if(t.length!==e.length)return!1;var n=t.length-1;return t[0]===e[0]&&t[n]===e[n]}function Xg(t,e,n){var r=t.isLinear;return t.isCategory?function(t,e,n){var r=t.values,i=t.ticks,o=t.tickMethod,a=t.tickCount,s=e.values,u=s.length,l=n[0]*u,c=Math.round(parseFloat((n[1]*u-l).toFixed(3))),h=Math.min(Math.round(l),u-c),p=s.slice(h,h+c),f=Math.round(a*s.length/p.length),d=Yp(o)({tickCount:f,values:s});if(!Vg(r,p)||!Vg(i,d))return t.change({values:p,ticks:d}),t}(t,e,n):r?function(t,e,n){var r=e.min,i=e.max;t.change({min:r+(i-r)*n[0],max:r+(i-r)*n[1],nice:!1})}(t,e,n):void 0}function Ug(t,e,n){var r=e.field,i=e.type,o={};return e.values.forEach((function(t){o[t]=!0})),t.map((function(t){var e=t.field,a=[];return n.forEach((function(t){var n="timeCat"===i?Ff(t[r]):t[r];if(o[n]){var s=t[e];y(s)?a.push.apply(a,s):a.push(s)}})),function(t,e){if(t.isLinear){var n=S(e);return t.change({min:n.min,max:n.max,nice:!0})}}(t,a)}))}function Hg(t,e,n){return(e-t)*n+t}function qg(t,e){if(!e)return!1;for(var n=0,r=t.length;r>n;n++)if(!I(t[n],e[n]))return!1;return!0}function Zg(t,e){if(!e)return!1;if(y(t))return qg(t,e);for(var n in t)if(!qg(t[n],e[n]))return!1;return!0}function Kg(t,e){return new t.constructor(r(r({},t.__cfg__),e))}var $g=function(t){return function(e){function i(t){var n=this;(n=e.call(this,r(r({},{onPanStart:function(){},onPinchStart:function(){},onPan:function(){},onPinch:function(){},onInit:function(){},onPanEnd:function(){},onPinchEnd:function(){},minCount:10}),t))||this).scale={},n.originScale={},n.swipeEnd={startX:0,startY:0,endX:0,endY:0},n.onPanStart=function(){var t=n.scale,e=n.props.onPanStart;n.onStart(),null==e||e({scale:t})},n.onPan=function(t){var e=n.props.onPan,r={};g(n.dims,(function(e){"x"!==e?"y"!==e||(r.y=n._doYPan(t)):r.x=n._doXPan(t)})),n.renderRange(r),null==e||e(t)},n.onPanEnd=function(){var t=n.scale,e=n.props.onPanEnd;n.onEnd(),null==e||e({scale:t})},n.onPinchStart=function(){var t=n.props.onPinchStart;n.onStart(),null==t||t()},n.onPinch=function(t){var e=n.props.onPinch,r={};g(n.dims,(function(e){"x"!==e?"y"!==e||(r.y=n._doYPinch(t)):r.x=n._doXPinch(t)})),n.renderRange(r),null==e||e(t)},n.onPinchEnd=function(){var t=n.scale,e=n.props.onPinchEnd;n.onEnd(),null==e||e({scale:t})},n.onStart=function(){n.startRange=n.state.range,n._cancelAnimationFrame()},n.onSwipe=function(t){var e=n.props,r=t.velocity,i=t.direction,o=t.velocityX,a=void 0===o?0:o,s=t.velocityY,u=void 0===s?0:s,l=e.mode,c=n.state.range;if(e.swipe&&l)if(1!==l.length){var h=t.points[0],p=h.x,f=h.y;5e-4>Math.abs((null==c?void 0:c.x[0])-0)&&a>0||5e-4>Math.abs((null==c?void 0:c.x[1])-1)&&0>a||5e-4>Math.abs((null==c?void 0:c.y[0])-0)&&0>u||5e-4>Math.abs((null==c?void 0:c.x[1])-1)&&u>0||(n.swipeEnd={startX:p,startY:f,endX:p+50*a,endY:f-50*u},n.onStart(),n.update())}else n.animateSwipe(l,c[l],"right"===i||"down"===i?-r:r)},n.onEnd=function(){n.startRange=null};var i=t.mode;return n.dims=y(i)?i:[i],n}return n(i,e),i.prototype.didMount=function(){(0,this.props.onInit)({scale:this.scale}),this._bindEvents()},i.prototype.willReceiveProps=function(t){var e=t.range,n=this.props,r=n.range;if(t.data!==n.data&&this._cancelAnimationFrame(),!Vu(e,r)){var i={};g(this.dims,(function(t){i[t]=e})),this.state={range:i}}},i.prototype.willMount=function(){var t=this,e=this.props,n=e.minCount,r=e.range,i=5e-324,o={};g(this.dims,(function(e){var n=t._getScale(e),a=n.values;i=a.length>i?a.length:i,t.scale[e]=n,t.originScale[e]=Kg(n),t.updateRange(r,e),o[e]=r})),this.minScale=n/i,this.renderRange(o)},i.prototype.willUpdate=function(){var t=this,e=this,n=e.props,i=e.state,o=n.minCount,a=n.range,s=5e-324,u={};if(g(e.dims,(function(e){var n=t._getScale(e);if(n!==t.scale[e]){var r=n.values;s=r.length>s?r.length:s,t.scale[e]=n,t.originScale[e]=Kg(n),t.state.range[e]=[0,1],t.updateRange(a,e),u[e]=a}})),Object.keys(u).length>0){this.minScale=o/s;var l=r(r({},i.range),u);this.renderRange(l)}},i.prototype.didUnmount=function(){this._cancelAnimationFrame(),this._unBindEvents()},i.prototype._requestAnimationFrame=function(t){return this.loop=(0,this.context.canvas.requestAnimationFrame)(t),this.loop},i.prototype._cancelAnimationFrame=function(){var t=this.loop;t&&this.context.canvas.cancelAnimationFrame(t)},i.prototype._bindEvents=function(){var t=this.props,e=t.chart,n=t.pinch,r=t.swipe;!1!==t.pan&&(e.on("panstart",this.onPanStart),e.on("pan",this.onPan),e.on("panend",this.onPanEnd)),!1!==n&&(e.on("pinch",this.onPinch),e.on("pinchstart",this.onPinchStart),e.on("pinchend",this.onPinchEnd)),!1!==r&&e.on("swipe",this.onSwipe)},i.prototype._unBindEvents=function(){var t=this.props,e=t.chart,n=t.pinch,r=t.swipe;!1!==t.pan&&(e.off("panstart",this.onPanStart),e.off("pan",this.onPan),e.off("panend",this.onPanEnd)),!1!==n&&(e.off("pinch",this.onPinch),e.off("pinchstart",this.onPinchStart),e.off("pinchend",this.onPinchEnd)),!1!==r&&e.off("swipe",this.onSwipe)},i.prototype.update=function(){var t=this,e=this.swipeEnd,n=e.startX,r=e.startY,i=e.endX,o=e.endY,a=Hg(n,i,.05),s=Hg(r,o,.05);this.swipeEnd={startX:a,startY:s,endX:i,endY:o};var u=this.props.coord,l=u.height,c={};c.x=this._doPan((a-n)/u.width,"x"),c.y=this._doPan((s-r)/l,"y"),this.renderRange(c),this.startRange=c,this._requestAnimationFrame((function(){return t.update()})),5e-4>Math.abs(a-i)&&5e-4>Math.abs(s-o)&&(this.onEnd(),this._cancelAnimationFrame())},i.prototype.animateSwipe=function(t,e,n){var r=this,i=this.props.swipeDuration,o=void 0===i?1e3:i,a=(e[1]-e[0])*n,s=Date.now(),u=function(n){var i=r.updateRange([e[0]+a*n,e[1]+a*n],t);r.renderRange({x:i})},l=function(){var t=Date.now()-s;if(o>t){var e,n=(e=t/o)*(2-e);u(n),r._requestAnimationFrame((function(){l()}))}else u(1)};l()},i.prototype._doXPan=function(t){var e=t.direction,n=t.deltaX;if(1===this.props.mode.length&&("up"===e||"down"===e))return this.state.range.x;t.preventDefault&&t.preventDefault();var r=this.props,i=r.panSensitive;return this._doPan(n/r.coord.width*(void 0===i?1:i),"x")},i.prototype._doYPan=function(t){var e=t.direction,n=t.deltaY;if(1===this.props.mode.length&&("left"===e||"right"===e))return this.state.range.y;t.preventDefault&&t.preventDefault();var r=this.props,i=r.panSensitive;return this._doPan(-n/r.coord.height*(void 0===i?1:i),"y")},i.prototype._doPan=function(t,e){var n=this.startRange[e],r=n[0],i=n[1],o=(i-r)*t;return this.updateRange([r-o,i-o],e)},i.prototype._doXPinch=function(t){t.preventDefault&&t.preventDefault();var e=t.zoom,n=t.center,r=this.props.coord,i=r.width,o=r.right;return this._doPinch(Math.abs(n.x-r.left)/i,Math.abs(o-n.x)/i,e,"x")},i.prototype._doYPinch=function(t){t.preventDefault&&t.preventDefault();var e=t.zoom,n=t.center,r=this.props.coord,i=r.height,o=r.bottom;return this._doPinch(Math.abs(n.y-r.top)/i,Math.abs(o-n.y)/i,e,"y")},i.prototype._doPinch=function(t,e,n,r){var i=this,o=i.minScale,a=i.props.pinchSensitive,s=void 0===a?1:a,u=i.startRange[r],l=u[0],c=u[1],h=(c-l)*(1>n?(1/n-1)*s:(1-n)*s),p=h*e,f=Math.max(0,l-h*t),d=Math.min(1,c+p);return o>d-f?this.state.range[r]:this.updateRange([f,d],r)},i.prototype.updateRange=function(t,e){if(t){var n,r=t[0],i=t[1],o=i-r;n=0>r?[0,o]:i>1?[1-o,1]:t;var a=this,s=a.props,u=a.scale,l=a.originScale,c=s.data,h=s.autoFit,p=a.state.range;if(p&&Zg(n,p[e]))return n;if(Xg(u[e],l[e],n),h){var f=this._getFollowScales(e);this.updateFollow(f,u[e],c)}return n}},i.prototype.updateFollow=function(t,e,n){Ug(t,e,n)},i.prototype._getScale=function(t){var e=this.props,n=e.coord,r=e.chart;return"x"===t?n.transposed?r.getYScales()[0]:r.getXScales()[0]:n.transposed?r.getXScales()[0]:r.getYScales()[0]},i.prototype._getFollowScales=function(t){var e=this.props,n=e.coord,r=e.chart;return"x"===t?n.transposed?r.getXScales():r.getYScales():"y"===t?n.transposed?r.getYScales():r.getXScales():void 0},i.prototype.renderRange=function(t){var e=this.state,n=this.props;if(!Zg(t,e.range)){var r=n.chart,i=r.animate;r.setAnimate(!1),e.range=t,r.forceUpdate((function(){r.setAnimate(i)}))}},i.prototype.render=function(){return vh(t,r({},this.props,this.state))},i}(on)},Jg=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.willMount=function(){e.prototype.willMount.call(this);var t=this.props,n=t.visible,r=t.position,i=void 0===r?"bottom":r,o=t.margin,a=t.chart,s=this.context.px2hd(void 0===o?"16px":o);if(!1===n)return null;a.updateCoordFor(this,{position:i,width:"left"===i||"right"===i?s:0,height:"bottom"===i||"top"===i?s:0})},i.prototype.render=function(){var e=this.props;return!1===e.visible?null:vh(t,r({position:"bottom"},e,this.state))},i}($g(t))},Qg=function(t,e){var n=t.coord,i=t.range,o=t.position,a=t.layout,s=t.style,u=t.background,l=t.barStyle,c=n.left,h=n.width,p=a.top,f=a.height,d=(null==i?void 0:i.x)||(null==i?void 0:i.y),y=d[0],v=h*y,g=h*(d[1]-y);if(!isNaN(g))return vh("group",{style:r({display:"flex",left:c,top:"top"===o?p-e.px2hd("8px"):p+f},s)},vh("line",{style:r({display:"flex",position:"absolute",left:0,width:h,height:0,stroke:"rgba(202, 215, 239, .2)",lineCap:"round",lineWidth:"8px"},u)}),vh("line",{style:r({display:"flex",position:"absolute",left:v,width:g,height:0,stroke:"rgba(202, 215, 239, .5)",lineCap:"round",lineWidth:"8px"},l)}))},tm=function(t,e){var n=t.coord,i=t.range,o=t.layout,a=t.style,s=t.background,u=t.barStyle,l=n.height,c=o.left,h=o.width,p=(null==i?void 0:i.y)||(null==i?void 0:i.x),f=p[0],d=l*f,y=l*(p[1]-f);return vh("group",{style:r({display:"flex",top:n.top,left:"left"===t.position?c-e.px2hd("8px"):c+h},a)},vh("line",{style:r({position:"absolute",top:0,left:0,width:0,height:l,stroke:"rgba(202, 215, 239, .2)",lineCap:"round",lineWidth:"8px"},s)}),vh("line",{style:r({position:"absolute",top:d,width:0,height:y,stroke:"rgba(202, 215, 239, .5)",lineCap:"round",lineWidth:"8px"},u)}))},em=function(t){var e=t.position;return t.mode.length>1?vh("group",null,vh(tm,r({},t)),vh(Qg,r({},t))):vh("left"===e||"right"===e?tm:Qg,r({},t))},nm=Jg(em),rm=["#E62C3B","#0E9976","#999999"],im=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return n(i,e),i.prototype.getDefaultCfg=function(){return{geomType:"candlestick"}},i.prototype.getSize=function(){var t=this.props.sizeRatio;return 1/this.attrs.x.scale.values.length*(void 0===t?.5:t)},i.prototype._getColor=function(t,e,n){var r=e.normalized.y,i=r[0],o=r[1];if(o>i)return t[0];if(i>o)return t[1];if(!n)return t[0];var a=n.normalized.y[1];return o>a?t[0]:a>o?t[1]:t[2]},i.prototype.mapping=function(){for(var t=e.prototype.mapping.call(this),n=this.props.coord,r=this.getY0Value(),i=this.getSize(),o=this.getAttr("color"),a=o?o.range:rm,s=0,u=t.length;u>s;s++)for(var l=t[s].children,c=0,h=l.length;h>c;c++){var f=l[c],d=f.normalized,y=f.size;if(p(y)){var v=d.size;V(f,n.convertRect({x:d.x,y:d.y,y0:r,size:void 0===v?i:v}))}else{V(f,n.transformToRect({x:f.x,y:f.y,y0:r,size:y}))}f.color=this._getColor(a,f,l[c-1]),V(f.shape,this.getSelectionStyle(f))}return t},i.prototype.render=function(){var e=this.props,n=this.mapping();return vh(t,r({},e,{records:n}))},i}(Ld)},om=function(t){var e=t.animation,n=t.y0,i=t.onClick;return vh("group",null,t.records.map((function(t){return vh("group",{key:t.key},t.children.map((function(t){var o=t.key,a=t.xMin,s=t.xMax,u=t.yMin,l=t.yMax,c=t.x,h=t.y,p=t.color,f=t.shape;return isNaN(a)||isNaN(s)||isNaN(u)||isNaN(l)?null:vh("group",null,vh("line",{key:"".concat(o,"-line"),style:{x1:c,y1:h[2],x2:c,y2:h[3],stroke:p,lineWidth:"2px",lineCap:"round"},animation:{appear:{easing:"linear",duration:300,property:["y1","y2"],start:{y1:0,y2:0}},update:{easing:"linear",duration:300,property:["x1","y1","x2","y2"]}}}),vh("rect",{key:"".concat(o,"-rect"),style:r({x:a,y:u,width:Math.max(s-a,1),height:Math.max(l-u,1),fill:p,radius:"2px"},f),onClick:i,animation:q({appear:{easing:"linear",duration:300,property:["y","height"],start:{y:n,height:0}},update:{easing:"linear",duration:300,property:["x","y","width","height"]}},e)}))})))})))},am=im(om),sm=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.render=function(){var t=this.context.px2hd,e=t(this.props).symbol;return vh("group",null,this.mapping().map((function(n){return vh("group",{key:n.key},n.children.map((function(n){return vh(e,r({},n,{width:n.xMax-n.xMin,height:n.yMax-n.yMin,px2hd:t}))})))})))},e}(Vd({}));t.ArcGuide=Av,t.Area=jd,t.AreaView=Bd,t.Axis=hy,t.AxisView=cy,t.Candlestick=am,t.CandlestickView=om,t.Canvas=Sp,t.CanvasRenderer=yh,t.Chart=Cf,t.Children=sn,t.Component=on,t.Fragment=function(t){return t.children},t.Gauge=zg,t.GaugeView=Wg,t.Geometry=Ld,t.Gesture=Du,t.Guide=Dv,t.ImageGuide=Rv,t.Interval=Kd,t.IntervalView=Hd,t.Legend=dy,t.LegendView=fy,t.Line=Dd,t.LineGuide=Cv,t.LineView=Id,t.LottieGuide=_v,t.Pictorial=sm,t.PieLabel=jg,t.PieLabelView=Bg,t.Player=Op,t.Point=Qd,t.PointGuide=Nv,t.PointView=Jd,t.PolylineGuide=Iv,t.RectGuide=Ov,t.Scale=zp,t.ScrollBar=nm,t.ScrollBarView=em,t.Smooth=_u,t.Sunburst=Cg,t.SunburstView=Tg,t.TagGuide=Lv,t.TextGuide=Tv,t.Timeline=Tp,t.Tooltip=Uv,t.TooltipView=Xv,t.Treemap=kg,t.TreemapView=Eg,t.Zoom=$g,t.computeLayout=rc,t.createContext=function(t){var e={_currentValue:t},n=function(t,e){var n=t.children,r=i(t,["children"]);return Object.assign(e,r),n};return n.contextInjecter=e,e.Provider=function(t){var n=t.children;return e._currentValue=t.value,n},e.Injecter=n,e.Consumer=function(t){return(0,t.children)(e._currentValue)},e},t.createElement=vh,t.createRef=Pp,t.default={version:'"5.5.2"'},t.isEqual=Vu,t.jsx=vh,t.parseColor=Yi,t.registerTag=Bu,t.withArea=Fd,t.withAxis=ty,t.withCandlestick=im,t.withGauge=Yg,t.withGuide=yy,t.withInterval=Vd,t.withLegend=py,t.withLine=_d,t.withPieLabel=Fg,t.withPoint=$d,t.withScrollBar=Jg,t.withSunburst=Pg,t.withTooltip=Fv,t.withTreemap=wg,Object.defineProperty(t,"__esModule",{value:!0})}));
|