UNPKG

@antv/g2

Version:

the Grammar of Graphics in Javascript

1 lines 922 kB
!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).G2={})}(this,function(t){"use strict";const e=()=>[["cartesian"]];e.props={};const n=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1},n=Object.assign(Object.assign({},e),t);return Object.assign(Object.assign({},n),(r=n.startAngle,i=n.endAngle,r%=2*Math.PI,i%=2*Math.PI,r<0&&(r=2*Math.PI+r),i<0&&(i=2*Math.PI+i),r>=i&&(i+=2*Math.PI),{startAngle:r,endAngle:i}));var r,i},r=t=>{const{startAngle:e,endAngle:r,innerRadius:i,outerRadius:a}=n(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,r,i,a]]};r.props={};const i=({startAngle:t=0,endAngle:e=6*Math.PI,innerRadius:n=0,outerRadius:r=1})=>[["translate",.5,.5],["reflect.y"],["translate",-.5,-.5],["helix",t,e,n,r]];i.props={};const a=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];a.props={transform:!0};const o=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:a}=((t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)})(t);return[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:a})]};o.props={};const s=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},c=t=>{const{startAngle:e,endAngle:n,innerRadius:i,outerRadius:a}=s(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:a})]};c.props={};const l=()=>[["parallel",0,1,0,1]];l.props={};const u=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];u.props={transform:!0};const f=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=3*Math.PI/2,innerRadius:i=0,outerRadius:a=1}=t;return[["parallel",0,1,0,1],...r({startAngle:e,endAngle:n,innerRadius:i,outerRadius:a})]};f.props={};const d=({value:t})=>e=>e.map(()=>t);d.props={};const h=({value:t})=>e=>e.map(t);h.props={};const p=({value:t})=>e=>e.map(e=>e[t]);p.props={};const g=({value:t})=>()=>t;g.props={};var v=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},m=function(t,e){if(!v(t))return t;for(var n=[],r=0;r<t.length;r++){var i=t[r];e(i,r)&&n.push(i)}return n};function y(t){return"function"==typeof t}function b(t){return null==t}function x(t){return Array.isArray(t)}var w=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function k(t,e){if(t)if(x(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(w(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}var E=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return k(t,function(n,r){y(t)&&"prototype"===r||e.push(r)}),e};var M=function(t){return"object"==typeof t&&null!==t},O={}.toString,S=function(t,e){return O.call(t)==="[object "+e+"]"},A=function(t){if(!M(t)||!S(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 T(t,e){if(!x(t))return null;var n;if(y(e)&&(n=e),A(e)&&(n=function(t){return function(t,e){var n=E(e),r=n.length;if(b(t))return!r;for(var i=0;i<r;i+=1){var a=n[i];if(e[a]!==t[a]||!(a in t))return!1}return!0}(t,e)}),n)for(var r=0;r<t.length;r+=1)if(n(t[r]))return t[r];return null}var _=function(t){if(!x(t))return[];for(var e=[],n=0;n<t.length;n++)e=e.concat(t[n]);return e};function C(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],r=1;r<e;r++)n=Math.max(n,t[r]);return n}var P=function(t){if(x(t))return t.reduce(function(t,e){return Math.min(t,e)},t[0])},N=function(t,e,n){if(!x(t)&&!A(t))return t;var r=n;return k(t,function(t,n){r=e(r,t,n)}),r};function L(t){return"string"==typeof t}function j(t){if(v(t)){return t[t.length-1]}}var R=function(t,e,n){return t<e?e:t>n?n:t};function I(t){return"number"==typeof t}function D(t,e,n){return void 0===n&&(n=1e-5),t===e||Math.abs(t-e)<n}var B=function(t,e){if(x(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var a=t[i],o=y(e)?e(a):a[e];o>r&&(n=a,r=o)}return n}},F=function(t,e){if(x(t)){for(var n,r=1/0,i=0;i<t.length;i++){var a=t[i],o=y(e)?e(a):a[e];o<r&&(n=a,r=o)}return n}},z=function(t,e){return(t%e+e)%e},G=function(t){return b(t)?"":t.toString()},W=function(t){var e=G(t);return e.charAt(0).toLowerCase()+e.substring(1)};var $=function(t){var e=G(t);return e.charAt(0).toUpperCase()+e.substring(1)},H=function(t){return S(t,"Boolean")};var Y=function(t){return void 0===t};function V(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}var U=function(t){if("object"!=typeof t||null===t)return t;var e;if(x(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=U(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=U(t[i]):e[i]=t[i];return e},q=U;function X(t,e,n){var r;return function(){var i=this,a=arguments,o=n&&!r;clearTimeout(r),r=setTimeout(function(){r=null,n||t.apply(i,a)},e),o&&t.apply(i,a)}}var K=new Map;function Z(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 Q(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(Z(e,i)){var a=e[i];null!==a&&A(a)?(A(t[i])||(t[i]={}),n<r?Q(t[i],a,n+1,r):t[i]=e[i]):x(a)?(t[i]=[],t[i]=t[i].concat(a)):void 0!==a&&(t[i]=a)}}var J=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)Q(t,e[r]);return t},tt=function(t,e){if(!v(t))return-1;var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var r=-1,i=0;i<t.length;i++)if(t[i]===e){r=i;break}return r},et=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(L(t)||L(e))return!1;if(v(t)||v(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=et(t[r],e[r]));r++);return n}if(M(t)||M(e)){var i=Object.keys(t),a=Object.keys(e);if(i.length!==a.length)return!1;for(n=!0,r=0;r<i.length&&(n=et(t[i[r]],e[i[r]]));r++);return n}return!1},nt=et,rt=function(t){return t},it=function(t,e,n){for(var r=0,i=L(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},at=function(t,e,n){var r=t,i=L(e)?e.split("."):e;return i.forEach(function(t,e){e<i.length-1?(w(r[t])||(r[t]=I(i[e+1])?[]:{}),r=r[t]):r[t]=n}),t},ot=Object.prototype.hasOwnProperty,st=function(t,e){return N(t,function(t,n,r){return e.includes(r)||(t[r]=n),t},{})},ct=function(t,e,n){var r,i,a,o,s=0;n||(n={});var c=function(){s=!1===n.leading?0:Date.now(),r=null,o=t.apply(i,a),r||(i=a=null)},l=function(){var l=Date.now();s||!1!==n.leading||(s=l);var u=e-(l-s);return i=this,a=arguments,u<=0||u>e?(r&&(clearTimeout(r),r=null),s=l,o=t.apply(i,a),r||(i=a=null)):r||!1===n.trailing||(r=setTimeout(c,u)),o};return l.cancel=function(){clearTimeout(r),s=0,r=i=a=null},l},lt=function(){},ut=function(t){return t};function ft(t){return b(t)?0:v(t)?t.length:Object.keys(t).length}var dt=1e-6,ht="undefined"!=typeof Float32Array?Float32Array:Array;function pt(){var t=new ht(9);return ht!=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}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var gt=function(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],d=n[0],h=n[1],p=n[2],g=n[3],v=n[4],m=n[5],y=n[6],b=n[7],x=n[8];return t[0]=d*r+h*o+p*l,t[1]=d*i+h*s+p*u,t[2]=d*a+h*c+p*f,t[3]=g*r+v*o+m*l,t[4]=g*i+v*s+m*u,t[5]=g*a+v*c+m*f,t[6]=y*r+b*o+x*l,t[7]=y*i+b*s+x*u,t[8]=y*a+b*c+x*f,t};function vt(){var t=new ht(16);return ht!=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 mt(t){var e=new ht(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}function yt(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 bt(t,e,n,r,i,a,o,s,c,l,u,f,d,h,p,g){var v=new ht(16);return v[0]=t,v[1]=e,v[2]=n,v[3]=r,v[4]=i,v[5]=a,v[6]=o,v[7]=s,v[8]=c,v[9]=l,v[10]=u,v[11]=f,v[12]=d,v[13]=h,v[14]=p,v[15]=g,v}function xt(t,e,n,r,i,a,o,s,c,l,u,f,d,h,p,g,v){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=d,t[12]=h,t[13]=p,t[14]=g,t[15]=v,t}function wt(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 kt(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[11]=e[14],t[12]=i,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function Et(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],g=e[13],v=e[14],m=e[15],y=n*s-r*o,b=n*c-i*o,x=n*l-a*o,w=r*c-i*s,k=r*l-a*s,E=i*l-a*c,M=u*g-f*p,O=u*v-d*p,S=u*m-h*p,A=f*v-d*g,T=f*m-h*g,_=d*m-h*v,C=y*_-b*T+x*A+w*S-k*O+E*M;return C?(C=1/C,t[0]=(s*_-c*T+l*A)*C,t[1]=(i*T-r*_-a*A)*C,t[2]=(g*E-v*k+m*w)*C,t[3]=(d*k-f*E-h*w)*C,t[4]=(c*S-o*_-l*O)*C,t[5]=(n*_-i*S+a*O)*C,t[6]=(v*x-p*E-m*b)*C,t[7]=(u*E-d*x+h*b)*C,t[8]=(o*T-s*S+l*M)*C,t[9]=(r*S-n*T-a*M)*C,t[10]=(p*k-g*x+m*y)*C,t[11]=(f*x-u*k-h*y)*C,t[12]=(s*O-o*A-c*M)*C,t[13]=(n*A-r*O+i*M)*C,t[14]=(g*b-p*w-v*y)*C,t[15]=(u*w-f*b+d*y)*C,t):null}function Mt(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],f=t[10],d=t[11],h=t[12],p=t[13],g=t[14],v=t[15];return(e*o-n*a)*(f*v-d*g)-(e*s-r*a)*(u*v-d*p)+(e*c-i*a)*(u*g-f*p)+(n*s-r*o)*(l*v-d*h)-(n*c-i*o)*(l*g-f*h)+(r*c-i*s)*(l*p-u*h)}function Ot(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],d=e[9],h=e[10],p=e[11],g=e[12],v=e[13],m=e[14],y=e[15],b=n[0],x=n[1],w=n[2],k=n[3];return t[0]=b*r+x*s+w*f+k*g,t[1]=b*i+x*c+w*d+k*v,t[2]=b*a+x*l+w*h+k*m,t[3]=b*o+x*u+w*p+k*y,b=n[4],x=n[5],w=n[6],k=n[7],t[4]=b*r+x*s+w*f+k*g,t[5]=b*i+x*c+w*d+k*v,t[6]=b*a+x*l+w*h+k*m,t[7]=b*o+x*u+w*p+k*y,b=n[8],x=n[9],w=n[10],k=n[11],t[8]=b*r+x*s+w*f+k*g,t[9]=b*i+x*c+w*d+k*v,t[10]=b*a+x*l+w*h+k*m,t[11]=b*o+x*u+w*p+k*y,b=n[12],x=n[13],w=n[14],k=n[15],t[12]=b*r+x*s+w*f+k*g,t[13]=b*i+x*c+w*d+k*v,t[14]=b*a+x*l+w*h+k*m,t[15]=b*o+x*u+w*p+k*y,t}function St(t,e,n){var r,i,a,o,s,c,l,u,f,d,h,p,g=n[0],v=n[1],m=n[2];return e===t?(t[12]=e[0]*g+e[4]*v+e[8]*m+e[12],t[13]=e[1]*g+e[5]*v+e[9]*m+e[13],t[14]=e[2]*g+e[6]*v+e[10]*m+e[14],t[15]=e[3]*g+e[7]*v+e[11]*m+e[15]):(r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],d=e[9],h=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f,t[9]=d,t[10]=h,t[11]=p,t[12]=r*g+s*v+f*m+e[12],t[13]=i*g+c*v+d*m+e[13],t[14]=a*g+l*v+h*m+e[14],t[15]=o*g+u*v+p*m+e[15]),t}function At(t,e,n){var r=n[0],i=n[1],a=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Tt(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[4],o=e[5],s=e[6],c=e[7],l=e[8],u=e[9],f=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=a*i+l*r,t[5]=o*i+u*r,t[6]=s*i+f*r,t[7]=c*i+d*r,t[8]=l*i-a*r,t[9]=u*i-o*r,t[10]=f*i-s*r,t[11]=d*i-c*r,t}function _t(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],c=e[3],l=e[8],u=e[9],f=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i-l*r,t[1]=o*i-u*r,t[2]=s*i-f*r,t[3]=c*i-d*r,t[8]=a*r+l*i,t[9]=o*r+u*i,t[10]=s*r+f*i,t[11]=c*r+d*i,t}function Ct(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 Pt(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 Nt(t,e,n){var r,i,a,o=n[0],s=n[1],c=n[2],l=Math.hypot(o,s,c);return l<dt?null:(o*=l=1/l,s*=l,c*=l,r=Math.sin(e),a=1-(i=Math.cos(e)),t[0]=o*o*a+i,t[1]=s*o*a+c*r,t[2]=c*o*a-s*r,t[3]=0,t[4]=o*s*a-c*r,t[5]=s*s*a+i,t[6]=c*s*a+o*r,t[7]=0,t[8]=o*c*a+s*r,t[9]=s*c*a-o*r,t[10]=c*c*a+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function Lt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function jt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Rt(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function It(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,c=i+i,l=a+a,u=r*s,f=r*c,d=r*l,h=i*c,p=i*l,g=a*l,v=o*s,m=o*c,y=o*l;return t[0]=1-(h+g),t[1]=f+y,t[2]=d-m,t[3]=0,t[4]=f-y,t[5]=1-(u+g),t[6]=p+v,t[7]=0,t[8]=d+m,t[9]=p-v,t[10]=1-(u+h),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Dt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Bt(t,e){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],s=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.hypot(n,r,i),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(c,l,u),t}function Ft(t,e){var n=new ht(3);Bt(n,e);var r=1/n[0],i=1/n[1],a=1/n[2],o=e[0]*r,s=e[1]*i,c=e[2]*a,l=e[4]*r,u=e[5]*i,f=e[6]*a,d=e[8]*r,h=e[9]*i,p=e[10]*a,g=o+u+p,v=0;return g>0?(v=2*Math.sqrt(g+1),t[3]=.25*v,t[0]=(f-h)/v,t[1]=(d-c)/v,t[2]=(s-l)/v):o>u&&o>p?(v=2*Math.sqrt(1+o-u-p),t[3]=(f-h)/v,t[0]=.25*v,t[1]=(s+l)/v,t[2]=(d+c)/v):u>p?(v=2*Math.sqrt(1+u-o-p),t[3]=(d-c)/v,t[0]=(s+l)/v,t[1]=.25*v,t[2]=(f+h)/v):(v=2*Math.sqrt(1+p-o-u),t[3]=(s-l)/v,t[0]=(d+c)/v,t[1]=(f+h)/v,t[2]=.25*v),t}function zt(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],c=e[3],l=a+a,u=o+o,f=s+s,d=a*l,h=a*u,p=a*f,g=o*u,v=o*f,m=s*f,y=c*l,b=c*u,x=c*f,w=r[0],k=r[1],E=r[2],M=i[0],O=i[1],S=i[2],A=(1-(g+m))*w,T=(h+x)*w,_=(p-b)*w,C=(h-x)*k,P=(1-(d+m))*k,N=(v+y)*k,L=(p+b)*E,j=(v-y)*E,R=(1-(d+g))*E;return t[0]=A,t[1]=T,t[2]=_,t[3]=0,t[4]=C,t[5]=P,t[6]=N,t[7]=0,t[8]=L,t[9]=j,t[10]=R,t[11]=0,t[12]=n[0]+M-(A*M+C*O+L*S),t[13]=n[1]+O-(T*M+P*O+j*S),t[14]=n[2]+S-(_*M+N*O+R*S),t[15]=1,t}function Gt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,c=i+i,l=n*o,u=r*o,f=r*s,d=i*o,h=i*s,p=i*c,g=a*o,v=a*s,m=a*c;return t[0]=1-f-p,t[1]=u+m,t[2]=d-v,t[3]=0,t[4]=u-m,t[5]=1-l-p,t[6]=h+g,t[7]=0,t[8]=d+v,t[9]=h-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Wt(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,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?(a=1/(r-i),t[10]=(i+r)*a,t[14]=2*i*r*a):(t[10]=-1,t[14]=-2*r),t}var $t=Wt;function Ht(t,e,n,r,i,a,o){var s=1/(e-n),c=1/(r-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,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)*c,t[14]=(o+a)*l,t[15]=1,t}var Yt=Ht;function Vt(t,e,n,r,i,a,o){var s=1/(e-n),c=1/(r-i),l=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*c,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)*c,t[14]=a*l,t[15]=1,t}function Ut(t,e,n,r){var i,a,o,s,c,l,u,f,d,h,p=e[0],g=e[1],v=e[2],m=r[0],y=r[1],b=r[2],x=n[0],w=n[1],k=n[2];return Math.abs(p-x)<dt&&Math.abs(g-w)<dt&&Math.abs(v-k)<dt?wt(t):(u=p-x,f=g-w,d=v-k,i=y*(d*=h=1/Math.hypot(u,f,d))-b*(f*=h),a=b*(u*=h)-m*d,o=m*f-y*u,(h=Math.hypot(i,a,o))?(i*=h=1/h,a*=h,o*=h):(i=0,a=0,o=0),s=f*o-d*a,c=d*i-u*o,l=u*a-f*i,(h=Math.hypot(s,c,l))?(s*=h=1/h,c*=h,l*=h):(s=0,c=0,l=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=a,t[5]=c,t[6]=f,t[7]=0,t[8]=o,t[9]=l,t[10]=d,t[11]=0,t[12]=-(i*p+a*g+o*v),t[13]=-(s*p+c*g+l*v),t[14]=-(u*p+f*g+d*v),t[15]=1,t)}function qt(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}function Xt(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]}var Kt=Ot,Zt=qt,Qt=Object.freeze({__proto__:null,create:vt,clone:mt,copy:yt,fromValues:bt,set:xt,identity:wt,transpose:kt,invert:Et,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],g=e[13],v=e[14],m=e[15];return t[0]=s*(d*m-h*v)-f*(c*m-l*v)+g*(c*h-l*d),t[1]=-(r*(d*m-h*v)-f*(i*m-a*v)+g*(i*h-a*d)),t[2]=r*(c*m-l*v)-s*(i*m-a*v)+g*(i*l-a*c),t[3]=-(r*(c*h-l*d)-s*(i*h-a*d)+f*(i*l-a*c)),t[4]=-(o*(d*m-h*v)-u*(c*m-l*v)+p*(c*h-l*d)),t[5]=n*(d*m-h*v)-u*(i*m-a*v)+p*(i*h-a*d),t[6]=-(n*(c*m-l*v)-o*(i*m-a*v)+p*(i*l-a*c)),t[7]=n*(c*h-l*d)-o*(i*h-a*d)+u*(i*l-a*c),t[8]=o*(f*m-h*g)-u*(s*m-l*g)+p*(s*h-l*f),t[9]=-(n*(f*m-h*g)-u*(r*m-a*g)+p*(r*h-a*f)),t[10]=n*(s*m-l*g)-o*(r*m-a*g)+p*(r*l-a*s),t[11]=-(n*(s*h-l*f)-o*(r*h-a*f)+u*(r*l-a*s)),t[12]=-(o*(f*v-d*g)-u*(s*v-c*g)+p*(s*d-c*f)),t[13]=n*(f*v-d*g)-u*(r*v-i*g)+p*(r*d-i*f),t[14]=-(n*(s*v-c*g)-o*(r*v-i*g)+p*(r*c-i*s)),t[15]=n*(s*d-c*f)-o*(r*d-i*f)+u*(r*c-i*s),t},determinant:Mt,multiply:Ot,translate:St,scale:At,rotate:function(t,e,n,r){var i,a,o,s,c,l,u,f,d,h,p,g,v,m,y,b,x,w,k,E,M,O,S,A,T=r[0],_=r[1],C=r[2],P=Math.hypot(T,_,C);return P<dt?null:(T*=P=1/P,_*=P,C*=P,i=Math.sin(n),o=1-(a=Math.cos(n)),s=e[0],c=e[1],l=e[2],u=e[3],f=e[4],d=e[5],h=e[6],p=e[7],g=e[8],v=e[9],m=e[10],y=e[11],b=T*T*o+a,x=_*T*o+C*i,w=C*T*o-_*i,k=T*_*o-C*i,E=_*_*o+a,M=C*_*o+T*i,O=T*C*o+_*i,S=_*C*o-T*i,A=C*C*o+a,t[0]=s*b+f*x+g*w,t[1]=c*b+d*x+v*w,t[2]=l*b+h*x+m*w,t[3]=u*b+p*x+y*w,t[4]=s*k+f*E+g*M,t[5]=c*k+d*E+v*M,t[6]=l*k+h*E+m*M,t[7]=u*k+p*E+y*M,t[8]=s*O+f*S+g*A,t[9]=c*O+d*S+v*A,t[10]=l*O+h*S+m*A,t[11]=u*O+p*S+y*A,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:Tt,rotateY:_t,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],c=e[3],l=e[4],u=e[5],f=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=a*i+l*r,t[1]=o*i+u*r,t[2]=s*i+f*r,t[3]=c*i+d*r,t[4]=l*i-a*r,t[5]=u*i-o*r,t[6]=f*i-s*r,t[7]=d*i-c*r,t},fromTranslation:Ct,fromScaling:Pt,fromRotation:Nt,fromXRotation:Lt,fromYRotation:jt,fromZRotation:Rt,fromRotationTranslation:It,fromQuat2:function(t,e){var n=new ht(3),r=-e[0],i=-e[1],a=-e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=r*r+i*i+a*a+o*o;return f>0?(n[0]=2*(s*o+u*r+c*a-l*i)/f,n[1]=2*(c*o+u*i+l*r-s*a)/f,n[2]=2*(l*o+u*a+s*i-c*r)/f):(n[0]=2*(s*o+u*r+c*a-l*i),n[1]=2*(c*o+u*i+l*r-s*a),n[2]=2*(l*o+u*a+s*i-c*r)),It(t,e,n),t},getTranslation:Dt,getScaling:Bt,getRotation:Ft,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],c=i+i,l=a+a,u=o+o,f=i*c,d=i*l,h=i*u,p=a*l,g=a*u,v=o*u,m=s*c,y=s*l,b=s*u,x=r[0],w=r[1],k=r[2];return t[0]=(1-(p+v))*x,t[1]=(d+b)*x,t[2]=(h-y)*x,t[3]=0,t[4]=(d-b)*w,t[5]=(1-(f+v))*w,t[6]=(g+m)*w,t[7]=0,t[8]=(h+y)*k,t[9]=(g-m)*k,t[10]=(1-(f+p))*k,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:zt,fromQuat:Gt,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),c=1/(i-r),l=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*c,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*c,t[10]=(o+a)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*l,t[15]=0,t},perspectiveNO:Wt,perspective:$t,perspectiveZO:function(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,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?(a=1/(r-i),t[10]=i*a,t[14]=i*r*a):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),c=2/(o+s),l=2/(i+a);return t[0]=c,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-s)*c*.5,t[9]=(i-a)*l*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:Ht,ortho:Yt,orthoZO:Vt,lookAt:Ut,targetTo:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=r[0],c=r[1],l=r[2],u=i-n[0],f=a-n[1],d=o-n[2],h=u*u+f*f+d*d;h>0&&(u*=h=1/Math.sqrt(h),f*=h,d*=h);var p=c*d-l*f,g=l*u-s*d,v=s*f-c*u;return(h=p*p+g*g+v*v)>0&&(p*=h=1/Math.sqrt(h),g*=h,v*=h),t[0]=p,t[1]=g,t[2]=v,t[3]=0,t[4]=f*v-d*g,t[5]=d*p-u*v,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=d,t[11]=0,t[12]=i,t[13]=a,t[14]=o,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:qt,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:Xt,equals:function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=t[9],d=t[10],h=t[11],p=t[12],g=t[13],v=t[14],m=t[15],y=e[0],b=e[1],x=e[2],w=e[3],k=e[4],E=e[5],M=e[6],O=e[7],S=e[8],A=e[9],T=e[10],_=e[11],C=e[12],P=e[13],N=e[14],L=e[15];return Math.abs(n-y)<=dt*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(r-b)<=dt*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=dt*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(a-w)<=dt*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-k)<=dt*Math.max(1,Math.abs(o),Math.abs(k))&&Math.abs(s-E)<=dt*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(c-M)<=dt*Math.max(1,Math.abs(c),Math.abs(M))&&Math.abs(l-O)<=dt*Math.max(1,Math.abs(l),Math.abs(O))&&Math.abs(u-S)<=dt*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-A)<=dt*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(d-T)<=dt*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(h-_)<=dt*Math.max(1,Math.abs(h),Math.abs(_))&&Math.abs(p-C)<=dt*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(g-P)<=dt*Math.max(1,Math.abs(g),Math.abs(P))&&Math.abs(v-N)<=dt*Math.max(1,Math.abs(v),Math.abs(N))&&Math.abs(m-L)<=dt*Math.max(1,Math.abs(m),Math.abs(L))},mul:Kt,sub:Zt});function Jt(){var t=new ht(3);return ht!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function te(t){var e=new ht(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function ee(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function ne(t,e,n){var r=new ht(3);return r[0]=t,r[1]=e,r[2]=n,r}function re(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ie(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function ae(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function oe(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function se(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function ce(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function le(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ue(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],c=n[2];return t[0]=i*c-a*s,t[1]=a*o-r*c,t[2]=r*s-i*o,t}function fe(t,e,n,r){var i=e[0],a=e[1],o=e[2];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o),t}function de(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return o=o||1,t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/o,t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t}function he(t,e,n){var r=e[0],i=e[1],a=e[2];return t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8],t}function pe(t,e){var n=t[0],r=t[1],i=t[2],a=e[0],o=e[1],s=e[2];return Math.abs(n-a)<=dt*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(r-o)<=dt*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=dt*Math.max(1,Math.abs(i),Math.abs(s))}var ge=oe,ve=function(t,e){var n=e[0]-t[0],r=e[1]-t[1],i=e[2]-t[2];return Math.hypot(n,r,i)},me=ee;function ye(){var t=new ht(4);return ht!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function be(t,e,n,r){var i=new ht(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i}function xe(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,t}function we(){var t=new ht(4);return ht!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ke(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function Ee(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=n[0],c=n[1],l=n[2],u=n[3];return t[0]=r*u+o*s+i*l-a*c,t[1]=i*u+o*c+a*s-r*l,t[2]=a*u+o*l+r*c-i*s,t[3]=o*u-r*s-i*c-a*l,t}function Me(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=a*s,t}function Oe(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(n),c=Math.cos(n),l=Math.sin(r),u=Math.cos(r);return t[0]=a*c*u-o*s*l,t[1]=o*s*u+a*c*l,t[2]=o*c*l-a*s*u,t[3]=o*c*u+a*s*l,t}Jt(),function(){var t=ye()}();var Se=be,Ae=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Te=function(t,e,n,r,i){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t},_e=Ee,Ce=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=r*o,t[2]=i*o,t[3]=a*o,t};function Pe(){var t=new ht(2);return ht!=Float32Array&&(t[0]=0,t[1]=0),t}Jt(),ne(1,0,0),ne(0,1,0),we(),we(),pt(),function(){var t=Pe()}();var Ne=function(t,e){return Ne=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])},Ne(t,e)};function Le(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Ne(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var je=function(){return je=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},je.apply(this,arguments)};function Re(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]])}return n}function Ie(t,e,n,r){var i,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(o=(a<3?i(o):a>3?i(e,n,o):i(e,n))||o);return a>3&&o&&Object.defineProperty(e,n,o),o}function De(t,e,n,r){return new(n||(n=Promise))(function(i,a){function o(t){try{c(r.next(t))}catch(t){a(t)}}function s(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,s)}c((r=r.apply(t,e||[])).next())})}function Be(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 Fe(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=a.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return o}function ze(t,e,n){if(n||2===arguments.length)for(var r,i=0,a=e.length;i<a;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 Ge(t,e,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(t):r?r.value:e.get(t)}var We={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function $e(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 He={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ye(t){return Array.isArray(t)&&t.every(function(t){var e=t[0].toLowerCase();return He[e]===t.length-1&&"achlmqstvz".includes(e)})}function Ve(t){return Ye(t)&&t.every(function(t){var e=t[0];return e===e.toUpperCase()})}function Ue(t){return Ve(t)&&t.every(function(t){var e=t[0];return"ACLMQZ".includes(e)})}function qe(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=He[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,He[n]))),He[n]););}function Xe(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function Ke(t){return t>=48&&t<=57||43===t||45===t||46===t}function Ze(t){return t>=48&&t<=57}function Qe(t){var e,n=t.max,r=t.pathValue,i=t.index,a=i,o=!1,s=!1,c=!1,l=!1;if(a>=n)t.err="[path-util]: Invalid path value at index ".concat(a,', "pathValue" is missing param');else if(43!==(e=r.charCodeAt(a))&&45!==e||(a+=1,e=r.charCodeAt(a)),Ze(e)||46===e){if(46!==e){if(o=48===e,a+=1,e=r.charCodeAt(a),o&&a<n&&e&&Ze(e))return void(t.err="[path-util]: Invalid path value at index ".concat(i,', "').concat(r[i],'" illegal number'));for(;a<n&&Ze(r.charCodeAt(a));)a+=1,s=!0;e=r.charCodeAt(a)}if(46===e){for(l=!0,a+=1;Ze(r.charCodeAt(a));)a+=1,c=!0;e=r.charCodeAt(a)}if(101===e||69===e){if(l&&!s&&!c)return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" invalid float exponent'));if(a+=1,43!==(e=r.charCodeAt(a))&&45!==e||(a+=1),!(a<n&&Ze(r.charCodeAt(a))))return void(t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" invalid integer exponent'));for(;a<n&&Ze(r.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(i,a)}else t.err="[path-util]: Invalid path value at index ".concat(a,', "').concat(r[a],'" is not a number')}function Je(t){return 10===t||13===t||8232===t||8233===t||32===t||9===t||11===t||12===t||160===t||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function tn(t){for(var e=t.pathValue,n=t.max;t.index<n&&Je(e.charCodeAt(t.index));)t.index+=1}function en(t){return 97==(32|t)}function nn(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),a=He[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,tn(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(!en(i)||3!==o&&4!==o?Qe(t):Xe(t),t.err.length)return;t.data.push(t.param),tn(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,tn(t))}if(t.index>=t.max)break;if(!Ke(n.charCodeAt(t.index)))break}qe(t)}else qe(t);else t.err='[path-util]: Invalid path value "'.concat(n[r],'" is not a path command')}var rn=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 an(t){if(Ve(t))return[].concat(t);var e=function(t){if(Ye(t))return[].concat(t);var e=new rn(t);for(tn(e);e.index<e.max&&!e.err.length;)nn(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,a=0;return e.map(function(t){var e,o=t.slice(1).map(Number),s=t[0],c=s.toUpperCase();if("M"===s)return n=o[0],r=o[1],i=n,a=r,["M",n,r];if(s!==c)switch(c){case"A":e=[c,o[0],o[1],o[2],o[3],o[4],o[5]+n,o[6]+r];break;case"V":e=[c,o[0]+r];break;case"H":e=[c,o[0]+n];break;default:var l=o.map(function(t,e){return t+(e%2?r:n)});e=[c].concat(l)}else e=[c].concat(o);var u=e.length;switch(c){case"Z":n=i,r=a;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[u-2],r=e[u-1],"M"===c&&(i=n,a=r)}return e})}function on(t,e){var n=t[0],r=e.x1,i=e.y1,a=e.x2,o=e.y2,s=t.slice(1).map(Number),c=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)c=["L",t[1],i];else if("V"===n)c=["L",r,t[1]];else if("S"===n){var l=2*r-a,u=2*i-o;e.x1=l,e.y1=u,c=["C",l,u].concat(s)}else if("T"===n){var f=2*r-e.qx,d=2*i-e.qy;e.qx=f,e.qy=d,c=["Q",f,d].concat(s)}else if("Q"===n){var h=s[0],p=s[1];e.qx=h,e.qy=p}return c}function sn(t){if(Ue(t))return[].concat(t);for(var e=an(t),n=je({},We),r=0;r<e.length;r+=1){e[r]=on(e[r],n);var i=e[r],a=i.length;n.x1=+i[a-2],n.y1=+i[a-1],n.x2=+i[a-4]||n.x1,n.y2=+i[a-3]||n.y1}return e}function cn(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function ln(t,e,n,r,i,a,o,s,c,l){var u,f,d,h,p,g=t,v=e,m=n,y=r,b=s,x=c,w=120*Math.PI/180,k=Math.PI/180*(+i||0),E=[];if(l)f=l[0],d=l[1],h=l[2],p=l[3];else{g=(u=cn(g,v,-k)).x,v=u.y;var M=(g-(b=(u=cn(b,x,-k)).x))/2,O=(v-(x=u.y))/2,S=M*M/(m*m)+O*O/(y*y);S>1&&(m*=S=Math.sqrt(S),y*=S);var A=m*m,T=y*y,_=(a===o?-1:1)*Math.sqrt(Math.abs((A*T-A*O*O-T*M*M)/(A*O*O+T*M*M)));h=_*m*O/y+(g+b)/2,p=_*-y*M/m+(v+x)/2,f=Math.asin(((v-p)/y*Math.pow(10,9)|0)/Math.pow(10,9)),d=Math.asin(((x-p)/y*Math.pow(10,9)|0)/Math.pow(10,9)),f=g<h?Math.PI-f:f,d=b<h?Math.PI-d:d,f<0&&(f=2*Math.PI+f),d<0&&(d=2*Math.PI+d),o&&f>d&&(f-=2*Math.PI),!o&&d>f&&(d-=2*Math.PI)}var C=d-f;if(Math.abs(C)>w){var P=d,N=b,L=x;d=f+w*(o&&d>f?1:-1),E=ln(b=h+m*Math.cos(d),x=p+y*Math.sin(d),m,y,i,0,o,N,L,[d,P,h,p])}C=d-f;var j=Math.cos(f),R=Math.sin(f),I=Math.cos(d),D=Math.sin(d),B=Math.tan(C/4),F=4/3*m*B,z=4/3*y*B,G=[g,v],W=[g+F*R,v-z*j],$=[b+F*D,x-z*I],H=[b,x];if(W[0]=2*G[0]-W[0],W[1]=2*G[1]-W[1],l)return W.concat($,H,E);for(var Y=[],V=0,U=(E=W.concat($,H,E)).length;V<U;V+=1)Y[V]=V%2?cn(E[V-1],E[V],k).y:cn(E[V],E[V+1],k).x;return Y}function un(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var fn=function(t,e,n,r){return ze(ze([],un([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function dn(t,e){var n,r,i,a,o,s,c,l,u,f=t[0],d=t.slice(1).map(Number),h=d[0],p=d[1],g=e.x1,v=e.y1,m=e.x,y=e.y;switch("TQ".includes(f)||(e.qx=null,e.qy=null),f){case"M":return e.x=h,e.y=p,t;case"A":return n=[g,v].concat(d),["C"].concat(ln(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=[g,v].concat(d),["C"].concat((r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],[(l=1/3)*r+(u=2/3)*a,l*i+u*o,l*s+u*a,l*c+u*o,s,c]));case"L":return["C"].concat(fn(g,v,h,p));case"Z":return g===m&&v===y?["C",g,v,m,y,m,y]:["C"].concat(fn(g,v,m,y))}return t}function hn(t,e){if(void 0===e&&(e=!1),function(t){return Ue(t)&&t.every(function(t){var e=t[0];return"MC".includes(e)})}(t)){var n=[].concat(t);return e?[n,[]]:n}for(var r,i,a=sn(t),o=je({},We),s=[],c="",l=a.length,u=[],f=0;f<l;f+=1){a[f]&&(c=a[f][0]),s[f]=c;var d=dn(a[f],o);a[f]=d,$e(a,s,f),l=a.length,"Z"===c&&u.push(f),i=(r=a[f]).length,o.x1=+r[i-2],o.y1=+r[i-1],o.x2=+r[i-4]||o.x1,o.y2=+r[i-3]||o.y1}return e?[a,u]:a}function pn(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function gn(t,e,n,r,i){var a=pn([t,e],[n,r]),o={x:0,y:0};if("number"==typeof i)if(i<=0)o={x:t,y:e};else if(i>=a)o={x:n,y:r};else{var s=un([t,e],[n,r],i/a);o={x:s[0],y:s[1]}}return{length:a,point:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function vn(t,e){var n=t.x,r=t.y,i=e.x,a=e.y,o=n*i+r*a,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2)));return(n*a-r*i<0?-1:1)*Math.acos(o/s)}function mn(t,e,n,r,i,a,o,s,c,l){var u=Math.abs,f=Math.sin,d=Math.cos,h=Math.sqrt,p=Math.PI,g=u(n),v=u(r),m=(i%360+360)%360*(p/180);if(t===s&&e===c)return{x:t,y:e};if(0===g||0===v)return gn(t,e,s,c,l).point;var y=(t-s)/2,b=(e-c)/2,x={x:d(m)*y+f(m)*b,y:-f(m)*y+d(m)*b},w=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(v,2);w>1&&(g*=h(w),v*=h(w));var k=(Math.pow(g,2)*Math.pow(v,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(v,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(v,2)*Math.pow(x.x,2)),E=(a!==o?1:-1)*h(k=k<0?0:k),M=E*(g*x.y/v),O=E*(-v*x.x/g),S=d(m)*M-f(m)*O+(t+s)/2,A=f(m)*M+d(m)*O+(e+c)/2,T={x:(x.x-M)/g,y:(x.y-O)/v},_=vn({x:1,y:0},T),C=vn(T,{x:(-x.x-M)/g,y:(-x.y-O)/v});!o&&C>0?C-=2*p:o&&C<0&&(C+=2*p);var P=_+(C%=2*p)*l,N=g*d(P),L=v*f(P);return{x:d(m)*N-f(m)*L+S,y:f(m)*N+d(m)*L+A}}function yn(t,e,n,r,i,a,o,s,c,l,u){var f,d=u.bbox,h=void 0===d||d,p=u.length,g=void 0===p||p,v=u.sampleSize,m=void 0===v?30:v,y="number"==typeof l,b=t,x=e,w=0,k=[b,x,w],E=[b,x],M={x:0,y:0},O=[{x:b,y:x}];y&&l<=0&&(M={x:b,y:x});for(var S=0;S<=m;S+=1){if(b=(f=mn(t,e,n,r,i,a,o,s,c,S/m)).x,x=f.y,h&&O.push({x:b,y:x}),g&&(w+=pn(E,[b,x])),E=[b,x],y&&w>=l&&l>k[2]){var A=(w-l)/(w-k[2]);M={x:E[0]*(1-A)+k[0]*A,y:E[1]*(1-A)+k[1]*A}}k=[b,x,w]}return y&&l>=w&&(M={x:s,y:c}),{length:w,point:M,min:{x:Math.min.apply(null,O.map(function(t){return t.x})),y:Math.min.apply(null,O.map(function(t){return t.y}))},max:{x:Math.max.apply(null,O.map(function(t){return t.x})),y:Math.max.apply(null,O.map(function(t){return t.y}))}}}function bn(t,e,n,r,i,a,o,s,c){var l=1-c;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*c*n+3*l*Math.pow(c,2)*i+Math.pow(c,3)*o,y:Math.pow(l,3)*e+3*Math.pow(l,2)*c*r+3*l*Math.pow(c,2)*a+Math.pow(c,3)*s}}function xn(t,e,n,r,i,a,o,s,c,l){var u,f=l.bbox,d=void 0===f||f,h=l.length,p=void 0===h||h,g=l.sampleSize,v=void 0===g?10:g,m="number"==typeof c,y=t,b=e,x=0,w=[y,b,x],k=[y,b],E={x:0,y:0},M=[{x:y,y:b}];m&&c<=0&&(E={x:y,y:b});for(var O=0;O<=v;O+=1){if(y=(u=bn(t,e,n,r,i,a,o,s,O/v)).x,b=u.y,d&&M.push({x:y,y:b}),p&&(x+=pn(k,[y,b])),k=[y,b],m&&x>=c&&c>w[2]){var S=(x-c)/(x-w[2]);E={x:k[0]*(1-S)+w[0]*S,y:k[1]*(1-S)+w[1]*S}}w=[y,b,x]}return m&&c>=x&&(E={x:o,y:s}),{length:x,point:E,min:{x:Math.min.apply(null,M.map(function(t){return t.x})),y:Math.min.apply(null,M.map(function(t){return t.y}))},max:{x:Math.max.apply(null,M.map(function(t){return t.x})),y:Math.max.apply(null,M.map(function(t){return t.y}))}}}function wn(t,e,n,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*i,y:Math.pow(s,2)*e+2*s*o*r+Math.pow(o,2)*a}}function kn(t,e,n,r,i,a,o,s){var c,l=s.bbox,u=void 0===l||l,f=s.length,d=void 0===f||f,h=s.sampleSize,p=void 0===h?10:h,g="number"==typeof o,v=t,m=e,y=0,b=[v,m,y],x=[v,m],w={x:0,y:0},k=[{x:v,y:m}];g&&o<=0&&(w={x:v,y:m});for(var E=0;E<=p;E+=1){if(v=(c=wn(t,e,n,r,i,a,E/p)).x,m=c.y,u&&k.push({x:v,y:m}),d&&(y+=pn(x,[v,m])),x=[v,m],g&&y>=o&&o>b[2]){var M=(y-o)/(y-b[2]);w={x:x[0]*(1-M)+b[0]*M,y:x[1]*(1-M)+b[1]*M}}b=[v,m,y]}return g&&o>=y&&(w={x:i,y:a}),{length:y,point:w,min:{x:Math.min.apply(null,k.map(function(t){return t.x})),y:Math.min.apply(null,k.map(function(t){return t.y}))},max:{x:Math.max.apply(null,k.map(function(t){return t.x})),y:Math.max.apply(null,k.map(function(t){return t.y}))}}}function En(t,e,n){for(var r,i,a,o,s,c,l,u,f,d=sn(t),h="number"==typeof e,p=[],g=0,v=0,m=0,y=0,b=[],x=[],w=0,k={x:0,y:0},E=k,M=k,O=k,S=0,A=0,T=d.length;A<T;A+=1)p=(l="M"===(u=(f=d[A])[0]))?p:[g,v].concat(f.slice(1)),l?(E=k={x:m=f[1],y:y=f[2]},w=0,h&&e<.001&&(O=k)):"L"===u?(w=(r=gn(p[0],p[1],p[2],p[3],(e||0)-S)).length,k=r.min,E=r.max,M=r.point):"A"===u?(w=(i=yn(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-S,n||{})).length,k=i.min,E=i.max,M=i.point):"C"===u?(w=(a=xn(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-S,n||{})).length,k=a.min,E=a.max,M=a.point):"Q"===u?(w=(o=kn(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-S,n||{})).length,k=o.min,E=o.max,M=o.point):"Z"===u&&(w=(s=gn((p=[g,v,m,y])[0],p[1],p[2],p[3],(e||0)-S)).length,k=s.min,E=s.max,M=s.point),h&&S<e&&S+w>=e&&(O=M),x.push(E),b.push(k),S+=w,g=(c="Z"!==u?f.slice(-2):[m,y])[0],v=c[1];return h&&e>=S&&(O={x:g,y:v}),{length:S,point:O,min:{x:Math.min.apply(null,b.map(function(t){return t.x})),y:Math.min.apply(null,b.map(function(t){return t.y}))},max:{x:Math.max.apply(null,x.map(function(t){return t.x})),y:Math.max.apply(null,x.map(function(t){return t.y}))}}}function Mn(t,e){var n=t.length-1,r=[],i=0,a=function(t){var e=t.length,n=e-1;return t.map(function(r,i){return t.map(function(r,a){var o,s=i+a;return 0===a||t[s]&&"M"===t[s][0]?(o=t[s],["M"].concat(o.slice(-2))):(s>=e&&(s-=n),t[s])})})}(t);return a.forEach(function(a,o){t.slice(1).forEach(function(r,a){i+=pn(t[(o+a)%n].slice(-2),e[a%n].slice(-2))}),r[o]=i,i=0}),a[r.indexOf(Math.min.apply(null,r))]}function On(t){return function(t){var e=0,n=0,r=0;return hn(t).map(function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var a=t.slice(1),o=a[0],s=a[1],c=a[2],l=a[3],u=a[4],f=a[5];return r=function(t,e,n,r,i,a,o,s){return 3*((s-e)*(n+i)-(o-t)*(r+a)+r*(t-i)-n*(e-a)+s*(i+t/3)-o*(a+e/3))/20}(e,n,o,s,c,l,u,f),i=t.slice(-2),e=i[0],n=i[1],r}).reduce(function(t,e){return t+e},0)}(t)>=0}function Sn(t){return t.map(function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?xn(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),a=t.slice(6,8),o=un(n,r,e),s=un(r,i,e),c=un(i,a,e),l=un(o,s,e),u=un(s,c,e),f=un(l,u,e);return[["C"].concat(o,l,f),["C"].concat(u,c,a)]}(r):[t,t]:[t],l:i}})}function An(t,e,n,r){if(void 0===r&&(r=0),r>50)return console.warn("Maximum recursion depth reached in equalizeSegments"),[t,e];var i=Sn(t),a=Sn(e),o=i.length,s=a.length,c=i.filter(function(t){return t.l}).length,l=a.filter(function(t){return t.l}).length,u=i.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/c||0,f=a.filter(function(t){return t.l}).reduce(function(t,e){return t+e.l},0)/l||0,d=n||Math.max(o,s),h=[u,f],p=[d-o,d-s],g=0,v=[i,a].map(function(t,e){return t.l===d?t.map(function(t){return t.s}):t.map(function(t,n){return g=n&&p[e]&&t.l>=h[e],p[e]-=g?1:0,g?t.ss:[t.s]}).flat()});return v[0].length===v[1].length?v:An(v[0],v[1],d,r+1)}function Tn(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function _n(t,e){if(null!==t)return{type:"column",value:t,field:e}}function Cn(t,e){const n=_n(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function Pn(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function Nn(t,e){const n=_n(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function Ln(t,e){const n=[];for(const r of t)n[r]=e;return n}function jn(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function Rn(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=jn(t,n);if(null!==e)return[e,r]}}return[null,null]}function In(t){return!(t instanceof Date)&&"object"==typeof t}const Dn=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,J({},e,{encode:{y1:Cn(Ln(t,0))}})]};function Bn(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Fn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function zn(t){let e,n,r;function i(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<0?i=e+1:a=e}while(i<a)}return i}return 2!==t.length?(e=Bn,n=(e,n)=>Bn(t(e),n),r=(e,n)=>t(e)-n):(e=t===Bn||t===Fn?t:Gn,n=t,r=t),{left:i,center:function(t,e,n=0,a=t.length){const o=i(t,e,n,a-1);return o>n&&r(t[o-1],e)>-r(t[o],e)?o-1:o},right:function(t,r,i=0,a=t.length){if(i<a){if(0!==e(r,r))return a;do{const e=i+a>>>1;n(t[e],r)<=0?i=e+1:a=e}while(i<a)}return i}}}function Gn(){return 0}function Wn(t){return null===t?NaN:+t}Dn.props={};const $n=zn(Bn),Hn=$n.right,Yn=$n.left,Vn=zn(Wn).center;var Un=Hn;function qn(t,e){let n=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&++n;else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(i=+i)>=i&&++n}return n}function Xn(t,e){const n=function(t,e){let n,r=0,i=0,a=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(n=e-i,i+=n/++r,a+=n*(e-i));else{let o=-1;for(let s of t)null!=(s=e(s,++o,t))&&(s=+s)>=s&&(n=s-i,i+=n/++r,a+=n*(s-i))}if(r>1)return a/(r-1)}(t,e);return n?Math.sqrt(n):n}function Kn(t,e){let n,r;if(void 0===e)for(const e of t)null!=e&&(void 0===n?e>=e&&(n=r=e):(n>e&&(n=e),r<e&&(r=e)));else{let i=-1;for(let a of t)null!=(a=e(a,++i,t))&&(void 0===n?a>=a&&(n=r=a):(n>a&&(n=a),r<a&&(r=a)))}return[n,r]}class Zn extends Map{constructor(t,e=Jn){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),null!=t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Qn(this,t))}has(t){return super.has(Qn(this,t))}set(t,e){return super.set(function({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}(this,t),e)}delete(t){return super.delete(function({_intern:t,_key:e},n){const r=e(n);t.has(r)&&(n=t.get(r),t.delete(r));return n}(this,t))}}function Qn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Jn(t){return null!==t&&"object"==typeof t?t.valueOf():t}function tr(t){return t}function er(t,...e){return ar(t,tr,tr,e)}function nr(t,...e){return ar(t,Array.from,tr,e)}function rr(t,e,...n){return ar(t,tr,e,n)}function ir(t,e,...n){return ar(t,Array.from,e,n)}function ar(t,e,n,r){return function t(i,a){if(a>=r.length)return n(i);const o=new Zn,s=r[a++];let c=-1;for(const t of i){const e=s(t,++c,i),n=o.get(e);n?n.push(t):o.set(e,[t])}for(const[e,n]of o)o.set(e,t(n,a));return e(o)}(t,0)}function or(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const r=Uint32Array.from(t,(t,e)=>e);return e.length>1?(e=e.map(e=>t.map(e)),r.sort((t,n)=>{for(const r of e){const e=cr(r[t],r[n]);if(e)return e}})):(n=t.map(n),r.sort((t,e)=>cr(n[t],n[e]))),function(t,e){return Array.from(e,e=>t[e])}(t,r)}return t.sort(sr(n))}function sr(t=Bn){if(t===Bn)return cr;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}function cr(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var lr=Array.prototype.slice;function ur(t){return()=>t}const fr=Math.sqrt(50),dr=Math.sqrt(10),hr=Math.sqrt(2);function pr(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=fr?10:a>=dr?5:a>=hr?2:1;let s,c,l;return i<0?(l=Math.pow(10,-i)/o,s=Math.round(t*l),c=Math.round(e*l),s/l<t&&++s,c/l>e&&--c,l=-l):(l=Math.pow(10,i)*o,s=Math.round(t/l),c=Math.round(e/l),s*l<t&&++s,c*l>e&&--c),c<s&&.5<=n&&n<2?pr(t,e,2*n):[s,c,l]}function gr(t,e,n){return pr(t=+t,e=+e,n=+n)[2]}function vr(t){return Math.max(1,Math.ceil(Math.log(qn(t))/Math.LN2)+1)}function mr(){var t=tr,e=Kn,n=vr;function r(r){Array.isArray(r)||(r=Array.from(r));var i,a,o,s=r.length,c=new Array(s);for(i=0;i<s;++i)c[i]=t(r[i],i,r);var l=e(c),u=l[0],f=l[1],d=n(c,u,f);if(!Array.isArray(d)){const t=f,n=+d;if(e===Kn&&([u,f]=function(t,e,n){let r;for(;;){const i=gr(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,f,n)),d=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)===(e=+e))return[t];const r=e<t,[i,a,o]=r?pr(e,t,n):pr(t,e,n);if(!(a>=i))return[];const s=a-i+1,c=new Array(s);if(r)if(o<0)for(let t=0;t<s;++t)c[t]=(a-t)/-o;else for(let t=0;t<s;++t)c[t]=(a-t)*o;else if(o<0)for(let t=0;t<s;++t)c[t]=(i+t)/-o;else for(let t=0;t<s;++t)c[t]=(i+t)*o;return c}(u,f,n),d[0]<=u&&(o=gr(u,f,n)),d[d.length-1]>=f)if(t>=f&&e===Kn){const t=gr(u,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else d.pop()}for(var h=d.length,p=0,g=h;d[p]<=u;)++p;for(;d[g-1]>f;)--g;(p||g<h)&&(d=d.slice(p,g),h=g-p);var v,m=new Array(h+1);for(i=0;i<=h;++i)(v=m[i]=[]).x0=i>0?d[i-1]:u,v.x1=i<h?d[i]:f;if(isFinite(o)){if(o>0)for(i=0;i<s;++i)null!=(a=c[i])&&u<=a&&a<=f&&m[Math.min(h,Math.floor((a-u)/o))].push(r[i]);else if(o<0)for(i=0;i<s;++i)if(null!=(a=c[i])&&u<=a&&a<=f){const t=Math.floor((u-a)*o);m[Math.min(h,t+(d[t]<=a))].push(r[i])}}else for(i=0;i<s;++i)null!=(a=c[i])&&u<=a&&a<=f&&m[Un(d,a,0,h)].push(r[i]);return m}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:ur(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:ur([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:ur(Array.isArray(t)?lr.call(t):t),r):n},r}function yr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n<e||void 0===n&&e>=e)&&(n=e);else{let r=-1;for(let i of t)null!=(i=e(i,++r,t))&&(n<i||void 0===n&&i>=i)&&(n=i)}return n}function br(t,e){let n,r=-1,i=-1;if(void 0===e)for(const e of t)++i,null!=e&&(n<e||void 0===n&&e>=e)&&(n=e,r=i);else for(let a of t)null!=(a=e(a,++i,t))&&(n<a||void 0===n&&a>=a)&&(n=a,r=i);return r}function xr(t,e){let n;if(void 0===e)for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);else{let r=-1;fo