UNPKG

@antv/g2

Version:

the Grammar of Graphics in Javascript

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