UNPKG

@antv/g2

Version:

the Grammar of Graphics in Javascript

1 lines 822 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};return Object.assign(Object.assign({},e),t)},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:i,outerRadius:o}=((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:o})]};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[["parallel",0,1,0,1],...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)},m=function(t){return"function"==typeof t},y=function(t){return null==t},v={}.toString,b=function(t,e){return v.call(t)==="[object "+e+"]"},x=function(t){return Array.isArray?Array.isArray(t):b(t,"Array")},w=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};var M=function(t){return"object"==typeof t&&null!==t},E=function(t){if(!M(t)||!b(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},O=function(t){if(x(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},k=function(t){if(x(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},S=function(t,e,n){if(!x(t)&&!E(t))return t;var r=n;return function(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}(t,(function(t,n){r=e(r,t,n)})),r},_=function(t){return b(t,"String")};var A=function(t,e,n){return t<e?e:t>n?n:t},T=function(t){return b(t,"Number")},P=1e-5;function C(t,e,n){return void 0===n&&(n=P),Math.abs(t-e)<n}var N=function(t,e){if(x(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}},L=function(t,e){if(x(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}},j=function(t,e){return(t%e+e)%e},R=function(t){return y(t)?"":t.toString()},I=function(t){var e=R(t);return e.charAt(0).toLowerCase()+e.substring(1)};var B=function(t){var e=R(t);return e.charAt(0).toUpperCase()+e.substring(1)},D=function(t){return b(t,"Boolean")},F=function(t){return void 0===t},z=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]=z(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=z(t[i]):e[i]=t[i];return e},G=z;function W(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 $(t){var e,n,r,i=t||1;function o(t,o){++e>i&&(r=n,a(1),++e),n[t]=o}function a(t){e=0,n=Object.create(null),t||(r=Object.create(null))}return a(),{clear:a,has:function(t){return void 0!==n[t]||void 0!==r[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=r[t])?(o(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:o(t,e)}}}function H(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 V(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(H(e,i)){var o=e[i];null!==o&&E(o)?(E(t[i])||(t[i]={}),n<r?V(t[i],o,n+1,r):t[i]=e[i]):x(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var Y=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)V(t,e[r]);return t},q=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(_(t)||_(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=q(t[r],e[r]));r++);return n}if(M(t)||M(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=q(t[i[r]],e[i[r]]));r++);return n}return!1},U=q,X=function(t,e,n){for(var r=0,i=_(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t},K=function(t,e){return S(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},Z=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},Q=function(){},J=1e-6,tt="undefined"!=typeof Float32Array?Float32Array:Array;function et(){var t=new tt(9);return tt!=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 nt=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],m=n[4],y=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+m*a+y*l,t[4]=g*i+m*s+y*u,t[5]=g*o+m*c+y*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 rt(){var t=new tt(16);return tt!=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 it(t){var e=new tt(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 ot(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 at(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g,m){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]=m,t}function st(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 ct(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 lt(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],m=e[14],y=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,E=i*l-o*c,O=u*g-f*p,k=u*m-h*p,S=u*y-d*p,_=f*m-h*g,A=f*y-d*g,T=h*y-d*m,P=v*T-b*A+x*_+w*S-M*k+E*O;return P?(P=1/P,t[0]=(s*T-c*A+l*_)*P,t[1]=(i*A-r*T-o*_)*P,t[2]=(g*E-m*M+y*w)*P,t[3]=(h*M-f*E-d*w)*P,t[4]=(c*S-a*T-l*k)*P,t[5]=(n*T-i*S+o*k)*P,t[6]=(m*x-p*E-y*b)*P,t[7]=(u*E-h*x+d*b)*P,t[8]=(a*A-s*S+l*O)*P,t[9]=(r*S-n*A-o*O)*P,t[10]=(p*M-g*x+y*v)*P,t[11]=(f*x-u*M-d*v)*P,t[12]=(s*k-a*_-c*O)*P,t[13]=(n*_-r*k+i*O)*P,t[14]=(g*b-p*w-m*v)*P,t[15]=(u*w-f*b+h*v)*P,t):null}function ut(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],m=t[15];return(e*a-n*o)*(f*m-h*g)-(e*s-r*o)*(u*m-h*p)+(e*c-i*o)*(u*g-f*p)+(n*s-r*a)*(l*m-h*d)-(n*c-i*a)*(l*g-f*d)+(r*c-i*s)*(l*p-u*d)}function ft(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],m=e[13],y=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*m,t[2]=b*o+x*l+w*d+M*y,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*m,t[6]=b*o+x*l+w*d+M*y,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*m,t[10]=b*o+x*l+w*d+M*y,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*m,t[14]=b*o+x*l+w*d+M*y,t[15]=b*a+x*u+w*p+M*v,t}function ht(t,e,n){var r,i,o,a,s,c,l,u,f,h,d,p,g=n[0],m=n[1],y=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*y+e[12],t[13]=e[1]*g+e[5]*m+e[9]*y+e[13],t[14]=e[2]*g+e[6]*m+e[10]*y+e[14],t[15]=e[3]*g+e[7]*m+e[11]*y+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*m+f*y+e[12],t[13]=i*g+c*m+h*y+e[13],t[14]=o*g+l*m+d*y+e[14],t[15]=a*g+u*m+p*y+e[15]),t}function dt(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 pt(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 gt(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 mt(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 yt(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 vt(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,m=a*s,y=a*c,v=a*l;return t[0]=1-(d+g),t[1]=f+v,t[2]=h-y,t[3]=0,t[4]=f-v,t[5]=1-(u+g),t[6]=p+m,t[7]=0,t[8]=h+y,t[9]=p-m,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 bt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function xt(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 wt(t,e){var n=new tt(3);xt(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,m=0;return g>0?(m=2*Math.sqrt(g+1),t[3]=.25*m,t[0]=(f-d)/m,t[1]=(h-c)/m,t[2]=(s-l)/m):a>u&&a>p?(m=2*Math.sqrt(1+a-u-p),t[3]=(f-d)/m,t[0]=.25*m,t[1]=(s+l)/m,t[2]=(h+c)/m):u>p?(m=2*Math.sqrt(1+u-a-p),t[3]=(h-c)/m,t[0]=(s+l)/m,t[1]=.25*m,t[2]=(f+d)/m):(m=2*Math.sqrt(1+p-a-u),t[3]=(s-l)/m,t[0]=(h+c)/m,t[1]=(f+d)/m,t[2]=.25*m),t}function Mt(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,m=a*f,y=s*f,v=c*l,b=c*u,x=c*f,w=r[0],M=r[1],E=r[2],O=i[0],k=i[1],S=i[2],_=(1-(g+y))*w,A=(d+x)*w,T=(p-b)*w,P=(d-x)*M,C=(1-(h+y))*M,N=(m+v)*M,L=(p+b)*E,j=(m-v)*E,R=(1-(h+g))*E;return t[0]=_,t[1]=A,t[2]=T,t[3]=0,t[4]=P,t[5]=C,t[6]=N,t[7]=0,t[8]=L,t[9]=j,t[10]=R,t[11]=0,t[12]=n[0]+O-(_*O+P*k+L*S),t[13]=n[1]+k-(A*O+C*k+j*S),t[14]=n[2]+S-(T*O+N*k+R*S),t[15]=1,t}function Et(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,m=o*s,y=o*c;return t[0]=1-f-p,t[1]=u+y,t[2]=h-m,t[3]=0,t[4]=u-y,t[5]=1-l-p,t[6]=d+g,t[7]=0,t[8]=h+m,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 Ot(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 kt=Ot;function St(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 _t=St;function At(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 Tt(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p=e[0],g=e[1],m=e[2],y=r[0],v=r[1],b=r[2],x=n[0],w=n[1],M=n[2];return Math.abs(p-x)<J&&Math.abs(g-w)<J&&Math.abs(m-M)<J?st(t):(u=p-x,f=g-w,h=m-M,i=v*(h*=d=1/Math.hypot(u,f,h))-b*(f*=d),o=b*(u*=d)-y*h,a=y*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*m),t[13]=-(s*p+c*g+l*m),t[14]=-(u*p+f*g+h*m),t[15]=1,t)}function Pt(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 Ct=ft,Nt=Pt,Lt=Object.freeze({__proto__:null,create:rt,clone:it,copy:ot,fromValues:function(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g){var m=new tt(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=i,m[5]=o,m[6]=a,m[7]=s,m[8]=c,m[9]=l,m[10]=u,m[11]=f,m[12]=h,m[13]=d,m[14]=p,m[15]=g,m},set:at,identity:st,transpose:ct,invert:lt,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],m=e[14],y=e[15];return t[0]=s*(h*y-d*m)-f*(c*y-l*m)+g*(c*d-l*h),t[1]=-(r*(h*y-d*m)-f*(i*y-o*m)+g*(i*d-o*h)),t[2]=r*(c*y-l*m)-s*(i*y-o*m)+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*y-d*m)-u*(c*y-l*m)+p*(c*d-l*h)),t[5]=n*(h*y-d*m)-u*(i*y-o*m)+p*(i*d-o*h),t[6]=-(n*(c*y-l*m)-a*(i*y-o*m)+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*y-d*g)-u*(s*y-l*g)+p*(s*d-l*f),t[9]=-(n*(f*y-d*g)-u*(r*y-o*g)+p*(r*d-o*f)),t[10]=n*(s*y-l*g)-a*(r*y-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*m-h*g)-u*(s*m-c*g)+p*(s*h-c*f)),t[13]=n*(f*m-h*g)-u*(r*m-i*g)+p*(r*h-i*f),t[14]=-(n*(s*m-c*g)-a*(r*m-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:ut,multiply:ft,translate:ht,scale:dt,rotate:function(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p,g,m,y,v,b,x,w,M,E,O,k,S,_,A=r[0],T=r[1],P=r[2],C=Math.hypot(A,T,P);return C<J?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],m=e[9],y=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,E=T*T*a+o,O=P*T*a+A*i,k=A*P*a+T*i,S=T*P*a-A*i,_=P*P*a+o,t[0]=s*b+f*x+g*w,t[1]=c*b+h*x+m*w,t[2]=l*b+d*x+y*w,t[3]=u*b+p*x+v*w,t[4]=s*M+f*E+g*O,t[5]=c*M+h*E+m*O,t[6]=l*M+d*E+y*O,t[7]=u*M+p*E+v*O,t[8]=s*k+f*S+g*_,t[9]=c*k+h*S+m*_,t[10]=l*k+d*S+y*_,t[11]=u*k+p*S+v*_,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:pt,rotateY:gt,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:mt,fromScaling:yt,fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],c=n[2],l=Math.hypot(a,s,c);return l<J?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)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:vt,fromQuat2:function(t,e){var n=new tt(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)),vt(t,e,n),t},getTranslation:bt,getScaling:xt,getRotation:wt,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,m=a*u,y=s*c,v=s*l,b=s*u,x=r[0],w=r[1],M=r[2];return t[0]=(1-(p+m))*x,t[1]=(h+b)*x,t[2]=(d-v)*x,t[3]=0,t[4]=(h-b)*w,t[5]=(1-(f+m))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(d+v)*M,t[9]=(g-y)*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:Mt,fromQuat:Et,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:Ot,perspective:kt,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:St,ortho:_t,orthoZO:At,lookAt:Tt,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,m=s*f-c*u;return(d=p*p+g*g+m*m)>0&&(p*=d=1/Math.sqrt(d),g*=d,m*=d),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=f*m-h*g,t[5]=h*p-u*m,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:Pt,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],m=t[14],y=t[15],v=e[0],b=e[1],x=e[2],w=e[3],M=e[4],E=e[5],O=e[6],k=e[7],S=e[8],_=e[9],A=e[10],T=e[11],P=e[12],C=e[13],N=e[14],L=e[15];return Math.abs(n-v)<=J*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-b)<=J*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=J*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=J*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-M)<=J*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-E)<=J*Math.max(1,Math.abs(s),Math.abs(E))&&Math.abs(c-O)<=J*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(l-k)<=J*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(u-S)<=J*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-_)<=J*Math.max(1,Math.abs(f),Math.abs(_))&&Math.abs(h-A)<=J*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(d-T)<=J*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-P)<=J*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-C)<=J*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(m-N)<=J*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(y-L)<=J*Math.max(1,Math.abs(y),Math.abs(L))},mul:Ct,sub:Nt});function jt(){var t=new tt(3);return tt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Rt(t){var e=new tt(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function It(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function Bt(t,e,n){var r=new tt(3);return r[0]=t,r[1]=e,r[2]=n,r}function Dt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ft(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function zt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Gt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Wt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function $t(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 Ht(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Vt(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],c=n[2];return t[0]=i*c-o*s,t[1]=o*a-r*c,t[2]=r*s-i*a,t}function Yt(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 qt(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 Ut(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 Xt(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)<=J*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=J*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=J*Math.max(1,Math.abs(i),Math.abs(s))}var Kt=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)},Zt=It;function Qt(){var t=new tt(4);return tt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Jt(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 te(){var t=new tt(4);return tt!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ee(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 ne(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 re(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 ie(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}jt(),function(){var t=Qt()}();var oe=function(t,e,n,r){var i=new tt(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ae=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},se=ne,ce=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};jt(),Bt(1,0,0),Bt(0,1,0),te(),te(),et(),function(){var t,e=(t=new tt(2),tt!=Float32Array&&(t[0]=0,t[1]=0),t)}();var le=function(t,e){return le=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])},le(t,e)};function ue(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}le(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var fe=function(){return fe=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},fe.apply(this,arguments)};function he(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 de(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 pe(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){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}c((r=r.apply(t,e||[])).next())}))}function ge(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 me(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 ye(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 ve(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 be(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 xe={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function we(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Me={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ee(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Me[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Oe(t){return Ee(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function ke(t){return Oe(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function Se(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Me[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,Me[n]))),Me[n]););}function _e(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 Ae(t){return t>=48&&t<=57||43===t||45===t||46===t}function Te(t){return t>=48&&t<=57}function Pe(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)),Te(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&Te(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;o<n&&Te(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;Te(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&&Te(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;o<n&&Te(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 Ce(t){for(var e,n=t.pathValue,r=t.max;t.index<r&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function Ne(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Me[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,Ce(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Pe(t):_e(t),t.err.length)return;t.data.push(t.param),Ce(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,Ce(t))}if(t.index>=t.max)break;if(!Ae(n.charCodeAt(t.index)))break}Se(t)}else Se(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var Le=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 je(t){if(Oe(t))return[].concat(t);var e=function(t){if(Ee(t))return[].concat(t);var e=new Le(t);for(Ce(e);e.index<e.max&&!e.err.length;)Ne(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 Re(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 Ie(t){if(ke(t))return[].concat(t);for(var e=je(t),n=fe({},xe),r=0;r<e.length;r+=1){e[r]=Re(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 Be(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function De(t,e,n,r,i,o,a,s,c,l){var u,f,h,d,p,g=t,m=e,y=n,v=r,b=s,x=c,w=120*Math.PI/180,M=Math.PI/180*(+i||0),E=[];if(l)f=l[0],h=l[1],d=l[2],p=l[3];else{g=(u=Be(g,m,-M)).x,m=u.y;var O=(g-(b=(u=Be(b,x,-M)).x))/2,k=(m-(x=u.y))/2,S=O*O/(y*y)+k*k/(v*v);S>1&&(y*=S=Math.sqrt(S),v*=S);var _=y*y,A=v*v,T=(o===a?-1:1)*Math.sqrt(Math.abs((_*A-_*k*k-A*O*O)/(_*k*k+A*O*O)));d=T*y*k/v+(g+b)/2,p=T*-v*O/y+(m+x)/2,f=Math.asin(((m-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,L=x;h=f+w*(a&&h>f?1:-1),E=De(b=d+y*Math.cos(h),x=p+v*Math.sin(h),y,v,i,0,a,N,L,[h,C,d,p])}P=h-f;var j=Math.cos(f),R=Math.sin(f),I=Math.cos(h),B=Math.sin(h),D=Math.tan(P/4),F=4/3*y*D,z=4/3*v*D,G=[g,m],W=[g+F*R,m-z*j],$=[b+F*B,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 V=[],Y=0,q=(E=W.concat($,H,E)).length;Y<q;Y+=1)V[Y]=Y%2?Be(E[Y-1],E[Y],M).y:Be(E[Y],E[Y+1],M).x;return V}function Fe(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var ze=function(t,e,n,r){return ve(ve([],Fe([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function Ge(t,e){var n,r,i,o,a,s,c,l,u,f=t[0],h=t.slice(1).map(Number),d=h[0],p=h[1],g=e.x1,m=e.y1,y=e.x,v=e.y;switch("TQ".includes(f)||(e.qx=null,e.qy=null),f){case"M":return e.x=d,e.y=p,t;case"A":return n=[g,m].concat(h),["C"].concat(De(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=d,e.qy=p,n=[g,m].concat(h),["C"].concat((r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],c=n[5],[(l=1/3)*r+(u=2/3)*o,l*i+u*a,l*s+u*o,l*c+u*a,s,c]));case"L":return["C"].concat(ze(g,m,d,p));case"Z":return g===y&&m===v?["C",g,m,y,v,y,v]:["C"].concat(ze(g,m,y,v))}return t}function We(t,e){if(void 0===e&&(e=!1),function(t){return ke(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=Ie(t),a=fe({},xe),s=[],c="",l=o.length,u=[],f=0;f<l;f+=1){o[f]&&(c=o[f][0]),s[f]=c;var h=Ge(o[f],a);o[f]=h,we(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 $e(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function He(t,e,n,r,i){var o=$e([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=Fe([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 Ve(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 Ye(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),m=u(r),y=(i%360+360)%360*(p/180);if(t===s&&e===c)return{x:t,y:e};if(0===g||0===m)return He(t,e,s,c,l).point;var v=(t-s)/2,b=(e-c)/2,x={x:h(y)*v+f(y)*b,y:-f(y)*v+h(y)*b},w=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(m,2);w>1&&(g*=d(w),m*=d(w));var M=(Math.pow(g,2)*Math.pow(m,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(m,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(m,2)*Math.pow(x.x,2)),E=(o!==a?1:-1)*d(M=M<0?0:M),O=E*(g*x.y/m),k=E*(-m*x.x/g),S=h(y)*O-f(y)*k+(t+s)/2,_=f(y)*O+h(y)*k+(e+c)/2,A={x:(x.x-O)/g,y:(x.y-k)/m},T=Ve({x:1,y:0},A),P=Ve(A,{x:(-x.x-O)/g,y:(-x.y-k)/m});!a&&P>0?P-=2*p:a&&P<0&&(P+=2*p);var C=T+(P%=2*p)*l,N=g*h(C),L=m*f(C);return{x:h(y)*N-f(y)*L+S,y:f(y)*N+h(y)*L+_}}function qe(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,m=u.sampleSize,y=void 0===m?30:m,v="number"==typeof l,b=t,x=e,w=0,M=[b,x,w],E=[b,x],O={x:0,y:0},k=[{x:b,y:x}];v&&l<=0&&(O={x:b,y:x});for(var S=0;S<=y;S+=1){if(b=(f=Ye(t,e,n,r,i,o,a,s,c,S/y)).x,x=f.y,d&&k.push({x:b,y:x}),g&&(w+=$e(E,[b,x])),E=[b,x],v&&w>=l&&l>M[2]){var _=(w-l)/(w-M[2]);O={x:E[0]*(1-_)+M[0]*_,y:E[1]*(1-_)+M[1]*_}}M=[b,x,w]}return v&&l>=w&&(O={x:s,y:c}),{length:w,point:O,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 Ue(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 Xe(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,m=void 0===g?10:g,y="number"==typeof c,v=t,b=e,x=0,w=[v,b,x],M=[v,b],E={x:0,y:0},O=[{x:v,y:b}];y&&c<=0&&(E={x:v,y:b});for(var k=0;k<=m;k+=1){if(v=(u=Ue(t,e,n,r,i,o,a,s,k/m)).x,b=u.y,h&&O.push({x:v,y:b}),p&&(x+=$e(M,[v,b])),M=[v,b],y&&x>=c&&c>w[2]){var S=(x-c)/(x-w[2]);E={x:M[0]*(1-S)+w[0]*S,y:M[1]*(1-S)+w[1]*S}}w=[v,b,x]}return y&&c>=x&&(E={x:a,y:s}),{length:x,point:E,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 Ke(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 Ze(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,m=t,y=e,v=0,b=[m,y,v],x=[m,y],w={x:0,y:0},M=[{x:m,y:y}];g&&a<=0&&(w={x:m,y:y});for(var E=0;E<=p;E+=1){if(m=(c=Ke(t,e,n,r,i,o,E/p)).x,y=c.y,u&&M.push({x:m,y:y}),h&&(v+=$e(x,[m,y])),x=[m,y],g&&v>=a&&a>b[2]){var O=(v-a)/(v-b[2]);w={x:x[0]*(1-O)+b[0]*O,y:x[1]*(1-O)+b[1]*O}}b=[m,y,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 Qe(t,e,n){for(var r,i,o,a,s,c,l,u,f,h=Ie(t),d="number"==typeof e,p=[],g=0,m=0,y=0,v=0,b=[],x=[],w=0,M={x:0,y:0},E=M,O=M,k=M,S=0,_=0,A=h.length;_<A;_+=1)p=(l="M"===(u=(f=h[_])[0]))?p:[g,m].concat(f.slice(1)),l?(E=M={x:y=f[1],y:v=f[2]},w=0,d&&e<.001&&(k=M)):"L"===u?(w=(r=He(p[0],p[1],p[2],p[3],(e||0)-S)).length,M=r.min,E=r.max,O=r.point):"A"===u?(w=(i=qe(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-S,n||{})).length,M=i.min,E=i.max,O=i.point):"C"===u?(w=(o=Xe(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-S,n||{})).length,M=o.min,E=o.max,O=o.point):"Q"===u?(w=(a=Ze(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-S,n||{})).length,M=a.min,E=a.max,O=a.point):"Z"===u&&(w=(s=He((p=[g,m,y,v])[0],p[1],p[2],p[3],(e||0)-S)).length,M=s.min,E=s.max,O=s.point),d&&S<e&&S+w>=e&&(k=O),x.push(E),b.push(M),S+=w,g=(c="Z"!==u?f.slice(-2):[y,v])[0],m=c[1];return d&&e>=S&&(k={x:g,y:m}),{length:S,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 Je(t){return function(t){var e=0,n=0,r=0;return We(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 tn(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Xe(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=Fe(n,r,e),s=Fe(r,i,e),c=Fe(i,o,e),l=Fe(a,s,e),u=Fe(s,c,e),f=Fe(l,u,e);return[["C"].concat(a,l,f),["C"].concat(u,c,o)]}(r):[t,t]:[t],l:i}}))}function en(t,e,n){var r=tn(t),i=tn(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:en(g[0],g[1],f)}function nn(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function rn(t,e){if(null!==t)return{type:"column",value:t,field:e}}function on(t,e){const n=rn(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function an(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function sn(t,e){const n=rn(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function cn(t,e){const n=[];for(const r of t)n[r]=e;return n}function ln(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function un(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=ln(t,n);if(null!==e)return[e,r]}}return[null,null]}function fn(t){return!(t instanceof Date)&&"object"==typeof t}const hn=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,Y({},e,{encode:{y1:on(cn(t,0))}})]};function dn(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 gn(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=dn,n=(e,n)=>dn(t(e),n),r=(e,n)=>t(e)-n):(e=t===dn||t===pn?t:mn,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 mn(){return 0}function yn(t){return null===t?NaN:+t}hn.props={};const vn=gn(dn),bn=vn.right,xn=vn.left,wn=gn(yn).center;var Mn=bn;function En(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 On(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 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 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 Sn extends Map{constructor(t,e=An){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(_n(this,t))}has(t){return super.has(_n(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 _n({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function An(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Tn(t){return t}function Pn(t,...e){return jn(t,Tn,Tn,e)}function Cn(t,...e){return jn(t,Array.from,Tn,e)}function Nn(t,e,...n){return jn(t,Tn,e,n)}function Ln(t,e,...n){return jn(t,Array.from,e,n)}function jn(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new Sn,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 Rn(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 o=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),o.sort(((t,n)=>{for(const r of e){const e=Bn(r[t],r[n]);if(e)return e}}))):(n=t.map(n),o.sort(((t,e)=>Bn(n[t],n[e])))),r=t,i=o,Array.from(i,(t=>r[t]))}var r,i;return t.sort(In(n))}function In(t=dn){if(t===dn)return Bn;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 Bn(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var Dn=Array.prototype.slice;function Fn(t){return()=>t}const zn=Math.sqrt(50),Gn=Math.sqrt(10),Wn=Math.sqrt(2);function $n(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>=zn?10:o>=Gn?5:o>=Wn?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?$n(t,e,2*n):[s,c,l]}function Hn(t,e,n){return $n(t=+t,e=+e,n=+n)[2]}function Vn(t){return Math.max(1,Math.ceil(Math.log(En(t))/Math.LN2)+1)}function Yn(){var t=Tn,e=kn,n=Vn;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===kn&&([u,f]=function(t,e,n){let r;for(;;){const i=Hn(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?$n(e,t,n):$n(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=Hn(u,f,n)),h[h.length-1]>=f)if(t>=f&&e===kn){const t=Hn(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 m,y=new Array(d+1);for(i=0;i<=d;++i)(m=y[i]=[]).x0=i>0?h[i-1]:u,m.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&&y[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);y[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&&y[Mn(h,o,0,d)].push(r[i]);return y}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:Fn(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:Fn([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Fn(Array.isArray(t)?Dn.call(t):t),r):n},r}function qn(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 Un(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 o of t)null!=(o=e(o,++i,t))&&(n<o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Xn(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 Kn(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 o of t)null!=(o=e(o,++i,t))&&(n>o||void 0===n&&o>=o)&&(n=o,r=i);return r}function Zn(t,e,n=0,r=1/0,i){if(e=Math.floor(e),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(t.length-1,r)),!(n<=e&&e<=r))return t;for(i=void 0===i?Bn:In(i);r>n;){if(r-n>600){const o=r-n+1,a=e-n+1,s=Math.log(o),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(o-c)/o)*(a-o/2<0?-1:1);Zn(t,e,Math.max(n,Math.floor(e-a*c/o+l)),Math.min(r,Math.floor(e+(o-a)*c/o+l)),i)}const o=t[e];let a=n,s=r;for(Qn(t,n,e),i(t[r],o)>0&&Qn(t,n,r);a<s;){for(Qn(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?Qn(t,n,s):(++s,Qn(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function Qn(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function Jn(t,e,n=yn){if(!isNaN(e=+e)){if(r=Float64Array.fr