1 | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).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: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 d=({value:t})=>e=>e.map(t);d.props={};const h=({value:t})=>e=>e.map((e=>e[t]));h.props={};const p=({value:t})=>()=>t;p.props={};var g=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},m=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},y=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){y(t)&&"prototype"===r||e.push(r)})),e};var k=function(t){return"object"==typeof t&&null!==t},S=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 A(t,e){if(!w(t))return null;var n;if(y(e)&&(n=e),S(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 _=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)&&!S(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 L=function(t,e,n){return t<e?e:t>n?n:t},j=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=y(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=y(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()},G=function(t){var e=z(t);return e.charAt(0).toLowerCase()+e.substring(1)};var W=function(t){var e=z(t);return e.charAt(0).toUpperCase()+e.substring(1)},$=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},U=Y;function q(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&&S(o)?(S(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||!S(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 dt=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],d=n[0],h=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]=d*r+h*a+p*l,t[1]=d*i+h*s+p*u,t[2]=d*o+h*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 ht(){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 mt(t,e,n,r,i,o,a,s,c,l,u,f,d,h,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]=d,t[12]=h,t[13]=p,t[14]=g,t[15]=m,t}function yt(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],d=e[10],h=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,O=i*l-o*c,E=u*g-f*p,k=u*m-d*p,S=u*y-h*p,A=f*m-d*g,_=f*y-h*g,T=d*y-h*m,P=v*T-b*_+x*A+w*S-M*k+O*E;return P?(P=1/P,t[0]=(s*T-c*_+l*A)*P,t[1]=(i*_-r*T-o*A)*P,t[2]=(g*O-m*M+y*w)*P,t[3]=(d*M-f*O-h*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*O-y*b)*P,t[7]=(u*O-d*x+h*b)*P,t[8]=(a*_-s*S+l*E)*P,t[9]=(r*S-n*_-o*E)*P,t[10]=(p*M-g*x+y*v)*P,t[11]=(f*x-u*M-h*v)*P,t[12]=(s*k-a*A-c*E)*P,t[13]=(n*A-r*k+i*E)*P,t[14]=(g*b-p*w-m*v)*P,t[15]=(u*w-f*b+d*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],d=t[11],h=t[12],p=t[13],g=t[14],m=t[15];return(e*a-n*o)*(f*m-d*g)-(e*s-r*o)*(u*m-d*p)+(e*c-i*o)*(u*g-f*p)+(n*s-r*a)*(l*m-d*h)-(n*c-i*a)*(l*g-f*h)+(r*c-i*s)*(l*p-u*h)}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],d=e[9],h=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*d+M*m,t[2]=b*o+x*l+w*h+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*d+M*m,t[6]=b*o+x*l+w*h+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*d+M*m,t[10]=b*o+x*l+w*h+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*d+M*m,t[14]=b*o+x*l+w*h+M*y,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,d,h,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],d=e[9],h=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]=d,t[10]=h,t[11]=p,t[12]=r*g+s*m+f*y+e[12],t[13]=i*g+c*m+d*y+e[13],t[14]=o*g+l*m+h*y+e[14],t[15]=a*g+u*m+p*y+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],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*r,t[5]=a*i+u*r,t[6]=s*i+f*r,t[7]=c*i+d*r,t[8]=l*i-o*r,t[9]=u*i-a*r,t[10]=f*i-s*r,t[11]=d*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],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-l*r,t[1]=a*i-u*r,t[2]=s*i-f*r,t[3]=c*i-d*r,t[8]=o*r+l*i,t[9]=a*r+u*i,t[10]=s*r+f*i,t[11]=c*r+d*i,t}function St(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 At(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 _t(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,d=r*l,h=i*c,p=i*l,g=o*l,m=a*s,y=a*c,v=a*l;return t[0]=1-(h+g),t[1]=f+v,t[2]=d-y,t[3]=0,t[4]=f-v,t[5]=1-(u+g),t[6]=p+m,t[7]=0,t[8]=d+y,t[9]=p-m,t[10]=1-(u+h),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function Lt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function jt(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);jt(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,d=e[8]*r,h=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-h)/m,t[1]=(d-c)/m,t[2]=(s-l)/m):a>u&&a>p?(m=2*Math.sqrt(1+a-u-p),t[3]=(f-h)/m,t[0]=.25*m,t[1]=(s+l)/m,t[2]=(d+c)/m):u>p?(m=2*Math.sqrt(1+u-a-p),t[3]=(d-c)/m,t[0]=(s+l)/m,t[1]=.25*m,t[2]=(f+h)/m):(m=2*Math.sqrt(1+p-a-u),t[3]=(s-l)/m,t[0]=(d+c)/m,t[1]=(f+h)/m,t[2]=.25*m),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,d=o*l,h=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],O=r[2],E=i[0],k=i[1],S=i[2],A=(1-(g+y))*w,_=(h+x)*w,T=(p-b)*w,P=(h-x)*M,C=(1-(d+y))*M,N=(m+v)*M,L=(p+b)*O,j=(m-v)*O,R=(1-(d+g))*O;return t[0]=A,t[1]=_,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]+E-(A*E+P*k+L*S),t[13]=n[1]+k-(_*E+C*k+j*S),t[14]=n[2]+S-(T*E+N*k+R*S),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,d=i*a,h=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]=d-m,t[3]=0,t[4]=u-y,t[5]=1-l-p,t[6]=h+g,t[7]=0,t[8]=d+m,t[9]=h-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function 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 Gt=zt;function Wt(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 $t(t,e,n,r){var i,o,a,s,c,l,u,f,d,h,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)<lt&&Math.abs(g-w)<lt&&Math.abs(m-M)<lt?yt(t):(u=p-x,f=g-w,d=m-M,i=v*(d*=h=1/Math.hypot(u,f,d))-b*(f*=h),o=b*(u*=h)-y*d,a=y*f-v*u,(h=Math.hypot(i,o,a))?(i*=h=1/h,o*=h,a*=h):(i=0,o=0,a=0),s=f*a-d*o,c=d*i-u*a,l=u*o-f*i,(h=Math.hypot(s,c,l))?(s*=h=1/h,c*=h,l*=h):(s=0,c=0,l=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=a,t[9]=l,t[10]=d,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+d*m),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,Ut=Object.freeze({__proto__:null,create:ht,clone:pt,copy:gt,fromValues:function(t,e,n,r,i,o,a,s,c,l,u,f,d,h,p,g){var m=new ut(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]=d,m[13]=h,m[14]=p,m[15]=g,m},set:mt,identity:yt,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],d=e[10],h=e[11],p=e[12],g=e[13],m=e[14],y=e[15];return t[0]=s*(d*y-h*m)-f*(c*y-l*m)+g*(c*h-l*d),t[1]=-(r*(d*y-h*m)-f*(i*y-o*m)+g*(i*h-o*d)),t[2]=r*(c*y-l*m)-s*(i*y-o*m)+g*(i*l-o*c),t[3]=-(r*(c*h-l*d)-s*(i*h-o*d)+f*(i*l-o*c)),t[4]=-(a*(d*y-h*m)-u*(c*y-l*m)+p*(c*h-l*d)),t[5]=n*(d*y-h*m)-u*(i*y-o*m)+p*(i*h-o*d),t[6]=-(n*(c*y-l*m)-a*(i*y-o*m)+p*(i*l-o*c)),t[7]=n*(c*h-l*d)-a*(i*h-o*d)+u*(i*l-o*c),t[8]=a*(f*y-h*g)-u*(s*y-l*g)+p*(s*h-l*f),t[9]=-(n*(f*y-h*g)-u*(r*y-o*g)+p*(r*h-o*f)),t[10]=n*(s*y-l*g)-a*(r*y-o*g)+p*(r*l-o*s),t[11]=-(n*(s*h-l*f)-a*(r*h-o*f)+u*(r*l-o*s)),t[12]=-(a*(f*m-d*g)-u*(s*m-c*g)+p*(s*d-c*f)),t[13]=n*(f*m-d*g)-u*(r*m-i*g)+p*(r*d-i*f),t[14]=-(n*(s*m-c*g)-a*(r*m-i*g)+p*(r*c-i*s)),t[15]=n*(s*d-c*f)-a*(r*d-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,d,h,p,g,m,y,v,b,x,w,M,O,E,k,S,A,_=r[0],T=r[1],P=r[2],C=Math.hypot(_,T,P);return C<lt?null:(_*=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],d=e[5],h=e[6],p=e[7],g=e[8],m=e[9],y=e[10],v=e[11],b=_*_*a+o,x=T*_*a+P*i,w=P*_*a-T*i,M=_*T*a-P*i,O=T*T*a+o,E=P*T*a+_*i,k=_*P*a+T*i,S=T*P*a-_*i,A=P*P*a+o,t[0]=s*b+f*x+g*w,t[1]=c*b+d*x+m*w,t[2]=l*b+h*x+y*w,t[3]=u*b+p*x+v*w,t[4]=s*M+f*O+g*E,t[5]=c*M+d*O+m*E,t[6]=l*M+h*O+y*E,t[7]=u*M+p*O+v*E,t[8]=s*k+f*S+g*A,t[9]=c*k+d*S+m*A,t[10]=l*k+h*S+y*A,t[11]=u*k+p*S+v*A,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],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*r,t[1]=a*i+u*r,t[2]=s*i+f*r,t[3]=c*i+d*r,t[4]=l*i-o*r,t[5]=u*i-a*r,t[6]=f*i-s*r,t[7]=d*i-c*r,t},fromTranslation:St,fromScaling:At,fromRotation:_t,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:Lt,getScaling:jt,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,d=i*l,h=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]=(d+b)*x,t[2]=(h-v)*x,t[3]=0,t[4]=(d-b)*w,t[5]=(1-(f+m))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(h+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: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:Gt,orthoZO:Wt,lookAt:$t,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],d=a-n[2],h=u*u+f*f+d*d;h>0&&(u*=h=1/Math.sqrt(h),f*=h,d*=h);var p=c*d-l*f,g=l*u-s*d,m=s*f-c*u;return(h=p*p+g*g+m*m)>0&&(p*=h=1/Math.sqrt(h),g*=h,m*=h),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=f*m-d*g,t[5]=d*p-u*m,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=d,t[11]=0,t[12]=i,t[13]=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],d=t[10],h=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],O=e[5],E=e[6],k=e[7],S=e[8],A=e[9],_=e[10],T=e[11],P=e[12],C=e[13],N=e[14],L=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-S)<=lt*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-A)<=lt*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(d-_)<=lt*Math.max(1,Math.abs(d),Math.abs(_))&&Math.abs(h-T)<=lt*Math.max(1,Math.abs(h),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(m-N)<=lt*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(y-L)<=lt*Math.max(1,Math.abs(y),Math.abs(L))},mul:Vt,sub:Yt});function qt(){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 de(){var t=new ut(4);return ut!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function he(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 me(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 ye(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}qt(),function(){var t=de()}();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=me,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};qt(),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 Se(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 Ae(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 _e(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 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 Le(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 je={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 Ge(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 We(t){return t>=48&&t<=57||43===t||45===t||46===t}function $e(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)),$e(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&$e(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;o<n&&$e(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;$e(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&&$e(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;o<n&&$e(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 Ue(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):Ge(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(!We(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 qe=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 qe(t);for(Ye(e);e.index<e.max&&!e.err.length;)Ue(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,d=2*i-e.qy;e.qx=f,e.qy=d,c=["Q",f,d].concat(s)}else if("Q"===n){var h=s[0],p=s[1];e.qx=h,e.qy=p}return c}function Ke(t){if(Fe(t))return[].concat(t);for(var e=Xe(t),n=ke({},je),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,d,h,p,g=t,m=e,y=n,v=r,b=s,x=c,w=120*Math.PI/180,M=Math.PI/180*(+i||0),O=[];if(l)f=l[0],d=l[1],h=l[2],p=l[3];else{g=(u=Qe(g,m,-M)).x,m=u.y;var E=(g-(b=(u=Qe(b,x,-M)).x))/2,k=(m-(x=u.y))/2,S=E*E/(y*y)+k*k/(v*v);S>1&&(y*=S=Math.sqrt(S),v*=S);var A=y*y,_=v*v,T=(o===a?-1:1)*Math.sqrt(Math.abs((A*_-A*k*k-_*E*E)/(A*k*k+_*E*E)));h=T*y*k/v+(g+b)/2,p=T*-v*E/y+(m+x)/2,f=Math.asin(((m-p)/v*Math.pow(10,9)|0)/Math.pow(10,9)),d=Math.asin(((x-p)/v*Math.pow(10,9)|0)/Math.pow(10,9)),f=g<h?Math.PI-f:f,d=b<h?Math.PI-d:d,f<0&&(f=2*Math.PI+f),d<0&&(d=2*Math.PI+d),a&&f>d&&(f-=2*Math.PI),!a&&d>f&&(d-=2*Math.PI)}var P=d-f;if(Math.abs(P)>w){var C=d,N=b,L=x;d=f+w*(a&&d>f?1:-1),O=Je(b=h+y*Math.cos(d),x=p+v*Math.sin(d),y,v,i,0,a,N,L,[d,C,h,p])}P=d-f;var j=Math.cos(f),R=Math.sin(f),I=Math.cos(d),B=Math.sin(d),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,O);for(var V=[],Y=0,U=(O=W.concat($,H,O)).length;Y<U;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,i,o,a,s,c,l,u,f=t[0],d=t.slice(1).map(Number),h=d[0],p=d[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=h,e.y=p,t;case"A":return n=[g,m].concat(d),["C"].concat(Je(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=p,n=[g,m].concat(d),["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(en(g,m,h,p));case"Z":return g===y&&m===v?["C",g,m,y,v,y,v]:["C"].concat(en(g,m,y,v))}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({},je),s=[],c="",l=o.length,u=[],f=0;f<l;f+=1){o[f]&&(c=o[f][0]),s[f]=c;var d=nn(o[f],a);o[f]=d,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,d=Math.cos,h=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 an(t,e,s,c,l).point;var v=(t-s)/2,b=(e-c)/2,x={x:d(y)*v+f(y)*b,y:-f(y)*v+d(y)*b},w=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(m,2);w>1&&(g*=h(w),m*=h(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)),O=(o!==a?1:-1)*h(M=M<0?0:M),E=O*(g*x.y/m),k=O*(-m*x.x/g),S=d(y)*E-f(y)*k+(t+s)/2,A=f(y)*E+d(y)*k+(e+c)/2,_={x:(x.x-E)/g,y:(x.y-k)/m},T=sn({x:1,y:0},_),P=sn(_,{x:(-x.x-E)/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*d(C),L=m*f(C);return{x:d(y)*N-f(y)*L+S,y:f(y)*N+d(y)*L+A}}function ln(t,e,n,r,i,o,a,s,c,l,u){var f,d=u.bbox,h=void 0===d||d,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],O=[b,x],E={x:0,y:0},k=[{x:b,y:x}];v&&l<=0&&(E={x:b,y:x});for(var S=0;S<=y;S+=1){if(b=(f=cn(t,e,n,r,i,o,a,s,c,S/y)).x,x=f.y,h&&k.push({x:b,y:x}),g&&(w+=on(O,[b,x])),O=[b,x],v&&w>=l&&l>M[2]){var A=(w-l)/(w-M[2]);E={x:O[0]*(1-A)+M[0]*A,y:O[1]*(1-A)+M[1]*A}}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,d=void 0===f||f,h=l.length,p=void 0===h||h,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],O={x:0,y:0},E=[{x:v,y:b}];y&&c<=0&&(O={x:v,y:b});for(var k=0;k<=m;k+=1){if(v=(u=un(t,e,n,r,i,o,a,s,k/m)).x,b=u.y,d&&E.push({x:v,y:b}),p&&(x+=on(M,[v,b])),M=[v,b],y&&x>=c&&c>w[2]){var S=(x-c)/(x-w[2]);O={x:M[0]*(1-S)+w[0]*S,y:M[1]*(1-S)+w[1]*S}}w=[v,b,x]}return y&&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 dn(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 hn(t,e,n,r,i,o,a,s){var c,l=s.bbox,u=void 0===l||l,f=s.length,d=void 0===f||f,h=s.sampleSize,p=void 0===h?10:h,g="number"==typeof 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 O=0;O<=p;O+=1){if(m=(c=dn(t,e,n,r,i,o,O/p)).x,y=c.y,u&&M.push({x:m,y:y}),d&&(v+=on(x,[m,y])),x=[m,y],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=[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 pn(t,e,n){for(var r,i,o,a,s,c,l,u,f,d=Ke(t),h="number"==typeof e,p=[],g=0,m=0,y=0,v=0,b=[],x=[],w=0,M={x:0,y:0},O=M,E=M,k=M,S=0,A=0,_=d.length;A<_;A+=1)p=(l="M"===(u=(f=d[A])[0]))?p:[g,m].concat(f.slice(1)),l?(O=M={x:y=f[1],y:v=f[2]},w=0,h&&e<.001&&(k=M)):"L"===u?(w=(r=an(p[0],p[1],p[2],p[3],(e||0)-S)).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)-S,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)-S,n||{})).length,M=o.min,O=o.max,E=o.point):"Q"===u?(w=(a=hn(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-S,n||{})).length,M=a.min,O=a.max,E=a.point):"Z"===u&&(w=(s=an((p=[g,m,y,v])[0],p[1],p[2],p[3],(e||0)-S)).length,M=s.min,O=s.max,E=s.point),h&&S<e&&S+w>=e&&(k=E),x.push(O),b.push(M),S+=w,g=(c="Z"!==u?f.slice(-2):[y,v])[0],m=c[1];return h&&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 gn(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 yn(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),d=[l,u],h=[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&&h[e]&&t.l>=d[e],h[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return g[0].length===g[1].length?g:yn(g[0],g[1],f)}function vn(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function bn(t,e){if(null!==t)return{type:"column",value:t,field:e}}function xn(t,e){const n=bn(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function wn(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function Mn(t,e){const n=bn(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function On(t,e){const n=[];for(const r of t)n[r]=e;return n}function En(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function kn(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=En(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:xn(On(t,0))}})]};function _n(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Tn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Pn(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=_n,n=(e,n)=>_n(t(e),n),r=(e,n)=>t(e)-n):(e=t===_n||t===Tn?t:Cn,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 Cn(){return 0}function Nn(t){return null===t?NaN:+t}An.props={};const Ln=Pn(_n),jn=Ln.right,Rn=Ln.left,In=Pn(Nn).center;var Bn=jn;function Dn(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 Fn(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 zn(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 Gn extends Map{constructor(t,e=$n){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(Wn(this,t))}has(t){return super.has(Wn(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 Wn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function $n(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Hn(t){return t}function Vn(t,...e){return Xn(t,Hn,Hn,e)}function Yn(t,...e){return Xn(t,Array.from,Hn,e)}function Un(t,e,...n){return Xn(t,Hn,e,n)}function qn(t,e,...n){return Xn(t,Array.from,e,n)}function Xn(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 Zn(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=Qn(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>Qn(n[t],n[e])))),function(t,e){return Array.from(e,(e=>t[e]))}(t,r)}return t.sort(Kn(n))}function Kn(t=_n){if(t===_n)return Qn;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 Qn(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var Jn=Array.prototype.slice;function tr(t){return()=>t}const er=Math.sqrt(50),nr=Math.sqrt(10),rr=Math.sqrt(2);function ir(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>=er?10:o>=nr?5:o>=rr?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?ir(t,e,2*n):[s,c,l]}function or(t,e,n){return ir(t=+t,e=+e,n=+n)[2]}function ar(t){return Math.max(1,Math.ceil(Math.log(Dn(t))/Math.LN2)+1)}function sr(){var t=Hn,e=zn,n=ar;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],d=n(c,u,f);if(!Array.isArray(d)){const t=f,n=+d;if(e===zn&&([u,f]=function(t,e,n){let r;for(;;){const i=or(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,f,n)),d=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,o,a]=r?ir(e,t,n):ir(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),d[0]<=u&&(a=or(u,f,n)),d[d.length-1]>=f)if(t>=f&&e===zn){const t=or(u,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else d.pop()}for(var h=d.length,p=0,g=h;d[p]<=u;)++p;for(;d[g-1]>f;)--g;(p||g<h)&&(d=d.slice(p,g),h=g-p);var m,y=new Array(h+1);for(i=0;i<=h;++i)(m=y[i]=[]).x0=i>0?d[i-1]:u,m.x1=i<h?d[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(h,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(h,t+(d[t]<=o))].push(r[i])}}else for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&y[Bn(d,o,0,h)].push(r[i]);return y}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:tr(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:tr([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:tr(Array.isArray(t)?Jn.call(t):t),r):n},r}function cr(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 lr(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 ur(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 fr(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 dr(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?Qn:Kn(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);dr(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(hr(t,n,e),i(t[r],o)>0&&hr(t,n,r);a<s;){for(hr(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?hr(t,n,s):(++s,hr(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function hr(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function pr(t,e,n=Nn){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>Nn(n(t[r],r,t)))),e<=0)return fr(r);if(e>=1)return lr(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return dr(i,a,0,o,((t,e)=>Qn(r[t],r[e]))),a=function(t,e=_n){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?_n(t,i)>0:0===_n(t,t))&&(n=o,i=t,r=!0)}}else for(const i of t)(r?e(i,n)>0:0===e(i,i))&&(n=i,r=!0);return n}(i.subarray(0,a+1),(t=>r[t])),a>=0?a:-1}}function gr(t,e){let n=0,r=0;if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(++n,r+=e);else{let i=-1;for(let o of t)null!=(o=e(o,++i,t))&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function mr(t,e){return function(t,e,n){if(t=Float64Array.from(function*(t,e){if(void 0===e)for(let e of t)null!=e&&(e=+e)>=e&&(yield e);else{let n=-1;for(let r of t)null!=(r=e(r,++n,t))&&(r=+r)>=r&&(yield r)}}(t,n)),(r=t.length)&&!isNaN(e=+e)){if(e<=0||r<2)return ur(t);if(e>=1)return cr(t);var r,i=(r-1)*e,o=Math.floor(i),a=cr(dr(t,o).subarray(0,o+1));return a+(ur(t.subarray(o+1))-a)*(i-o)}}(t,.5,e)}function yr(t,e){let n=0;if(void 0===e)for(let e of t)(e=+e)&&(n+=e);else{let r=-1;for(let i of t)(i=+e(i,++r,t))&&(n+=i)}return n}function vr(t){return t}function br(t){return t.reduce(((t,e)=>(n,...r)=>e(t(n,...r),...r)),vr)}function xr(t){return t.replace(/( |^)[a-z]/g,(t=>t.toUpperCase()))}function wr(t=""){throw new Error(t)}function Mr(t,e){const{attributes:n}=e,r=new Set(["id","className"]);for(const[e,i]of Object.entries(n))r.has(e)||t.attr(e,i)}function Or(t){return null!=t&&!Number.isNaN(t)}function Er(t){const e=new Map;return n=>{if(e.has(n))return e.get(n);const r=t(n);return e.set(n,r),r}}function kr(t,e){return Sr(t,e)||{}}function Sr(t,e){const n=Object.entries(t||{}).filter((([t])=>t.startsWith(e))).map((([t,n])=>[G(t.replace(e,"").trim()),n])).filter((([t])=>!!t));return 0===n.length?null:Object.fromEntries(n)}function Ar(t,...e){return Object.fromEntries(Object.entries(t).filter((([t])=>e.every((e=>!t.startsWith(e))))))}function _r(t,e){if(void 0===t)return null;if("number"==typeof t)return t;const n=+t.replace("%","");return Number.isNaN(n)?null:n/100*e}function Tr(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function Pr(t){return null===t||!1===t}function Cr(t,e,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(e)){const o=e[i];S(o)&&S(t[i])?Cr(t[i],o,n,r+1):t[i]=o}return t}}function Nr(t,e){return Object.entries(t).reduce(((n,[r,i])=>(n[r]=e(i,r,t),n)),{})}function Lr(t){return t.map(((t,e)=>e))}function jr(t){return t[0]}function Rr(t){return t[t.length-1]}function Ir(t,e){const n=[[],[]];return t.forEach((t=>{n[e(t)?0:1].push(t)})),n}function Br(t,e=t.length){if(1===e)return t.map((t=>[t]));const n=[];for(let r=0;r<t.length;r++){Br(t.slice(r+1),e-1).forEach((e=>{n.push([t[r],...e])}))}return n}function Dr(t,e,n){const{encode:r}=n;if(null===t)return[e];const i=function(t){return Array.isArray(t)?t:[t]}(t).map((t=>{var e;return[t,null===(e=En(r,t))||void 0===e?void 0:e[0]]})).filter((([,t])=>Or(t)));return Array.from(Vn(e,(t=>i.map((([,e])=>e[t])).join("-"))).values())}function Fr(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce(((t,i)=>0!==t?t:_n(e[n][i],e[r][i])),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>Yr((n=>t(e[n])))}(t):"series"===t?Wr:"value"===t?$r:"sum"===t?Hr:"maxIndex"===t?Vr:null}function zr(t,e){for(const n of t)n.sort(e)}function Gr(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function Wr(t,e,n){return Yr((t=>n[t]))}function $r(t,e,n){return Yr((t=>e[t]))}function Hr(t,e,n){const r=Lr(t),i=Array.from(Vn(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,n.reduce(((t,n)=>t+ +e[n]))])));return Yr((t=>o.get(n[t])))}function Vr(t,e,n){const r=Lr(t),i=Array.from(Vn(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,lr(n,(t=>e[t]))])));return Yr((t=>o.get(n[t])))}function Yr(t){return(e,n)=>_n(t(e),t(n))}const Ur=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=t;return(t,s)=>{var c;const{data:l,encode:u,style:f={}}=s,[d,h]=En(u,"y"),[p,g]=En(u,"y1"),[m]=a?kn(u,"series","color"):En(u,"color"),y=Dr(e,t,s),v=(null!==(c=Fr(n))&&void 0!==c?c:()=>null)(l,d,m);v&&zr(y,v);const b=new Array(t.length),x=new Array(t.length),w=new Array(t.length),M=[],O=[];for(const t of y){r&&t.reverse();const e=p?+p[t[0]]:0,n=[],i=[];for(const r of t){const t=w[r]=+d[r]-e;t<0?i.push(r):t>=0&&n.push(r)}const o=n.length>0?n:i,a=i.length>0?i:n;let s=n.length-1,c=0;for(;s>0&&0===d[o[s]];)s--;for(;c<a.length-1&&0===d[a[c]];)c++;M.push(o[s]),O.push(a[c]);let l=e;for(const t of i.reverse()){const e=w[t];l=b[t]=(x[t]=l)+e}let u=e;for(const t of n){const e=w[t];e>0?u=b[t]=(x[t]=u)+e:b[t]=x[t]=u}}const E=new Set(M),k=new Set(O),S="y"===i?b:x,A="y"===o?b:x;return[t,K({},s,{encode:{y0:xn(d,h),y:bn(S,h),y1:bn(A,g)},style:Object.assign({first:(t,e)=>E.has(e),last:(t,e)=>k.has(e)},f)})]}};function qr(t){const{type:e}=t;return"string"==typeof e&&["stackY","dodgeX","groupX"].includes(e)}Ur.props={};const Xr=t=>(e,n,r)=>{const{encode:i,transform:o=[]}=n;if(o.some(qr))return[e,n];const{x:a,y:s}=i;if(void 0===a||void 0===s)return[e,n];const{series:c}=t;return Ur({groupBy:c?["x","series"]:"x"})(e,n,r)};function Zr(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function Kr(t){const e=`${t.getFullYear()}-${Zr(t.getMonth()+1)}-${Zr(t.getDate())}`,n=t.getHours(),r=t.getMinutes(),i=t.getSeconds();return n||r||i?`${e} ${Zr(n)}:${Zr(r)}:${Zr(i)}`:e}Xr.props={};const Qr=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(Pr(i))return[t,n];const{title:o}=i;if(void 0!==o)return[t,n];const a=Object.keys(r).filter((t=>t.startsWith(e))).filter((t=>!r[t].inferred)).map((t=>En(r,t))).filter((([t])=>t)).map((t=>t[0]));if(0===a.length)return[t,n];const s=[];for(const e of t)s[e]={value:a.map((t=>t[e]instanceof Date?Kr(t[e]):t[e])).join(", ")};return[t,K({},n,{tooltip:{title:s}})]}};Qr.props={};const Jr=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,K({},e,{encode:{x:xn(On(t,0))},scale:{x:{guide:null}}})]};Jr.props={};const ti=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,K({},e,{encode:{y:xn(On(t,0))},scale:{y:{guide:null}}})]};ti.props={};const ei=()=>(t,e)=>{const{encode:n}=e,{z:r}=n;return void 0!==r?[t,e]:[t,K({},e,{encode:{z:xn(On(t,0))},scale:{z:{guide:null}}})]};ei.props={};const ni=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,K({},e,{encode:{size:wn(On(t,3))}})]};ni.props={};const ri=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=Se(n,["key"]);if(void 0!==r)return[t,e];const o=Object.values(i).map((({value:t})=>t)),a=t.map((t=>o.filter(Array.isArray).map((e=>e[t])).join("-")));return[t,K({},e,{encode:{key:bn(a)}})]};ri.props={};const ii=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[o,a]=En(n,"color");return[t,K({},e,{encode:{series:bn(o,a)}})]};ii.props={};const oi=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(Sn)?[t,e]:[t,K({},e,{encode:{y:bn(n)}})]};oi.props={};const ai=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(Sn)?[t,e]:[t,K({},e,{encode:{x:bn(n)}})]};ai.props={};const si=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=En(n,"y");return[t,K({},e,{encode:{y1:bn([...i])}})]};si.props={};const ci=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=En(n,"x");return[t,K({},e,{encode:{x1:bn([...i])}})]};ci.props={};const li=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(Sn))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,K({},e,{encode:{x:bn(r(n,0)),x1:bn(r(n,1))}})]}return[t,e]};li.props={};const ui=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(Sn))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,K({},e,{encode:{y:bn(r(n,0)),y1:bn(r(n,1))}})]}return[t,e]};ui.props={};const fi=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(Pr(i))return[t,n];const{items:o=[]}=i;if(!o||o.length>0)return[t,n];const a=(Array.isArray(e)?e:[e]).flatMap((t=>Object.keys(r).filter((e=>e.startsWith(t))).map((t=>{const{field:e,value:n,inferred:i=!1,aggregate:o}=r[t];return i?null:o&&n?{channel:t}:e?{field:e}:n?{channel:t}:null})).filter((t=>null!==t))));return[t,K({},n,{tooltip:{items:a}})]}};fi.props={};const di=()=>(t,e)=>[t,K({scale:{x:{padding:0},y:{padding:0}}},e)];di.props={};const hi=()=>(t,e)=>{const{data:n,style:r={}}=e,i=Se(e,["data","style"]),{x:o,y:a}=r,s=Se(r,["x","y"]);if(null==o||null==a)return[t,e];const c=a||0;return[[0],K({},i,{data:[0],cartesian:!0,encode:{x:bn([o||0]),y:bn([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};hi.props={};const pi=()=>(t,e)=>{const{style:n={}}=e;return[t,K({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter((([,t])=>"function"==typeof t)).map((([t,e])=>[t,()=>e]))))})]};pi.props={};const gi=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(Sn))return[t,e];const r=Array.isArray(n[0])?n:[n],i=r.map((t=>t[0])),o=r.map((t=>t[1]));return[t,K({},e,{encode:{x:bn(i),y:bn(o)}})]};gi.props={};const mi=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:o}=n;return!o||i?[t,e]:[t,K({},e,{encode:{series:wn(On(t,void 0))}})]};mi.props={};const yi=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return Se(t,["groupBy","reverse","orderBy","padding"]),(t,o)=>{const{data:a,encode:s,scale:c}=o,{series:l}=c,[u]=En(s,"y"),[f]=kn(s,"series","color"),d=Gr(f,l),h=K({},o,{scale:{series:{domain:d,paddingInner:i}}}),p=Dr(e,t,o),g=Fr(r);if(!g)return[t,K(h,{encode:{series:bn(f)}})];const m=g(a,u,f);m&&zr(p,m);const y=new Array(t.length);for(const t of p){n&&t.reverse();for(let e=0;e<t.length;e++)y[t[e]]=d[e]}return[t,K(h,{encode:{series:bn(r?y:f)}})]}};yi.props={};const vi=t=>{const{groupBy:e=["x"],reducer:n=(t,e)=>e[t[0]],orderBy:r=null,reverse:i=!1,duration:o}=t;return(t,a)=>{const{encode:s}=a,c=(Array.isArray(e)?e:[e]).map((t=>[t,En(s,t)[0]]));if(0===c.length)return[t,a];let l=[t];for(const[,t]of c){const e=[];for(const n of l){const r=Array.from(Vn(n,(e=>t[e])).values());e.push(...r)}l=e}if(r){const[t]=En(s,r);t&&l.sort(((e,r)=>n(e,t)-n(r,t))),i&&l.reverse()}const u=(o||3e3)/l.length,[f]=o?[On(t,u)]:kn(s,"enterDuration",On(t,u)),[d]=kn(s,"enterDelay",On(t,0)),h=new Array(t.length);for(let t=0,e=0;t<l.length;t++){const n=l[t],r=cr(n,(t=>+f[t]));for(const t of n)h[t]=+d[t]+e;e+=r}return[t,K({},a,{encode:{enterDuration:wn(f),enterDelay:wn(h)}})]}};vi.props={};const bi=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:o}=r,a=Se(i,["x"]),s=Object.entries(a).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,En(i,t)[0]])),[,c]=s.find((([t])=>"y"===t)),l=s.map((([e])=>[e,new Array(t.length)])),u=Dr(e,t,r),f=function(t){return"function"==typeof t?t:{min:(t,e)=>ur(t,(t=>e[+t])),max:(t,e)=>cr(t,(t=>e[+t])),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>gr(t,(t=>e[+t])),median:(t,e)=>mr(t,(t=>e[+t])),sum:(t,e)=>yr(t,(t=>e[+t])),deviation:(t,e)=>Fn(t,(t=>e[+t]))}[t]||cr}(n);for(const t of u){const e=f(t,c);for(const n of t)for(let t=0;t<s.length;t++){const[,r]=s[t],[,i]=l[t];i[n]=+r[n]/e}}const d=Pr(o)||(null==o?void 0:o.items)&&0!==(null==o?void 0:o.items.length);return[t,K({},r,Object.assign({encode:Object.fromEntries(l.map((([t,e])=>[t,bn(e,En(i,t)[1])])))},!d&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function xi(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function wi(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function Mi(t,e,n,r,i){let o=n||0,a=r||t.length;const s=i||(t=>t);for(;o<a;){const n=Math.floor((o+a)/2);s(t[n])>e?a=n:o=n+1}return o}bi.props={};const Oi=Math.sqrt(50),Ei=Math.sqrt(10),ki=Math.sqrt(2);function Si(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/10**i;return i>=0?(o>=Oi?10:o>=Ei?5:o>=ki?2:1)*10**i:-(10**-i)/(o>=Oi?10:o>=Ei?5:o>=ki?2:1)}function Ai(t,e,n){const r=Math.abs(e-t)/Math.max(0,n);let i=10**Math.floor(Math.log(r)/Math.LN10);const o=r/i;return o>=Oi?i*=10:o>=Ei?i*=5:o>=ki&&(i*=2),e<t?-i:i}const _i=(t,e,n=5)=>{const r=[t,e];let i,o=0,a=r.length-1,s=r[o],c=r[a];return c<s&&([s,c]=[c,s],[o,a]=[a,o]),i=Si(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=Si(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=Si(s,c,n)),i>0?(r[o]=Math.floor(s/i)*i,r[a]=Math.ceil(c/i)*i):i<0&&(r[o]=Math.ceil(s*i)/i,r[a]=Math.floor(c*i)/i),r},Ti=1e3,Pi=6e4,Ci=36e5,Ni=864e5,Li=6048e5,ji=2592e6,Ri=31536e6;function Ii(t,e,n,r){const i=(t,i)=>{i&&((t,e)=>{const i=t=>r(t)%e==0;let o=e;for(;o&&!i(t);)n(t,-1),o-=1})(t,i),e(t)},o=(t,e)=>{const r=new Date(+t-1);return i(r,e),n(r,e),i(r),r};return{ceil:o,floor:(t,e)=>{const n=new Date(+t);return i(n,e),n},range:(t,e,r,a)=>{const s=[],c=Math.floor(r);for(let l=a?o(t,r):o(t);l<e;n(l,c),i(l))s.push(new Date(+l));return s},duration:t}}const Bi=Ii(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Di=Ii(Ti,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Ti*e)}),(t=>t.getSeconds())),Fi=Ii(Pi,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+Pi*e)}),(t=>t.getMinutes())),zi=Ii(Ci,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+Ci*e)}),(t=>t.getHours())),Gi=Ii(Ni,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Ni*e)}),(t=>t.getDate()-1)),Wi=Ii(ji,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),$i=Ii(Li,(t=>{t.setDate(t.getDate()-t.getDay()%7),t.setHours(0,0,0,0)}),((t,e=1)=>{t.setDate(t.getDate()+7*e)}),(t=>{const e=Wi.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Li)})),Hi=Ii(Ri,(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getFullYear();t.setFullYear(n+e)}),(t=>t.getFullYear())),Vi={millisecond:Bi,second:Di,minute:Fi,hour:zi,day:Gi,week:$i,month:Wi,year:Hi},Yi=Ii(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Ui=Ii(Ti,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Ti*e)}),(t=>t.getUTCSeconds())),qi=Ii(Pi,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+Pi*e)}),(t=>t.getUTCMinutes())),Xi=Ii(Ci,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+Ci*e)}),(t=>t.getUTCHours())),Zi=Ii(Ni,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Ni*e)}),(t=>t.getUTCDate()-1)),Ki=Ii(ji,(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)}),(t=>t.getUTCMonth())),Qi=Ii(Li,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Li*e)}),(t=>{const e=Ki.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Li)})),Ji=Ii(Ri,(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCFullYear();t.setUTCFullYear(n+e)}),(t=>t.getUTCFullYear())),to={millisecond:Yi,second:Ui,minute:qi,hour:Xi,day:Zi,week:Qi,month:Ki,year:Ji};function eo(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?to:Vi,{year:n,month:r,week:i,day:o,hour:a,minute:s,second:c,millisecond:l}=e;return{tickIntervals:[[c,1],[c,5],[c,15],[c,30],[s,1],[s,5],[s,15],[s,30],[a,1],[a,3],[a,6],[a,12],[o,1],[o,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:l}}(i),u=([t,e])=>t.duration*e,f=r?(a-o)/r:n||5,d=r||(a-o)/f,h=s.length,p=Mi(s,d,0,h,u);let g;if(p===h){g=[c,Ai(o/c.duration,a/c.duration,f)]}else if(p){const t=d/u(s[p-1])<u(s[p])/d,[e,n]=t?s[p-1]:s[p];g=[e,r?Math.ceil(r/e.duration):n]}else{g=[l,Math.max(Ai(o,a,f),1)]}return g}const no=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=eo(a,s,n,r,i),u=[c.floor(a,l),c.ceil(s,l)];return o?u.reverse():u};function ro(t){return!V(t)&&!H(t)&&!Number.isNaN(t)}const io=t=>e=>-t(-e),oo=(t,e)=>{const n=Math.log(t),r=t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:t=>Math.log(t)/n;return e?io(r):r},ao=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?io(n):n},so=(t,e,n,r)=>{const i=t<0,o=oo(r,i),a=ao(r,i),s=t>e,c=s?e:t,l=s?t:e,u=[a(Math.floor(o(c))),a(Math.ceil(o(l)))];return s?u.reverse():u};var co={exports:{}},lo={exports:{}},uo=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},fo=Array.prototype.concat,ho=Array.prototype.slice,po=lo.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];uo(i)?e=fo.call(e,ho.call(i)):e.push(i)}return e};po.wrap=function(t){return function(){return t(po(arguments))}};var go={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},mo=lo.exports,yo=Object.hasOwnProperty,vo=Object.create(null);for(var bo in go)yo.call(go,bo)&&(vo[go[bo]]=bo);var xo=co.exports={to:{},get:{}};function wo(t,e,n){return Math.min(Math.max(e,t),n)}function Mo(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}xo.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=xo.get.hsl(t),n="hsl";break;case"hwb":e=xo.get.hwb(t),n="hwb";break;default:e=xo.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},xo.get.rgb=function(t){if(!t)return null;var e,n,r,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var o=2*n;i[n]=parseInt(e.slice(o,o+2),16)}r&&(i[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);r&&(i[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:yo.call(go,e[1])?((i=go[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=wo(i[n],0,255);return i[3]=wo(i[3],0,1),i},xo.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,wo(parseFloat(e[2]),0,100),wo(parseFloat(e[3]),0,100),wo(isNaN(n)?1:n,0,1)]}return null},xo.get.hwb=function(t){if(!t)return null;var e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,wo(parseFloat(e[2]),0,100),wo(parseFloat(e[3]),0,100),wo(isNaN(n)?1:n,0,1)]}return null},xo.to.hex=function(){var t=mo(arguments);return"#"+Mo(t[0])+Mo(t[1])+Mo(t[2])+(t[3]<1?Mo(Math.round(255*t[3])):"")},xo.to.rgb=function(){var t=mo(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},xo.to.rgb.percent=function(){var t=mo(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},xo.to.hsl=function(){var t=mo(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},xo.to.hwb=function(){var t=mo(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},xo.to.keyword=function(t){return vo[t.slice(0,3)]};var Oo=co.exports;function Eo(t,e,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function ko(t){const e=Oo.get(t);if(!e)return null;const{model:n,value:r}=e;return"rgb"===n?r:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100,i=t[3];if(0===n)return[255*r,255*r,255*r,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o;return[255*Eo(a,o,e+1/3),255*Eo(a,o,e),255*Eo(a,o,e-1/3),i]}(r):null}const So=(t,e)=>n=>t*(1-n)+e*n,Ao=(t,e)=>"number"==typeof t&&"number"==typeof e?So(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=ko(t),r=ko(e);return null===n||null===r?n?()=>t:()=>e:t=>{const e=new Array(4);for(let i=0;i<4;i+=1){const o=n[i],a=r[i];e[i]=o*(1-t)+a*t}const[i,o,a,s]=e;return`rgba(${Math.round(i)}, ${Math.round(o)}, ${Math.round(a)}, ${s})`}})(t,e):()=>t,_o=(t,e)=>{const n=So(t,e);return t=>Math.round(n(t))};function To({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Po(t){return"object"==typeof t?t.valueOf():t}class Co extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Po,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(To({map:this.map,initKey:this.initKey},t))}has(t){return super.has(To({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(function({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):(t.set(r,n),n)}({map:this.map,initKey:this.initKey},t),e)}delete(t){return super.delete(function({map:t,initKey:e},n){const r=e(n);return t.has(r)&&(n=t.get(r),t.delete(r)),n}({map:this.map,initKey:this.initKey},t))}}class No{constructor(t){this.options=K({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=K({},this.options,t),this.rescale(t)}rescale(t){}}const Lo=Symbol("defaultUnknown");function jo(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Ro(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==Lo)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function Io(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Bo extends No{getDefaultOptions(){return{domain:[],range:[],unknown:Lo}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&jo(this.domainIndexMap,this.getDomain(),this.domainKey),Ro({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&jo(this.rangeIndexMap,this.getRange(),this.rangeKey),Ro({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[e]=this.options.domain,[n]=this.options.range;if(this.domainKey=Io(e),this.rangeKey=Io(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new Bo(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:e}=this.options;return this.sortedDomain=e?[...t].sort(e):t,this.sortedDomain}}function Do(t){return Math.round(1e12*t)/1e12}function Fo(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t,c=e.length,l=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(o,c),[u,f]=n,d=f-u,h=d/(2/c*r+1-1/c*i),p=h*i/c,g=h-c*p,m=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(l),y=m.reduce(((t,e)=>t+e)),v=g/y,b=new Co(e.map(((t,e)=>{const n=m[e]*v;return[t,a?Math.floor(n):n]}))),x=new Co(e.map(((t,e)=>{const n=m[e]*v+p;return[t,a?Math.floor(n):n]}))),w=Array.from(x.values()).reduce(((t,e)=>t+e)),M=u+(d-(w-w/c*i))*s;let O=a?Math.round(M):M;const E=new Array(c);for(let t=0;t<c;t+=1){E[t]=Do(O);const n=e[t];O+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:E}}class zo extends Bo{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Lo,flex:[]}}constructor(t){super(t)}clone(){return new zo(this.options)}getStep(t){return void 0===this.valueStep?1:"number"==typeof this.valueStep?this.valueStep:void 0===t?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return void 0===this.valueBandWidth?1:"number"==typeof this.valueBandWidth?this.valueBandWidth:void 0===t?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:e}=this.options;return t>0?t:e}getPaddingOuter(){const{padding:t,paddingOuter:e}=this.options;return t>0?t:e}rescale(){super.rescale();const{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:o,valueBandWidth:a,valueStep:s}=function(t){var e;const{domain:n}=t,r=n.length;if(0===r)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return Fo(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:c}=t;let l,u,f=i[0];const d=i[1]-f,h=2*o,p=r-a;l=d/Math.max(1,h+p),s&&(l=Math.floor(l)),f+=(d-l*(r-a))*c,u=l*(1-a),s&&(f=Math.round(f),u=Math.round(u));const g=new Array(r).fill(0).map(((t,e)=>f+e*l));return{valueStep:l,valueBandWidth:u,adjustedRange:g}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=a,this.adjustedRange=o}}const Go=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=Si(o,a,n);if(0===s||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let t=0;t<r;t+=1)i[t]=(o+t)/s}return i};class Wo extends No{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:Go}}map(t){const[e]=this.options.range;return void 0!==e?e:this.options.unknown}invert(t){const[e]=this.options.range;return t===e&&void 0!==e?this.options.domain:[]}getTicks(){const{tickMethod:t,domain:e,tickCount:n}=this.options,[r,i]=e;return j(r)&&j(i)?t(r,i,n):[]}clone(){return new Wo(this.options)}}function $o(t){return Math.abs(t)<1e-14?t:parseFloat(t.toFixed(14))}const Ho=[1,5,2,2.5,4,3],Vo=100*Number.EPSILON;function Yo(t,e,n,r,i,o){const a=ct(e),s=Q(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,o);return(l<Vo||o-l<Vo)&&r<=0&&i>=0&&(c=1),1-s/(a-1)-n+c}function Uo(t,e,n){const r=ct(e);return 1-Q(e,t)/(r-1)-n+1}function qo(t,e,n,r,i,o){const a=(t-1)/(o-i),s=(e-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function Xo(t,e){return t>=e?2-(t-1)/(e-1):1}function Zo(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function Ko(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}const Qo=(t,e,n=5,r=!0,i=Ho,o=[.25,.2,.5,.05])=>{const a=n<0?0:Math.round(n);if(Number.isNaN(t)||Number.isNaN(e)||"number"!=typeof t||"number"!=typeof e||!a)return[];if(e-t<1e-15||1===a)return[t];const s={score:-2,lmin:0,lmax:0,lstep:0};let c=1;for(;c<1/0;){for(let n=0;n<i.length;n+=1){const l=i[n],u=Uo(l,i,c);if(o[0]*u+o[1]+o[2]+o[3]<s.score){c=1/0;break}let f=2;for(;f<1/0;){const n=Xo(f,a);if(o[0]*u+o[1]+o[2]*n+o[3]<s.score)break;const d=(e-t)/(f+1)/c/l;let h=Math.ceil(Math.log10(d));for(;h<1/0;){const d=c*l*10**h,p=Ko(t,e,d*(f-1));if(o[0]*u+o[1]*p+o[2]*n+o[3]<s.score)break;const g=Math.floor(e/d)*c-(f-1)*c,m=Math.ceil(t/d)*c;if(g<=m){const n=m-g;for(let u=0;u<=n;u+=1){const n=(g+u)*(d/c),h=n+d*(f-1),p=d,m=Yo(l,i,c,n,h,p),y=Zo(t,e,n,h),v=qo(f,a,t,e,n,h),b=1,x=o[0]*m+o[1]*y+o[2]*v+o[3]*b;x>s.score&&(!r||n<=t&&h>=e)&&(s.lmin=n,s.lmax=h,s.lstep=p,s.score=x)}}h+=1}f+=1}}c+=1}const l=$o(s.lmax),u=$o(s.lmin),f=$o(s.lstep),d=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,h=new Array(d);h[0]=$o(u);for(let t=1;t<d;t+=1)h[t]=$o(h[t-1]+f);return h};class Jo extends No{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:Qo}}map(t){return ro(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Jo(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return j(r)&&j(i)?n(r,i,e):[]}}const ta=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=wi(r,i),c=n(o,a)):(s=wi(i,r),c=n(a,o)),xi(c,s)},ea=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r),a=t[0]>t[r],s=a?[...t].reverse():t,c=a?[...e].reverse():e;for(let t=0;t<r;t+=1)i[t]=wi(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=Mi(t,e,1,r)-1,a=i[n];return xi(o[n],a)(e)}},na=(t,e,n,r)=>(Math.min(t.length,e.length)>2?ea:ta)(t,e,r?_o:n);class ra extends No{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:So,tickCount:5}}map(t){return ro(t)?this.output(t):this.options.unknown}invert(t){return ro(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,e,n,...r]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,e,n,...r)}getTicks(){const{tickMethod:t}=this.options,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return _i}rescale(){this.nice();const[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){const{clamp:e,range:n}=this.options,r=this.options.domain.map(t),i=Math.min(r.length,n.length);return e?function(t,e){const n=e<t?e:t,r=t>e?t:e;return t=>Math.min(Math.max(n,t),r)}(r[0],r[i-1]):st}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=na(n.map(t),r,o,i);this.output=xi(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=na(i,r.map(t),So);this.input=xi(e,n,o)}}class ia extends ra{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Ao,tickMethod:Go,tickCount:5}}chooseTransforms(){return[st,st]}clone(){return new ia(this.options)}}class oa extends zo{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Lo,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new oa(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const aa=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class sa extends ra{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Ao,tickMethod:Go,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[st,st];const e=.5===t?aa:(t=>e=>e<0?-((-e)**t):e**t)(t),n=(t=>e=>e<0?-((-e)**(1/t)):e**(1/t))(t);return[e,n]}clone(){return new sa(this.options)}}class ca extends sa{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Ao,tickMethod:Go,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new ca(this.options)}}class la extends No{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!ro(t))return this.options.unknown;const e=Mi(this.thresholds,t,0,this.n);return this.options.range[e]}invert(t){const{range:e}=this.options,n=e.indexOf(t),r=this.thresholds;return[r[n-1],r[n]]}clone(){return new la(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const ua=(t,e,n,r=10)=>{const i=t<0,o=ao(r,i),a=oo(r,i),s=e<t,c=s?e:t,l=s?t:e;let u=a(c),f=a(l),d=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){const t=o(u);for(let e=r-1;e>=1;e-=1){const n=t*e;if(n>l)break;n>=c&&d.push(n)}}else for(;u<=f;u+=1){const t=o(u);for(let e=1;e<r;e+=1){const n=t*e;if(n>l)break;n>=c&&d.push(n)}}2*d.length<n&&(d=Go(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);d=Go(u,f,t).map(o)}return s?d.reverse():d};class fa extends ra{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:Ao,tickMethod:ua,tickCount:5}}chooseNice(){return so}getTickMethodOptions(){const{domain:t,tickCount:e,base:n}=this.options;return[t[0],t[t.length-1],e,n]}chooseTransforms(){const{base:t,domain:e}=this.options,n=e[0]<0;return[oo(t,n),ao(t,n)]}clone(){return new fa(this.options)}}class da extends la{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:Qo}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=_i(t,e,n)}}getTicks(){const{tickMethod:t}=this.options,[e,n,r]=this.getTickMethodOptions();return t(e,n,r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}rescale(){this.nice();const{range:t,domain:e}=this.options,[n,r]=e;this.n=t.length-1,this.thresholds=new Array(this.n);for(let t=0;t<this.n;t+=1)this.thresholds[t]=((t+1)*r-(t-this.n)*n)/(this.n+1)}invert(t){const[e,n]=super.invert(t),[r,i]=this.options.domain;return void 0===e&&void 0===n?[e,n]:[e||r,n||i]}getThresholds(){return this.thresholds}clone(){return new da(this.options)}}function ha(t,e){const n=t.length;if(!n)return;if(n<2)return t[n-1];const r=(n-1)*e,i=Math.floor(r),o=t[i];return o+(t[i+1]-o)*(r-i)}class pa extends la{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:Qo}}constructor(t){super(t)}rescale(){const{domain:t,range:e}=this.options;this.n=e.length-1,this.thresholds=function(t,e,n=!1){const r=t;n||r.sort(((t,e)=>t-e));const i=[];for(let t=1;t<e;t+=1)i.push(ha(r,t/e));return i}(t,this.n+1,!1)}invert(t){const[e,n]=super.invert(t),{domain:r}=this.options,i=r[0],o=r[r.length-1];return void 0===e&&void 0===n?[e,n]:[e||i,n||o]}getThresholds(){return this.thresholds}clone(){return new pa(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var ga=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,ma=/\[([^]*?)\]/gm;function ya(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function va(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];for(var a in o)t[a]=o[a]}return t}var ba=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],xa=["January","February","March","April","May","June","July","August","September","October","November","December"],wa=ya(xa,3),Ma=va({},{dayNamesShort:ya(ba,3),dayNames:ba,monthNamesShort:wa,monthNames:xa,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),Oa=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},Ea={D:function(t){return String(t.getDate())},DD:function(t){return Oa(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return Oa(t.getDay())},ddd:function(t,e){return e.dayNamesShort[t.getDay()]},dddd:function(t,e){return e.dayNames[t.getDay()]},M:function(t){return String(t.getMonth()+1)},MM:function(t){return Oa(t.getMonth()+1)},MMM:function(t,e){return e.monthNamesShort[t.getMonth()]},MMMM:function(t,e){return e.monthNames[t.getMonth()]},YY:function(t){return Oa(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return Oa(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return Oa(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return Oa(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return Oa(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return Oa(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return Oa(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return Oa(t.getMilliseconds(),3)},a:function(t,e){return t.getHours()<12?e.amPm[0]:e.amPm[1]},A:function(t,e){return t.getHours()<12?e.amPm[0].toUpperCase():e.amPm[1].toUpperCase()},ZZ:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Oa(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Oa(Math.floor(Math.abs(e)/60),2)+":"+Oa(Math.abs(e)%60,2)}},ka={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"};const Sa=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=eo(a,s,n,r,i),u=c.range(a,new Date(+s+1),l,!0);return o?u.reverse():u};function Aa(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class _a extends ra{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:Sa,interpolate:So,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return no}getTickMethodOptions(){const{domain:t,tickCount:e,tickInterval:n,utc:r}=this.options;return[t[0],t[t.length-1],e,n,r]}getFormatter(){const{mask:t,utc:e}=this.options,n=e?to:Vi,r=e?Aa:st;return e=>function(t,e,n){if(void 0===e&&(e=ka.default),void 0===n&&(n={}),"number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date pass to format");var r=[];e=(e=ka[e]||e).replace(ma,(function(t,e){return r.push(e),"@@@"}));var i=va(va({},Ma),n);return(e=e.replace(ga,(function(e){return Ea[e](t,i)}))).replace(/@@@/g,(function(){return r.shift()}))}(r(e),t||function(t,e){const{second:n,minute:r,hour:i,day:o,week:a,month:s,year:c}=e;return n.floor(t)<t?".SSS":r.floor(t)<t?":ss":i.floor(t)<t?"hh:mm":o.floor(t)<t?"hh A":s.floor(t)<t?a.floor(t)<t?"MMM DD":"ddd DD":c.floor(t)<t?"MMMM":"YYYY"}(e,n))}clone(){return new _a(this.options)}}var Ta,Pa=window&&window.__decorate||function(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};let Ca=Ta=class extends ia{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:st,tickMethod:Go,tickCount:5}}constructor(t){super(t)}clone(){return new Ta(this.options)}};function Na(t,e,n){if(null===t)return[-.5,.5];const r=Gr(t,e),i=new zo({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function La(t,e,n){return e*(1-t)+n*t}Ca=Ta=Pa([function(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){const{interpolator:e}=this.options;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){const{domain:r,interpolator:i,round:o}=this.getOptions(),a=e(r.map(t)),s=o?(t=>e=>{const n=t(e);return j(n)?Math.round(n):n})(i):i;this.output=xi(s,a,n,t)},n.prototype.invert=void 0}}((function(t){return[t(0),t(1)]}),(t=>{const[e,n]=t;return xi(So(0,1),wi(e,n))}))],Ca);const ja=(t={})=>{const{padding:e=0,paddingX:n=e,paddingY:r=e,random:i=Math.random}=t;return(t,e)=>{const{encode:o,scale:a}=e,{x:s,y:c}=a,[l]=En(o,"x"),[u]=En(o,"y"),f=Na(l,s,n),d=Na(u,c,r),h=t.map((()=>La(i(),...d))),p=t.map((()=>La(i(),...f)));return[t,K({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:bn(h),dx:bn(p)}})]}};ja.props={};const Ra=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{x:a}=o,[s]=En(i,"x"),c=Na(s,a,e),l=t.map((()=>La(n(),...c)));return[t,K({scale:{x:{padding:.5}}},r,{encode:{dx:bn(l)}})]}};Ra.props={};const Ia=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{y:a}=o,[s]=En(i,"y"),c=Na(s,a,e),l=t.map((()=>La(n(),...c)));return[t,K({scale:{y:{padding:.5}}},r,{encode:{dy:bn(l)}})]}};Ia.props={};const Ba=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,i=Se(r,["x"]),o=Object.entries(i).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,En(r,t)[0]])),a=o.map((([e])=>[e,new Array(t.length)])),s=Dr(e,t,n),c=new Array(s.length);for(let t=0;t<s.length;t++){const e=s[t].flatMap((t=>o.map((([,e])=>+e[t])))),[n,r]=zn(e);c[t]=(n+r)/2}const l=Math.max(...c);for(let t=0;t<s.length;t++){const e=l-c[t],n=s[t];for(const t of n)for(let n=0;n<o.length;n++){const[,r]=o[n],[,i]=a[n];i[t]=+r[t]+e}}return[t,K({},n,{encode:Object.fromEntries(a.map((([t,e])=>[t,bn(e,En(r,t)[1])])))})]}};Ba.props={};const Da=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(t,r)=>{const{encode:i}=r,[o]=En(i,"y"),[a,s]=En(i,"y1");n?kn(i,"series","color"):En(i,"color");const c=Dr(e,t,r),l=new Array(t.length);for(const t of c){const e=t.map((t=>+o[t]));for(let n=0;n<t.length;n++){const r=t[n],i=Math.max(...e.filter(((t,e)=>e!==n)));l[r]=+o[r]>i?i:o[r]}}return[t,K({},r,{encode:{y1:bn(l,s)}})]}};function Fa(t,e){return[t[0]]}function za(t,e){return[t[t.length-1]]}function Ga(t,e){return[t[lr(t,(t=>e[t]))]]}function Wa(t,e){return[t[fr(t,(t=>e[t]))]]}Da.props={};const $a=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:o}=i,a=Dr(e,t,i),[s]=En(o,n),c=function(t){return"function"==typeof t?t:{first:Fa,last:za,max:Ga,min:Wa}[t]||Fa}(r);return[a.flatMap((t=>c(t,s))),i]}};$a.props={};const Ha=(t={})=>{const{selector:e}=t,n=Se(t,["selector"]);return $a(Object.assign({channel:"x",selector:e},n))};Ha.props={};const Va=(t={})=>{const{selector:e}=t,n=Se(t,["selector"]);return $a(Object.assign({channel:"y",selector:e},n))};function Ya(t){return e=>null===e?t:`${t} of ${e}`}function Ua(){return[(t,e)=>gr(t,(t=>+e[t])),Ya("mean")]}function qa(){return[(t,e)=>mr(t,(t=>+e[t])),Ya("median")]}function Xa(){return[(t,e)=>cr(t,(t=>+e[t])),Ya("max")]}function Za(){return[(t,e)=>ur(t,(t=>+e[t])),Ya("min")]}function Ka(){return[(t,e)=>t.length,Ya("count")]}function Qa(){return[(t,e)=>yr(t,(t=>+e[t])),Ya("sum")]}function Ja(){return[(t,e)=>e[t[0]],Ya("first")]}function ts(){return[(t,e)=>e[t[t.length-1]],Ya("last")]}Va.props={};const es=(t={})=>{const{groupBy:e}=t,n=Se(t,["groupBy"]);return(t,r)=>{const{data:i,encode:o}=r,a=e(t,r);if(!a)return[t,r];const s=Object.entries(n).map((([t,e])=>{const[n,r]=function(t){if("function"==typeof t)return[t,null];const e={mean:Ua,max:Xa,count:Ka,first:Ja,last:ts,sum:Qa,min:Za,median:qa}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,c]=En(o,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=En(o,n);return r})(c,e),u=a.map((t=>n(t,null!=s?s:i)));return[t,Object.assign(Object.assign({},Mn(u,(null==r?void 0:r(l))||l)),{aggregate:!0})]})),c=Object.keys(o).map((t=>{const[e,n]=En(o,t),r=a.map((t=>e[t[0]]));return[t,bn(r,n)]})),l=a.map((t=>i[t[0]]));return[Lr(a),K({},r,{data:l,encode:Object.fromEntries([...c,...s])})]}};es.props={};const ns=(t={})=>{const{channels:e=["x","y"]}=t,n=Se(t,["channels"]);return es(Object.assign(Object.assign({},n),{groupBy:(t,n)=>Dr(e,t,n)}))};ns.props={};const rs=(t={})=>ns(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));rs.props={};const is=(t={})=>ns(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));is.props={};const os=(t={})=>ns(Object.assign(Object.assign({},t),{channels:["color"]}));function as(t,e,n){var r;const{reverse:i,slice:o,channel:a}=n,s=Se(n,["reverse","slice","channel"]),{encode:c,scale:l={}}=e,u=null===(r=l[a])||void 0===r?void 0:r.domain,[f]=En(c,a),d=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[o]=En(n,r);if("function"==typeof i)return t=>i(t,o);if("max"===i)return t=>cr(t,(t=>+o[t]));if("min"===i)return t=>ur(t,(t=>+o[t]));if("sum"===i)return t=>yr(t,(t=>+o[t]));if("median"===i)return t=>mr(t,(t=>+o[t]));if("mean"===i)return t=>gr(t,(t=>+o[t]));if("first"===i)return t=>o[t[0]];if("last"===i)return t=>o[t[t.length-1]];throw new Error(`Unknown reducer: ${i}`)}(a,s,c),h=function(t,e,n){if(!Array.isArray(n))return t;const r=new Set(n);return t.filter((t=>r.has(e[t])))}(t,f,u),p=function(t,e,n){return(2!==e.length?Zn(Un(t,e,n),(([t,e],[n,r])=>_n(e,r)||_n(t,n))):Zn(Vn(t,n),(([t,n],[r,i])=>e(n,i)||_n(t,r)))).map((([t])=>t))}(h,d,(t=>f[t]));i&&p.reverse();const g="number"==typeof o?[0,o]:o,m=o?p.slice(...g):p;return[t,K(e,{scale:{[a]:{domain:m}}})]}os.props={};const ss=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,o=Se(t,["reverse","slice","channel","ordinal"]);return(t,a)=>i?as(t,a,Object.assign({reverse:e,slice:n,channel:r},o)):function(t,e,n){const{reverse:r,channel:i}=n,{encode:o}=e,[a]=En(o,i),s=Zn(t,(t=>a[t]));return r&&s.reverse(),[s,e]}(t,a,Object.assign({reverse:e,slice:n,channel:r},o))};ss.props={};const cs=(t={})=>ss(Object.assign(Object.assign({},t),{channel:"x"}));cs.props={};const ls=(t={})=>ss(Object.assign(Object.assign({},t),{channel:"color"}));ls.props={};const us=(t={})=>ss(Object.assign(Object.assign({},t),{channel:"y"}));us.props={};const fs=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:o,encode:a}=i,[s]=En(a,"x"),c=e?function(t,e){return"string"==typeof e?t.map((t=>t[e])):t.map(e)}(o,e):En(a,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>yr(t,(t=>+e[t]));throw new Error(`Unknown reducer: ${t}`)}(r,c),u=qn(t,l,(t=>s[t])).map((t=>t[1]));return[t,K({},i,{scale:{x:{flex:u}}})]}};function ds([t,e],[n,r]){return[t-n,e-r]}function hs([t,e],[n,r]){return[t+n,e+r]}function ps([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function gs([t,e]){return Math.atan2(e,t)}function ms([t,e]){return gs([t,e])+Math.PI/2}function ys(t,e){const n=gs(t),r=gs(e);return n<r?r-n:2*Math.PI-(n-r)}function vs(t){let e=1/0,n=-1/0,r=1/0,i=-1/0;for(const[o,a]of t)e=Math.min(o,e),n=Math.max(o,n),r=Math.min(a,r),i=Math.max(a,i);return[e,r,n-e,i-r]}function bs([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function xs(t){const{padding:e=0,direction:n="col"}=t;return(t,r,i)=>{const o=t.length;if(0===o)return[];const{innerWidth:a,innerHeight:s}=i,c=s/a;let l=Math.ceil(Math.sqrt(r/c)),u=a/l,f=Math.ceil(r/l),d=f*u;for(;d>s;)l+=1,u=a/l,f=Math.ceil(r/l),d=f*u;const h=s-f*u,p=f<=1?0:h/(f-1),[g,m]=f<=1?[(a-o*u)/(o-1),(s-u)/2]:[0,0];return t.map(((t,r)=>{const[i,o,a,s]=vs(t),c="col"===n?r%l:Math.floor(r/f),d="col"===n?Math.floor(r/l):r%f;return`translate(${c*u-i+g*c+.5*e}, ${(f-d-1)*u+h-o-p*d-m+.5*e}) scale(${(u-e)/a}, ${(u-e)/s})`}))}}fs.props={};const ws=t=>(e,n)=>[e,K({},n,{modifier:xs(t),axis:!1})];ws.props={};const Ms="thresholds";function Os(t){const[e,n]=zn(t);return Math.min(200,function(t,e,n){const r=Dn(t),i=Fn(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}const Es=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=Se(t,["groupChannels","binChannels"]),i={};return es(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter((([t])=>!t.startsWith(Ms))))),Object.fromEntries(n.flatMap((t=>{const e=([e])=>+i[t].get(e).split(",")[1];return e.from=t,[[t,([e])=>+i[t].get(e).split(",")[0]],[`${t}1`,e]]})))),{groupBy:(t,o)=>{const{encode:a}=o,s=n.map((t=>{const[e]=En(a,t);return e})),c=kr(r,Ms),l=t.filter((t=>s.every((e=>Or(e[t]))))),u=[...e.map((t=>{const[e]=En(a,t);return e})).filter(Or).map((t=>e=>t[e])),...n.map(((t,e)=>{const n=s[e],r=c[t]||Os(n),o=sr().thresholds(r).value((t=>+n[t]))(l),a=new Map(o.flatMap((t=>{const{x0:e,x1:n}=t,r=`${e},${n}`;return t.map((t=>[t,r]))})));return i[t]=a,t=>a.get(t)}))];return Array.from(Vn(l,(t=>u.map((e=>e(t))).join("-"))).values())}}))};Es.props={};const ks=(t={})=>{const{thresholds:e}=t;return Es(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function Ss(t,e,n,r){const i=t.length;if(r>=i||0===r)return t;const o=n=>1*e[t[n]],a=e=>1*n[t[e]],s=[],c=(i-2)/(r-2);let l,u,f,d=0;s.push(d);for(let t=0;t<r-2;t++){let e=0,n=0,r=Math.floor((t+1)*c)+1,h=Math.floor((t+2)*c)+1;h=Math.min(h,i);const p=h-r;for(;r<h;r++)e+=o(r),n+=a(r);e/=p,n/=p;let g=Math.floor((t+0)*c)+1;const m=Math.floor((t+1)*c)+1,y=[o(d),a(d)];for(l=u=-1;g<m;g++)u=.5*Math.abs((y[0]-e)*(o(g)-y[1])-(y[0]-a(g))*(n-y[0])),u>l&&(l=u,f=g);s.push(f),d=f}return s.push(i-1),s.map((e=>t[e]))}ks.props={};const As=(t={})=>{const{strategy:e="median",thresholds:n=2e3,groupBy:r=["series","color"]}=t,i=function(t){if("function"==typeof t)return t;if("lttb"===t)return Ss;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[fr(t,(t=>n[t]))]],max:(t,e,n)=>[t[lr(t,(t=>n[t]))]],median:(t,e,n)=>{return[t[(r=t,i=t=>n[t],pr(r,.5,i))]];var r,i}},n=e[t]||e.median;return(t,e,r,i)=>{const o=function(t,e){const n=t.length,r=[];let i=0;for(;i<n;)r.push(t.slice(i,i+=e));return r}(t,Math.max(1,Math.floor(t.length/i)));return o.flatMap((t=>n(t,e,r)))}}(e);return(t,e)=>{const{encode:o}=e,a=Dr(r,t,e),[s]=En(o,"x"),[c]=En(o,"y");return[a.flatMap((t=>i(t,s,c,n))),e]}};As.props={};const _s=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map((([t,e])=>{const[n]=En(r,t);if(!n)return null;const[i,o=!0]=function(t){return"object"==typeof t?[t.value,t.ordinal]:[t,!0]}(e);if("function"==typeof i)return t=>i(n[t]);if(o){const t=Array.isArray(i)?i:[i];return 0===t.length?null:e=>t.includes(n[e])}{const[t,e]=i;return r=>n[r]>=t&&n[r]<=e}})).filter(Or);if(0===o.length)return[e,n];const a=e.filter((t=>o.every((e=>e(t))))),s=a.map(((t,e)=>e)),c=Object.entries(r).map((([t,e])=>[t,Object.assign(Object.assign({},e),{value:s.map((t=>e.value[a[t]])).filter((t=>void 0!==t))})]));return[s,K({},n,{encode:Object.fromEntries(c),data:a.map((t=>i[t]))})]};function Ts(t){return function(){return t}}_s.props={};const Ps=Math.abs,Cs=Math.atan2,Ns=Math.cos,Ls=Math.max,js=Math.min,Rs=Math.sin,Is=Math.sqrt,Bs=1e-12,Ds=Math.PI,Fs=Ds/2,zs=2*Ds;function Gs(t){return t>=1?Fs:t<=-1?-Fs:Math.asin(t)}const Ws=Math.PI,$s=2*Ws,Hs=1e-6,Vs=$s-Hs;function Ys(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class Us{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?Ys:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return Ys;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=Math.round(arguments[e]*n)/n+t[e]}}(t)}moveTo(t,e){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,e){this._append`L${this._x1=+t},${this._y1=+e}`}quadraticCurveTo(t,e,n,r){this._append`Q${+t},${+e},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(t,e,n,r,i,o){this._append`C${+t},${+e},${+n},${+r},${this._x1=+i},${this._y1=+o}`}arcTo(t,e,n,r,i){if(t=+t,e=+e,n=+n,r=+r,(i=+i)<0)throw new Error(`negative radius: ${i}`);let o=this._x1,a=this._y1,s=n-t,c=r-e,l=o-t,u=a-e,f=l*l+u*u;if(null===this._x1)this._append`M${this._x1=t},${this._y1=e}`;else if(f>Hs)if(Math.abs(u*s-c*l)>Hs&&i){let d=n-o,h=r-a,p=s*s+c*c,g=d*d+h*h,m=Math.sqrt(p),y=Math.sqrt(f),v=i*Math.tan((Ws-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>Hs&&this._append`L${t+b*l},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*d>l*h)},${this._x1=t+x*s},${this._y1=e+x*c}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,o){if(t=+t,e=+e,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let a=n*Math.cos(r),s=n*Math.sin(r),c=t+a,l=e+s,u=1^o,f=o?r-i:i-r;null===this._x1?this._append`M${c},${l}`:(Math.abs(this._x1-c)>Hs||Math.abs(this._y1-l)>Hs)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%$s+$s),f>Vs?this._append`A${n},${n},0,1,${u},${t-a},${e-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:f>Hs&&this._append`A${n},${n},0,${+(f>=Ws)},${u},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function qs(){return new Us}function Xs(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new Us(e)}function Zs(t){return t.innerRadius}function Ks(t){return t.outerRadius}function Qs(t){return t.startAngle}function Js(t){return t.endAngle}function tc(t){return t&&t.padAngle}function ec(t,e,n,r,i,o,a){var s=t-n,c=e-r,l=(a?o:-o)/Is(s*s+c*c),u=l*c,f=-l*s,d=t+u,h=e+f,p=n+u,g=r+f,m=(d+p)/2,y=(h+g)/2,v=p-d,b=g-h,x=v*v+b*b,w=i-o,M=d*g-p*h,O=(b<0?-1:1)*Is(Ls(0,w*w*x-M*M)),E=(M*b-v*O)/x,k=(-M*v-b*O)/x,S=(M*b+v*O)/x,A=(-M*v+b*O)/x,_=E-m,T=k-y,P=S-m,C=A-y;return _*_+T*T>P*P+C*C&&(E=S,k=A),{cx:E,cy:k,x01:-u,y01:-f,x11:E*(i/w-1),y11:k*(i/w-1)}}function nc(){var t=Zs,e=Ks,n=Ts(0),r=null,i=Qs,o=Js,a=tc,s=null,c=Xs(l);function l(){var l,u,f=+t.apply(this,arguments),d=+e.apply(this,arguments),h=i.apply(this,arguments)-Fs,p=o.apply(this,arguments)-Fs,g=Ps(p-h),m=p>h;if(s||(s=l=c()),d<f&&(u=d,d=f,f=u),d>Bs)if(g>zs-Bs)s.moveTo(d*Ns(h),d*Rs(h)),s.arc(0,0,d,h,p,!m),f>Bs&&(s.moveTo(f*Ns(p),f*Rs(p)),s.arc(0,0,f,p,h,m));else{var y,v,b=h,x=p,w=h,M=p,O=g,E=g,k=a.apply(this,arguments)/2,S=k>Bs&&(r?+r.apply(this,arguments):Is(f*f+d*d)),A=js(Ps(d-f)/2,+n.apply(this,arguments)),_=A,T=A;if(S>Bs){var P=Gs(S/f*Rs(k)),C=Gs(S/d*Rs(k));(O-=2*P)>Bs?(w+=P*=m?1:-1,M-=P):(O=0,w=M=(h+p)/2),(E-=2*C)>Bs?(b+=C*=m?1:-1,x-=C):(E=0,b=x=(h+p)/2)}var N=d*Ns(b),L=d*Rs(b),j=f*Ns(M),R=f*Rs(M);if(A>Bs){var I,B=d*Ns(x),D=d*Rs(x),F=f*Ns(w),z=f*Rs(w);if(g<Ds)if(I=function(t,e,n,r,i,o,a,s){var c=n-t,l=r-e,u=a-i,f=s-o,d=f*c-u*l;if(!(d*d<Bs))return[t+(d=(u*(e-o)-f*(t-i))/d)*c,e+d*l]}(N,L,F,z,B,D,j,R)){var G=N-I[0],W=L-I[1],$=B-I[0],H=D-I[1],V=1/Rs(function(t){return t>1?0:t<-1?Ds:Math.acos(t)}((G*$+W*H)/(Is(G*G+W*W)*Is($*$+H*H)))/2),Y=Is(I[0]*I[0]+I[1]*I[1]);_=js(A,(f-Y)/(V-1)),T=js(A,(d-Y)/(V+1))}else _=T=0}E>Bs?T>Bs?(y=ec(F,z,N,L,d,T,m),v=ec(B,D,j,R,d,T,m),s.moveTo(y.cx+y.x01,y.cy+y.y01),T<A?s.arc(y.cx,y.cy,T,Cs(y.y01,y.x01),Cs(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,T,Cs(y.y01,y.x01),Cs(y.y11,y.x11),!m),s.arc(0,0,d,Cs(y.cy+y.y11,y.cx+y.x11),Cs(v.cy+v.y11,v.cx+v.x11),!m),s.arc(v.cx,v.cy,T,Cs(v.y11,v.x11),Cs(v.y01,v.x01),!m))):(s.moveTo(N,L),s.arc(0,0,d,b,x,!m)):s.moveTo(N,L),f>Bs&&O>Bs?_>Bs?(y=ec(j,R,B,D,f,-_,m),v=ec(N,L,F,z,f,-_,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),_<A?s.arc(y.cx,y.cy,_,Cs(y.y01,y.x01),Cs(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,_,Cs(y.y01,y.x01),Cs(y.y11,y.x11),!m),s.arc(0,0,f,Cs(y.cy+y.y11,y.cx+y.x11),Cs(v.cy+v.y11,v.cx+v.x11),m),s.arc(v.cx,v.cy,_,Cs(v.y11,v.x11),Cs(v.y01,v.x01),!m))):s.arc(0,0,f,M,w,m):s.lineTo(j,R)}else s.moveTo(0,0);if(s.closePath(),l)return s=null,l+""||null}return l.centroid=function(){var n=(+t.apply(this,arguments)+ +e.apply(this,arguments))/2,r=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-Ds/2;return[Ns(r)*n,Rs(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Ts(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Ts(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Ts(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Ts(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Ts(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Ts(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Ts(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function rc(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function ic(t){this._context=t}function oc(t){return new ic(t)}function ac(t){return t[0]}function sc(t){return t[1]}function cc(t,e){var n=Ts(!0),r=null,i=oc,o=null,a=Xs(s);function s(s){var c,l,u,f=(s=rc(s)).length,d=!1;for(null==r&&(o=i(u=a())),c=0;c<=f;++c)!(c<f&&n(l=s[c],c,s))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+t(l,c,s),+e(l,c,s));if(u)return o=null,u+""||null}return t="function"==typeof t?t:void 0===t?ac:Ts(t),e="function"==typeof e?e:void 0===e?sc:Ts(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Ts(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Ts(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:Ts(!!t),s):n},s.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),s):i},s.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),s):r},s}function lc(t,e,n){var r=null,i=Ts(!0),o=null,a=oc,s=null,c=Xs(l);function l(l){var u,f,d,h,p,g=(l=rc(l)).length,m=!1,y=new Array(g),v=new Array(g);for(null==o&&(s=a(p=c())),u=0;u<=g;++u){if(!(u<g&&i(h=l[u],u,l))===m)if(m=!m)f=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=u-1;d>=f;--d)s.point(y[d],v[d]);s.lineEnd(),s.areaEnd()}m&&(y[u]=+t(h,u,l),v[u]=+e(h,u,l),s.point(r?+r(h,u,l):y[u],n?+n(h,u,l):v[u]))}if(p)return s=null,p+""||null}function u(){return cc().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?ac:Ts(+t),e="function"==typeof e?e:Ts(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?sc:Ts(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Ts(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Ts(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Ts(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Ts(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Ts(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Ts(+t),l):n},l.lineX0=l.lineY0=function(){return u().x(t).y(e)},l.lineY1=function(){return u().x(t).y(n)},l.lineX1=function(){return u().x(r).y(e)},l.defined=function(t){return arguments.length?(i="function"==typeof t?t:Ts(!!t),l):i},l.curve=function(t){return arguments.length?(a=t,null!=o&&(s=a(o)),l):a},l.context=function(t){return arguments.length?(null==t?o=s=null:s=a(o=t),l):o},l}qs.prototype=Us.prototype,ic.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var uc=dc(oc);function fc(t){this._curve=t}function dc(t){function e(e){return new fc(t(e))}return e._curve=t,e}function hc(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(dc(t)):e()._curve},t}function pc(){}function gc(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function mc(t,e){this._context=t,this._k=(1-e)/6}function yc(t,e){this._context=t,this._k=(1-e)/6}function vc(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Bs){var s=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*s-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*s-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Bs){var l=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,u=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*l+t._x1*t._l23_2a-e*t._l12_2a)/u,a=(a*l+t._y1*t._l23_2a-n*t._l12_2a)/u}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function bc(t,e){this._context=t,this._alpha=e}function xc(t,e){this._context=t,this._alpha=e}fc.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}},mc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:gc(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:gc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new mc(t,e)}return n.tension=function(e){return t(+e)},n}(0),yc.prototype={areaStart:pc,areaEnd:pc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:gc(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return new yc(t,e)}return n.tension=function(e){return t(+e)},n}(0),bc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:vc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}},function t(e){function n(t){return e?new bc(t,e):new mc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5),xc.prototype={areaStart:pc,areaEnd:pc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:vc(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var wc=function t(e){function n(t){return e?new xc(t,e):new yc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Mc(t){this._context=t}function Oc(t){return new Mc(t)}function Ec(t){return t<0?-1:1}function kc(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Ec(o)+Ec(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Sc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Ac(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,s=(o-r)/3;t._context.bezierCurveTo(r+s,i+s*e,o-s,a-s*n,o,a)}function _c(t){this._context=t}function Tc(t){this._context=new Pc(t)}function Pc(t){this._context=t}function Cc(t){return new _c(t)}function Nc(t){return new Tc(t)}function Lc(t,e){this._context=t,this._t=e}function jc(t){return new Lc(t,.5)}function Rc(t){return new Lc(t,0)}function Ic(t){return new Lc(t,1)}function Bc(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function Dc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function Fc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function zc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function Gc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function Wc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function $c(t){return zc(t)||Dc(t)}function Hc(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find((t=>"polar"===t[0]));return[+n,+r]}function Vc(t,e=!0){const{transformations:n}=t.getOptions(),[,r,i]=n.find((t=>"polar"===t[0]));return e?[180*+r/Math.PI,180*+i/Math.PI]:[r,i]}Mc.prototype={areaStart:pc,areaEnd:pc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}},_c.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ac(this,this._t0,Sc(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(e=+e,(t=+t)!==this._x1||e!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Ac(this,Sc(this,n=kc(this,t,e)),n);break;default:Ac(this,this._t0,n=kc(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Tc.prototype=Object.create(_c.prototype)).point=function(t,e){_c.prototype.point.call(this,e,t)},Pc.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,r,i,o){this._context.bezierCurveTo(e,t,r,n,o,i)}},Lc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Yc="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},Uc={exports:{}};!function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),c=n?n+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],s]:t._events[c].push(s):(t._events[c]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=n?n+t:t,r=this._events[e];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,o=r.length,a=new Array(o);i<o;i++)a[i]=r[i].fn;return a},s.prototype.listenerCount=function(t){var e=n?n+t:t,r=this._events[e];return r?r.fn?1:r.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var c,l,u=this._events[s],f=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),f){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,r),!0;case 4:return u.fn.call(u.context,e,r,i),!0;case 5:return u.fn.call(u.context,e,r,i,o),!0;case 6:return u.fn.call(u.context,e,r,i,o,a),!0}for(l=1,c=new Array(f-1);l<f;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var d,h=u.length;for(l=0;l<h;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),f){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,r);break;case 4:u[l].fn.call(u[l].context,e,r,i);break;default:if(!c)for(d=1,c=new Array(f-1);d<f;d++)c[d-1]=arguments[d];u[l].fn.apply(u[l].context,c)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var c=0,l=[],u=s.length;c<u;c++)(s[c].fn!==e||i&&!s[c].once||r&&s[c].context!==r)&&l.push(s[c]);l.length?this._events[o]=1===l.length?l[0]:l:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?(e=n?n+t:t,this._events[e]&&a(this,e)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}(Uc);var qc=Uc.exports;function Xc(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Zc(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Kc(){}var Qc=.7,Jc=1/Qc,tl="\\s*([+-]?\\d+)\\s*",el="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",nl="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rl=/^#([0-9a-f]{3,8})$/,il=new RegExp(`^rgb\\(${tl},${tl},${tl}\\)$`),ol=new RegExp(`^rgb\\(${nl},${nl},${nl}\\)$`),al=new RegExp(`^rgba\\(${tl},${tl},${tl},${el}\\)$`),sl=new RegExp(`^rgba\\(${nl},${nl},${nl},${el}\\)$`),cl=new RegExp(`^hsl\\(${el},${nl},${nl}\\)$`),ll=new RegExp(`^hsla\\(${el},${nl},${nl},${el}\\)$`),ul={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function fl(){return this.rgb().formatHex()}function dl(){return this.rgb().formatRgb()}function hl(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=rl.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?pl(e):3===n?new vl(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?gl(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?gl(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=il.exec(t))?new vl(e[1],e[2],e[3],1):(e=ol.exec(t))?new vl(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=al.exec(t))?gl(e[1],e[2],e[3],e[4]):(e=sl.exec(t))?gl(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=cl.exec(t))?El(e[1],e[2]/100,e[3]/100,1):(e=ll.exec(t))?El(e[1],e[2]/100,e[3]/100,e[4]):ul.hasOwnProperty(t)?pl(ul[t]):"transparent"===t?new vl(NaN,NaN,NaN,0):null}function pl(t){return new vl(t>>16&255,t>>8&255,255&t,1)}function gl(t,e,n,r){return r<=0&&(t=e=n=NaN),new vl(t,e,n,r)}function ml(t){return t instanceof Kc||(t=hl(t)),t?new vl((t=t.rgb()).r,t.g,t.b,t.opacity):new vl}function yl(t,e,n,r){return 1===arguments.length?ml(t):new vl(t,e,n,null==r?1:r)}function vl(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function bl(){return`#${Ol(this.r)}${Ol(this.g)}${Ol(this.b)}`}function xl(){const t=wl(this.opacity);return`${1===t?"rgb(":"rgba("}${Ml(this.r)}, ${Ml(this.g)}, ${Ml(this.b)}${1===t?")":`, ${t})`}`}function wl(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ml(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ol(t){return((t=Ml(t))<16?"0":"")+t.toString(16)}function El(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Sl(t,e,n,r)}function kl(t){if(t instanceof Sl)return new Sl(t.h,t.s,t.l,t.opacity);if(t instanceof Kc||(t=hl(t)),!t)return new Sl;if(t instanceof Sl)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,c=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=c<.5?o+i:2-o-i,a*=60):s=c>0&&c<1?0:a,new Sl(a,s,c,t.opacity)}function Sl(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Al(t){return(t=(t||0)%360)<0?t+360:t}function _l(t){return Math.max(0,Math.min(1,t||0))}function Tl(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Xc(Kc,hl,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:fl,formatHex:fl,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return kl(this).formatHsl()},formatRgb:dl,toString:dl}),Xc(vl,yl,Zc(Kc,{brighter(t){return t=null==t?Jc:Math.pow(Jc,t),new vl(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Qc:Math.pow(Qc,t),new vl(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new vl(Ml(this.r),Ml(this.g),Ml(this.b),wl(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:bl,formatHex:bl,formatHex8:function(){return`#${Ol(this.r)}${Ol(this.g)}${Ol(this.b)}${Ol(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:xl,toString:xl})),Xc(Sl,(function(t,e,n,r){return 1===arguments.length?kl(t):new Sl(t,e,n,null==r?1:r)}),Zc(Kc,{brighter(t){return t=null==t?Jc:Math.pow(Jc,t),new Sl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Qc:Math.pow(Qc,t),new Sl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new vl(Tl(t>=240?t-240:t+120,i,r),Tl(t,i,r),Tl(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Sl(Al(this.h),_l(this.s),_l(this.l),wl(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=wl(this.opacity);return`${1===t?"hsl(":"hsla("}${Al(this.h)}, ${100*_l(this.s)}%, ${100*_l(this.l)}%${1===t?")":`, ${t})`}`}}));const Pl=Math.PI/180,Cl=180/Math.PI;var Nl=-.14861,Ll=1.78277,jl=-.29227,Rl=-.90649,Il=1.97294,Bl=Il*Rl,Dl=Il*Ll,Fl=Ll*jl-Rl*Nl;function zl(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof Gl)return new Gl(t.h,t.s,t.l,t.opacity);t instanceof vl||(t=ml(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(Fl*r+Bl*e-Dl*n)/(Fl+Bl-Dl),o=r-i,a=(Il*(n-i)-jl*o)/Rl,s=Math.sqrt(a*a+o*o)/(Il*i*(1-i)),c=s?Math.atan2(a,o)*Cl-120:NaN;return new Gl(c<0?c+360:c,s,i,t.opacity)}(t):new Gl(t,e,n,null==r?1:r)}function Gl(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Wl(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function $l(t,e){var n=Math.min.apply(Math,Ne([],Ce(t),!1)),r=Math.min.apply(Math,Ne([],Ce(e),!1));return{x:n,y:r,width:Math.max.apply(Math,Ne([],Ce(t),!1))-n,height:Math.max.apply(Math,Ne([],Ce(e),!1))-r}}function Hl(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Vl(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function Yl(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),c=1/0,l=-1/0,u=[o,a],f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var d=s+f;o<a?o<d&&d<a&&u.push(d):a<d&&d<o&&u.push(d)}for(f=0;f<u.length;f++){var h=Hl(t,0,n,r,i,u[f]);h<c&&(c=h),h>l&&(l=h)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,m=-1/0,y=[o,a];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var v=p+f;o<a?o<v&&v<a&&y.push(v):a<v&&v<o&&y.push(v)}for(f=0;f<y.length;f++){var b=Vl(0,e,n,r,i,y[f]);b<g&&(g=b),b>m&&(m=b)}return{x:c,y:g,width:l-c,height:m-g}}Xc(Gl,zl,Zc(Kc,{brighter(t){return t=null==t?Jc:Math.pow(Jc,t),new Gl(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Qc:Math.pow(Qc,t),new Gl(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*Pl,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new vl(255*(e+n*(Nl*r+Ll*i)),255*(e+n*(jl*r+Rl*i)),255*(e+n*(Il*r)),this.opacity)}}));var Ul=1e-4;function ql(t,e,n,r,i,o){var a=-1,s=1/0,c=[n,r],l=20;o&&o>200&&(l=o/10);for(var u=1/l,f=u/10,d=0;d<=l;d++){var h=d*u,p=[i.apply(void 0,Ne([],Ce(t.concat([h])),!1)),i.apply(void 0,Ne([],Ce(e.concat([h])),!1))];(v=Wl(c[0],c[1],p[0],p[1]))<s&&(a=h,s=v)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var g=t.length;return{x:t[g-1],y:e[g-1]}}s=1/0;for(d=0;d<32&&!(f<Ul);d++){var m=a-f,y=a+f,v=(p=[i.apply(void 0,Ne([],Ce(t.concat([m])),!1)),i.apply(void 0,Ne([],Ce(e.concat([m])),!1))],Wl(c[0],c[1],p[0],p[1]));if(m>=0&&v<s)a=m,s=v;else{var b=[i.apply(void 0,Ne([],Ce(t.concat([y])),!1)),i.apply(void 0,Ne([],Ce(e.concat([y])),!1))],x=Wl(c[0],c[1],b[0],b[1]);y<=1&&x<s?(a=y,s=x):f*=.5}}return{x:i.apply(void 0,Ne([],Ce(t.concat([a])),!1)),y:i.apply(void 0,Ne([],Ce(e.concat([a])),!1))}}function Xl(t,e,n,r){return Wl(t,e,n,r)}function Zl(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Kl(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var c=[i-t,o-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(c,s))}function Ql(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function Jl(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,c=6*t-12*e+6*n,l=3*e-3*t,u=[];if(I(s,0))I(c,0)||(i=-l/c)>=0&&i<=1&&u.push(i);else{var f=c*c-4*s*l;I(f,0)?u.push(-c/(2*s)):f>0&&(o=(-c-(a=Math.sqrt(f)))/(2*s),(i=(-c+a)/(2*s))>=0&&i<=1&&u.push(i),o>=0&&o<=1&&u.push(o))}return u}function tu(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],u=Jl(t,n,i,a),f=Jl(e,r,o,s),d=0;d<u.length;d++)c.push(Ql(t,n,i,a,u[d]));for(d=0;d<f.length;d++)l.push(Ql(e,r,o,s,f[d]));return $l(c,l)}function eu(t,e,n,r,i,o,a,s,c,l,u){var f=function(t,e,n,r,i,o,a,s,c,l,u){return ql([t,n,i,a],[e,r,o,s],c,l,Ql,u)}(t,e,n,r,i,o,a,s,c,l,u);return Wl(f.x,f.y,c,l)}function nu(t){return function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=Wl(r[0],r[1],i[0],i[1])}return e}(t)}function ru(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function iu(t,e,n){var r=t+n-2*e;if(I(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function ou(t,e,n,r,i,o){var a=iu(t,n,i)[0],s=iu(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(ru(t,n,i,a)),void 0!==s&&l.push(ru(e,r,o,s)),$l(c,l)}function au(t,e,n,r,i,o,a,s){var c=function(t,e,n,r,i,o,a,s){return ql([t,n,i],[e,r,o],a,s,ru)}(t,e,n,r,i,o,a,s);return Wl(c.x,c.y,a,s)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==Yc||"undefined"!=typeof self&&self;var su={exports:{}};!function(t,e){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,c=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*u*(s-u)/s)*(c-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-c*u/s+f)),Math.min(o,Math.floor(r+(s-c)*u/s+f)),a)}var d=t[r],h=i,p=o;for(n(t,i,r),a(t[o],d)>0&&n(t,i,o);h<p;){for(n(t,h,p),h++,p--;a(t[h],d)<0;)h++;for(;a(t[p],d)>0;)p--}0===a(t[i],d)?n(t,i,p):n(t,++p,o),p<=r&&(i=p+1),r<=p&&(o=p-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,n){if(!n)return e.indexOf(t);for(var r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function a(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=y(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var a=t.children[o];c(i,t.leaf?r(a):a)}return i}function c(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function h(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function g(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function m(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function v(e,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!m(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var o=0;o<e.children.length;o++){var a=e.children[o],s=e.leaf?r(a):a;m(t,s)&&(e.leaf?n.push(a):g(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!m(t,e))return!1;for(var n=[];e;){for(var r=0;r<e.children.length;r++){var i=e.children[r],o=e.leaf?this.toBBox(i):i;if(m(t,o)){if(e.leaf||g(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=y([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),c=[],l=[];a||c.length;){if(a||(a=c.pop(),r=c[c.length-1],n=l.pop(),i=!0),a.leaf){var u=o(t,a.children,e);if(-1!==u)return a.children.splice(u,1),c.push(a),this._condense(c),this}i||a.leaf||!g(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(c.push(a),l.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return a(i=y(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=y([])).leaf=!1,i.height=r;var c=Math.ceil(o/s),l=c*Math.ceil(Math.sqrt(s));v(t,e,n,l,this.compareMinX);for(var u=e;u<=n;u+=l){var f=Math.min(u+l-1,n);v(t,u,f,c,this.compareMinY);for(var d=u;d<=f;d+=c){var h=Math.min(d+c-1,f);i.children.push(this._build(t,d,h,r-1))}}return a(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,o=1/0,a=void 0,s=0;s<e.children.length;s++){var c=e.children[s],l=f(c),u=h(t,c)-l;u<o?(o=u,i=l<i?l:i,a=c):u===o&&l<i&&(i=l,a=c)}e=a||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),c(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=y(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;a<=n-e;a++){var c=s(t,0,a,this.toBBox),l=s(t,a,n,this.toBBox),u=p(c,l),d=f(c)+f(l);u<i?(i=u,r=a,o=d<o?d:o):u===i&&d<o&&(o=d,r=a)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,o=s(t,0,e,i),a=s(t,n-e,n,i),l=d(o)+d(a),u=e;u<n-e;u++){var f=t.children[u];c(o,t.leaf?i(f):f),l+=d(o)}for(var h=n-e-1;h>=e;h--){var p=t.children[h];c(a,t.leaf?i(p):p),l+=d(a)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)c(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)},i}()}(su);var cu,lu,uu=su.exports;!function(t){t.GROUP="g",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh"}(cu||(cu={})),function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"}(lu||(lu={}));var fu=function(){function t(){this.plugins=[]}return t.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},t.prototype.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)}))},t}(),du=function(){function t(t){this.clipSpaceNearZ=lu.NEGATIVE_ONE,this.plugins=[],this.config=ke({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0},t)}return t.prototype.registerPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));-1===e&&this.plugins.push(t)},t.prototype.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},t.prototype.getPlugins=function(){return this.plugins},t.prototype.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},t.prototype.getConfig=function(){return this.config},t.prototype.setConfig=function(t){Object.assign(this.config,t)},t}();function hu(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function pu(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function gu(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function mu(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function yu(t){return void 0===t?0:t>360||t<-360?t%360:t}function vu(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Xt(t):j(t)?Kt(t,e,n):Kt(t[0],t[1]||e,t[2]||n)}function bu(t){return t*(Math.PI/180)}function xu(t){return t*(180/Math.PI)}function wu(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=Ce(jt(qt(),e),3),a=o[0],s=o[1],c=o[2],l=Math.asin(-e[2]/a);return l<i?l>-i?(n=Math.atan2(e[6]/s,e[10]/c),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=l,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,c=o*o,l=n*n+a+s+c,u=n*o-r*i;return u>.499995*l?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):u<-.499995*l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+c)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function Mu(t,e,n,r,i){var o,a,s,c,l,u,f,d,h,p,g=Math.cos(t),m=Math.sin(t);return o=r*g,a=i*m,s=0,c=-r*m,l=i*g,u=0,f=e,d=n,h=1,(p=new ut(9))[0]=o,p[1]=a,p[2]=s,p[3]=c,p[4]=l,p[5]=u,p[6]=f,p[7]=d,p[8]=h,p}function Ou(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);e*i-n*r<0&&(e<i?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=xu(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var Eu=ht(),ku=ht(),Su=de(),Au=[qt(),qt(),qt()],_u=qt();function Tu(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}var Pu,Cu=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]},t.prototype.update=function(t,e){hu(this.center,t),hu(this.halfExtents,e),pu(this.min,this.center,this.halfExtents),gu(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){gu(this.center,e,t),mu(this.center,this.center,.5),pu(this.halfExtents,e,t),mu(this.halfExtents,this.halfExtents,.5),hu(this.min,t),hu(this.max,e)},t.prototype.getMin=function(){return this.min},t.prototype.getMax=function(){return this.max},t.prototype.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],c=a[1],l=a[2],u=r-s,f=r+s,d=i-c,h=i+c,p=o-l,g=o+l,m=e.center,y=m[0],v=m[1],b=m[2],x=e.halfExtents,w=x[0],M=x[1],O=x[2],E=y-w,k=y+w,S=v-M,A=v+M,_=b-O,T=b+O;E<u&&(u=E),k>f&&(f=k),S<d&&(d=S),A>h&&(h=A),_<p&&(p=_),T>g&&(g=T),n[0]=.5*(u+f),n[1]=.5*(d+h),n[2]=.5*(p+g),a[0]=.5*(f-u),a[1]=.5*(h-d),a[2]=.5*(g-p),this.min[0]=u,this.min[1]=d,this.min[2]=p,this.max[0]=f,this.max[1]=h,this.max[2]=g}},t.prototype.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],c=e[8],l=e[1],u=e[5],f=e[9],d=e[2],h=e[6],p=e[10],g=Math.abs(a),m=Math.abs(s),y=Math.abs(c),v=Math.abs(l),b=Math.abs(u),x=Math.abs(f),w=Math.abs(d),M=Math.abs(h),O=Math.abs(p);n[0]=e[12]+a*i[0]+s*i[1]+c*i[2],n[1]=e[13]+l*i[0]+u*i[1]+f*i[2],n[2]=e[14]+d*i[0]+h*i[1]+p*i[2],r[0]=g*o[0]+m*o[1]+y*o[2],r[1]=v*o[0]+b*o[1]+x*o[2],r[2]=w*o[0]+M*o[1]+O*o[2],pu(this.min,n,r),gu(this.max,n,r)},t.prototype.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return n[0]<=r[0]&&e[0]>=i[0]&&n[1]<=r[1]&&e[1]>=i[1]&&n[2]<=r[2]&&e[2]>=i[2]},t.prototype.intersection=function(e){if(!this.intersects(e))return null;var n,r,i,o=new t,a=(n=[0,0,0],r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}([0,0,0],this.getMax(),e.getMax());return o.setMinMax(a,s),o},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?hu([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},t.prototype.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?hu([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},t}(),Nu=function(){function t(t,e){this.distance=t||0,this.normal=e||Kt(0,1,0),this.updatePNVertexFlag()}return t.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},t.prototype.distanceToPoint=function(t){return ie(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/fe(this.normal);ne(this.normal,this.normal,t),this.distance*=t},t.prototype.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&ae(n,t,e,i),o},t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(Pu||(Pu={}));var Lu,ju,Ru,Iu=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Nu)}return t.prototype.extractFromVPMatrix=function(t){var e=Ce(t,16),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],d=e[10],h=e[11],p=e[12],g=e[13],m=e[14],y=e[15];Jt(this.planes[0].normal,o-n,l-a,h-u),this.planes[0].distance=y-p,Jt(this.planes[1].normal,o+n,l+a,h+u),this.planes[1].distance=y+p,Jt(this.planes[2].normal,o+r,l+s,h+f),this.planes[2].distance=y+g,Jt(this.planes[3].normal,o-r,l-s,h-f),this.planes[3].distance=y-g,Jt(this.planes[4].normal,o-i,l-c,h-d),this.planes[4].distance=y-m,Jt(this.planes[5].normal,o+i,l+c,h+d),this.planes[5].distance=y+m,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),Bu=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}return t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Du=function(){function t(t,e,n,r){this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}(),Fu="Method not implemented.",zu="Use document.documentElement instead.";!function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"}(Lu||(Lu={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"}(ju||(ju={})),function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"}(Ru||(Ru={}));var Gu,Wu,$u,Hu,Vu,Yu="updated",Uu=2e-4,qu=function(){function t(){this.clipSpaceNearZ=lu.NEGATIVE_ONE,this.eventEmitter=new qc,this.matrix=ht(),this.right=Kt(1,0,0),this.up=Kt(0,1,0),this.forward=Kt(0,0,1),this.position=Kt(0,0,1),this.focalPoint=Kt(0,0,0),this.distanceVector=Kt(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=ht(),this.projectionMatrixInverse=ht(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Lu.EXPLORING,this.trackingMode=ju.DEFAULT,this.projectionMode=Ru.PERSPECTIVE,this.frustum=new Iu,this.orthoMatrix=ht()}return t.prototype.isOrtho=function(){return this.projectionMode===Ru.ORTHOGRAPHIC},t.prototype.getProjectionMode=function(){return this.projectionMode},t.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},t.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},t.prototype.getFrustum=function(){return this.frustum},t.prototype.getPosition=function(){return this.position},t.prototype.getFocalPoint=function(){return this.focalPoint},t.prototype.getDollyingStep=function(){return this.dollyingStep},t.prototype.getNear=function(){return this.near},t.prototype.getFar=function(){return this.far},t.prototype.getZoom=function(){return this.zoom},t.prototype.getOrthoMatrix=function(){return this.orthoMatrix},t.prototype.getView=function(){return this.view},t.prototype.setEnableUpdate=function(t){this.enableUpdate=t},t.prototype.setType=function(t,e){return this.type=t,this.type===Lu.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Lu.TRACKING&&void 0!==e&&this.setTrackingMode(e),this},t.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},t.prototype.setTrackingMode=function(t){if(this.type!==Lu.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},t.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},t.prototype.getViewTransform=function(){return bt(ht(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(t,e){var n=St(ht(),[t,e,0]);this.jitteredProjectionMatrix=wt(ht(),n,this.projectionMatrix)},t.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},t.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},t.prototype.setProjectionMatrix=function(t){this.projectionMatrix=t},t.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},t.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},t.prototype.setNear=function(t){return this.projectionMode===Ru.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},t.prototype.setFar=function(t){return this.projectionMode===Ru.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},t.prototype.setViewOffset=function(t,e,n,r,i,o){return this.aspect=t/e,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=r,this.view.width=i,this.view.height=o,this.projectionMode===Ru.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},t.prototype.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Ru.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},t.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===Ru.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Ru.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},t.prototype.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=Kt(a.x-r,a.y-i,0),c=ie(s,this.right)/Zt(this.right),l=ie(s,this.up)/Zt(this.up),u=Ce(this.getPosition(),2),f=u[0],d=u[1],h=Ce(this.getFocalPoint(),2),p=h[0],g=h[1];return this.setPosition(f-c,d-l),this.setFocalPoint(p-c,g-l),this},t.prototype.setPerspective=function(t,e,n,r){var i;this.projectionMode=Ru.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(bu(.5*this.fov))/this.zoom,a=2*o,s=this.aspect*a,c=-.5*s;if(null===(i=this.view)||void 0===i?void 0:i.enabled){var l=this.view.fullWidth,u=this.view.fullHeight;c+=this.view.offsetX*s/l,o-=this.view.offsetY*a/u,s*=this.view.width/l,a*=this.view.height/u}return function(t,e,n,r,i,o,a,s){void 0===s&&(s=!1);var c,l,u=2*o/(n-e),f=2*o/(r-i),d=(n+e)/(n-e),h=(r+i)/(r-i);s?(c=-a/(a-o),l=-a*o/(a-o)):(c=-(a+o)/(a-o),l=-2*a*o/(a-o)),t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=f,t[6]=0,t[7]=0,t[8]=d,t[9]=h,t[10]=c,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,c,c+s,o-a,o,t,this.far,this.clipSpaceNearZ===lu.ZERO),bt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(t,e,n,r,i,o){var a;this.projectionMode=Ru.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=r,this.near=i,this.far=o;var s=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,u=(this.top+this.bottom)/2,f=l-s,d=l+s,h=u+c,p=u-c;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(f+=g*this.view.offsetX)+g*this.view.width,p=(h-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===lu.NEGATIVE_ONE?Gt(this.projectionMatrix,f,d,h,p,i,o):Wt(this.projectionMatrix,f,d,h,p,i,o),bt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},t.prototype.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=vu(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},t.prototype.setFocalPoint=function(t,e,n){void 0===e&&(e=this.focalPoint[1]),void 0===n&&(n=this.focalPoint[2]);var r=Kt(0,1,0);if(this.focalPoint=vu(t,e,n),this.trackingMode===ju.CINEMATIC){var i=ee(qt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=Zt(i),a=xu(Math.asin(e/o)),s=90+xu(Math.atan2(n,t)),c=ht();kt(c,c,bu(s)),Et(c,c,bu(a)),r=se(qt(),[0,1,0],c)}return bt(this.matrix,$t(ht(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},t.prototype.getDistance=function(){return this.distance},t.prototype.getDistanceVector=function(){return this.distanceVector},t.prototype.setDistance=function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<Uu&&(this.distance=Uu),this.dollyingStep=this.distance/100;var e=qt();t=this.distance;var n=this.forward,r=this.focalPoint;return e[0]=t*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},t.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},t.prototype.setMinDistance=function(t){return this.minDistance=t,this},t.prototype.setAzimuth=function(t){return this.azimuth=yu(t),this.computeMatrix(),this._getAxes(),this.type===Lu.ORBITING||this.type===Lu.EXPLORING?this._getPosition():this.type===Lu.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(t){return this.elevation=yu(t),this.computeMatrix(),this._getAxes(),this.type===Lu.ORBITING||this.type===Lu.EXPLORING?this._getPosition():this.type===Lu.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(t){return this.roll=yu(t),this.computeMatrix(),this._getAxes(),this.type===Lu.ORBITING||this.type===Lu.EXPLORING?this._getPosition():this.type===Lu.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getRoll=function(){return this.roll},t.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},t.prototype.computeMatrix=function(){var t=ge(pe(),[0,0,1],bu(this.roll));yt(this.matrix);var e=ge(pe(),[1,0,0],bu((this.rotateWorld&&this.type!==Lu.TRACKING||this.type===Lu.TRACKING?1:-1)*this.elevation)),n=ge(pe(),[0,1,0],bu((this.rotateWorld&&this.type!==Lu.TRACKING||this.type===Lu.TRACKING?1:-1)*this.azimuth)),r=me(pe(),n,e);r=me(pe(),r,t);var i=Bt(ht(),r);this.type===Lu.ORBITING||this.type===Lu.EXPLORING?(Mt(this.matrix,this.matrix,this.focalPoint),wt(this.matrix,this.matrix,i),Mt(this.matrix,this.matrix,[0,0,this.distance])):this.type===Lu.TRACKING&&(Mt(this.matrix,this.matrix,this.position),wt(this.matrix,this.matrix,i))},t.prototype._setPosition=function(t,e,n){this.position=vu(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},t.prototype._getAxes=function(){Qt(this.right,vu(he(de(),[1,0,0,0],this.matrix))),Qt(this.up,vu(he(de(),[0,1,0,0],this.matrix))),Qt(this.forward,vu(he(de(),[0,0,1,0],this.matrix))),re(this.right,this.right),re(this.up,this.up),re(this.forward,this.forward)},t.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Zt(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===Lu.TRACKING||this.rotateWorld?(this.elevation=xu(Math.asin(e/r)),this.azimuth=xu(Math.atan2(-t,-n))):(this.elevation=-xu(Math.asin(e/r)),this.azimuth=-xu(Math.atan2(-t,-n)))},t.prototype._getPosition=function(){Qt(this.position,vu(he(de(),[0,0,0,1],this.matrix))),this._getDistance()},t.prototype._getFocalPoint=function(){var t,e;ce(this.distanceVector,[0,0,-this.distance],(t=ft(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),te(this.focalPoint,this.position,this.distanceVector),this._getDistance()},t.prototype._getDistance=function(){this.distanceVector=ee(qt(),this.focalPoint,this.position),this.distance=Zt(this.distanceVector),this.dollyingStep=this.distance/100},t.prototype._getOrthoMatrix=function(){if(this.projectionMode===Ru.ORTHOGRAPHIC){var t=this.position,e=ge(pe(),[0,0,1],-this.roll*Math.PI/180);It(this.orthoMatrix,e,Kt((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Kt(this.zoom,this.zoom,1),t)}},t.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=wt(ht(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Yu)}},t.prototype.rotate=function(t,e,n){throw new Error(Fu)},t.prototype.pan=function(t,e){throw new Error(Fu)},t.prototype.dolly=function(t){throw new Error(Fu)},t.prototype.createLandmark=function(t,e){throw new Error(Fu)},t.prototype.gotoLandmark=function(t,e){throw new Error(Fu)},t.prototype.cancelLandmarkAnimation=function(){throw new Error(Fu)},t}();function Xu(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(Xu.Cache||Map),n}Xu.Cache=Map,function(t){t[t.kUnknown=0]="kUnknown",t[t.kNumber=1]="kNumber",t[t.kPercentage=2]="kPercentage",t[t.kEms=3]="kEms",t[t.kPixels=4]="kPixels",t[t.kRems=5]="kRems",t[t.kDegrees=6]="kDegrees",t[t.kRadians=7]="kRadians",t[t.kGradians=8]="kGradians",t[t.kTurns=9]="kTurns",t[t.kMilliseconds=10]="kMilliseconds",t[t.kSeconds=11]="kSeconds",t[t.kInteger=12]="kInteger"}(Gu||(Gu={})),function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(Wu||(Wu={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}($u||($u={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Hu||(Hu={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Vu||(Vu={}));var Zu,Ku=[{name:"em",unit_type:Gu.kEms},{name:"px",unit_type:Gu.kPixels},{name:"deg",unit_type:Gu.kDegrees},{name:"rad",unit_type:Gu.kRadians},{name:"grad",unit_type:Gu.kGradians},{name:"ms",unit_type:Gu.kMilliseconds},{name:"s",unit_type:Gu.kSeconds},{name:"rem",unit_type:Gu.kRems},{name:"turn",unit_type:Gu.kTurns}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(Zu||(Zu={}));var Qu,Ju=function(t){return t?"number"===t?Gu.kNumber:"percent"===t||"%"===t?Gu.kPercentage:function(t){return Ku.find((function(e){return e.name===t})).unit_type}(t):Gu.kUnknown},tf=function(t){var e=1;switch(t){case Gu.kPixels:case Gu.kDegrees:case Gu.kSeconds:break;case Gu.kMilliseconds:e=.001;break;case Gu.kRadians:e=180/Math.PI;break;case Gu.kGradians:e=.9;break;case Gu.kTurns:e=360}return e},ef=function(t){switch(t){case Gu.kNumber:case Gu.kInteger:return"";case Gu.kPercentage:return"%";case Gu.kEms:return"em";case Gu.kRems:return"rem";case Gu.kPixels:return"px";case Gu.kDegrees:return"deg";case Gu.kRadians:return"rad";case Gu.kGradians:return"grad";case Gu.kMilliseconds:return"ms";case Gu.kSeconds:return"s";case Gu.kTurns:return"turn"}return""},nf=function(){function t(){}return t.isAngle=function(t){return t===Gu.kDegrees||t===Gu.kRadians||t===Gu.kGradians||t===Gu.kTurns},t.isLength=function(t){return t>=Gu.kEms&&t<Gu.kDegrees},t.isRelativeUnit=function(t){return t===Gu.kPercentage||t===Gu.kEms||t===Gu.kRems},t.isTime=function(t){return t===Gu.kSeconds||t===Gu.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(Hu.kNo,Vu.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=Zu.kUnitType&&this.getType()<=Zu.kClampType},t}(),rf=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return Ee(e,t),e.prototype.getType=function(){return Zu.kColorType},e.prototype.to=function(t){return this},e}(nf);!function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"}(Qu||(Qu={}));var of=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return Ee(e,t),e.prototype.clone=function(){return new e(this.type,this.value)},e.prototype.buildCSSText=function(t,e,n){return n},e.prototype.getType=function(){return Zu.kColorType},e}(nf),af=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return Ee(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return Zu.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(nf),sf=Xu((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),cf=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function lf(t){return"function"==typeof t}var uf={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},ff=Xu((function(t){var e=sf(t),n=uf[e];return e=(null==n?void 0:n.alias)||e})),df=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw new Error}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},hf=function(t){return function(t){switch(t){case Wu.kUNumber:return Gu.kNumber;case Wu.kULength:return Gu.kPixels;case Wu.kUPercent:return Gu.kPercentage;case Wu.kUTime:return Gu.kSeconds;case Wu.kUAngle:return Gu.kDegrees;default:return Gu.kUnknown}}(function(t){switch(t){case Gu.kNumber:case Gu.kInteger:return Wu.kUNumber;case Gu.kPercentage:return Wu.kUPercent;case Gu.kPixels:return Wu.kULength;case Gu.kMilliseconds:case Gu.kSeconds:return Wu.kUTime;case Gu.kDegrees:case Gu.kRadians:case Gu.kGradians:case Gu.kTurns:return Wu.kUAngle;default:return Wu.kUOther}}(t))},pf=function(t){function e(e,n){void 0===n&&(n=Gu.kNumber);var r,i=t.call(this)||this;return r="string"==typeof n?Ju(n):n,i.unit=r,i.value=e,i}return Ee(e,t),e.prototype.clone=function(){return new e(this.value,this.unit)},e.prototype.equals=function(t){var e=t;return this.value===e.value&&this.unit===e.unit},e.prototype.getType=function(){return Zu.kUnitType},e.prototype.convertTo=function(t){if(this.unit===t)return new e(this.value,this.unit);var n=hf(this.unit);if(n!==hf(t)||n===Gu.kUnknown)return null;var r=tf(this.unit)/tf(t);return new e(this.value*r,t)},e.prototype.buildCSSText=function(t,e,n){var r;switch(this.unit){case Gu.kUnknown:break;case Gu.kInteger:r=Number(this.value).toFixed(0);break;case Gu.kNumber:case Gu.kPercentage:case Gu.kEms:case Gu.kRems:case Gu.kPixels:case Gu.kDegrees:case Gu.kRadians:case Gu.kGradians:case Gu.kMilliseconds:case Gu.kSeconds:case Gu.kTurns:var i=this.value,o=ef(this.unit);if(i<-999999||i>999999){var a=ef(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?df(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r},e}(nf),gf=new pf(0,"px");new pf(1,"px");var mf,yf,vf=new pf(0,"deg"),bf=function(t){function e(e,n,r,i,o){void 0===i&&(i=1),void 0===o&&(o=!1);var a=t.call(this,"rgb")||this;return a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}return Ee(e,t),e.prototype.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},e.prototype.buildCSSText=function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},e}(rf),xf=new af("unset"),wf=new af("initial"),Mf=new af("inherit"),Of={"":xf,unset:xf,initial:wf,inherit:Mf},Ef=function(t){return Of[t]||(Of[t]=new af(t)),Of[t]},kf=new bf(0,0,0,0,!0),Sf=new bf(0,0,0,0),Af=Xu((function(t,e,n,r){return new bf(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),_f=function(t,e){return void 0===e&&(e=Gu.kNumber),new pf(t,e)};new pf(50,"%"),function(t){t[t.Standard=0]="Standard"}(mf||(mf={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"}(yf||(yf={}));var Tf,Pf={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Du(0,0,0,0)};function Cf(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}!function(t){t.COORDINATE="<coordinate>",t.COLOR="<color>",t.PAINT="<paint>",t.NUMBER="<number>",t.ANGLE="<angle>",t.OPACITY_VALUE="<opacity-value>",t.SHADOW_BLUR="<shadow-blur>",t.LENGTH="<length>",t.PERCENTAGE="<percentage>",t.LENGTH_PERCENTAGE="<length> | <percentage>",t.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",t.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",t.LIST_OF_POINTS="<list-of-points>",t.PATH="<path>",t.FILTER="<filter>",t.Z_INDEX="<z-index>",t.OFFSET_DISTANCE="<offset-distance>",t.DEFINED_PATH="<defined-path>",t.MARKER="<marker>",t.TRANSFORM="<transform>",t.TRANSFORM_ORIGIN="<transform-origin>",t.TEXT="<text>",t.TEXT_TRANSFORM="<text-transform>"}(Tf||(Tf={}));var Nf=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){throw new Error(e+": "+t)}function r(){var t=h(i);return e.length>0&&n("Invalid input not EOF"),t}function i(){return o("linear-gradient",t.linearGradient,s)||o("repeating-linear-gradient",t.repeatingLinearGradient,s)||o("radial-gradient",t.radialGradient,c)||o("repeating-radial-gradient",t.repeatingRadialGradient,c)||o("conic-gradient",t.conicGradient,c)}function o(e,r,i){return a(r,(function(r){var o=i();return o&&(b(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:h(p)}}))}function a(e,r){var i=b(e);if(i){b(t.startCall)||n("Missing (");var o=r(i);return b(t.endCall)||n("Missing )"),o}}function s(){return v("directional",t.sideOrCorner,1)||v("angular",t.angleValue,1)}function c(){var n,r,i=l();return i&&((n=[]).push(i),r=e,b(t.comma)&&((i=l())?n.push(i):e=r)),n}function l(){var t=function(){var t=v("shape",/^(circle)/i,0);t&&(t.style=y()||u());return t}()||function(){var t=v("shape",/^(ellipse)/i,0);t&&(t.style=m()||u());return t}();if(t)t.at=f();else{var e=u();if(e){t=e;var n=f();n&&(t.at=n)}else{var r=d();r&&(t={type:"default-radial",at:r})}}return t}function u(){return v("extent-keyword",t.extentKeywords,1)}function f(){if(v("position",/^at/,0)){var t=d();return t||n("Missing positioning value"),t}}function d(){var t={x:m(),y:m()};if(t.x||t.y)return{type:"position",value:t}}function h(e){var r=e(),i=[];if(r)for(i.push(r);b(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function p(){var e=v("hex",t.hexColor,1)||a(t.rgbaColor,(function(){return{type:"rgba",value:h(g)}}))||a(t.rgbColor,(function(){return{type:"rgb",value:h(g)}}))||v("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=m(),e}function g(){return b(t.number)[1]}function m(){return v("%",t.percentageValue,1)||v("position-keyword",t.positionKeywords,1)||y()}function y(){return v("px",t.pixelValue,1)||v("em",t.emValue,1)}function v(t,e,n){var r=b(e);if(r)return{type:t,value:r[n]}}function b(t){var n=/^[\n\r\t\s]+/.exec(e);n&&x(n[0].length);var r=t.exec(e);return r&&x(r[0].length),r}function x(t){e=e.substring(t)}return function(t){return e=t,r()}}();var Lf=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,jf=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Rf=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,If=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Bf={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},Df=Xu((function(t){var e;return e="angular"===t.type?Number(t.value):Bf[t.value]||0,_f(e,"deg")})),Ff=Xu((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:_f(e,r),cy:_f(n,i)}})),zf=Xu((function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Nf(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var o=0,a=Number(t[0].length.value),s=1;s<i;s++){var c=null===(r=t[s].length)||void 0===r?void 0:r.value;if(!v(c)&&!v(a)){for(var l=1;l<s-o;l++)t[o+l].length={type:"%",value:"".concat(a+(Number(c)-a)*l/(s-o))};o=s,a=Number(c)}}}(r);var i=r.map((function(t){return{offset:_f(Number(t.length.value),"%"),color:Cf(t)}}));if("linear-gradient"===e)return new of(Qu.LinearGradient,{angle:n?Df(n):vf,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o=Ff(n[0].at),a=o.cx,s=o.cy,c=void 0;if(n[0].style){var l=n[0].style,u=l.type,f=l.value;c="extent-keyword"===u?Ef(f):_f(f,u)}return new of(Qu.RadialGradient,{cx:a,cy:s,size:c,steps:i})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=Lf.exec(t);if(r){var i=(null===(e=r[2].match(If))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return[new of(Qu.LinearGradient,{angle:_f(parseFloat(r[1]),"deg"),steps:i.map((function(t){var e=Ce(t,2),n=e[0],r=e[1];return{offset:_f(100*Number(n),"%"),color:r}}))})]}}else if("r"===n){var o=function(t){var e,n=jf.exec(t);if(n){var r=(null===(e=n[4].match(If))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:_f(50,"%"),cy:_f(50,"%"),steps:r.map((function(t){var e=Ce(t,2),n=e[0],r=e[1];return{offset:_f(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!C(o))return[new of(Qu.RadialGradient,o)];t=o}}else if("p"===n)return function(t){var e=Rf.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(t)}));function Gf(t){return t&&!!t.image}function Wf(t){return t&&!v(t.r)&&!v(t.g)&&!v(t.b)}var $f=Xu((function(t){if(Gf(t))return ke({repetition:"repeat"},t);if(v(t)&&(t=""),"transparent"===t)return Sf;if("currentColor"===t)t="black";else if("none"===t)return kf;var e=zf(t);if(e)return e;var n=hl(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Af.apply(void 0,Ne([],Ce(r),!1))}));function Hf(t,e){if(Wf(t)&&Wf(e))return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;n<3;n++)e[n]=Math.round(L(e[n],0,255));return e[3]=L(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Vf(t,e){if(v(e))return _f(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return _f(Number(e),"px");if("deg".search(t)>=0)return _f(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return _f(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var Yf=function(t){return Vf(new RegExp("px","g"),t)},Uf=Xu(Yf);Xu((function(t){return Vf(new RegExp("%","g"),t)}));var qf=function(t){return j(t)||isFinite(Number(t))?_f(Number(t)||0,"px"):Vf(new RegExp("px|%|em|rem","g"),t)},Xf=Xu(qf),Zf=function(t){return Vf(new RegExp("deg|rad|grad|turn","g"),t)},Kf=Xu(Zf);function Qf(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,c=hf(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(a=l.value,s=u.value,o=ef(t.unit)):(pf.isLength(t.unit)||pf.isLength(e.unit))&&(a=nd(t,i,n),s=nd(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Jf(t){var e=0;return t.unit===Gu.kDegrees?e=t.value:t.unit===Gu.kRadians?e=xu(Number(t.value)):t.unit===Gu.kTurns&&(e=360*Number(t.value)),e}function td(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):C(t)?n=t.split(" ").map((function(t){return Number(t)})):j(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function ed(t){return C(t)?t.split(" ").map((function(t){return Xf(t)})):t.map((function(t){return Xf(t.toString())}))}function nd(t,e,n,r){if(void 0===r&&(r=!1),t.unit===Gu.kPixels)return Number(t.value);if(t.unit===Gu.kPercentage&&n){var i=n.nodeName===cu.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var rd=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function id(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,rd.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Vf(/deg|rad|grad|turn|px|%/g,t)||$f(t)}))}),n.lastIndex===t.length)return r}return[]}function od(t){return t.toString()}var ad=function(t){return"number"==typeof t?_f(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?_f(Number(t)):_f(0)},sd=Xu(ad);function cd(t,e){return[t,e,od]}function ld(t,e){return function(n,r){return[n,r,function(n){return od(L(n,t,e))}]}}function ud(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function fd(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=pn(t.parsedStyle.d.absolutePath,void 0,ke(ke({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function dd(t,e){return t[0]===e[0]&&t[1]===e[1]}function hd(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),c=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!c||0===Math.sin(c)||I(c,0))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return l=l>Math.PI/2?Math.PI-l:l,u=u>Math.PI/2?Math.PI-u:u,{xExtra:Math.cos(c/2-l)*(e/2*(1/Math.sin(c/2)))-e/2||0,yExtra:Math.cos(u-c/2)*(e/2*(1/Math.sin(c/2)))-e/2||0}}function pd(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Xu((function(t){return C(t)?t.split(" ").map(sd):t.map(sd)}));var gd=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/r)},md=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var c=bu(r=F(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-a.x)/2,u=(t.y-a.y)/2,f={x:Math.cos(c)*l+Math.sin(c)*u,y:-Math.sin(c)*l+Math.cos(c)*u},d=Math.pow(f.x,2)/Math.pow(e,2)+Math.pow(f.y,2)/Math.pow(n,2);d>1&&(e=Math.sqrt(d)*e,n=Math.sqrt(d)*n);var h=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2))/(Math.pow(e,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2));h=h<0?0:h;var p=(i!==o?1:-1)*Math.sqrt(h),g=p*(e*f.y/n),m=p*(-n*f.x/e),y={x:Math.cos(c)*g-Math.sin(c)*m+(t.x+a.x)/2,y:Math.sin(c)*g+Math.cos(c)*m+(t.y+a.y)/2},v={x:(f.x-g)/e,y:(f.y-m)/n},b=gd({x:1,y:0},v),x=gd(v,{x:(-f.x-g)/e,y:(-f.y-m)/n});!o&&x>0?x-=2*Math.PI:o&&x<0&&(x+=2*Math.PI);var w=b+(x%=2*Math.PI)*s,M=e*Math.cos(w),O=n*Math.sin(w);return{x:Math.cos(c)*M-Math.sin(c)*O+y.x,y:Math.sin(c)*M+Math.cos(c)*O+y.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:w,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function yd(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,c=r.xRotation,l=r.arcFlag,u=r.sweepFlag,f=md({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),d=md({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),h=d.x-f.x,p=d.y-f.y,g=Math.sqrt(h*h+p*p);return{x:-h/g,y:-p/g}}function vd(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function bd(t,e){return vd(t)*vd(e)?(t[0]*e[0]+t[1]*e[1])/(vd(t)*vd(e)):1}function xd(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(bd(t,e))}function wd(t,e){var n=e[1],r=e[2],i=F(bu(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],c=t[1],l=e[6],u=e[7],f=Math.cos(i)*(s-l)/2+Math.sin(i)*(c-u)/2,d=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(c-u)/2,h=f*f/(n*n)+d*d/(r*r);h>1&&(n*=Math.sqrt(h),r*=Math.sqrt(h));var p=n*n*(d*d)+r*r*(f*f),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(g*=-1),isNaN(g)&&(g=0);var m=r?g*n*d/r:0,y=n?g*-r*f/n:0,v=(s+l)/2+Math.cos(i)*m-Math.sin(i)*y,b=(c+u)/2+Math.sin(i)*m+Math.cos(i)*y,x=[(f-m)/n,(d-y)/r],w=[(-1*f-m)/n,(-1*d-y)/r],M=xd([1,0],x),O=xd(x,w);return bd(x,w)<=-1&&(O=Math.PI),bd(x,w)>=1&&(O=0),0===a&&O>0&&(O-=2*Math.PI),1===a&&O<0&&(O+=2*Math.PI),{cx:v,cy:b,rx:dd(t,[l,u])?0:n,ry:dd(t,[l,u])?0:r,startAngle:M,endAngle:M+O,xRotation:i,arcFlag:o,sweepFlag:a}}function Md(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,s=n-t,c=n+t,l=r-e,u=r+e;return[["M",s,r],["C",s,r-a,n-o,l,n,l],["C",n+o,l,c,r-a,c,r],["C",c,r+a,n+o,u,n,u],["C",n-o,u,s,r+a,s,r],["Z"]]}function Od(t,e){void 0===e&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case cu.LINE:var r=t.parsedStyle,i=r.x1,o=void 0===i?0:i,a=r.y1,s=void 0===a?0:a,c=r.x2,l=void 0===c?0:c,u=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(o,s,l,void 0===u?0:u);break;case cu.CIRCLE:var f=t.parsedStyle,d=f.r,h=void 0===d?0:d,p=f.cx,g=void 0===p?0:p,m=f.cy;n=Md(h,h,g,void 0===m?0:m);break;case cu.ELLIPSE:var y=t.parsedStyle,v=y.rx,b=void 0===v?0:v,x=y.ry,w=void 0===x?0:x,M=y.cx,O=(g=void 0===M?0:M,y.cy);n=Md(b,w,g,void 0===O?0:O);break;case cu.POLYLINE:case cu.POLYGON:n=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===cu.POLYGON);break;case cu.RECT:var E=t.parsedStyle,k=E.width,S=void 0===k?0:k,A=E.height,_=void 0===A?0:A,T=E.x,P=void 0===T?0:T,C=E.y,N=void 0===C?0:C,j=E.radius,R=j&&j.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var o=Ce(i,4),a=o[0],s=o[1],c=o[2],l=o[3],u=t>0?1:-1,f=e>0?1:-1,d=u+f!==0?1:0;return[["M",u*a+n,r],["L",t-u*s+n,r],s?["A",s,s,0,0,d,t+n,f*s+r]:null,["L",t+n,e-f*c+r],c?["A",c,c,0,0,d,t+n-u*c,e+r]:null,["L",n+u*l,e+r],l?["A",l,l,0,0,d,n,e+r-f*l]:null,["L",n,f*a+r],a?["A",a,a,0,0,d,u*a+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(S,_,P,N,R&&j.map((function(t){return L(t,0,Math.min(Math.abs(S)/2,Math.abs(_)/2))})));break;case cu.PATH:n=Ne([],Ce(t.parsedStyle.d.absolutePath),!1)}if(n.length)return function(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=Kt(e[1],e[2],0);n&&se(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var o=Kt(e[1],e[2],0),a=Kt(e[3],e[4],0),s=Kt(e[5],e[6],0);n&&(se(o,o,n),se(a,a,n),se(s,s,n)),r="".concat(e[0]).concat(o[0],",").concat(o[1],",").concat(a[0],",").concat(a[1],",").concat(s[0],",").concat(s[1])}else if("A"===e[0]){var c=Kt(e[6],e[7],0);n&&se(c,c,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(c[0],",").concat(c[1])}else"Q"===e[0]&&(o=Kt(e[1],e[2],0),a=Kt(e[3],e[4],0),n&&(se(o,o,n),se(a,a,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(n,0,e)}var Ed=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=Ke(t)}catch(n){e=Ke(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;e<t.length;e++){var n=t[e-1],r=t[e];if("M"===r[0]&&n){var i=n[0],o=[r[1],r[2]],a=void 0;"L"===i||"M"===i?a=[n[1],n[2]]:"C"!==i&&"A"!==i&&"Q"!==i||(a=[n[n.length-2],n[n.length-1]]),a&&dd(o,a)&&(t.splice(e,1),e--)}}}(e);var n=function(t){for(var e=!1,n=t.length,r=0;r<n;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;i<t.length;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;s<a;s++){var c=t[s];r=t[s+1];var l=c[0],u={command:l,prePoint:n,params:c,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[c[1],c[2]],o=s;break;case"A":var f=wd(n,c);u.arcParams=f}if("Z"===l)n=i,r=t[o+1];else{var d=c.length;n=[c[d-2],c[d-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),u.currentPoint=n,e[o]&&dd(n,e[o].currentPoint)&&(e[o].prePoint=u.prePoint);var h=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=h;var p=u.prePoint;if(["L","H","V"].includes(l))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===l){var g=[c[1],c[2]];u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]}else if("T"===l)g=pd((v=e[s-1]).currentPoint,p),"Q"===v.command?(u.command="Q",u.startTangent=[p[0]-g[0],p[1]-g[1]],u.endTangent=[n[0]-g[0],n[1]-g[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]]);else if("C"===l){var m=[c[1],c[2]],y=[c[3],c[4]];u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[m[0]-y[0],m[1]-y[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[y[0]-m[0],y[1]-m[1]])}else if("S"===l){var v;m=pd((v=e[s-1]).currentPoint,p),y=[c[1],c[2]],"C"===v.command?(u.command="C",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]]):(u.command="SQ",u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]])}else if("A"===l){var b=yd(u,0),x=b.x,w=b.y,M=yd(u,1,!1),O=M.x,E=M.y;u.startTangent=[x,w],u.endTangent=[O,E]}e.push(u)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=(g=t[o]).currentPoint,s=g.params,c=g.prePoint,l=void 0;switch(g.command){case"Q":l=ou(c[0],c[1],s[1],s[2],s[3],s[4]);break;case"C":l=tu(c[0],c[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var u=g.arcParams;l=Yl(u.cx,u.cy,u.rx,u.ry,u.xRotation,u.startAngle,u.endAngle);break;default:n.push(a[0]),r.push(a[1])}l&&(g.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height)),e&&("L"===g.command||"M"===g.command)&&g.prePoint&&g.nextPoint&&i.push(g)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var f=T(n),d=T(r),h=_(n),p=_(r);if(0===i.length)return{x:f,y:d,width:h-f,height:p-d};for(o=0;o<i.length;o++){var g;(a=(g=i[o]).currentPoint)[0]===f?f-=hd(g,e).xExtra:a[0]===h&&(h+=hd(g,e).xExtra),a[1]===d?d-=hd(g,e).yExtra:a[1]===p&&(p+=hd(g,e).yExtra)}return{x:f,y:d,width:h-f,height:p-d}}(a,0),c=s.x,l=s.y,u=s.width,f=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(c)?c:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(f)?f:0}}},kd=Xu(Ed);function Sd(t){return C(t)?kd(t):Ed(t)}function Ad(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=rn(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=rn(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=yn(r,i));var a,s,c,l,u,f,d,h,p=gn(o[0])!==gn(o[1])?(a=o[0],s=a.slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):function(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}(o[0]);return[p,(c=o[1],l=p,u=c.length-1,f=[],d=0,h=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])}))}))}(c),h.forEach((function(t,e){c.slice(1).forEach((function(t,n){d+=on(c[(e+n)%u].slice(-2),l[n%u].slice(-2))})),f[e]=d,d=0})),h[f.indexOf(Math.min.apply(null,f))]),function(t){return t}]}function _d(t,e){var n;return n=C(t)?t.split(" ").map((function(t){var e=Ce(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]})):t,{points:n,totalLength:0,segments:[]}}function Td(t,e){return[t.points,e.points,function(t){return t}]}var Pd=null;function Cd(t){return function(e){var n=0;return t.map((function(t){return t===Pd?e[n++]:t}))}}function Nd(t){return t}var Ld={matrix:["NNNNNN",[Pd,Pd,0,0,Pd,Pd,0,0,0,0,1,0,Pd,Pd,0,1],Nd],matrix3d:["NNNNNNNNNNNNNNNN",Nd],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Cd([Pd,Pd,new pf(1)]),Nd],scalex:["N",Cd([Pd,new pf(1),new pf(1)]),Cd([Pd,new pf(1)])],scaley:["N",Cd([new pf(1),Pd,new pf(1)]),Cd([new pf(1),Pd])],scalez:["N",Cd([new pf(1),new pf(1),Pd])],scale3d:["NNN",Nd],skew:["Aa",null,Nd],skewx:["A",null,Cd([Pd,vf])],skewy:["A",null,Cd([vf,Pd])],translate:["Tt",Cd([Pd,Pd,gf]),Nd],translatex:["T",Cd([Pd,gf,gf]),Cd([Pd,gf])],translatey:["T",Cd([gf,Pd,gf]),Cd([gf,Pd])],translatez:["L",Cd([gf,gf,Pd])],translate3d:["TTL",Nd]};function jd(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=Ld[o];if(!a)return[];var s=e[2].split(","),c=a[0];if(c.length<s.length)return[];for(var l=[],u=0;u<c.length;u++){var f=s[u],d=c[u],h=void 0;if(void 0===(h=f?{A:function(t){return"0"===t.trim()?vf:Kf(t)},N:sd,T:Xf,L:Uf}[d.toUpperCase()](f):{a:vf,n:l[0],t:gf}[d]))return[];l.push(h)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function Rd(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=Ld[o];if(!a)return[];var s=e[2].split(","),c=a[0];if(c.length<s.length)return[];for(var l=[],u=0;u<c.length;u++){var f=s[u],d=c[u],h=void 0;if(void 0===(h=f?{A:function(t){return"0"===t.trim()?vf:Zf(t)},N:ad,T:qf,L:Yf}[d.toUpperCase()](f):{a:vf,n:l[0],t:gf}[d]))return[];l.push(h)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function Id(t){var e,n,r,i;switch(t.t){case"rotatex":return i=bu(Jf(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotatey":return i=bu(Jf(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotatez":return i=bu(Jf(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=bu(Jf(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),c=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*c),2*(e*r*l-n*c),0,2*(e*n*l-r*c),1-2*(e*e+r*r)*l,2*(n*r*l+e*c),0,2*(e*r*l+n*c),2*(n*r*l-e*c),1-2*(e*e+n*n)*l,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var u=bu(Jf(t.d[0])),f=bu(Jf(t.d[1]));return[1,Math.tan(f),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=bu(Jf(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return i=bu(Jf(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=nd(t.d[0],0,null)||0,n=nd(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=nd(t.d[0],0,null)||0,0,0,1];case"translatey":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=nd(t.d[0],0,null)||0,0,1];case"translatez":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=nd(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=nd(t.d[0],0,null)||0,n=nd(t.d[1],0,null)||0,r=nd(t.d[2],0,null)||0,1];case"perspective":var d=nd(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,d?-1/d:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function Bd(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function Dd(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return function(t,e,n,r,i,o){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;i<16;i++)t[i]=e[i]*r;return!0}(Eu,t))return!1;if(gt(ku,Eu),ku[3]=0,ku[7]=0,ku[11]=0,ku[15]=1,Math.abs(xt(ku))<1e-8)return!1;var a,s,c=Eu[3],l=Eu[7],u=Eu[11],f=Eu[12],d=Eu[13],h=Eu[14],p=Eu[15];if(0!==c||0!==l||0!==u){if(Su[0]=c,Su[1]=l,Su[2]=u,Su[3]=p,!bt(ku,ku))return!1;vt(ku,ku),he(i,Su,ku)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=d,e[2]=h,s=Eu,(a=Au)[0][0]=s[0],a[0][1]=s[1],a[0][2]=s[2],a[1][0]=s[4],a[1][1]=s[5],a[1][2]=s[6],a[2][0]=s[8],a[2][1]=s[9],a[2][2]=s[10],n[0]=Zt(Au[0]),re(Au[0],Au[0]),r[0]=ie(Au[0],Au[1]),Tu(Au[1],Au[1],Au[0],1,-r[0]),n[1]=Zt(Au[1]),re(Au[1],Au[1]),r[0]/=n[1],r[1]=ie(Au[0],Au[2]),Tu(Au[2],Au[2],Au[0],1,-r[1]),r[2]=ie(Au[1],Au[2]),Tu(Au[2],Au[2],Au[1],1,-r[2]),n[2]=Zt(Au[2]),re(Au[2],Au[2]),r[1]/=n[2],r[2]/=n[2],oe(_u,Au[1],Au[2]),ie(Au[0],_u)<0)for(var g=0;g<3;g++)n[g]*=-1,Au[g][0]*=-1,Au[g][1]*=-1,Au[g][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+Au[0][0]-Au[1][1]-Au[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-Au[0][0]+Au[1][1]-Au[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-Au[0][0]-Au[1][1]+Au[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+Au[0][0]+Au[1][1]+Au[2][2],0)),Au[2][1]>Au[1][2]&&(o[0]=-o[0]),Au[0][2]>Au[2][0]&&(o[1]=-o[1]),Au[1][0]>Au[0][1]&&(o[2]=-o[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Id).reduce(Bd)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var Fd=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;r<4;r++)for(var i=0;i<4;i++)for(var o=0;o<4;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;s<4;s++)a[s][3]=o[s];for(s=0;s<3;s++)for(var c=0;c<3;c++)a[3][s]+=e[c]*a[c][s];var l=i[0],u=i[1],f=i[2],d=i[3],h=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];h[0][0]=1-2*(u*u+f*f),h[0][1]=2*(l*u-f*d),h[0][2]=2*(l*f+u*d),h[1][0]=2*(l*u+f*d),h[1][1]=1-2*(l*l+f*f),h[1][2]=2*(u*f-l*d),h[2][0]=2*(l*f-u*d),h[2][1]=2*(u*f+l*d),h[2][2]=1-2*(l*l+u*u),a=t(a,h);var p,g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(r[2]&&(g[2][1]=r[2],a=t(a,g)),r[1]&&(g[2][1]=0,g[2][0]=r[0],a=t(a,g)),r[0]&&(g[2][0]=0,g[1][0]=r[0],a=t(a,g)),s=0;s<3;s++)for(c=0;c<3;c++)a[s][c]*=n[s];return 0==(p=a)[0][2]&&0==p[0][3]&&0==p[1][2]&&0==p[1][3]&&0==p[2][0]&&0==p[2][1]&&1==p[2][2]&&0==p[2][3]&&0==p[3][2]&&1==p[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function zd(t){return t.toFixed(6).replace(".000000","")}function Gd(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Dd(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Dd(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}(t,e);r=L(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return Fd(t[0],t[1],t[2],e,t[4]).map(zd).join(",")}])}function Wd(t){return t.replace(/[xy]/,"")}function $d(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Hd(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?_f(a):_f(a,t.unit)}))})},o=0;o<t.length;o++)i(o)}var a,s,c=[],l=[],u=[];if(t.length!==e.length)c=[(v=Gd(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];else for(o=0;o<t.length;o++){var f=t[o].t,d=e[o].t,h=t[o].d,p=e[o].d,g=Ld[f],m=Ld[d],y=void 0;if(s=d,"perspective"===(a=f)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var v=Gd([t[o]],[e[o]]);c.push(v[0]),l.push(v[1]),u.push(["matrix",[v[2]]])}else{if(f===d)y=f;else if(g[2]&&m[2]&&Wd(f)===Wd(d))y=Wd(f),h=g[2](h),p=m[2](p);else{if(!g[1]||!m[1]||$d(f)!==$d(d)){c=[(v=Gd(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];break}y=$d(f),h=g[1](h),p=m[1](p)}for(var b=[],x=[],w=[],M=0;M<h.length;M++){v=Qf(h[M],p[M],n,!1,M);b[M]=v[0],x[M]=v[1],w.push(v[2])}c.push(b),l.push(x),u.push([y,w])}}if(r){var O=c;c=l,l=O}return[c,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return u[e][1][n](t)})).join(",");return"matrix"===u[e][0]&&16===n.split(",").length&&(u[e][0]="matrix3d"),"matrix3d"===u[e][0]&&6===n.split(",").length&&(u[e][0]="matrix"),u[e][0]+"("+n+")"})).join(" ")}]}var Vd=Xu((function(t){if(C(t)){if("text-anchor"===t)return[_f(0,"px"),_f(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[Xf(Ud(e[0])),Xf(Ud(e[1]))]}return[_f(t[0]||0,"px"),_f(t[1]||0,"px")]})),Yd=function(t){if(C(t)){if("text-anchor"===t)return[_f(0,"px"),_f(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[qf(Ud(e[0])),qf(Ud(e[1]))]}return[_f(t[0]||0,"px"),_f(t[1]||0,"px")]};function Ud(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var qd=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Tf.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Tf.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Tf.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Tf.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Tf.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Tf.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Tf.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Tf.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Tf.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Tf.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Tf.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:Tf.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Tf.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Tf.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Tf.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Tf.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Tf.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Tf.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:Tf.FILTER},{n:"clipPath",syntax:Tf.DEFINED_PATH},{n:"textPath",syntax:Tf.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Tf.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Tf.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:Tf.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:Tf.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:Tf.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:Tf.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Tf.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Tf.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Tf.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:Tf.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:Tf.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:Tf.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Tf.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Tf.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Tf.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Tf.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Tf.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Tf.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Tf.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Tf.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Tf.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:Tf.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Tf.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Tf.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Tf.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Tf.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:Tf.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Tf.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Tf.NUMBER,d:function(t){return t===cu.PATH||t===cu.POLYGON||t===cu.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:Tf.MARKER},{n:"markerEnd",syntax:Tf.MARKER},{n:"markerMid",syntax:Tf.MARKER},{n:"markerStartOffset",syntax:Tf.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Tf.LENGTH,l:!0,int:!0,d:"0"}],Xd=qd.filter((function(t){return!!t.l})).map((function(t){return t.n})),Zd={},Kd=new WeakMap,Qd=function(){function t(t){var e=this;this.runtime=t,qd.forEach((function(t){e.registerMetadata(t)}))}return t.prototype.registerMetadata=function(t){Ne([t.n],Ce(t.a||[]),!1).forEach((function(e){Zd[e]=t}))},t.prototype.unregisterMetadata=function(t){delete Zd[t]},t.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},t.prototype.processProperties=function(t,e,n){var r=this;if(void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0}),this.runtime.enableCSSParsing){var i=n.skipUpdateAttribute,o=n.skipParse,a=n.forceUpdateGeometry,s=n.usedAttributes,c=n.memoize,l=a,u=Object.keys(e);u.forEach((function(n){var r;i||(t.attributes[n]=e[n]),!l&&(null===(r=Zd[n])||void 0===r?void 0:r.l)&&(l=!0)})),o||u.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t,c)})),(null==s?void 0:s.length)&&(u=Array.from(new Set(u.concat(s)))),u.forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=r.computeProperty(e,t.computedStyle[e],t,c))})),l&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t)),u.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t,u)})),this.runtime.enableCSSParsing&&t.children.length&&u.forEach((function(e){e in t.parsedStyle&&r.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))}else{Object.assign(t.attributes,e);var f=Object.keys(e),d=t.parsedStyle.clipPath,h=t.parsedStyle.offsetPath;t.parsedStyle=Object.assign(t.parsedStyle,e);var p=!!n.forceUpdateGeometry;if(!p)for(var g=0;g<Xd.length;g++)if(Xd[g]in e){p=!0;break}e.fill&&(t.parsedStyle.fill=$f(e.fill)),e.stroke&&(t.parsedStyle.stroke=$f(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=$f(e.shadowColor)),e.filter&&(t.parsedStyle.filter=id(e.filter)),v(e.radius)||(t.parsedStyle.radius=td(e.radius,4)),v(e.lineDash)||(t.parsedStyle.lineDash=td(e.lineDash,2)),e.points&&(t.parsedStyle.points=_d(e.points)),""===e.d&&(t.parsedStyle.d=ke({},Pf)),e.d&&(t.parsedStyle.d=Sd(e.d)),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},t,null),V(e.clipPath)||this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",d,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",h,e.offsetPath,t,this.runtime),e.transform&&(t.parsedStyle.transform=jd(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=Vd(e.transformOrigin)),e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",e.markerMid,e.markerMid,null,null)),v(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(t,f),v(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(t,f),e.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(t,f),e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory["<transform-origin>"].postProcessor(t,f),p&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},t.prototype.parseProperty=function(t,e,n,r){var i=Zd[t],o=e;if((""===e||v(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)o=Ef(e);else if(i){var a=i.k,s=i.syntax,c=s&&this.getPropertySyntax(s);a&&a.indexOf(e)>-1?o=Ef(e):c&&(!r&&c.parserUnmemoize?o=c.parserUnmemoize(e,n):c.parser&&(o=c.parser(e,n)))}return o},t.prototype.computeProperty=function(t,e,n,r){var i=Zd[t],o="g-root"===n.id,a=e;if(i){var s=i.syntax,c=i.inh,l=i.d;if(e instanceof af){var u=e.value;if("unset"===u&&(u=c&&!o?"inherit":"initial"),"initial"===u)v(l)||(e=this.parseProperty(t,lf(l)?l(n.nodeName):l,n,r));else if("inherit"===u){var f=this.tryToResolveProperty(n,t,{inherited:!0});return v(f)?void this.addUnresolveProperty(n,t):f}}var d=s&&this.getPropertySyntax(s);if(d&&d.calculator){var h=n.parsedStyle[t];a=d.calculator(t,h,e,n,this.runtime)}else a=e instanceof af?e.value:e}return a},t.prototype.postProcessProperty=function(t,e,n){var r=Zd[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},t.prototype.addUnresolveProperty=function(t,e){var n=Kd.get(t);n||(Kd.set(t,[]),n=Kd.get(t)),-1===n.indexOf(e)&&n.push(e)},t.prototype.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=Kd.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},t.prototype.recalc=function(t){var e=Kd.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Kd.delete(t)}},t.prototype.updateGeometry=function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new Cu),r.renderBounds||(r.renderBounds=new Cu);var i=t.parsedStyle,o=n.update(i,t),a=o.cx,s=void 0===a?0:a,c=o.cy,l=void 0===c?0:c,u=o.cz,f=void 0===u?0:u,d=o.hwidth,h=void 0===d?0:d,p=o.hheight,g=void 0===p?0:p,m=o.hdepth,y=void 0===m?0:m,v=[Math.abs(h),Math.abs(g),y],b=i,x=b.stroke,w=b.lineWidth,M=void 0===w?1:w,O=b.increasedLineWidthForHitTesting,E=void 0===O?0:O,k=b.shadowType,S=void 0===k?"outer":k,A=b.shadowColor,_=b.filter,T=void 0===_?[]:_,P=b.transformOrigin,C=[s,l,f];r.contentBounds.update(C,v);var N=e===cu.POLYLINE||e===cu.POLYGON||e===cu.PATH?Math.SQRT2:.5;if(x&&!x.isNone){var L=((M||0)+(E||0))*N;v[0]+=L,v[1]+=L}if(r.renderBounds.update(C,v),A&&S&&"inner"!==S){var j=r.renderBounds,R=j.min,I=j.max,B=i,D=B.shadowBlur||0,F=B.shadowOffsetX||0,z=B.shadowOffsetY||0,G=R[0]-D+F,W=I[0]+D+F,$=R[1]-D+z,H=I[1]+D+z;R[0]=Math.min(R[0],G),I[0]=Math.max(I[0],W),R[1]=Math.min(R[1],$),I[1]=Math.max(I[1],H),r.renderBounds.setMinMax(R,I)}T.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,gu(r.renderBounds.halfExtents,r.renderBounds.halfExtents,[i,i,0]))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,c=r.renderBounds,l=c.min,u=c.max,f=l[0]-s+o,d=u[0]+s+o,h=l[1]-s+a,p=u[1]+s+a;l[0]=Math.min(l[0],f),u[0]=Math.max(u[0],d),l[1]=Math.min(l[1],h),u[1]=Math.max(u[1],p),r.renderBounds.setMinMax(l,u)}})),t.geometry.dirty=!1;var V=g<0,Y=(h<0?-1:1)*(P?nd(P[0],0,t,!0):0),U=(V?-1:1)*(P?nd(P[1],1,t,!0):0);(Y||U)&&t.setOrigin(Y,U)}},t.prototype.updateSizeAttenuation=function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===cu.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===cu.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))},t.prototype.isPropertyInheritable=function(t){var e=Zd[t];return!!e&&e.inh},t}(),Jd=function(){function t(){this.parser=Kf,this.parserUnmemoize=Zf,this.parserWithCSSDisabled=null,this.mixer=cd}return t.prototype.calculator=function(t,e,n,r){return Jf(n)},t}(),th=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof af&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n},t}(),eh=function(){function t(){this.parser=$f,this.parserWithCSSDisabled=$f,this.mixer=Hf}return t.prototype.calculator=function(t,e,n,r){return n instanceof af?"none"===n.value?kf:Sf:n},t}(),nh=function(){function t(){this.parser=id}return t.prototype.calculator=function(t,e,n){return n instanceof af?[]:n},t}();function rh(t){var e=t.parsedStyle.fontSize;return v(e)?null:e}var ih=function(){function t(){this.parser=Xf,this.parserUnmemoize=qf,this.parserWithCSSDisabled=null,this.mixer=cd}return t.prototype.calculator=function(t,e,n,r,i){var o;if(j(n))return n;if(!pf.isRelativeUnit(n.unit))return n.value;var a=i.styleValueRegistry;if(n.unit===Gu.kPercentage)return 0;if(n.unit===Gu.kEms){if(r.parentNode){if(s=rh(r.parentNode))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}if(n.unit===Gu.kRems){if(null===(o=null==r?void 0:r.ownerDocument)||void 0===o?void 0:o.documentElement){var s;if(s=rh(r.ownerDocument.documentElement))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}},t}(),oh=function(){function t(){this.mixer=ud}return t.prototype.parser=function(t){var e=ed(j(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),ah=function(){function t(){this.mixer=ud}return t.prototype.parser=function(t){var e=ed(j(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},t.prototype.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),sh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof af&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),ch=function(){function t(){this.mixer=cd,this.parser=sd,this.parserUnmemoize=ad,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),lh=function(){function t(){this.parser=sd,this.parserUnmemoize=ad,this.parserWithCSSDisabled=null,this.mixer=ld(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t.prototype.postProcessor=function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===cu.LINE||i===cu.PATH||i===cu.POLYLINE){var o=n.getPoint(r);o&&t.setLocalPosition(o.x,o.y)}}},t}(),uh=function(){function t(){this.parser=sd,this.parserUnmemoize=ad,this.parserWithCSSDisabled=null,this.mixer=ld(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),fh=function(){function t(){this.parser=Sd,this.parserWithCSSDisabled=Sd,this.mixer=Ad}return t.prototype.calculator=function(t,e,n){return n instanceof af&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Du(0,0,0,0)}:n},t}(),dh=function(){this.parser=_d,this.mixer=Td},hh=function(t){function e(){var e=t.apply(this,Ne([],Ce(arguments),!1))||this;return e.mixer=ld(0,1/0),e}return Ee(e,t),e}(ih),ph=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof af?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),gh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),mh={},yh=0;var vh="undefined"!=typeof window&&void 0!==window.document;function bh(t){return!!t.getAttribute}function xh(t,e){var n=Number(t.parsedStyle.zIndex||0),r=Number(e.parsedStyle.zIndex||0);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function wh(t){var e,n=t;do{if(null===(e=n.parsedStyle)||void 0===e?void 0:e.clipPath)return n;n=n.parentElement}while(null!==n);return null}function Mh(t,e){if(vh)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Oh={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Eh="object"==typeof performance&&performance.now?performance:Date;function kh(t,e,n){void 0===t&&(t="auto");var r=!1,i=!1,o=!!e&&!e.isNone,a=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=o,i=a):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]}var Sh=1,Ah="object"==typeof self&&self.self==self?self:"object"==typeof Yc&&Yc.global==Yc?Yc:{},_h=Date.now(),Th={},Ph=Date.now(),Ch=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Ph,r=n>16?0:16-n,i=Sh++;return Th[i]=t,Object.keys(Th).length>1||setTimeout((function(){Ph=e;var t=Th;Th={},Object.keys(t).forEach((function(e){return t[e](Ah.performance&&"function"==typeof Ah.performance.now?Ah.performance.now():Date.now()-_h)}))}),r),i},Nh=function(t){delete Th[t]},Lh=function(t){return"string"!=typeof t?Ch:""===t?Ah.requestAnimationFrame:Ah[t+"RequestAnimationFrame"]},jh=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!Lh(t)})),Rh=Lh(jh),Ih=function(t){return"string"!=typeof t?Nh:""===t?Ah.cancelAnimationFrame:Ah[t+"CancelAnimationFrame"]||Ah[t+"CancelRequestAnimationFrame"]}(jh);Ah.requestAnimationFrame=Rh,Ah.cancelAnimationFrame=Ih;var Bh=function(){function t(){this.callbacks=[]}return t.prototype.getCallbacksNum=function(){return this.callbacks.length},t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Promise.all(this.callbacks.map((function(e){return e.apply(void 0,Ne([],Ce(t),!1))})))},t}(),Dh=function(){function t(){this.callbacks=[]}return t.prototype.tapPromise=function(t,e){this.callbacks.push(e)},t.prototype.promise=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return _e(this,void 0,void 0,(function(){var e,n,r;return Te(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,Ne([],Ce(t),!1))]:[3,6];case 1:e=i.sent(),n=0,i.label=2;case 2:return n<this.callbacks.length-1?[4,(0,this.callbacks[n])(e)]:[3,5];case 3:e=i.sent(),i.label=4;case 4:return n++,[3,2];case 5:return[2,e];case 6:return[2,null]}}))}))},t}(),Fh=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){var t=arguments;this.callbacks.forEach((function(e){e.apply(void 0,t)}))},t}(),zh=function(){function t(){this.callbacks=[]}return t.prototype.tap=function(t,e){this.callbacks.push(e)},t.prototype.call=function(){if(this.callbacks.length){for(var t=arguments,e=this.callbacks[0].apply(void 0,t),n=0;n<this.callbacks.length-1;n++){e=(0,this.callbacks[n])(e)}return e}return null},t}(),Gh=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Wh=/([\"\'])[^\'\"]+\1/;function $h(t,e,n){return yt(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var Hh=1e-5,Vh=ht(),Yh=ht();function Uh(t,e){if(t.length){var n=yt(Vh);t.forEach((function(t){var e=t.t,r=t.d;if("scale"===e){var i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Hh)})))||[1,1];At(Yh,[i[0],i[1],1])}else if("scalex"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Hh)})))||[1];At(Yh,[i[0],1,1])}else if("scaley"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Hh)})))||[1];At(Yh,[1,i[0],1])}else if("scalez"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Hh)})))||[1];At(Yh,[1,1,i[0]])}else if("scale3d"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Hh)})))||[1,1,1];At(Yh,[i[0],i[1],i[2]])}else if("translate"===e){St(Yh,[(o=r||[gf,gf])[0].value,o[1].value,0])}else if("translatex"===e){St(Yh,[(o=r||[gf])[0].value,0,0])}else if("translatey"===e){St(Yh,[0,(o=r||[gf])[0].value,0])}else if("translatez"===e){St(Yh,[0,0,(o=r||[gf])[0].value])}else if("translate3d"===e){var o;St(Yh,[(o=r||[gf,gf,gf])[0].value,o[1].value,o[2].value])}else if("rotate"===e){Ct(Yh,bu(Jf((a=r||[vf])[0])))}else if("rotatex"===e){Tt(Yh,bu(Jf((a=r||[vf])[0])))}else if("rotatey"===e){Pt(Yh,bu(Jf((a=r||[vf])[0])))}else if("rotatez"===e){Ct(Yh,bu(Jf((a=r||[vf])[0])))}else if("rotate3d"===e){var a;_t(Yh,bu(Jf((a=r||[gf,gf,gf,vf])[3])),[a[0].value,a[1].value,a[2].value])}else if("skew"===e){var s=(null==r?void 0:r.map((function(t){return t.value})))||[0,0];$h(Yh,bu(s[0]),bu(s[1]))}else if("skewx"===e){s=(null==r?void 0:r.map((function(t){return t.value})))||[0];$h(Yh,bu(s[0]),0)}else if("skewy"===e){s=(null==r?void 0:r.map((function(t){return t.value})))||[0];$h(Yh,0,bu(s[0]))}else if("matrix"===e){var c=Ce(r.map((function(t){return t.value})),6),l=c[0],u=c[1],f=c[2],d=c[3],h=c[4],p=c[5];mt(Yh,l,u,0,0,f,d,0,0,0,0,1,0,h,p,0,1)}else"matrix3d"===e&&mt.apply(Ut,Ne([Yh],Ce(r.map((function(t){return t.value}))),!1));Vt(n,n,Yh)})),e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var qh=function(){function t(){this.parser=jd,this.parserUnmemoize=Rd,this.parserWithCSSDisabled=Rd,this.mixer=Hd}return t.prototype.calculator=function(t,e,n,r){return n instanceof af?[]:n},t.prototype.postProcessor=function(t){Uh(t.parsedStyle.transform,t)},t}(),Xh=function(){function t(){this.parser=Vd,this.parserUnmemoize=Yd}return t.prototype.postProcessor=function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===Gu.kPixels&&e[1].unit===Gu.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()},t}(),Zh=function(){function t(){this.parser=sd,this.parserUnmemoize=ad}return t.prototype.calculator=function(t,e,n,r){return n.value},t.prototype.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0,r.dirtyReason=yf.Z_INDEX_CHANGED)}},t}(),Kh=function(){function t(){}return t.prototype.update=function(t,e){var n=t.cx,r=void 0===n?0:n,i=t.cy,o=void 0===i?0:i,a=t.r,s=void 0===a?0:a;return{cx:r,cy:o,hwidth:s,hheight:s}},t}(),Qh=function(){function t(){}return t.prototype.update=function(t,e){var n=t.cx,r=void 0===n?0:n,i=t.cy,o=void 0===i?0:i,a=t.rx,s=void 0===a?0:a,c=t.ry;return{cx:r,cy:o,hwidth:s,hheight:void 0===c?0:c}},t}(),Jh=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i),c=(a-o)/2,l=(Math.max(n,i)-s)/2;return{cx:o+c,cy:s+l,hwidth:c,hheight:l}},t}(),tp=function(){function t(){}return t.prototype.update=function(t){var e=t.d.rect,n=e.x,r=e.y,i=e.width/2,o=e.height/2;return{cx:n+i,cy:r+o,hwidth:i,hheight:o}},t}(),ep=function(){function t(){}return t.prototype.update=function(t){if(t.points&&w(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,Ne([],Ce(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,Ne([],Ce(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,Ne([],Ce(e.map((function(t){return t[1]}))),!1)),o=Math.max.apply(Math,Ne([],Ce(e.map((function(t){return t[1]}))),!1)),a=(r-n)/2,s=(o-i)/2;return{cx:n+a,cy:i+s,hwidth:a,hheight:s}}return{cx:0,cy:0,hwidth:0,hheight:0}},t}(),np=function(){function t(){}return t.prototype.update=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.src,s=t.width,c=void 0===s?0:s,l=t.height,u=c,f=void 0===l?0:l;return a&&!C(a)&&(u||(u=a.width,t.width=u),f||(f=a.height,t.height=f)),{cx:r+u/2,cy:o+f/2,hwidth:u/2,hheight:f/2}},t}(),rp=function(){function t(t){this.globalRuntime=t}return t.prototype.isReadyToMeasure=function(t,e){var n=t.text,r=t.textAlign,i=t.textBaseline,o=t.fontSize,a=t.fontStyle,s=t.fontWeight,c=t.fontVariant,l=t.lineWidth;return Cp.enableCSSParsing?n&&o&&a&&s&&c&&r&&i&&!v(l):n},t.prototype.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=void 0===o?"start":o,s=t.lineWidth,c=void 0===s?1:s,l=t.textBaseline,u=void 0===l?"alphabetic":l,f=t.dx,d=void 0===f?0:f,h=t.dy,p=void 0===h?0:h,g=t.x,m=void 0===g?0:g,y=t.y,v=void 0===y?0:y;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var b=((null===(r=null===(n=null==e?void 0:e.ownerDocument)||void 0===n?void 0:n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas,x=this.globalRuntime.textService.measureText(i,t,b);t.metrics=x;var w=x.width,M=x.height,O=x.lineHeight,E=x.fontProperties,k=w/2,S=M/2,A=m+k;"center"===a||"middle"===a?A+=c/2-k:"right"!==a&&"end"!==a||(A+=c-2*k);var _=v-S;return"middle"===u?_+=S:"top"===u||"hanging"===u?_+=2*S:"alphabetic"===u?_+=this.globalRuntime.enableCSSParsing?O-E.ascent:0:"bottom"!==u&&"ideographic"!==u||(_+=0),d&&(A+=d),p&&(_+=p),{cx:A,cy:_,hwidth:k,hheight:S}},t}(),ip=function(){function t(){}return t.prototype.update=function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}},t}();var op,ap=function(){function t(e){this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Bu,this.page=new Bu,this.canvas=new Bu,this.viewport=new Bu,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}return Object.defineProperty(t.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),t.prototype.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(t.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},t.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t.prototype.initEvent=function(){},t.prototype.initUIEvent=function(){},t.prototype.clone=function(){throw new Error(Fu)},t}(),sp=function(t){function e(){var e=t.apply(this,Ne([],Ce(arguments),!1))||this;return e.client=new Bu,e.movement=new Bu,e.offset=new Bu,e.global=new Bu,e.screen=new Bu,e}return Ee(e,t),Object.defineProperty(e.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),e.prototype.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},e.prototype.initMouseEvent=function(){throw new Error(Fu)},e}(ap),cp=function(t){function e(){var e=t.apply(this,Ne([],Ce(arguments),!1))||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return Ee(e,t),e.prototype.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},e.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},e.prototype.clone=function(){return this.manager.clonePointerEvent(this)},e}(sp),lp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ee(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(sp),up=function(t){function e(e,n){var r=t.call(this,null)||this;return r.type=e,r.detail=n,Object.assign(r,n),r}return Ee(e,t),e}(ap),fp=function(){function t(){this.emitter=new qc}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r=$(n)&&n||M(n)&&n.capture,i=M(n)&&n.once,o=lf(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var c=Ce(t.split(":"),2),l=c[0];t=c[1],s=l,a=!0}if(t=r?"".concat(t,"capture"):t,e=lf(e)?e:e.handleEvent,a){var u=e;e=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(null===(t=e[0].target)||void 0===t?void 0:t.name)===s&&u.apply(void 0,Ne([],Ce(e),!1))}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},t.prototype.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},t.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},t.prototype.removeEventListener=function(t,e,n){var r=$(n)&&n||M(n)&&n.capture,i=lf(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=lf(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new up(t,e))},t.prototype.dispatchEvent=function(t,e){var n,r,i;if(void 0===e&&(e=!1),!t.type)throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");if(i=this.document?this:this.defaultView?this.defaultView:null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView){if(t.manager=i.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null===(r=t.manager)||void 0===r||r.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),dp=function(t){function e(){var e=t.call(this)||this;return e.shadow=!1,e.ownerDocument=null,e.isConnected=!1,e.baseURI="",e.childNodes=[],e.nodeType=0,e.nodeName="",e.nodeValue=null,e.parentNode=null,e}return Ee(e,t),e.isNode=function(t){return!!t.childNodes},Object.defineProperty(e.prototype,"textContent",{get:function(){var t,e,n="";this.nodeName===cu.TEXT&&(n+=this.style.text);try{for(var r=Pe(this.childNodes),i=r.next();!i.done;i=r.next()){var o=i.value;o.nodeName===cu.TEXT?n+=o.nodeValue:n+=o.textContent}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===cu.TEXT&&(this.style.text="".concat(t))},enumerable:!1,configurable:!0}),e.prototype.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},e.prototype.hasChildNodes=function(){return this.childNodes.length>0},e.prototype.isDefaultNamespace=function(t){throw new Error(Fu)},e.prototype.lookupNamespaceURI=function(t){throw new Error(Fu)},e.prototype.lookupPrefix=function(t){throw new Error(Fu)},e.prototype.normalize=function(){throw new Error(Fu)},e.prototype.isEqualNode=function(t){return this===t},e.prototype.isSameNode=function(t){return this.isEqualNode(t)},Object.defineProperty(e.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),e.prototype.compareDocumentPosition=function(t){var n;if(t===this)return 0;for(var r=t,i=this,o=[r],a=[i];null!==(n=r.parentNode)&&void 0!==n?n:i.parentNode;)r=r.parentNode?(o.push(r.parentNode),r.parentNode):r,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i;if(r!==i)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=o.length>a.length?o:a,c=s===o?a:o;if(s[s.length-c.length]===c[0])return s===o?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-c.length,u=c.length-1;u>=0;u--){var f=c[u],d=s[l+u];if(d!==f){var h=f.parentNode.childNodes;return h.indexOf(f)<h.indexOf(d)?c===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===o?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING},e.prototype.contain=function(t){return this.contains(t)},e.prototype.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},e.prototype.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},e.prototype.forEach=function(t,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},e.DOCUMENT_POSITION_DISCONNECTED=1,e.DOCUMENT_POSITION_PRECEDING=2,e.DOCUMENT_POSITION_FOLLOWING=4,e.DOCUMENT_POSITION_CONTAINS=8,e.DOCUMENT_POSITION_CONTAINED_BY=16,e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,e}(fp),hp=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new qc,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=ht(),this.tmpVec3=qt(),this.onPointerDown=function(t){var e=n.createPointerEvent(t);if(n.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)n.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var r=2===e.button;n.dispatchEvent(e,r?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e,r=Eh.now(),i=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(i,"pointerup"),"touch"===i.pointerType)n.dispatchEvent(i,"touchend");else if("mouse"===i.pointerType||"pen"===i.pointerType){var o=2===i.button;n.dispatchEvent(i,o?"rightup":"mouseup")}var a=n.trackingData(t.pointerId),s=n.findMountedTarget(a.pressTargetsByButton[t.button]),c=s;if(s&&!i.composedPath().includes(s)){for(var l=s;l&&!i.composedPath().includes(l);){if(i.currentTarget=l,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType)n.notifyTarget(i,"touchendoutside");else if("mouse"===i.pointerType||"pen"===i.pointerType){o=2===i.button;n.notifyTarget(i,o?"rightupoutside":"mouseupoutside")}dp.isNode(l)&&(l=l.parentNode)}delete a.pressTargetsByButton[t.button],c=l}if(c){var u=n.clonePointerEvent(i,"click");u.target=c,u.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:u.target,timeStamp:r});var f=a.clicksByButton[t.button];f.target===u.target&&r-f.timeStamp<200?++f.clickCount:f.clickCount=1,f.target=u.target,f.timeStamp=r,u.detail=f.clickCount,(null===(e=i.detail)||void 0===e?void 0:e.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==u.pointerType&&"touch"!==u.pointerType||n.dispatchEvent(u,"click"),n.dispatchEvent(u,"pointertap")),n.freeEvent(u)}n.freeEvent(i)},this.onPointerMove=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),r="mouse"===e.pointerType||"pen"===e.pointerType,i=n.trackingData(t.pointerId),o=n.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a="mousemove"===t.type?"mouseout":"pointerout",s=n.createPointerEvent(t,a,o||void 0);if(n.dispatchEvent(s,"pointerout"),r&&n.dispatchEvent(s,"mouseout"),!e.composedPath().includes(o)){var c=n.createPointerEvent(t,"pointerleave",o||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!e.composedPath().includes(c.target);)c.currentTarget=c.target,n.notifyTarget(c),r&&n.notifyTarget(c,"mouseleave"),dp.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c)}n.freeEvent(s)}if(o!==e.target){var l="mousemove"===t.type?"mouseover":"pointerover",u=n.clonePointerEvent(e,l);n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var f=o&&dp.isNode(o)&&o.parentNode;f&&f!==(dp.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(dp.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var d=n.clonePointerEvent(e,"pointerenter");for(d.eventPhase=d.AT_TARGET;d.target&&d.target!==o&&d.target!==(dp.isNode(n.rootTarget)&&n.rootTarget.parentNode);)d.currentTarget=d.target,n.notifyTarget(d),r&&n.notifyTarget(d,"mouseenter"),dp.isNode(d.target)&&(d.target=d.target.parentNode);n.freeEvent(d)}n.freeEvent(u)}n.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&n.dispatchEvent(e,"touchmove"),r&&(n.dispatchEvent(e,"mousemove"),n.cursor=n.getCursor(e.target)),i.overTargets=e.composedPath(),n.freeEvent(e)},this.onPointerOut=function(t){var e=n.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,i=n.findMountedTarget(e.overTargets),o=n.createPointerEvent(t,"pointerout",i||void 0);n.dispatchEvent(o),r&&n.dispatchEvent(o,"mouseout");var a=n.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(dp.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),dp.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,n.freeEvent(o),n.freeEvent(a)}n.cursor=null},this.onPointerOver=function(t){var e=n.trackingData(t.pointerId),r=n.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;n.dispatchEvent(r,"pointerover"),i&&n.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(n.cursor=n.getCursor(r.target));var o=n.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(dp.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),dp.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=r.composedPath(),n.freeEvent(r),n.freeEvent(o)},this.onPointerUpOutside=function(t){var e=n.trackingData(t.pointerId),r=n.findMountedTarget(e.pressTargetsByButton[t.button]),i=n.createPointerEvent(t);if(r){for(var o=r;o;)i.currentTarget=o,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),dp.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}n.freeEvent(i)},this.onWheel=function(t){var e=n.createWheelEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.onClick=function(t){if(n.context.config.useNativeClickEvent){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)}},this.onPointerCancel=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(e),n.freeEvent(e)}}return t.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},t.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},t.prototype.getScale=function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,o=r.offsetHeight;i&&o&&(e=t.width/i,n=t.height/o)}return{scaleX:e,scaleY:n,bbox:t}},t.prototype.client2Viewport=function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new Bu((t.x-((null==i?void 0:i.left)||0))/n,(t.y-((null==i?void 0:i.top)||0))/r)},t.prototype.viewport2Client=function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new Bu((t.x+((null==i?void 0:i.left)||0))*n,(t.y+((null==i?void 0:i.top)||0))*r)},t.prototype.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),c=r.getWorldTransform(),l=wt(this.tmpMatrix,c,s),u=Jt(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return se(u,u,l),new Bu(u[0],u[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=wt(this.tmpMatrix,n,r),o=Jt(this.tmpVec3,t.x,t.y,0);se(this.tmpVec3,this.tmpVec3,i);var a=this.context.config,s=a.width,c=a.height;return new Bu((o[0]+1)/2*s,(1-(o[1]+1)/2)*c)},t.prototype.setPickHandler=function(t){this.pickHandler=t},t.prototype.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},t.prototype.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;n<r;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}},t.prototype.dispatchEvent=function(t,e,n){if(n){t.eventPhase=t.AT_TARGET;var r=this.rootTarget.defaultView||null;t.currentTarget=r,this.notifyListeners(t,e)}else t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e);this.emitter.emit(e||t.type,t)},t.prototype.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(r=i+1;r<n.length;r++)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},t.prototype.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;r<2048&&t!==this.rootTarget;r++)dp.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},t.prototype.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config,i=r.width,o=r.height,a=r.disableHitTesting;return e<0||n<0||e>i||n>o?null:!a&&this.pickHandler(t)||this.rootTarget||null},t.prototype.isNativeEventFromCanvas=function(t,e){var n=null==e?void 0:e.target;if((null==n?void 0:n.shadowRoot)&&(n=e.composedPath()[0]),n){if(n===t)return!0;if(t&&t.contains)return t.contains(n)}return!!(null==e?void 0:e.composedPath)&&e.composedPath().indexOf(t)>-1},t.prototype.getExistedHTML=function(t){var e,n;if(t.nativeEvent.composedPath)try{for(var r=Pe(t.nativeEvent.composedPath()),i=r.next();!i.done;i=r.next()){var o=i.value,a=this.nativeHTMLMap.get(o);if(a)return a}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}return null},t.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},t.prototype.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(cp);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var o=this.getExistedHTML(i),a=this.context.contextService.getDomElement();return i.target=null!=n?n:o||this.isNativeEventFromCanvas(a,i.nativeEvent)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},t.prototype.createWheelEvent=function(t){var e=this.allocateEvent(lp);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e),r=this.context.contextService.getDomElement();return e.target=n||this.isNativeEventFromCanvas(r,e.nativeEvent)&&this.pickTarget(e),e},t.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},t.prototype.cloneWheelEvent=function(t){var e=this.allocateEvent(lp);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=t.type,e},t.prototype.clonePointerEvent=function(t,e){var n=this.allocateEvent(cp);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},t.prototype.copyPointerData=function(t,e){e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist},t.prototype.copyMouseData=function(t,e){e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset)},t.prototype.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},t.prototype.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=Eh.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},t.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},t.prototype.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},t.prototype.notifyTarget=function(t,e){e=null!=e?e:t.type;var n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(e,"capture"):e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},t.prototype.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;i<r.length&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},t.prototype.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||dp.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=bh(e)&&e.getAttribute("cursor");if(n)return n;e=dp.isNode(e)&&e.parentNode}},t}(),pp=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||Cp.offscreenCanvas)this.canvas=t||Cp.offscreenCanvas,this.context=this.canvas.getContext("2d",ke({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",ke({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",ke({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas},t.prototype.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();!function(t){t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE"}(op||(op={}));var gp,mp=function(){function t(t,e){this.globalRuntime=t,this.context=e,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new Fh,initAsync:new Bh,dirtycheck:new zh,cull:new zh,beginFrame:new Fh,beforeRender:new Fh,render:new Fh,afterRender:new Fh,endFrame:new Fh,destroy:new Fh,pick:new Dh,pickSync:new zh,pointerDown:new Fh,pointerUp:new Fh,pointerMove:new Fh,pointerOut:new Fh,pointerOver:new Fh,pointerWheel:new Fh,pointerCancel:new Fh,click:new Fh}}return t.prototype.init=function(t){var e=this,n=ke(ke({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()}))},t.prototype.getStats=function(){return this.stats},t.prototype.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(op.CAMERA_CHANGED)},t.prototype.render=function(t,e,n){var r=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var i=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(i.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),i.renderReasons.size&&this.inited){i.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var o=1===i.renderReasons.size&&i.renderReasons.has(op.CAMERA_CHANGED),a=!t.disableRenderHooks||!(t.disableRenderHooks&&o);a&&this.renderDisplayObject(i.root,t,i),this.hooks.beginFrame.call(e),a&&i.renderListCurrentFrame.forEach((function(t){r.hooks.beforeRender.call(t),r.hooks.render.call(t),r.hooks.afterRender.call(t)})),this.hooks.endFrame.call(e),i.renderListCurrentFrame=[],i.renderReasons.clear(),n()}},t.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=t.renderable,c=o?s.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(c){var l=a?this.hooks.cull.call(c,this.context.camera):c;l&&(this.stats.rendered++,n.renderListCurrentFrame.push(l))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var u=t.sortable;u.dirty&&(this.sort(t,u),u.dirty=!1,u.dirtyChildren=[],u.dirtyReason=void 0),(u.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)}))},t.prototype.sort=function(t,e){e.sorted&&e.dirtyReason!==yf.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var r=e.sorted.indexOf(n);r>=0&&e.sorted.splice(r,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var i=function(t,e){for(var n=0,r=t.length;n<r;){var i=n+r>>>1;xh(t[i],e)<0?n=i+1:r=i}return n}(e.sorted,n);e.sorted.splice(i,0,n)}})):e.sorted=t.childNodes.slice().sort(xh)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(op.DISPLAY_OBJECT_CHANGED)},t}(),yp=/\[\s*(.*)=(.*)\s*\]/,vp=function(){function t(){}return t.prototype.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},t.prototype.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},t.prototype.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},t.prototype.getIdOrClassname=function(t){return t.substring(1)},t.prototype.getAttribute=function(t){var e=t.match(yp),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},t.prototype.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return v(n)?"":n.toString?n.toString():""},t}(),bp=function(t){function e(e,n,r,i,o,a,s,c){var l=t.call(this,null)||this;return l.relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=o,l.attrChange=a,l.prevParsedValue=s,l.newParsedValue=c,l.type=e,l}return Ee(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(ap);function xp(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}!function(t){t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled"}(gp||(gp={}));var wp,Mp,Op,Ep=new bp(gp.REPARENT,null,"","","",0,"",""),kp=function(){function t(t){var e,n,r,i,o,a,s,c,l=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new up(gp.BOUNDS_CHANGED),this.rotate=(e=pe(),function(t,n,r,i,o){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=!0),"number"==typeof n&&(n=Kt(n,r,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var s=pe();ve(s,n[0],n[1],n[2]);var c=l.getRotation(t),u=l.getRotation(t.parentNode);xe(e,u),ye(e,e),me(s,e,s),me(a.localRotation,s,c),Me(a.localRotation,a.localRotation),o&&l.dirtifyLocal(t,a)}else l.rotateLocal(t,n)}),this.rotateLocal=(n=pe(),function(t,e,r,i,o){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=!0),"number"==typeof e&&(e=Kt(e,r,i));var a=t.transformable;ve(n,e[0],e[1],e[2]),we(a.localRotation,a.localRotation,n),o&&l.dirtifyLocal(t,a)}),this.setEulerAngles=(r=pe(),function(t,e,n,i,o){void 0===n&&(n=0),void 0===i&&(i=0),void 0===o&&(o=!0),"number"==typeof e&&(e=Kt(e,n,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){ve(a.localRotation,e[0],e[1],e[2]);var s=l.getRotation(t.parentNode);xe(r,ye(pe(),s)),we(a.localRotation,a.localRotation,r),o&&l.dirtifyLocal(t,a)}else l.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=Kt(e,n,r));var o=t.transformable;le(e,qt())||(function(t,e,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=e[0],c=e[1],l=e[2],u=i*l-o*c,f=o*s-r*l,d=r*c-i*s,h=i*d-o*f,p=o*u-r*d,g=r*f-i*u,m=2*a;u*=m,f*=m,d*=m,h*=2,p*=2,g*=2,t[0]=s+u+h,t[1]=c+f+p,t[2]=l+d+g}(e,e,o.localRotation),te(o.localPosition,o.localPosition,e),i&&l.dirtifyLocal(t,o))},this.setPosition=(i=ht(),o=qt(),function(t,e,n){void 0===n&&(n=!0);var r=t.transformable;if(o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,!le(l.getPosition(t),o)){if(Qt(r.position,o),null!==t.parentNode&&t.parentNode.transformable){var a=t.parentNode.transformable;gt(i,a.worldTransform),bt(i,i),se(r.localPosition,o,i)}else Qt(r.localPosition,o);n&&l.dirtifyLocal(t,r)}}),this.setLocalPosition=function(){var t=qt();return function(e,n,r){void 0===r&&(r=!0);var i=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,le(i.localPosition,t)||(Qt(i.localPosition,t),r&&l.dirtifyLocal(e,i))}}(),this.translate=(a=qt(),s=qt(),c=qt(),function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=Jt(s,e,n,r)),le(e,a)||(te(c,l.getPosition(t),e),l.setPosition(t,c,i))}),this.setRotation=function(){var t=pe();return function(e,n,r,i,o,a){void 0===a&&(a=!0);var s=e.transformable;if("number"==typeof n&&(n=be(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var c=l.getRotation(e.parentNode);xe(t,c),ye(t,t),me(s.localRotation,t,n),Me(s.localRotation,s.localRotation),a&&l.dirtifyLocal(e,s)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=ht(),e=qt(),n=be(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(It(r.localTransform,r.localRotation,r.localPosition,Kt(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=yt(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),wt(r.localTransform,r.localTransform,i)}var o=It(t,n,e,r.localScale,r.origin);wt(r.localTransform,r.localTransform,o)}else It(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}()}return t.prototype.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},t.prototype.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},t.prototype.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},t.prototype.attach=function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t)),t.parentNode=e,v(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var o=e.sortable;((null===(r=null==o?void 0:o.sorted)||void 0===r?void 0:r.length)||t.parsedStyle.zIndex)&&(-1===o.dirtyChildren.indexOf(t)&&o.dirtyChildren.push(t),o.dirty=!0,o.dirtyReason=yf.ADDED);var a=t.transformable;a&&this.dirtifyWorld(t,a),a.frozen&&this.unfreezeParentToRoot(t),i&&t.dispatchEvent(Ep)},t.prototype.detach=function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;((null===(e=null==i?void 0:i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=yf.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}},t.prototype.getOrigin=function(t){return t.getGeometryBounds(),t.transformable.origin},t.prototype.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},t.prototype.setLocalEulerAngles=function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=Kt(e,n,r));var o=t.transformable;ve(o.localRotation,e[0],e[1],e[2]),i&&this.dirtifyLocal(t,o)},t.prototype.scaleLocal=function(t,e,n){void 0===n&&(n=!0);var r,i,o,a=t.transformable;r=a.localScale,i=a.localScale,o=Kt(e[0],e[1],e[2]||1),r[0]=i[0]*o[0],r[1]=i[1]*o[1],r[2]=i[2]*o[2],n&&this.dirtifyLocal(t,a)},t.prototype.setLocalScale=function(t,e,n){void 0===n&&(n=!0);var r=t.transformable,i=Kt(e[0],e[1],e[2]||r.localScale[2]);le(i,r.localScale)||(Qt(r.localScale,i),n&&this.dirtifyLocal(t,r))},t.prototype.setLocalRotation=function(t,e,n,r,i,o){void 0===o&&(o=!0),"number"==typeof e&&(e=be(e,n,r,i));var a=t.transformable;xe(a.localRotation,e),o&&this.dirtifyLocal(t,a)},t.prototype.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new ut(2);return n[0]=t,n[1]=e,n}(e,n));var r,i,o=t.transformable;r=o.localSkew,i=e,r[0]=i[0],r[1]=i[1],this.dirtifyLocal(t,o)},t.prototype.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},t.prototype.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},t.prototype.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=Ce(t,2),r=e[0],i=e[1];i.affectChildren?r.forEach((function(t){n(t,i)})):n(r,i)})),this.clearPendingEvents(),e.clear()},t.prototype.clearPendingEvents=function(){this.pendingEvents=[]},t.prototype.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)xp(n),n=n.parentNode;e&&t.forEach((function(t){xp(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},t.prototype.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},t.prototype.informDependentDisplayObjects=function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new bp(gp.ATTR_MODIFIED,n,e,e,t,bp.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))},t.prototype.getPosition=function(t){var e=t.transformable;return Lt(e.position,this.getWorldTransform(t,e))},t.prototype.getRotation=function(t){var e=t.transformable;return Rt(e.rotation,this.getWorldTransform(t,e))},t.prototype.getScale=function(t){var e=t.transformable;return jt(e.scaling,this.getWorldTransform(t,e))},t.prototype.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},t.prototype.getLocalPosition=function(t){return t.transformable.localPosition},t.prototype.getLocalRotation=function(t){return t.transformable.localRotation},t.prototype.getLocalScale=function(t){return t.transformable.localScale},t.prototype.getLocalSkew=function(t){return t.transformable.localSkew},t.prototype.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},t.prototype.setLocalTransform=function(t,e){var n=Lt(qt(),e),r=Rt(pe(),e),i=jt(qt(),e);this.setLocalScale(t,i,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,r,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)},t.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},t.prototype.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(Cu.isEmpty(r))return null;var i=n||new Cu;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},t.prototype.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return n.dirty&&Cp.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new Cu},t.prototype.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new Cu).update(r.center,r.halfExtents))})),o||(o=new Cu),e){var a=wh(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o.update(s.center,s.halfExtents)}}return e?(r.renderBounds=o,r.renderBoundsDirty=!1):(r.bounds=o,r.boundsDirty=!1),o},t.prototype.getLocalBounds=function(t){if(t.parentNode){var e=ht();t.parentNode.transformable&&(e=bt(ht(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Cu.isEmpty(n)){var r=new Cu;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);Cu.isEmpty(i)||(r=new Cu).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(n=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=Ce(r.getMin(),2),s=a[0],c=a[1],l=Ce(r.getMax(),2),u=l[0],f=l[1];return new Du(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),u-s,f-c)}return new Du((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},t.prototype.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},t.prototype.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;r<n.length;r++)this.syncHierarchy(n[r])}},t.prototype.sync=function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?wt(e.worldTransform,r.worldTransform,e.localTransform):gt(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},t.prototype.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},t}(),Sp={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},Ap=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,_p=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Tp=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Pp=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!Tp.exec(n)&&!_p.exec(t))},this.trimByKinsokuShorui=function(t){var e=Ne([],Ce(t),!1),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e}}return t.prototype.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(e),i=this.runtime.offscreenCanvasCreator.getOrCreateContext(e,{willReadFrequently:!0});i.font=t;var o=Sp.MetricsString+Sp.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(Sp.BaselineSymbol).width),c=Sp.HeightMultiplier*s;s=s*Sp.BaselineMultiplier|0,r.width=a,r.height=c,i.fillStyle="#f00",i.fillRect(0,0,a,c),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var l=i.getImageData(0,0,a||1,c||1).data,u=l.length,f=4*a,d=0,h=0,p=!1;for(d=0;d<s;++d){for(var g=0;g<f;g+=4)if(255!==l[h+g]){p=!0;break}if(p)break;h+=f}for(n.ascent=s-d,h=u-f,p=!1,d=c;d>s;--d){for(g=0;g<f;g+=4)if(255!==l[h+g]){p=!0;break}if(p)break;h-=f}return n.descent=d-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},t.prototype.measureText=function(t,e,n){var r=e.fontSize,i=void 0===r?16:r,o=e.wordWrap,a=void 0!==o&&o,s=e.lineHeight,c=e.lineWidth,l=void 0===c?1:c,u=e.textBaseline,f=void 0===u?"alphabetic":u,d=e.textAlign,h=void 0===d?"start":d,p=e.letterSpacing,g=void 0===p?0:p,m=e.textPath,y=e.leading,v=void 0===y?0:y,b=function(t){for(var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,o=t.fontStyle,a=void 0===o?"normal":o,s=t.fontVariant,c=void 0===s?"normal":s,l=t.fontWeight,u=void 0===l?"normal":l,f=j(n)&&"".concat(n,"px")||"16px",d=i.split(","),h=d.length-1;h>=0;h--){var p=d[h].trim();!Wh.test(p)&&Gh.indexOf(p)<0&&(p='"'.concat(p,'"')),d[h]=p}return"".concat(a," ").concat(c," ").concat(u," ").concat(f," ").concat(d.join(","))}(e),x=this.measureFont(b,n);0===x.fontSize&&(x.fontSize=i,x.ascent=i);var w=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);w.font=b,e.isOverflowing=!1;var M=(a?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),O=new Array(M.length),E=0;if(!m){for(T=0;T<M.length;T++){var k=w.measureText(M[T]).width+(M[T].length-1)*g;O[T]=k,E=Math.max(E,k)}P=E+l;var S=s||x.fontSize+l,A=Math.max(S,x.fontSize+l)+(M.length-1)*(S+v),_=0;return"middle"===f?_=-A/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?_=-A:"top"!==f&&"hanging"!==f||(_=0),{font:b,width:P,height:A,lines:M,lineWidths:O,lineHeight:S+=v,maxLineWidth:E,fontProperties:x,lineMetrics:O.map((function(t,e){var n=0;return"center"===h||"middle"===h?n-=t/2:"right"!==h&&"end"!==h||(n-=t),new Du(n-l/2,_+e*S,t+l,S)}))}}m.getTotalLength();for(var T=0;T<M.length;T++)var P=w.measureText(M[T]).width+(M[T].length-1)*g},t.prototype.setGraphemeOnPath=function(){},t.prototype.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=void 0===a?0:a,c=e.maxLines,l=void 0===c?1/0:c,u=e.textOverflow,f=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),d=o+s,h="";"ellipsis"===u?h="...":u&&"clip"!==u&&(h=u);for(var p=[],g=0,m=0,y={},v=function(t){return r.getFromCache(t,s,y,f)},b=Array.from(h).reduce((function(t,e){return t+v(e)}),0),x=Array.from(t),w=0;w<x.length;w++){var M=x[w],O=t[w-1],E=t[w+1],k=v(M);if(this.isNewline(M)){if(++g>=l){e.isOverflowing=!0;break}m=0,p[g]=""}else{if(m>0&&m+k>d){if(g+1>=l){if(e.isOverflowing=!0,b>0&&b<=d){for(var S=p[g].length,A=0,_=S,T=0;T<S;T++){var P=v(p[g][T]);if(A+P+b>d){_=T;break}A+=P}p[g]=(p[g]||"").slice(0,_)+h}break}if(m=0,p[++g]="",this.isBreakingSpace(M))continue;this.canBreakInLastChar(M)||(p=this.trimToBreakable(p),m=this.sumTextWidthByCache(p[g]||"",y)),this.shouldBreakByKinsokuShorui(M,E)&&(p=this.trimByKinsokuShorui(p),m+=v(O||""))}m+=k,p[g]=(p[g]||"")+M}}return p.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&Sp.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&Sp.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=Ne([],Ce(t),!1),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+1,a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(o,n.length),e[e.length-2]=n.slice(0,a),e},t.prototype.canBreakInLastChar=function(t){return!t||!Ap.test(t)},t.prototype.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},t.prototype.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!Ap.test(t[e]))return e;return-1},t.prototype.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),Cp={},Np=(Mp=new np,Op=new ep,(wp={})[cu.CIRCLE]=new Kh,wp[cu.ELLIPSE]=new Qh,wp[cu.RECT]=Mp,wp[cu.IMAGE]=Mp,wp[cu.GROUP]=new ip,wp[cu.LINE]=new Jh,wp[cu.TEXT]=new rp(Cp),wp[cu.POLYLINE]=Op,wp[cu.POLYGON]=Op,wp[cu.PATH]=new tp,wp[cu.HTML]=null,wp[cu.MESH]=null,wp),Lp=function(){var t,e=new eh,n=new ih;return(t={})[Tf.PERCENTAGE]=null,t[Tf.NUMBER]=new ch,t[Tf.ANGLE]=new Jd,t[Tf.DEFINED_PATH]=new th,t[Tf.PAINT]=e,t[Tf.COLOR]=e,t[Tf.FILTER]=new nh,t[Tf.LENGTH]=n,t[Tf.LENGTH_PERCENTAGE]=n,t[Tf.LENGTH_PERCENTAGE_12]=new oh,t[Tf.LENGTH_PERCENTAGE_14]=new ah,t[Tf.COORDINATE]=new ih,t[Tf.OFFSET_DISTANCE]=new lh,t[Tf.OPACITY_VALUE]=new uh,t[Tf.PATH]=new fh,t[Tf.LIST_OF_POINTS]=new dh,t[Tf.SHADOW_BLUR]=new hh,t[Tf.TEXT]=new ph,t[Tf.TEXT_TRANSFORM]=new gh,t[Tf.TRANSFORM]=new qh,t[Tf.TRANSFORM_ORIGIN]=new Xh,t[Tf.Z_INDEX]=new Zh,t[Tf.MARKER]=new sh,t}();Cp.CameraContribution=qu,Cp.AnimationTimeline=null,Cp.EasingFunction=null,Cp.offscreenCanvasCreator=new pp,Cp.sceneGraphSelector=new vp,Cp.sceneGraphService=new kp(Cp),Cp.textService=new Pp(Cp),Cp.geometryUpdaterFactory=Np,Cp.CSSPropertySyntaxFactory=Lp,Cp.styleValueRegistry=new Qd(Cp),Cp.layoutRegistry=null,Cp.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==Yc?Yc:{},Cp.enableCSSParsing=!1,Cp.enableDataset=!1,Cp.enableStyleSyntax=!0,Cp.enableAttributeDashCased=!1,Cp.enableSizeAttenuation=!1;var jp=0,Rp=new bp(gp.INSERTED,null,"","","",0,"",""),Ip=new bp(gp.REMOVED,null,"","","",0,"",""),Bp=new up(gp.DESTROY),Dp=function(t){function e(){var e=t.call(this)||this;return e.entity=jp++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.cullable={strategy:mf.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},e.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},e.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},e.rBushNode={aabb:void 0},e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.destroyed=!1,e.style={},e.computedStyle=Cp.enableCSSParsing?{opacity:xf,fillOpacity:xf,strokeOpacity:xf,fill:xf,stroke:xf,transform:xf,transformOrigin:xf,visibility:xf,pointerEvents:xf,lineWidth:xf,lineCap:xf,lineJoin:xf,increasedLineWidthForHitTesting:xf,fontSize:xf,fontFamily:xf,fontStyle:xf,fontWeight:xf,fontVariant:xf,textAlign:xf,textBaseline:xf,textTransform:xf,zIndex:xf,filter:xf,shadowType:xf}:null,e.parsedStyle={},e.attributes={},e}return Ee(e,t),Object.defineProperty(e.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"classList",{get:function(){return this.className.split(" ").filter((function(t){return""!==t}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(t){throw new Error(Fu)},e.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return Cp.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),this.isMutationObserved&&(Rp.relatedNode=this,t.dispatchEvent(Rp)),t},e.prototype.insertBefore=function(t,e){if(e){t.parentElement&&t.parentElement.removeChild(t);var n=this.childNodes.indexOf(e);-1===n?this.appendChild(t):this.appendChild(t,n)}else this.appendChild(t);return t},e.prototype.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},e.prototype.removeChild=function(t){var e;return Ip.relatedNode=this,t.dispatchEvent(Ip),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),Cp.sceneGraphService.detach(t),t},e.prototype.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}},e.prototype.destroyChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},e.prototype.matches=function(t){return Cp.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return Cp.sceneGraphService.querySelector("#".concat(t),this)},e.prototype.getElementsByName=function(t){return Cp.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},e.prototype.getElementsByClassName=function(t){return Cp.sceneGraphService.querySelectorAll(".".concat(t),this)},e.prototype.getElementsByTagName=function(t){return Cp.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return Cp.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return Cp.sceneGraphService.querySelectorAll(t,this)},e.prototype.closest=function(t){var e=this;do{if(Cp.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},e.prototype.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},e.prototype.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},e.prototype.after=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this);e.forEach((function(e,n){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(e,r+n+1)}))}},e.prototype.before=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this.parentNode){var r=this.parentNode.childNodes.indexOf(this),i=Ce(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,Ne([],Ce(a),!1))}},e.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,Ne([],Ce(t),!1)),this.remove()},e.prototype.append=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e){return t.appendChild(e)}))},e.prototype.prepend=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];e.forEach((function(e,n){return t.appendChild(e,n)}))},e.prototype.replaceChildren=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,Ne([],Ce(t),!1))},e.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.prototype.destroy=function(){this.dispatchEvent(Bp),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return Cp.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return Cp.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return Cp.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return Cp.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return Cp.sceneGraphService.getBoundingClientRect(this)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},e.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},e.prototype.getAttribute=function(t){if(function(t){return"symbol"==typeof t}(t))return Cp.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){if(Cp.enableAttributeDashCased){var n=ff(t);e=this.attributes[n]}return Cp.enableCSSParsing&&v(e)?null:e}return e},e.prototype.hasAttribute=function(t){return this.getAttributeNames().includes(t)},e.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},e.prototype.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},e.prototype.setAttribute=function(t,e,n,r){this.attributes[t]=e},e.prototype.getAttributeNS=function(t,e){throw new Error(Fu)},e.prototype.getAttributeNode=function(t){throw new Error(Fu)},e.prototype.getAttributeNodeNS=function(t,e){throw new Error(Fu)},e.prototype.hasAttributeNS=function(t,e){throw new Error(Fu)},e.prototype.removeAttributeNS=function(t,e){throw new Error(Fu)},e.prototype.removeAttributeNode=function(t){throw new Error(Fu)},e.prototype.setAttributeNS=function(t,e,n){throw new Error(Fu)},e.prototype.setAttributeNode=function(t){throw new Error(Fu)},e.prototype.setAttributeNodeNS=function(t){throw new Error(Fu)},e.prototype.toggleAttribute=function(t,e){throw new Error(Fu)},e}(dp);function Fp(t){return!!(null==t?void 0:t.nodeName)}var zp,Gp=Cp.globalThis.Proxy?Cp.globalThis.Proxy:function(){},Wp=new bp(gp.ATTR_MODIFIED,null,null,null,null,bp.MODIFICATION,null,null),$p={opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Hp={fill:kf,stroke:kf,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Vp=Ne(Ne([],Ce(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),Yp="data-",Up=function(t){function e(e){var n=t.call(this)||this;return n.isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=e,n.id=n.config.id||"",n.name=n.config.name||"",(n.config.className||n.config.class)&&(n.className=n.config.className||n.config.class),n.nodeName=n.config.type||cu.GROUP,Cp.enableCSSParsing?(Object.assign(n.attributes,$p),Object.assign(n.parsedStyle,Hp,n.config.initialParsedStyle)):n.config.initialParsedStyle&&Object.assign(n.parsedStyle,n.config.initialParsedStyle),n.initAttributes(n.config.style),Cp.enableDataset&&(n.dataset=new Gp({},{get:function(t,e){var r="".concat(Yp).concat(cf(e));return void 0!==t[r]?t[r]:n.getAttribute(r)},set:function(t,e,r){return n.setAttribute("".concat(Yp).concat(cf(e)),r),!0}})),Cp.enableStyleSyntax&&(n.style=new Gp({setProperty:function(t,e){n.setAttribute(t,e)},getPropertyValue:function(t){return n.getAttribute(t)},removeProperty:function(t){n.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:n.getAttribute(e)},set:function(t,e,r){return n.setAttribute(e,r),!0}})),n}return Ee(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},e.prototype.cloneNode=function(t,e){var n=ke({},this.attributes);for(var r in n){var i=n[r];Fp(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return o.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);o.appendChild(n)}})),o},e.prototype.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable,n={forceUpdateGeometry:!0};Cp.enableCSSParsing&&(n.usedAttributes=Vp);var r=t;if(Cp.enableAttributeDashCased)for(var i in r={},t){r[ff(i)]=t[i]}Cp.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},e.prototype.setAttribute=function(e,n,r,i){void 0===r&&(r=!1),void 0===i&&(i=!0),Cp.enableAttributeDashCased&&(e=ff(e)),V(n)||(r||n!==this.attributes[e])&&(this.internalSetAttribute(e,n,{memoize:i}),t.prototype.setAttribute.call(this,e,n))},e.prototype.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];Cp.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(Wp.relatedNode=this,Wp.prevValue=o,Wp.newValue=e,Wp.attrName=t,Wp.prevParsedValue=a,Wp.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(Wp):(Wp.target=this,this.ownerDocument.defaultView.dispatchEvent(Wp,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},e.prototype.getBBox=function(){var t=this.getBounds(),e=Ce(t.getMin(),2),n=e[0],r=e[1],i=Ce(t.getMax(),2),o=i[0],a=i[1];return new Du(n,r,o-n,a-r)},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Cp.sceneGraphService.setOrigin(this,vu(t,e,n)),this},e.prototype.getOrigin=function(){return Cp.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Cp.sceneGraphService.setPosition(this,vu(t,e,n)),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Cp.sceneGraphService.setLocalPosition(this,vu(t,e,n)),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Cp.sceneGraphService.translate(this,vu(t,e,n)),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Cp.sceneGraphService.translateLocal(this,vu(t,e,n)),this},e.prototype.getPosition=function(){return Cp.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return Cp.sceneGraphService.getLocalPosition(this)},e.prototype.scale=function(t,e,n){return this.scaleLocal(t,e,n)},e.prototype.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=vu(t,e=e||t,n=n||t)),Cp.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=vu(t,e=e||t,n=n||t)),Cp.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return Cp.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return Cp.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){return xu(Ce(wu(qt(),Cp.sceneGraphService.getWorldTransform(this)),3)[2])},e.prototype.getLocalEulerAngles=function(){return xu(Ce(wu(qt(),Cp.sceneGraphService.getLocalRotation(this)),3)[2])},e.prototype.setEulerAngles=function(t){return Cp.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return Cp.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return v(e)&&v(n)?Cp.sceneGraphService.rotateLocal(this,0,0,t):Cp.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return v(e)&&v(n)?Cp.sceneGraphService.rotate(this,0,0,t):Cp.sceneGraphService.rotate(this,t,e,n),this},e.prototype.setRotation=function(t,e,n,r){return Cp.sceneGraphService.setRotation(this,t,e,n,r),this},e.prototype.setLocalRotation=function(t,e,n,r){return Cp.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.prototype.setLocalSkew=function(t,e){return Cp.sceneGraphService.setLocalSkew(this,t,e),this},e.prototype.getRotation=function(){return Cp.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return Cp.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return Cp.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return Cp.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return Cp.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(t){return Cp.sceneGraphService.setLocalTransform(this,t),this},e.prototype.resetLocalTransform=function(){Cp.sceneGraphService.resetLocalTransform(this)},e.prototype.getAnimations=function(){return this.activeAnimations},e.prototype.animate=function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null},e.prototype.isVisible=function(){var t,e;return Cp.enableCSSParsing?"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility):"hidden"!==(null===(e=this.parsedStyle)||void 0===e?void 0:e.visibility)},Object.defineProperty(e.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"},enumerable:!1,configurable:!0}),e.prototype.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},e.prototype.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},e.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,Ne([],Ce(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))+1),this},e.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,Ne([],Ce(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))),!1))-1),this},e.prototype.getConfig=function(){return this.config},e.prototype.attr=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=Ce(e,2),i=r[0],o=r[1];return i?M(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===e.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},e.prototype.getMatrix=function(t){var e=t||this.getWorldTransform(),n=Ce(Lt(qt(),e),2),r=n[0],i=n[1],o=Ce(jt(qt(),e),2),a=o[0],s=o[1],c=Rt(pe(),e),l=Ce(wu(qt(),c),3),u=l[0],f=l[2];return Mu(u||f,r,i,a,s)},e.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.prototype.setMatrix=function(t){var e=Ce(Ou(t),5),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4];this.setEulerAngles(a).setPosition(n,r).setLocalScale(i,o)},e.prototype.setLocalMatrix=function(t){var e=Ce(Ou(t),5),n=e[0],r=e[1],i=e[2],o=e[3],a=e[4];this.setLocalEulerAngles(a).setLocalPosition(n,r).setLocalScale(i,o)},e.prototype.show=function(){Cp.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},e.prototype.hide=function(){Cp.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))},e.prototype.getCount=function(){return this.childElementCount},e.prototype.getParent=function(){return this.parentElement},e.prototype.getChildren=function(){return this.children},e.prototype.getFirst=function(){return this.firstElementChild},e.prototype.getLast=function(){return this.lastElementChild},e.prototype.getChildByIndex=function(t){return this.children[t]||null},e.prototype.add=function(t,e){return this.appendChild(t,e)},e.prototype.set=function(t,e){this.config[t]=e},e.prototype.get=function(t){return this.config[t]},e.prototype.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},e.prototype.setZIndex=function(t){return this.style.zIndex=t,this},e}(Dp),qp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,ke({type:cu.CIRCLE},e))||this}return Ee(e,t),e}(Up),Xp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Se(e,["style"]);return(n=t.call(this,ke({style:(Cp.enableCSSParsing,ke({},r))},i))||this).isCustomElement=!0,n}return Ee(e,t),e}(Up),Zp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,ke({type:cu.ELLIPSE},e))||this}return Ee(e,t),e}(Up),Kp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,ke({type:cu.GROUP},e))||this}return Ee(e,t),e}(Up),Qp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Se(e,["style"]);return(n=t.call(this,ke({type:cu.HTML,style:Cp.enableCSSParsing?ke({x:"",y:"",width:"auto",height:"auto",innerHTML:""},r):ke({},r)},i))||this).cullable.enable=!1,n}return Ee(e,t),e.prototype.getDomElement=function(){return this.parsedStyle.$el},e.prototype.getBoundingClientRect=function(){if(this.parsedStyle.$el)return this.parsedStyle.$el.getBoundingClientRect();var t=this.parsedStyle,e=t.x,n=t.y,r=t.width,i=t.height;return new Du(e,n,r,i)},e.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},e.prototype.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(e=null===(t=this.ownerDocument)||void 0===t?void 0:t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect(),i=new Cu,o=n.left-((null==r?void 0:r.left)||0),a=n.top-((null==r?void 0:r.top)||0);return i.setMinMax([o,a,0],[o+n.width,a+n.height,0]),i},e.prototype.getLocalBounds=function(){if(this.parentNode){var t=bt(ht(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Cu.isEmpty(e)){var n=new Cu;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(Up),Jp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,ke({type:cu.IMAGE},e))||this}return Ee(e,t),e}(Up),tg=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Se(e,["style"]);(n=t.call(this,ke({type:cu.LINE,style:ke({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i))||this).markerStartAngle=0,n.markerEndAngle=0;var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd;return a&&Fp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),s&&Fp(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return Ee(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Fp(r)&&(this.markerStartAngle=0,r.remove()),i&&Fp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Fp(r)&&(this.markerEndAngle=0,r.remove()),i&&Fp(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.x1,s=e.x2,c=e.y1,l=e.y2,u=t?n:r;if(u&&Fp(u)){var f,d,h,p,g,m,y;t?(p=a,g=c,d=s-a,h=l-c,m=i||0,y=this.markerStartAngle):(p=s,g=l,d=a-s,h=c-l,m=o||0,y=this.markerEndAngle),f=Math.atan2(h,d),u.setLocalEulerAngles(180*f/Math.PI+y),u.setLocalPosition(p+Math.cos(f)*m,g+Math.sin(f)*m)}},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=Zl(n.x1,n.y1,n.x2,n.y2,t),i=r.x,o=r.y,a=se(qt(),Kt(i,o,0),e?this.getWorldTransform():this.getLocalTransform());return new Bu(a[0],a[1])},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getTotalLength=function(){var t=this.parsedStyle;return Xl(t.x1,t.y1,t.x2,t.y2)},e}(Up),eg=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Se(e,["style"]);(n=t.call(this,ke({type:cu.PATH,style:Cp.enableCSSParsing?ke({d:"",miterLimit:""},r):ke({},r),initialParsedStyle:Cp.enableCSSParsing?null:{miterLimit:4,d:ke({},Pf)}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&Fp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&Fp(c)&&n.placeMarkerMid(c),s&&Fp(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return Ee(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Fp(r)&&(this.markerStartAngle=0,r.remove()),i&&Fp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Fp(r)&&(this.markerEndAngle=0,r.remove()),i&&Fp(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=t?n:r;if(a&&Fp(a)){var s,c,l,u,f,d,h;if(t){var p=Ce(this.getStartTangent(),2),g=p[0];u=(m=p[1])[0],f=m[1],c=g[0]-m[0],l=g[1]-m[1],d=i||0,h=this.markerStartAngle}else{var m,y=Ce(this.getEndTangent(),2);g=y[0];u=(m=y[1])[0],f=m[1],c=g[0]-m[0],l=g[1]-m[1],d=o||0,h=this.markerEndAngle}s=Math.atan2(l,c),a.setLocalEulerAngles(180*s/Math.PI+h),a.setLocalPosition(u+Math.cos(s)*d,f+Math.sin(s)*d)}},e.prototype.placeMarkerMid=function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&Fp(t))for(var n=1;n<e.length-1;n++){var r=Ce(e[n].currentPoint,2),i=r[0],o=r[1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(i,o)}},e.prototype.getTotalLength=function(){return fd(this)},e.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=function(t,e,n){return pn(t,e,ke(ke({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,o=se(qt(),Kt(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new Bu(o[0],o[1])},e.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*fd(this),e)},e.prototype.getStartTangent=function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},e}(Up),ng=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Se(e,["style"]);(n=t.call(this,ke({type:cu.POLYGON,style:Cp.enableCSSParsing?ke({points:"",miterLimit:"",isClosed:!0},r):ke({},r),initialParsedStyle:Cp.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&Fp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&Fp(c)&&n.placeMarkerMid(c),s&&Fp(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return Ee(e,t),e.prototype.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&Fp(r)&&(this.markerStartAngle=0,r.remove()),i&&Fp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Fp(r)&&(this.markerEndAngle=0,r.remove()),i&&Fp(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},e.prototype.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=(e.points||{}).points,s=t?n:r;if(s&&Fp(s)&&a){var c,l,u,f,d,h,p;if(f=a[0][0],d=a[0][1],t)l=a[1][0]-a[0][0],u=a[1][1]-a[0][1],h=i||0,p=this.markerStartAngle;else{var g=a.length;this.parsedStyle.isClosed?(l=a[g-1][0]-a[0][0],u=a[g-1][1]-a[0][1]):(f=a[g-1][0],d=a[g-1][1],l=a[g-2][0]-a[g-1][0],u=a[g-2][1]-a[g-1][1]),h=o||0,p=this.markerEndAngle}c=Math.atan2(u,l),s.setLocalEulerAngles(180*c/Math.PI+p),s.setLocalPosition(f+Math.cos(c)*h,d+Math.sin(c)*h)}},e.prototype.placeMarkerMid=function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&Fp(t)&&e)for(var n=1;n<(this.parsedStyle.isClosed?e.length:e.length-1);n++){var r=e[n][0],i=e[n][1],o=1===n?t:t.cloneNode(!0);this.markerMidList.push(o),this.appendChild(o),o.setLocalPosition(r,i)}},e}(Up),rg=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Se(e,["style"]);return t.call(this,ke({type:cu.POLYLINE,style:Cp.enableCSSParsing?ke({points:"",miterLimit:"",isClosed:!1},n):ke({},n),initialParsedStyle:Cp.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r))||this}return Ee(e,t),e.prototype.getTotalLength=function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=nu(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t},e.prototype.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var r,i,o=[],a=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=Xl(t[0],t[1],n[e+1][0],n[e+1][1]),a+=i,r[1]=a/s,o.push(r))})),this.parsedStyle.points.segments=o}var c=0,l=0;this.parsedStyle.points.segments.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(c=(t-e[0])/(e[1]-e[0]),l=n)}));var u=Zl(n[l][0],n[l][1],n[l+1][0],n[l+1][1],c),f=u.x,d=u.y,h=se(qt(),Kt(f,d,0),e?this.getWorldTransform():this.getLocalTransform());return new Bu(h[0],h[1])},e.prototype.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},e.prototype.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},e}(ng),ig=function(t){function e(e){return void 0===e&&(e={}),t.call(this,ke({type:cu.RECT},e))||this}return Ee(e,t),e}(Up),og=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Se(e,["style"]);return t.call(this,ke({type:cu.TEXT,style:Cp.enableCSSParsing?ke({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},n):ke({fill:"black"},n)},r))||this}return Ee(e,t),e.prototype.getComputedTextLength=function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},e.prototype.getLineBoundingRects=function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},e.prototype.isOverflowing=function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing},e}(Up),ag=function(){function t(){this.registry={},this.define(cu.CIRCLE,qp),this.define(cu.ELLIPSE,Zp),this.define(cu.RECT,ig),this.define(cu.IMAGE,Jp),this.define(cu.LINE,tg),this.define(cu.GROUP,Kp),this.define(cu.PATH,eg),this.define(cu.POLYGON,ng),this.define(cu.POLYLINE,rg),this.define(cu.TEXT,og),this.define(cu.HTML,Qp)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),sg=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;Cp.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},cg=function(t){function e(){var e=t.call(this)||this;e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new Cp.AnimationTimeline(e)}catch(t){}var n={};return qd.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=lf(i)?i(cu.GROUP):i)})),e.documentElement=new Kp({id:"g-root",style:n}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return Ee(e,t),Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),e.prototype.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?og:Kp);var r=new n(e);return r.ownerDocument=this,r},e.prototype.createElementNS=function(t,e,n){return this.createElement(e,n)},e.prototype.cloneNode=function(t){throw new Error(Fu)},e.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}},e.prototype.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,r=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!r||r&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},e.prototype.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return null;var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f&&f[0]||this.documentElement},e.prototype.elementFromPoint=function(t,e){return _e(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return Te(this,(function(d){switch(d.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,r<0||i<0||r>a||i>s?[2,null]:(c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]})]);case 1:return[2,(f=d.sent().picked)&&f[0]||this.documentElement]}}))}))},e.prototype.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height;if(r<0||i<0||r>a||i>s)return[];var c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,f=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]}).picked;return f[f.length-1]!==this.documentElement&&f.push(this.documentElement),f},e.prototype.elementsFromPoint=function(t,e){return _e(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return Te(this,(function(d){switch(d.label){case 0:return n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig(),a=o.width,s=o.height,r<0||i<0||r>a||i>s?[2,[]]:(c=this.defaultView.viewport2Client({x:r,y:i}),l=c.x,u=c.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:l,clientY:u},picked:[]})]);case 1:return(f=d.sent().picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),[2,f]}}))}))},e.prototype.appendChild=function(t,e){throw new Error(zu)},e.prototype.insertBefore=function(t,e){throw new Error(zu)},e.prototype.removeChild=function(t,e){throw new Error(zu)},e.prototype.replaceChild=function(t,e,n){throw new Error(zu)},e.prototype.append=function(){throw new Error(zu)},e.prototype.prepend=function(){throw new Error(zu)},e.prototype.getElementById=function(t){return this.documentElement.getElementById(t)},e.prototype.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},e.prototype.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},e.prototype.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},e.prototype.querySelector=function(t){return this.documentElement.querySelector(t)},e.prototype.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},e.prototype.find=function(t){return this.documentElement.find(t)},e.prototype.findAll=function(t){return this.documentElement.findAll(t)},e}(dp),lg=function(){function t(t){this.strategies=t}return t.prototype.apply=function(e){var n=e.camera,r=e.renderingService,i=e.renderingContext,o=this.strategies;r.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return 0===o.length?e.visible=i.unculledEntities.indexOf(t.entity)>-1:e.visible=o.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new up(gp.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="Culling",t}(),ug=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new cp(null),this.rootWheelEvent=new lp(null),this.onPointerMove=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView;if(!a.supportsTouchEvents||"touch"!==e.pointerType){var s=t.normalizeToPointerEvent(e,a);try{for(var c=Pe(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=t.bootstrapEvent(t.rootPointerEvent,u,a,e);t.context.eventService.mapEvent(f)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(e){var n,r,i,o,a=null===(o=null===(i=t.context.renderingContext.root)||void 0===i?void 0:i.ownerDocument)||void 0===o?void 0:o.defaultView,s=t.normalizeToPointerEvent(e,a);try{for(var c=Pe(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=t.bootstrapEvent(t.rootPointerEvent,u,a,e);t.context.eventService.mapEvent(f)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}t.setCursor(t.context.eventService.cursor)}}return t.prototype.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&o[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();try{for(var a=Pe(o),s=a.next();!s.done;s=a.next()){var c=s.value,l=n.bootstrapEvent(n.rootPointerEvent,c,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){var e,r;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var o=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(o,t)?"":"outside",s=n.normalizeToPointerEvent(t,i);try{for(var c=Pe(s),l=c.next();!l.done;l=c.next()){var u=l.value,f=n.bootstrapEvent(n.rootPointerEvent,u,i,t);f.type+=a,n.context.eventService.mapEvent(f)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove),r.hooks.click.tap(t.tag,this.onClick),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r,o=n.normalizeToPointerEvent(t,i);try{for(var a=Pe(o),s=a.next();!s.done;s=a.next()){var c=s.value,l=n.bootstrapEvent(n.rootPointerEvent,c,i,t);n.context.eventService.mapEvent(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n.setCursor(n.context.eventService.cursor)}))},t.prototype.bootstrapEvent=function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),o=i.x,a=i.y;t.viewport.x=o,t.viewport.y=a;var s=this.context.eventService.viewport2Canvas(t.viewport),c=s.x,l=s.y;return t.canvas.x=c,t.canvas.y=l,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Oh[t.type]||t.type),t},t.prototype.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var o=this.context.eventService.viewport2Canvas(e.viewport),a=o.x,s=o.y;return e.canvas.x=a,e.canvas.y=s,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},t.prototype.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=Eh.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},t.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},t.prototype.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];V(i.button)&&(i.button=0),V(i.buttons)&&(i.buttons=1),V(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),V(i.width)&&(i.width=i.radiusX||1),V(i.height)&&(i.height=i.radiusY||1),V(i.tiltX)&&(i.tiltX=0),V(i.tiltY)&&(i.tiltY=0),V(i.pointerType)&&(i.pointerType="touch"),V(i.pointerId)&&(i.pointerId=i.identifier||0),V(i.pressure)&&(i.pressure=i.force||.5),V(i.twist)&&(i.twist=0),V(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;V(o.isPrimary)&&(o.isPrimary=!0),V(o.width)&&(o.width=1),V(o.height)&&(o.height=1),V(o.tiltX)&&(o.tiltX=0),V(o.tiltY)&&(o.tiltY=0),V(o.pointerType)&&(o.pointerType="mouse"),V(o.pointerId)&&(o.pointerId=1),V(o.pressure)&&(o.pressure=.5),V(o.twist)&&(o.twist=0),V(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),fg=[cu.CIRCLE,cu.ELLIPSE,cu.IMAGE,cu.RECT,cu.LINE,cu.POLYLINE,cu.POLYGON,cu.TEXT,cu.PATH,cu.HTML],dg=function(){function t(){}return t.prototype.isVisible=function(t,e){var n,r,i=e.cullable;if(!i.enable)return!0;var o=e.getRenderBounds();if(Cu.isEmpty(o))return!1;var a=t.getFrustum(),s=null===(r=null===(n=e.parentNode)||void 0===n?void 0:n.cullable)||void 0===r?void 0:r.visibilityPlaneMask;return i.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,o,s||Pu.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==Pu.OUTSIDE,i.visible},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Pu.OUTSIDE||n===Pu.INSIDE)return n;for(var i=Pu.INSIDE,o=fg.indexOf(t.nodeName)>-1,a=0,s=r.length;a<s;++a){var c=1<<a;if(n&c&&(!o||4!==a&&5!==a)){var l=r[a],u=l.normal,f=l.distance;if(ie(u,e.getPositiveFarPoint(r[a]))+f<0)return Pu.OUTSIDE;ie(u,e.getNegativeFarPoint(r[a]))+f<0&&(i|=c)}}return i},t}(),hg=function(){function t(){this.toSync=new Set,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return t.prototype.apply=function(e){var n,r=this,i=e.renderingService,o=e.renderingContext,a=e.rBushRoot,s=o.root.ownerDocument.defaultView;this.rBush=a;var c=function(t){t.target.renderable.dirty=!0,i.dirtify()},l=function(t){var e=t.detail.affectChildren,n=t.target;e&&n.forEach((function(t){r.toSync.add(t)}));for(var o=n;o;)o.renderable&&r.toSync.add(o),o=o.parentElement;i.dirtify()},u=function(t){var e=t.target;Cp.enableSizeAttenuation&&Cp.styleValueRegistry.updateSizeAttenuation(e,s.getCamera().getZoom()),Cp.enableCSSParsing&&Cp.styleValueRegistry.recalc(e),Cp.sceneGraphService.dirtifyToRoot(e),i.dirtify()},f=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.toSync.delete(e),Cp.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(t.tag,(function(){s.addEventListener(gp.MOUNTED,u),s.addEventListener(gp.UNMOUNTED,f),s.addEventListener(gp.ATTR_MODIFIED,c),s.addEventListener(gp.BOUNDS_CHANGED,l)})),i.hooks.destroy.tap(t.tag,(function(){s.removeEventListener(gp.MOUNTED,u),s.removeEventListener(gp.UNMOUNTED,f),s.removeEventListener(gp.ATTR_MODIFIED,c),s.removeEventListener(gp.BOUNDS_CHANGED,l),r.toSync.clear()}));var d=null!==(n=Cp.globalThis.requestIdleCallback)&&void 0!==n?n:Rh.bind(Cp.globalThis);i.hooks.endFrame.tap(t.tag,(function(){r.isFirstTimeRendering?(r.isFirstTimeRendering=!1,r.syncing=!0,d((function(){r.syncRTree(!0),r.isFirstTimeRenderingFinished=!0}))):r.syncRTree()}))},t.prototype.syncRTree=function(t){var e=this;if(void 0===t&&(t=!1),t||!this.syncing&&0!==this.toSync.size){this.syncing=!0;var n=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(r){var i=r.rBushNode;i&&i.aabb&&e.rBush.remove(i.aabb);var o=r.getRenderBounds();if(o){var a=r.renderable;t&&(a.dirtyRenderBounds||(a.dirtyRenderBounds=new Cu),a.dirtyRenderBounds.update(o.center,o.halfExtents));var s=Ce(o.getMin(),2),c=s[0],l=s[1],u=Ce(o.getMax(),2),f=u[0],d=u[1];i.aabb||(i.aabb={}),i.aabb.displayObject=r,i.aabb.minX=c,i.aabb.minY=l,i.aabb.maxX=f,i.aabb.maxY=d}i.aabb&&(isNaN(i.aabb.maxX)||isNaN(i.aabb.maxX)||isNaN(i.aabb.minX)||isNaN(i.aabb.minY)||n.push(i.aabb))})),this.rBush.load(n),n.length=0,this.toSync.clear(),this.syncing=!1}},t.tag="Prepare",t}();!function(t){t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged"}(zp||(zp={}));var pg=new up(gp.MOUNTED),gg=new up(gp.UNMOUNTED),mg=new up(zp.BEFORE_RENDER),yg=new up(zp.RERENDER),vg=new up(zp.AFTER_RENDER),bg=function(t){function e(e){var n=t.call(this)||this;n.Element=Up,n.inited=!1,n.context={},n.document=new cg,n.document.defaultView=n,n.customElements=new ag;var r=e.container,i=e.canvas,o=e.offscreenCanvas,a=e.width,s=e.height,c=e.devicePixelRatio,l=e.renderer,u=e.background,f=e.cursor,d=e.document,h=e.requestAnimationFrame,p=e.cancelAnimationFrame,g=e.createImage,m=e.supportsPointerEvents,y=e.supportsTouchEvents,v=e.supportsCSSTransform,b=e.supportsMutipleCanvasesInOneContainer,x=e.useNativeClickEvent,w=e.alwaysTriggerPointerEventOnCanvas,M=e.isTouchEvent,O=e.isMouseEvent;b||function(t,e){if(t){var n="string"==typeof t?t:t.id||yh++;mh[n]&&mh[n].destroy(),mh[n]=e}}(r,n);var E=a,k=s,S=c;return i&&(S=(S=c||vh&&window.devicePixelRatio||1)>=1?Math.ceil(S):1,E=a||function(t){var e=Mh(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/S,k=s||function(t){var e=Mh(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/S),o&&(Cp.offscreenCanvas=o),n.devicePixelRatio=S,n.requestAnimationFrame=null!=h?h:Rh.bind(Cp.globalThis),n.cancelAnimationFrame=null!=p?p:Ih.bind(Cp.globalThis),n.supportsTouchEvents=null!=y?y:"ontouchstart"in Cp.globalThis,n.supportsPointerEvents=null!=m?m:!!Cp.globalThis.PointerEvent,n.isTouchEvent=null!=M?M:function(t){return n.supportsTouchEvents&&t instanceof Cp.globalThis.TouchEvent},n.isMouseEvent=null!=O?O:function(t){return!Cp.globalThis.MouseEvent||t instanceof Cp.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Cp.globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:E,height:k,renderer:l,offscreenCanvas:o,devicePixelRatio:S,cursor:f||"default",background:u||"transparent",createImage:g,document:d,supportsCSSTransform:v,useNativeClickEvent:x,alwaysTriggerPointerEventOnCanvas:w}),n.initDefaultCamera(E,k,l.clipSpaceNearZ),n.initRenderer(l,!0),n}return Ee(e,t),e.prototype.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},e.prototype.initDefaultCamera=function(t,e,n){var r=this,i=new Cp.CameraContribution;i.clipSpaceNearZ=n,i.setType(Lu.EXPLORING,ju.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(Yu,(function(){r.context.renderingContext.renderReasons.add(op.CAMERA_CHANGED),Cp.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()})),this.context.camera=i},e.prototype.updateSizeAttenuation=function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){Cp.styleValueRegistry.updateSizeAttenuation(e,t)}))},e.prototype.getConfig=function(){return this.context.config},e.prototype.getRoot=function(){return this.document.documentElement},e.prototype.getCamera=function(){return this.context.camera},e.prototype.getContextService=function(){return this.context.contextService},e.prototype.getEventService=function(){return this.context.eventService},e.prototype.getRenderingService=function(){return this.context.renderingService},e.prototype.getRenderingContext=function(){return this.context.renderingContext},e.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(e.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),e.prototype.destroy=function(t,e){(void 0===t&&(t=!0),void 0===e&&(e=!1),e||this.dispatchEvent(new up(zp.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new up(zp.AFTER_DESTROY))},e.prototype.changeSize=function(t,e){this.resize(t,e)},e.prototype.resize=function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var r=this.context.camera,i=r.getProjectionMode();r.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),i===Ru.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new up(zp.RESIZE,{width:t,height:e}))},e.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},e.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},e.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.prototype.render=function(t){var e=this;t&&(mg.detail=t,vg.detail=t),this.dispatchEvent(mg),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(yg)})),this.dispatchEvent(vg)},e.prototype.run=function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()},e.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new uu,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new ug,new hg,new lg([new dg])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(ke(ke({},Cp),this.context)),this.context.renderingService=new mp(Cp,this.context),this.context.eventService=new hp(Cp,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,e,!0)):this.context.contextService.initAsync().then((function(){n.initRenderingService(t,e)}))},e.prototype.initRenderingService=function(t,e,n){var r=this;void 0===e&&(e=!1),void 0===n&&(n=!1),this.context.renderingService.init((function(){r.inited=!0,e?(n?r.requestAnimationFrame((function(){r.dispatchEvent(new up(zp.READY))})):r.dispatchEvent(new up(zp.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new up(zp.RENDERER_CHANGED)),e||r.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),r.mountChildren(r.getRoot()),t.getConfig().enableAutoRendering&&r.run()}))},e.prototype.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(Cp)}))},e.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),Ne([],Ce(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy(Cp)})),this.initRenderer(t)}},e.prototype.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},e.prototype.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(gg):(gg.target=t,this.dispatchEvent(gg,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},e.prototype.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(pg):(pg.target=t,this.dispatchEvent(pg,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},e.prototype.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},e.prototype.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},e.prototype.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},e.prototype.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},e.prototype.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},e.prototype.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},e}(fp),xg=function(t){function e(){var e=t.apply(this,Ne([],Ce(arguments),!1))||this;return e.landmarks=[],e}return Ee(e,t),e.prototype.rotate=function(t,e,n){if(this.relElevation=yu(e),this.relAzimuth=yu(t),this.relRoll=yu(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Lu.EXPLORING){var r=ge(pe(),[1,0,0],bu((this.rotateWorld?1:-1)*this.relElevation)),i=ge(pe(),[0,1,0],bu((this.rotateWorld?1:-1)*this.relAzimuth)),o=ge(pe(),[0,0,1],bu(this.relRoll)),a=me(pe(),i,r);a=me(pe(),a,o);var s=Bt(ht(),a);Mt(this.matrix,this.matrix,[0,0,-this.distance]),wt(this.matrix,this.matrix,s),Mt(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===Lu.ORBITING||this.type===Lu.EXPLORING?this._getPosition():this.type===Lu.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(t,e){var n=vu(t,e,0),r=Xt(this.position);return te(r,r,ne(qt(),this.right,n[0])),te(r,r,ne(qt(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},e.prototype.dolly=function(t){var e=this.forward,n=Xt(this.position),r=this.dollyingStep,i=this.distance+t*this.dollyingStep;return r=Math.max(Math.min(i,this.maxDistance),this.minDistance)-this.distance,n[0]+=r*e[0],n[1]+=r*e[1],n[2]+=r*e[2],this._setPosition(n),this.type===Lu.ORBITING||this.type===Lu.EXPLORING?this._getDistance():this.type===Lu.TRACKING&&te(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this},e.prototype.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},e.prototype.createLandmark=function(t,e){var n,r,i,o;void 0===e&&(e={});var a=e.position,s=void 0===a?this.position:a,c=e.focalPoint,l=void 0===c?this.focalPoint:c,u=e.roll,f=e.zoom,d=new Cp.CameraContribution;d.setType(this.type,void 0),d.setPosition(s[0],null!==(n=s[1])&&void 0!==n?n:this.position[1],null!==(r=s[2])&&void 0!==r?r:this.position[2]),d.setFocalPoint(l[0],null!==(i=l[1])&&void 0!==i?i:this.focalPoint[1],null!==(o=l[2])&&void 0!==o?o:this.focalPoint[2]),d.setRoll(null!=u?u:this.roll),d.setZoom(null!=f?f:this.zoom);var h={name:t,matrix:pt(d.getWorldTransform()),right:Xt(d.right),up:Xt(d.up),forward:Xt(d.forward),position:Xt(d.getPosition()),focalPoint:Xt(d.getFocalPoint()),distanceVector:Xt(d.getDistanceVector()),distance:d.getDistance(),dollyingStep:d.getDollyingStep(),azimuth:d.getAzimuth(),elevation:d.getElevation(),roll:d.getRoll(),relAzimuth:d.relAzimuth,relElevation:d.relElevation,relRoll:d.relRoll,zoom:d.getZoom()};return this.landmarks.push(h),h},e.prototype.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=C(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=j(e)?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,c=void 0===s?100:s,l=i.easingFunction,u=void 0===l?void 0:l,f=i.onfinish,d=void 0===f?void 0:f,h=i.onframe,p=void 0===h?void 0:h;this.cancelLandmarkAnimation();var g,m=r.position,y=r.focalPoint,v=r.zoom,b=r.roll,x=u||Cp.EasingFunction(a),w=function(){n.setFocalPoint(y),n.setPosition(m),n.setRoll(b),n.setZoom(v),n.computeMatrix(),n.triggerUpdate(),null==d||d()};if(0===c)return w();var M=function(t){void 0===g&&(g=t);var e=t-g;if(e>=c)w();else{var r,i,o=x(e/c),a=qt(),s=qt();if(ae(a,n.focalPoint,y,o),ae(s,n.position,m,o),i=n.roll*(1-o)+b*o,r=n.zoom*(1-o)+v*o,n.setFocalPoint(a),n.setPosition(s),n.setRoll(i),n.setZoom(r),ue(a,y)+ue(s,m)<=.01&&null==v&&null==b)return w();n.computeMatrix(),n.triggerUpdate(),e<c&&(null==p||p(o),n.landmarkAnimationID=n.canvas.requestAnimationFrame(M))}};this.canvas.requestAnimationFrame(M)}},e}(qu);Cp.CameraContribution=xg;var wg=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return Ee(e,t),e}(ap),Mg=0,Og=function(){function t(t,e){var n;this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=e,this.id="".concat(Mg++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(n=this.effect)||void 0===n?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return Object.defineProperty(t.prototype,"pending",{get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"finished",{get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var e;t=Number(t),isNaN(t)||(this.timeline.restart(),this._paused||null===this._startTime||(this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"startTime",{get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isFinished",{get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_needsTick",{get:function(){return this.pending||"running"===this.playState||!this._finishedFlag},enumerable:!1,configurable:!0}),t.prototype.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},t.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},t.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},t.prototype.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},t.prototype.cancel=function(){var t=this;if(this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var e=new wg(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}},t.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},t.prototype.updatePlaybackRate=function(t){this.playbackRate=t},t.prototype.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},t.prototype.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},t.prototype.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},t.prototype.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},t.prototype.rewind=function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}},t.prototype.persist=function(){throw new Error(Fu)},t.prototype.addEventListener=function(t,e,n){throw new Error(Fu)},t.prototype.removeEventListener=function(t,e,n){throw new Error(Fu)},t.prototype.dispatchEvent=function(t){throw new Error(Fu)},t.prototype.commitStyles=function(){throw new Error(Fu)},t.prototype.ensureAlive=function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime)),this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},t.prototype.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},t.prototype.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new wg(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new wg(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),Eg=.1,kg="function"==typeof Float32Array,Sg=function(t,e){return 1-3*e+3*t},Ag=function(t,e){return 3*e-6*t},_g=function(t){return 3*t},Tg=function(t,e,n){return((Sg(e,n)*t+Ag(e,n))*t+_g(e))*t},Pg=function(t,e,n){return 3*Sg(e,n)*t*t+2*Ag(e,n)*t+_g(e)},Cg=function(t,e,n,r){if(!(0<=t&&t<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=kg?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=Tg(o*Eg,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=Eg;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*Eg,s=Pg(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=Pg(e,n,r);if(0===o)return e;e-=(Tg(e,n,r)-t)/o}return e}(e,a,t,n):0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=Tg(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&++s<10);return a}(e,r,r+Eg,t,n)};return function(t){return 0===t||1===t?t:Tg(a(t),e,r)}},Ng=function(t){return Math.pow(t,2)},Lg=function(t){return Math.pow(t,3)},jg=function(t){return Math.pow(t,4)},Rg=function(t){return Math.pow(t,5)},Ig=function(t){return Math.pow(t,6)},Bg=function(t){return 1-Math.cos(t*Math.PI/2)},Dg=function(t){return 1-Math.sqrt(1-t*t)},Fg=function(t){return t*t*(3*t-2)},zg=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},Gg=function(t,e){void 0===e&&(e=[]);var n=Ce(e,2),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?.5:o,s=L(Number(i),1,10),c=L(Number(a),.1,2);return 0===t||1===t?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-c/(2*Math.PI)*Math.asin(1/s))*(2*Math.PI)/c)},Wg=function(t,e,n){void 0===e&&(e=[]);var r=Ce(e,4),i=r[0],o=void 0===i?1:i,a=r[1],s=void 0===a?100:a,c=r[2],l=void 0===c?10:c,u=r[3],f=void 0===u?0:u;o=L(o,.1,1e3),s=L(s,.1,1e3),l=L(l,.1,1e3),f=L(f,.1,1e3);var d=Math.sqrt(s/o),h=l/(2*Math.sqrt(s*o)),p=h<1?d*Math.sqrt(1-h*h):0,g=h<1?(h*d-f)/p:-f+d,m=n?n*t/1e3:t;return m=h<1?Math.exp(-m*h*d)*(1*Math.cos(p*m)+g*Math.sin(p*m)):(1+g*m)*Math.exp(-m*d),0===t||1===t?t:1-m},$g=function(t,e){void 0===e&&(e=[]);var n=Ce(e,2),r=n[0],i=void 0===r?10:r;return("start"==n[1]?Math.ceil:Math.floor)(L(t,0,1)*i)/i},Hg=function(t,e){void 0===e&&(e=[]);var n=Ce(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return Cg(r,i,o,a)(t)},Vg=Cg(.42,0,1,1),Yg=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},Ug=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},qg=function(t){return function(e,n,r){return void 0===n&&(n=[]),e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},Xg={steps:$g,"step-start":function(t){return $g(t,[1,"start"])},"step-end":function(t){return $g(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Hg,ease:function(t){return Hg(t,[.25,.1,.25,1])},in:Vg,out:Yg(Vg),"in-out":Ug(Vg),"out-in":qg(Vg),"in-quad":Ng,"out-quad":Yg(Ng),"in-out-quad":Ug(Ng),"out-in-quad":qg(Ng),"in-cubic":Lg,"out-cubic":Yg(Lg),"in-out-cubic":Ug(Lg),"out-in-cubic":qg(Lg),"in-quart":jg,"out-quart":Yg(jg),"in-out-quart":Ug(jg),"out-in-quart":qg(jg),"in-quint":Rg,"out-quint":Yg(Rg),"in-out-quint":Ug(Rg),"out-in-quint":qg(Rg),"in-expo":Ig,"out-expo":Yg(Ig),"in-out-expo":Ug(Ig),"out-in-expo":qg(Ig),"in-sine":Bg,"out-sine":Yg(Bg),"in-out-sine":Ug(Bg),"out-in-sine":qg(Bg),"in-circ":Dg,"out-circ":Yg(Dg),"in-out-circ":Ug(Dg),"out-in-circ":qg(Dg),"in-back":Fg,"out-back":Yg(Fg),"in-out-back":Ug(Fg),"out-in-back":qg(Fg),"in-bounce":zg,"out-bounce":Yg(zg),"in-out-bounce":Ug(zg),"out-in-bounce":qg(zg),"in-elastic":Gg,"out-elastic":Yg(Gg),"in-out-elastic":Ug(Gg),"out-in-elastic":qg(Gg),spring:Wg,"spring-in":Wg,"spring-out":Yg(Wg),"spring-in-out":Ug(Wg),"spring-out-in":qg(Wg)},Zg=function(t){return Xg[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||Xg.linear},Kg=function(t){return t},Qg=1,Jg=.5,tm=0;function em(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var nm="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",rm=new RegExp("cubic-bezier\\("+nm+","+nm+","+nm+","+nm+"\\)"),im=/steps\(\s*(\d+)\s*\)/,om=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function am(t){var e=rm.exec(t);if(e)return Cg.apply(void 0,Ne([],Ce(e.slice(1).map(Number)),!1));var n=im.exec(t);if(n)return em(Number(n[1]),tm);var r=om.exec(t);return r?em(Number(r[1]),{start:Qg,middle:Jg,end:tm}[r[2]]):Zg(t)}function sm(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}var cm=0,lm=1,um=2,fm=3;function dm(t,e,n){var r=function(t,e,n){if(null===e)return cm;var r=n.endTime;return e<Math.min(n.delay,r)?lm:e>=Math.min(n.delay+t+n.endDelay,r)?um:fm}(t,e,n),i=function(t,e,n,r,i){switch(r){case lm:return"backwards"===e||"both"===e?0:null;case fm:return n-i;case um:return"forwards"===e||"both"===e?t:null;case cm:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?e!==lm&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||n!==um||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),c=function(t,e,n,r){return t===um&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),l=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,c,s);return n.currentIteration=c,n.progress=l,n.easingFunction(l)}function hm(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(pm(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:am(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;o<i.length-1;o++){var a=o,s=o+1,c=i[a].computedOffset,l=i[s].computedOffset,u=c,f=l;0===o&&(u=-1/0,0===l&&(s=a)),o===i.length-2&&(f=1/0,1===c&&(a=s)),n.push({applyFrom:u,applyTo:f,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:mm(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&e<t.applyTo})).forEach((function(n){var r=e-n.startOffset,i=n.endOffset-n.startOffset,o=0===i?0:r/i;t.setAttribute(n.property,n.interpolation(o),!1,!1)}));else for(var n in r)pm(n)&&t.setAttribute(n,null)}}function pm(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var gm=function(t,e,n){return function(r){var i=ym(t,e,r);return!Cp.enableCSSParsing&&j(i)?i:n(i)}};function mm(t,e,n,r){var i=Zd[t];if(i&&i.syntax&&i.int){var o=Cp.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(Cp.enableCSSParsing){var c=Cp.styleValueRegistry.parseProperty(t,e,r,!1),l=Cp.styleValueRegistry.parseProperty(t,n,r,!1);a=Cp.styleValueRegistry.computeProperty(t,c,r,!1),s=Cp.styleValueRegistry.computeProperty(t,l,r,!1)}else{var u=o.parserWithCSSDisabled;a=u?u(e,r):e,s=u?u(n,r):n}var f=o.mixer(a,s,r);if(f){var d=gm.apply(void 0,Ne([],Ce(f),!1));return function(t){return 0===t?e:1===t?n:d(t)}}}}return gm(!1,!0,(function(t){return t?n:e}))}function ym(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return n<.5?t:e;if(Array.isArray(t)&&Array.isArray(e)){for(var r=t.length,i=e.length,o=Math.max(r,i),a=[],s=0;s<o;s++)a.push(ym(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var vm=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Kg,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return Object.defineProperty(t.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=am(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function bm(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;o<i;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}void 0!==r[o]&&null!==r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(i<0||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error("".concat(i," compositing is not supported"));n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;o<n.length;o++){var a=n[o].offset;if(v(a))r=!1;else{if(a<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter((function(t){return Number(t.offset)>=0&&Number(t.offset)<=1})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;a<r;a++){var s=n[a].computedOffset;if(!v(s)&&!v(o)){for(var c=1;c<a-i;c++)n[i+c].computedOffset=o+(Number(s)-o)*c/(a-i);i=a,o=Number(s)}}}(),n}var xm="backwards|forwards|both|none".split("|"),wm="reverse|alternate|alternate-reverse".split("|");function Mm(t,e){return function(t,e){var n=new vm;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(void 0!==t[e]&&null!==t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===xm.indexOf(t[e]))return;if("direction"===e&&-1===wm.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),e)}var Om=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=Mm(n,!1),this.timing.effect=this,this.timing.activeDuration=sm(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=bm(e,this.timing),this.interpolations=hm(this.normalizedKeyframes,this.timing,this.target);var i=Cp.globalThis.Proxy;this.computedTiming=i?new i(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}return t.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},t.prototype.update=function(t){return null!==t&&(this.timeFraction=dm(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=bm(t)},t.prototype.getComputedTiming=function(){return this.computedTiming},t.prototype.getTiming=function(){return this.timing},t.prototype.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))},t}();function Em(t,e){return Number(t.id)-Number(e.id)}var km=function(){function t(t){var e=this;this.document=t,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],t<Number(e.currentTime)&&(t=Number(e.currentTime)),e.animations.sort(Em),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()}}return t.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},t.prototype.isTicking=function(){return this.inTick},t.prototype.play=function(t,e,n){var r=new Om(t,e,n),i=new Og(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i},t.prototype.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Em),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},t.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},t.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},t.prototype.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},t.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},t.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},t.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},t.prototype.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},t.prototype.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},t.prototype.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],c=[],l=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?c.push(n):l.push(n)})),(r=this.pendingEffects).push.apply(r,Ne([],Ce(a),!1)),(i=this.pendingEffects).push.apply(i,Ne([],Ce(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,l]},t}();function Sm(t){return new Am([t],null,t,t.ownerDocument)}Cp.EasingFunction=am,Cp.AnimationTimeline=km;class Am{constructor(t=null,e=null,n=null,r=null,i=[null,null,null,null,null],o=[],a=[]){this._elements=Array.from(t),this._data=e,this._parent=n,this._document=r,this._enter=i[0],this._update=i[1],this._exit=i[2],this._merge=i[3],this._split=i[4],this._transitions=o,this._facetElements=a}selectAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new Am(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new Am(this._elements,null,this._parent,this._document,void 0,void 0,e)}select(t){const e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new Am([e],null,e,this._document)}append(t){const e="function"==typeof t?t:()=>this.createElement(t),n=[];if(null!==this._data){for(let t=0;t<this._data.length;t++){const r=this._data[t],[i,o]=Array.isArray(r)?r:[r,null],a=e(i,t);a.__data__=i,null!==o&&(a.__fromElements__=o),this._parent.appendChild(a),n.push(a)}return new Am(n,null,this._parent,this._document)}for(let t=0;t<this._elements.length;t++){const r=this._elements[t],i=e(r.__data__,t);r.appendChild(i),n.push(i)}return new Am(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new Am([i],null,this._parent,this._document);const o="string"==typeof e?this.createElement(e):e();return o.id=t,n&&(o.className=n),r.appendChild(o),new Am([o],null,this._parent,this._document)}data(t,e=t=>t,n=()=>null){const r=[],i=[],o=new Set(this._elements),a=[],s=new Set,c=new Map(this._elements.map(((t,n)=>[e(t.__data__,n),t]))),l=new Map(this._facetElements.map(((t,n)=>[e(t.__data__,n),t]))),u=Vn(this._elements,(t=>n(t.__data__)));for(let f=0;f<t.length;f++){const d=t[f],h=e(d,f),p=n(d,f);if(c.has(h)){const t=c.get(h);t.__data__=d,t.__facet__=!1,i.push(t),o.delete(t),c.delete(h)}else if(l.has(h)){const t=l.get(h);t.__data__=d,t.__facet__=!0,i.push(t),l.delete(h)}else if(u.has(h)){const t=u.get(h);a.push([d,t]);for(const e of t)o.delete(e);u.delete(h)}else if(c.has(p)){const t=c.get(p);t.__toData__?t.__toData__.push(d):t.__toData__=[d],s.add(t),o.delete(t)}else r.push(d)}const f=[new Am([],r,this._parent,this._document),new Am(i,null,this._parent,this._document),new Am(o,null,this._parent,this._document),new Am([],a,this._parent,this._document),new Am(s,null,this._parent,this._document)];return new Am(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new Am(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=Am.registry[t];return e?new e:wr(`Unknown node type: ${t}`)}join(t=t=>t,e=t=>t,n=t=>t.remove(),r=t=>t,i=t=>t.remove()){const o=t(this._enter),a=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(c).merge(l)}remove(){for(let t=0;t<this._elements.length;t++){const e=this._transitions[t];if(e){const n=Array.isArray(e)?e:[e];Promise.all(n.map((t=>t.finished))).then((()=>{this._elements[t].remove()}))}else{this._elements[t].remove()}}return new Am([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let e=0;e<this._elements.length;e++){const n=this._elements[e];t(n.__data__,e,n)}return this}attr(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i,o){void 0!==e&&(o[t]=n(r,i,o))}))}style(t,e){const n="function"!=typeof e?()=>e:e;return this.each((function(r,i,o){void 0!==e&&(o.style[t]=n(r,i,o))}))}transition(t){const e="function"!=typeof t?()=>t:t,{_transitions:n}=this;return this.each((function(t,r,i){n[r]=e(t,r,i)}))}on(t,e){return this.each((function(n,r,i){i.addEventListener(t,e)})),this}call(t,...e){return t(this,...e),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}}function _m(t,e,n){return Math.max(e,Math.min(t,n))}function Tm(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function Pm(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function Cm(t,e,n,r,i){const o=gs(ds(r,e))+Math.PI,a=gs(ds(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function Nm(t,e,n,r="y",i="between",o=!1){const a="y"===r||!0===r?n:e,s=((t,e)=>"y"===t||!0===t?e?180:90:e?90:0)(r,o),c=Lr(a),[l,u]=zn(c,(t=>a[t])),f=new ia({domain:[l,u],range:[0,100]}),d=t=>j(a[t])&&!Number.isNaN(a[t])?f.map(a[t]):0,h={between:e=>`${t[e]} ${d(e)}%`,start:e=>0===e?`${t[e]} ${d(e)}%`:`${t[e-1]} ${d(e)}%, ${t[e]} ${d(e)}%`,end:e=>e===t.length-1?`${t[e]} ${d(e)}%`:`${t[e]} ${d(e)}%, ${t[e+1]} ${d(e)}%`};return`linear-gradient(${s}deg, ${c.sort(((t,e)=>d(t)-d(e))).map(h[i]||h.between).join(",")})`}function Lm(t){const[e,n,r,i]=t;return[i,e,n,r]}function jm(t,e,n){const[r,i,,o]=Bc(t)?Lm(e):e,[a,s]=n,c=t.getCenter(),l=ms(ds(r,c)),u=ms(ds(i,c)),f=u===l&&a!==s?u+2*Math.PI:u;return{startAngle:l,endAngle:f-l>=0?f:2*Math.PI+f,innerRadius:ps(o,c),outerRadius:ps(r,c)}}function Rm(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function Im(t,e){if(!Dc(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function Bm(t){if(1===t.length)return t[0];const[[e,n,r=0],[i,o,a=0]]=t;return[(e+i)/2,(n+o)/2,(r+a)/2]}function Dm(t,e,n,r,i={}){const{inset:o=0,radius:a=0,insetLeft:s=o,insetTop:c=o,insetRight:l=o,insetBottom:u=o,radiusBottomLeft:f=a,radiusBottomRight:d=a,radiusTopLeft:h=a,radiusTopRight:p=a,minWidth:g=-1/0,maxWidth:m=1/0,minHeight:y=-1/0}=i,v=Se(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!Dc(r)&&!zc(r)){const n=!!Bc(r),[i,,o]=n?Lm(e):e,[a,b]=i,[x,w]=ds(o,i),M=(x>0?a:a+x)+s,O=(w>0?b:b+w)+c,E=Math.abs(x)-(s+l),k=Math.abs(w)-(c+u),S=n?_m(E,y,1/0):_m(E,g,m),A=n?_m(k,g,m):_m(k,y,1/0),_=n?M:M-(S-E)/2,T=n?O-(A-k)/2:O-(A-k);return Sm(t.createElement("rect",{})).style("x",_).style("y",T).style("width",S).style("height",A).style("radius",[h,p,d,f]).call(Pm,v).node()}const{y:b,y1:x}=n,w=r.getCenter(),M=jm(r,e,[b,x]),O=nc().cornerRadius(a).padAngle(o*Math.PI/180);return Sm(t.createElement("path",{})).style("d",O(M)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",a).style("inset",o).call(Pm,v).node()}Am.registry={g:Kp,rect:ig,circle:qp,path:eg,text:og,ellipse:Zp,image:Jp,line:tg,polygon:ng,polyline:rg,html:Qp};const Fm=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=t,a=Se(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,d=Se(l,["color","radius"]),h=d.lineWidth||1,{stroke:p,radius:g=f,radiusTopLeft:m=g,radiusTopRight:y=g,radiusBottomRight:v=g,radiusBottomLeft:b=g,innerRadius:x=0,innerRadiusTopLeft:w=x,innerRadiusTopRight:M=x,innerRadiusBottomRight:O=x,innerRadiusBottomLeft:E=x,lineWidth:k=("stroke"===n||p?h:0),inset:S=0,insetLeft:A=S,insetRight:_=S,insetBottom:T=S,insetTop:P=S,minWidth:C,maxWidth:N,minHeight:L}=a,j=Se(a,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:R=u,opacity:I}=r,B=[i?m:w,i?y:M,o?v:O,o?b:E],D=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];Bc(s)&&D.push(D.shift());const F=Object.assign(Object.assign({radius:g},Object.fromEntries(D.map(((t,e)=>[t,B[e]])))),{inset:S,insetLeft:A,insetRight:_,insetBottom:T,insetTop:P,minWidth:C,maxWidth:N,minHeight:L});return Sm(Dm(c,e,r,s,F)).call(Pm,d).style("fill","transparent").style(n,R).style(Rm(t),I).style("lineWidth",k).style("stroke",void 0===p?R:p).call(Pm,j).node()}};Fm.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const zm=(t,e)=>Fm(Object.assign({colorAttribute:"fill"},t),e);zm.props=Object.assign(Object.assign({},Fm.props),{defaultMarker:"square"});const Gm=(t,e)=>Fm(Object.assign({colorAttribute:"stroke"},t),e);function Wm(t,e,n){const[r,i,o,a]=t;if(Bc(n)){return[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:o[0],o[1]],a]}return[r,[i[0],e?e[0][1]:i[1]],[o[0],e?e[3][1]:o[1]],a]}Gm.props=Object.assign(Object.assign({},Fm.props),{defaultMarker:"hollowSquare"});const $m=(t,e)=>{const{adjustPoints:n=Wm}=t,r=Se(t,["adjustPoints"]),{coordinate:i,document:o}=e;return(t,e,a,s)=>{const{index:c}=e,{color:l}=a,u=Se(a,["color"]),f=s[c+1],d=n(t,f,i),h=!!Bc(i),[p,g,m,y]=h?Lm(d):d,{color:v=l,opacity:b}=e,x=cc().curve(Oc)([p,g,m,y]);return Sm(o.createElement("path",{})).call(Pm,u).style("d",x).style("fill",v).style("fillOpacity",b).call(Pm,r).node()}};function Hm(t,e,n){const[r,i,o,a]=t;if(Bc(n)){return[r,[e?e[0][0]:(i[0]+o[0])/2,i[1]],[e?e[3][0]:(i[0]+o[0])/2,o[1]],a]}return[r,[i[0],e?e[0][1]:(i[1]+o[1])/2],[o[0],e?e[3][1]:(i[1]+o[1])/2],a]}$m.props={defaultMarker:"square"};const Vm=(t,e)=>$m(Object.assign({adjustPoints:Hm},t),e);function Ym(t){const e="function"==typeof t?t:t.render;return class extends Xp{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Vm.props={defaultMarker:"square"};const Um=Ym((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;Sm(t).maybeAppend("line",(()=>o.createElement("path",{}))).style("d",e).call(Pm,r),Sm(t).maybeAppend("line1",(()=>o.createElement("path",{}))).style("d",n).call(Pm,i)}));const qm=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=t=>!Number.isNaN(t)&&null!=t,connect:a=!1}=t,s=Se(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:d}=u,h=Se(u,["color","lineWidth"]),{color:p=f,size:g=d,seriesColor:m,seriesX:y,seriesY:v}=e,b=Im(c,e),x=Bc(c),w=r&&m?Nm(m,y,v,r,i,x):p,M=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},h),w&&{stroke:w}),g&&{lineWidth:g}),b&&{transform:b}),s);let O;if(Dc(c)){const t=c.getCenter();O=e=>hc(cc().curve(uc)).angle(((n,r)=>ms(ds(e[r],t)))).radius(((n,r)=>ps(e[r],t))).defined((([t,e])=>o(t)&&o(e))).curve(n)(e)}else O=cc().x((t=>t[0])).y((t=>t[1])).defined((([t,e])=>o(t)&&o(e))).curve(n);const[E,k]=function(t,e){const n=[],r=[];let i=!1,o=null;for(const a of t)e(a[0])&&e(a[1])?(n.push(a),i&&(i=!1,r.push([o,a])),o=a):i=!0;return[n,r]}(t,o),S=kr(M,"connect"),A=!!k.length;if(!A||a&&!Object.keys(S).length)return Sm(l.createElement("path",{})).style("d",O(E)||[]).call(Pm,M).node();if(A&&!a)return Sm(l.createElement("path",{})).style("d",O(t)).call(Pm,M).node();return Sm(new Um).style("style1",Object.assign(Object.assign({},M),S)).style("style2",M).style("d1",(_=k,_.map(O).join(","))).style("d2",O(t)).node();var _}};qm.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Xm=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Dc(n)?Oc:oc;return qm(Object.assign({curve:i},t),e)(...r)}};Xm.props=Object.assign(Object.assign({},qm.props),{defaultMarker:"line"});const Zm=(t,e)=>{const n=Se(t,[]),{coordinate:r}=e;return(...t)=>{const i=Dc(r)?wc:Bc(r)?Nc:Cc;return qm(Object.assign({curve:i},n),e)(...t)}};Zm.props=Object.assign(Object.assign({},qm.props),{defaultMarker:"smooth"});const Km=(t,e)=>qm(Object.assign({curve:Ic},t),e);Km.props=Object.assign(Object.assign({},qm.props),{defaultMarker:"hv"});const Qm=(t,e)=>qm(Object.assign({curve:Rc},t),e);Qm.props=Object.assign(Object.assign({},qm.props),{defaultMarker:"vh"});const Jm=(t,e)=>qm(Object.assign({curve:jc},t),e);function ty(t,e,n,r,i){const o=gs(ds(n,e)),a=o+Math.PI/2,s=[r/2*Math.cos(a),r/2*Math.sin(a)],c=[i/2*Math.cos(a),i/2*Math.sin(a)],l=[i/2*Math.cos(o),i/2*Math.sin(o)],u=[r/2*Math.cos(o),r/2*Math.sin(o)],f=hs(e,s),d=hs(n,c),h=hs(d,l),p=hs(n,l),g=ds(p,c),m=ds(n,c),y=ds(e,s),v=ds(y,u),b=ds(e,u),x=ds(f,u);t.moveTo(...f),t.lineTo(...d),t.arcTo(...h,...p,i/2),t.arcTo(...g,...m,i/2),t.lineTo(...y),t.arcTo(...v,...b,r/2),t.arcTo(...x,...f,r/2),t.closePath()}Jm.props=Object.assign(Object.assign({},qm.props),{defaultMarker:"hvh"});const ey=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=Se(i,["color"]),l=qs();for(let t=0;t<e.length-1;t++){const n=e[t],r=e[t+1],i=o[t],a=o[t+1];[...n,...r].every(Or)&&ty(l,n,r,i,a)}return Sm(n.createElement("path",{})).call(Pm,c).style("fill",a||s).style("d",l.toString()).call(Pm,t).node()}};ey.props=Object.assign(Object.assign({},qm.props),{defaultMarker:"line"});const ny=(t,e,n)=>[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]];ny.style=["fill"];const ry=ny.bind(void 0);ry.style=["stroke","lineWidth"];const iy=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];iy.style=["fill"];const oy=iy.bind(void 0);oy.style=["fill"];const ay=iy.bind(void 0);ay.style=["stroke","lineWidth"];const sy=(t,e,n)=>{const r=.618*n;return[["M",t-r,e],["L",t,e-n],["L",t+r,e],["L",t,e+n],["Z"]]};sy.style=["fill"];const cy=sy.bind(void 0);cy.style=["stroke","lineWidth"];const ly=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]};ly.style=["fill"];const uy=ly.bind(void 0);uy.style=["stroke","lineWidth"];const fy=(t,e,n)=>{const r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]};fy.style=["fill"];const dy=fy.bind(void 0);dy.style=["stroke","lineWidth"];const hy=(t,e,n)=>{const r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]};hy.style=["fill"];const py=hy.bind(void 0);py.style=["stroke","lineWidth"];const gy=(t,e,n)=>{const r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]};gy.style=["fill"];const my=gy.bind(void 0);my.style=["stroke","lineWidth"];const yy=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];yy.style=["stroke","lineWidth"];const vy=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];vy.style=["stroke","lineWidth"];const by=(t,e,n)=>[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]];by.style=["stroke","lineWidth"];const xy=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];xy.style=["stroke","lineWidth"];const wy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];wy.style=["stroke","lineWidth"];const My=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];My.style=["stroke","lineWidth"];const Oy=My.bind(void 0);Oy.style=["stroke","lineWidth"];const Ey=(t,e,n)=>[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]];Ey.style=["stroke","lineWidth"];const ky=(t,e,n)=>[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]];ky.style=["stroke","lineWidth"];const Sy=(t,e,n)=>[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]];Sy.style=["stroke","lineWidth"];const Ay=(t,e,n)=>[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]];Ay.style=["stroke","lineWidth"];const _y=(t,e,n)=>[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]];_y.style=["stroke","lineWidth"];const Ty=new Map([["bowtie",gy],["cross",vy],["dash",Oy],["diamond",sy],["dot",My],["hexagon",hy],["hollowBowtie",my],["hollowDiamond",cy],["hollowHexagon",py],["hollowPoint",ry],["hollowSquare",ay],["hollowTriangle",uy],["hollowTriangleDown",dy],["hv",ky],["hvh",Ay],["hyphen",wy],["line",yy],["plus",xy],["point",ny],["rect",oy],["smooth",Ey],["square",iy],["tick",by],["triangleDown",fy],["triangle",ly],["vh",Sy],["vhv",_y]]);function Py(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||Wc(r)){const[[t,n],[r,i]]=e,o=Math.abs((r-t)/2),a=Math.abs((i-n)/2);return Math.max(0,(o+a)/2)}return i}const Cy=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=Se(t,["colorAttribute","symbol","mode"]),a=Ty.get(r)||Ty.get("point"),{coordinate:s,document:c}=e;return(e,r,l)=>{const{lineWidth:u,color:f}=l,d=o.stroke?u||1:u,{color:h=f,transform:p,opacity:g}=r,[m,y]=Bm(e),v=Py(i,e,r,s)||o.r||l.r;return Sm(c.createElement("path",{})).call(Pm,l).style("fill","transparent").style("d",a(m,y,v)).style("lineWidth",d).style("transform",p).style("transformOrigin",`${m-v} ${y-v}`).style("stroke",h).style(Rm(t),g).style(n,h).call(Pm,o).node()}};Cy.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ny=(t,e)=>Cy(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);Ny.props=Object.assign({defaultMarker:"hollowBowtie"},Cy.props);const Ly=(t,e)=>Cy(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);Ly.props=Object.assign({defaultMarker:"hollowDiamond"},Cy.props);const jy=(t,e)=>Cy(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);jy.props=Object.assign({defaultMarker:"hollowHexagon"},Cy.props);const Ry=(t,e)=>Cy(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);Ry.props=Object.assign({defaultMarker:"hollowPoint"},Cy.props);const Iy=(t,e)=>Cy(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);Iy.props=Object.assign({defaultMarker:"hollowSquare"},Cy.props);const By=(t,e)=>Cy(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);By.props=Object.assign({defaultMarker:"hollowTriangle"},Cy.props);const Dy=(t,e)=>Cy(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);Dy.props=Object.assign({defaultMarker:"hollowTriangleDown"},Cy.props);const Fy=(t,e)=>{const{colorAttribute:n,mode:r="auto"}=t,i=Se(t,["colorAttribute","mode"]),{coordinate:o,document:a}=e;return(e,s,c)=>{const{lineWidth:l,color:u}=c,f=i.stroke?l||1:l,{color:d=u,transform:h,opacity:p}=s,[g,m]=Bm(e),y=Py(r,e,s,o)||i.r||c.r;return Sm(a.createElement("circle",{})).call(Pm,c).style("fill","transparent").style("cx",g).style("cy",m).style("r",y).style("lineWidth",f).style("transform",h).style("transformOrigin",`${g} ${m}`).style("stroke",d).style(Rm(t),p).style(n,d).call(Pm,i).node()}},zy=(t,e)=>Fy(Object.assign({colorAttribute:"fill"},t),e);zy.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const Gy=(t,e)=>Fy(Object.assign({colorAttribute:"stroke"},t),e);Gy.props=Object.assign({defaultMarker:"hollowPoint"},zy.props);const Wy=(t,e)=>Cy(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);Wy.props=Object.assign({defaultMarker:"bowtie"},Cy.props);const $y=(t,e)=>Cy(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);$y.props=Object.assign({defaultMarker:"cross"},Cy.props);const Hy=(t,e)=>Cy(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);Hy.props=Object.assign({defaultMarker:"diamond"},Cy.props);const Vy=(t,e)=>Cy(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Vy.props=Object.assign({defaultMarker:"hexagon"},Cy.props);const Yy=(t,e)=>Cy(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);Yy.props=Object.assign({defaultMarker:"hyphen"},Cy.props);const Uy=(t,e)=>Cy(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);Uy.props=Object.assign({defaultMarker:"line"},Cy.props);const qy=(t,e)=>Cy(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);qy.props=Object.assign({defaultMarker:"plus"},Cy.props);const Xy=(t,e)=>Cy(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);Xy.props=Object.assign({defaultMarker:"point"},Cy.props);const Zy=(t,e)=>Cy(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);Zy.props=Object.assign({defaultMarker:"square"},Cy.props);const Ky=(t,e)=>Cy(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);Ky.props=Object.assign({defaultMarker:"tick"},Cy.props);const Qy=(t,e)=>Cy(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);Qy.props=Object.assign({defaultMarker:"triangle"},Cy.props);const Jy=(t,e)=>Cy(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);Jy.props=Object.assign({defaultMarker:"triangleDown"},Cy.props);const tv=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=Se(t,["arrow","arrowSize"]),{document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Se(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,d]=t,h=qs();if(h.moveTo(...f),h.lineTo(...d),n){const[t,e]=function(t,e,n){const{arrowSize:r}=n,i="string"==typeof r?+parseFloat(r)/100*ps(t,e):r,o=Math.PI/6,a=Math.atan2(e[1]-t[1],e[0]-t[0]),s=Math.PI/2-a-o,c=a-o;return[[e[0]-i*Math.sin(s),e[1]-i*Math.cos(s)],[e[0]-i*Math.cos(c),e[1]-i*Math.sin(c)]]}(f,d,{arrowSize:r});h.moveTo(...t),h.lineTo(...d),h.lineTo(...e)}return Sm(o.createElement("path",{})).call(Pm,c).style("d",h.toString()).style("stroke",l).style("transform",u).call(Pm,i).node()}};function ev(t,e){e(t),t.children&&t.children.forEach((function(t){t&&ev(t,e)}))}function nv(t){iv(t,!0)}function rv(t){iv(t,!1)}function iv(t,e){var n=e?"visible":"hidden";ev(t,(function(t){t.attr("visibility",n)}))}tv.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var ov=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,Ne([],Ce(e),!1))||this;return r.isMutationObserved=!0,r.addEventListener(gp.INSERTED,(function(){rv(r)})),r}return Ee(e,t),e}(Kp);function av(t){var e=t.appendChild(new ov({class:"offscreen"}));return rv(e),e}var sv=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Se(e,["style"]);return t.call(this,ke({style:ke({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return Ee(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=av(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(og);function cv(t){return t*Math.PI/180}function lv(t){return Number((180*t/Math.PI).toPrecision(5))}var uv=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t}();function fv(t,e){return y(t)?t.apply(void 0,Ne([],Ce(e),!1)):t}var dv,hv=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=Ce(t,2),r=e[0],i=e[1],o=n(i);return[r,{name:o,class:".".concat(o),id:"#".concat(o),toString:function(){return o}}]})));return Object.assign(r,{prefix:n}),r},pv=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var o=Ce(i,2),a=o[0],s=o[1],c=t;Object.prototype.hasOwnProperty.call(e,a)&&(s?S(s)?(S(t[a])||(c[a]={}),n<r?pv(t[a],s,n+1,r):c[a]=e[a]):w(s)?(c[a]=[],c[a]=c[a].concat(s)):c[a]=s:c[a]=s)}))},gv=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)pv(t,e[r]);return t},mv=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},yv=function(t,e,n){if(void 0===n&&(n=128),!y(t))throw new TypeError("Expected a function");var r=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var s=t.apply(this,n);return a.set(o,s),s};return r.cache=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)}}}(n),r}((function(t,e){var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return dv||(dv=Cp.offscreenCanvasCreator.getOrCreateContext(void 0)),dv.font=[o,a,i,"".concat(n,"px"),r].join(" "),dv.measureText(t).width}),(function(t,e){return[t,Object.values(e||vv(t)).join()].join("")}),4096),vv=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",r=t.style.fontStyle||"normal",i=t.style.fontVariant,o=t.style.fontSize;return{fontSize:o="object"==typeof o?o.value:o,fontFamily:e,fontWeight:n,fontStyle:r,fontVariant:i}};function bv(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function xv(t,e){var n=bv(t);n&&n.attr(e)}function wv(t,e,n){void 0===n&&(n="..."),xv(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function Mv(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var o=n[0];return[o.clientX,o.clientY]}return r&&i?[r,i]:[0,0]}function Ov(t){return"function"==typeof t?t():C(t)||j(t)?new sv({style:{text:String(t)}}):t}function Ev(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=function(t){t.node().removeChildren()}),t?n(e):(r&&i(e),null)}function kv(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=!1),!!(r&&t===e||i&&t===n)||t>e&&t<n}var Sv=function(t,e){return function(n){return t*(1-n)+e*n}};function Av(t,e){return"number"==typeof t&&"number"==typeof e?Sv(t,e):Array.isArray(t)&&Array.isArray(e)?function(t,e){var n=e?e.length:0,r=t?Math.min(n,t.length):0;return function(i){var o=new Array(r),a=new Array(n),s=0;for(s=0;s<r;++s)o[s]=Av(t[s],e[s]);for(;s<n;++s)a[s]=e[s];for(s=0;s<r;++s)a[s]=o[s](i);return a}}(t,e):"object"==typeof t&&"object"==typeof e?function(t,e){void 0===t&&(t={}),void 0===e&&(e={});var n={},r={};return Object.entries(e).forEach((function(e){var i=Ce(e,2),o=i[0],a=i[1];o in t?n[o]=Av(t[o],a):r[o]=a})),function(t){return Object.entries(n).forEach((function(e){var n=Ce(e,2),i=n[0],o=n[1];return r[i]=o(t)})),r}}(t,e):function(e){return t}}function _v(t){for(var e=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<t.length;o++){var a=t[o],s=a.x,c=a.y,l=Ce([s+a.width,c+a.height],2),u=l[0],f=l[1];s<e&&(e=s),c<n&&(n=c),u>r&&(r=u),f>i&&(i=f)}return new uv(e,n,r-e,i-n)}var Tv=function(t,e,n){var r=t.width,i=t.height,o=n.flexDirection,a=void 0===o?"row":o,s=n.justifyContent,c=void 0===s?"flex-start":s,l=n.alignItems,u=void 0===l?"flex-start":l,f="row"===a,d="row"===a||"column"===a,h=f?d?[1,0]:[-1,0]:d?[0,1]:[0,-1],p=Ce([0,0],2),g=p[0],m=p[1],y=e.map((function(t){var e,n=t.width,r=t.height,i=Ce([g,m],2),o=i[0],a=i[1];return e=Ce([g+n*h[0],m+r*h[1]],2),g=e[0],m=e[1],new uv(o,a,n,r)})),v=_v(y),b={"flex-start":0,"flex-end":f?r-v.width:i-v.height,center:f?(r-v.width)/2:(i-v.height)/2},x=y.map((function(t){var e=t.x,n=t.y,r=uv.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r}));_v(x);var w=function(t){var e=Ce(f?["height",i]:["width",r],2),n=e[0],o=e[1];switch(u){case"flex-start":default:return 0;case"flex-end":return o-t[n];case"center":return o/2-t[n]/2}},M=x.map((function(t){var e=t.x,n=t.y,r=uv.fromRect(t);return r.x=f?e:e+w(r),r.y=f?n+w(r):n,r})),O=M.map((function(e){var n,r,i=uv.fromRect(e);return i.x+=null!==(n=t.x)&&void 0!==n?n:0,i.y+=null!==(r=t.y)&&void 0!==r?r:0,i}));return O},Pv=function(t,e,n){return[]};function Cv(t,e){return[t[0]*e,t[1]*e]}function Nv(t,e){return[t[0]+e[0],t[1]+e[1]]}function Lv(t,e){return[t[0]-e[0],t[1]-e[1]]}function jv(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Rv(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Iv(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Bv(t){if(0===t[0]&&0===t[1])return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function Dv(t,e){return+t.toPrecision(e)}function Fv(t,e){var n={},r=Array.isArray(e)?e:[e];for(var i in t)r.includes(i)||(n[i]=t[i]);return n}function zv(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var r=!!e,i=[],o=0,a=t.length;o<a;o+=2)i.push([t[o],t[o+1]]);var s,c,l,u=function(t,e,n,r){var i,o,a,s,c,l,u=[],f=!!r,d=[1/0,1/0],h=[-1/0,-1/0];if(f){d=(i=Ce(r,2))[0],h=i[1];for(var p=0,g=t.length;p<g;p+=1)d=jv(d,y=t[p]),h=Rv(h,y)}p=0;for(var m=t.length;p<m;p+=1){var y=t[p];if(0!==p||n)if(p!==m-1||n){o=t[[p?p-1:m-1,p-1][n?0:1]];var v=[0,0];v=Cv(v=Lv(a=t[n?(p+1)%m:p+1],o),e);var b=Iv(y,o),x=Iv(y,a),w=b+x;0!==w&&(b/=w,x/=w);var M=Cv(v,-b),O=Cv(v,x);c=Nv(y,M),s=jv(s=Nv(y,O),Rv(a,y)),s=Rv(s,jv(a,y)),c=jv(c=Nv(y,M=Cv(M=Lv(s,y),-b/x)),Rv(o,y)),s=Nv(y,O=Cv(O=Lv(y,c=Rv(c,jv(o,y))),x/b)),f&&(c=jv(c=Rv(c,d),h),s=jv(s=Rv(s,d),h)),u.push(l),u.push(c),l=s}else c=y,u.push(l),u.push(c);else l=y}return n&&u.push(u.shift()),u}(i,.4,r,n),f=i.length,d=[];for(o=0;o<f-1;o+=1)s=u[2*o],c=u[2*o+1],l=i[o+1],d.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]]);return r&&(s=u[f],c=u[f+1],l=Ce(i,1)[0],d.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),d}var Gv=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function Wv(t){return Gv.includes(t)}function $v(t){var e={};for(var n in t)Wv(n)&&(e[n]=t[n]);return e}function Hv(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,o=r.height,a=e/Math.max(i,o);return n&&(t.style.transform="scale(".concat(a,")")),a}var Vv=function(){function t(t,n,r,i,o,a,s){void 0===t&&(t=null),void 0===n&&(n=null),void 0===r&&(r=null),void 0===i&&(i=null),void 0===o&&(o=[null,null,null,null,null]),void 0===a&&(a=[]),void 0===s&&(s=[]),e.add(this),this._elements=Array.from(t),this._data=n,this._parent=r,this._document=i,this._enter=o[0],this._update=o[1],this._exit=o[2],this._merge=o[3],this._split=o[4],this._transitions=a,this._facetElements=s}var e,n,r;return t.prototype.selectAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(e,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(this._elements,null,this._parent,this._document,void 0,void 0,e)},t.prototype.select=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new n([e],null,e,this._document)},t.prototype.append=function(t){var e=this,r="function"==typeof t?t:function(){return e.createElement(t)},i=[];if(null!==this._data){for(var o=0;o<this._data.length;o++){var a=this._data[o],s=Ce(Array.isArray(a)?a:[a,null],2),c=s[0],l=s[1];(f=r(c,o)).__data__=c,null!==l&&(f.__fromElements__=l),this._parent.appendChild(f),i.push(f)}return new n(i,null,this._parent,this._document)}for(o=0;o<this._elements.length;o++){var u=this._elements[o],f=r(c=u.__data__,o);u.appendChild(f),i.push(f)}return new n(i,null,i[0],this._document)},t.prototype.maybeAppend=function(t,n){var i=Le(this,e,"m",r).call(this,"#"===t[0]?t:"#".concat(t),n);return i.attr("id",t),i},t.prototype.maybeAppendByClassName=function(t,n){var i=t.toString(),o=Le(this,e,"m",r).call(this,"."===i[0]?i:".".concat(i),n);return o.attr("className",i),o},t.prototype.maybeAppendByName=function(t,n){var i=Le(this,e,"m",r).call(this,'[name="'.concat(t,'"]'),n);return i.attr("name",t),i},t.prototype.data=function(t,e,r){var i,o;void 0===e&&(e=function(t){return t}),void 0===r&&(r=function(){return null});for(var a=[],s=[],c=new Set(this._elements),l=[],u=new Set,f=new Map(this._elements.map((function(t,n){return[e(t.__data__,n),t]}))),d=new Map(this._facetElements.map((function(t,n){return[e(t.__data__,n),t]}))),h=function(t,e){var n=new Map;return t.forEach((function(t){var r=e(t);n.has(r)||n.set(r,[]),n.get(r).push(t)})),n}(this._elements,(function(t){return r(t.__data__)})),p=0;p<t.length;p++){var g=t[p],m=e(g,p),y=r(g,p);if(f.has(m))(w=f.get(m)).__data__=g,w.__facet__=!1,s.push(w),c.delete(w),f.delete(m);else if(d.has(m)){(w=d.get(m)).__data__=g,w.__facet__=!0,s.push(w),d.delete(m)}else if(h.has(m)){var v=h.get(m);l.push([g,v]);try{for(var b=(i=void 0,Pe(v)),x=b.next();!x.done;x=b.next()){var w=x.value;c.delete(w)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}h.delete(m)}else if(f.has(y)){(w=f.get(y)).__toData__?w.__toData__.push(g):w.__toData__=[g],u.add(w),c.delete(w)}else a.push(g)}var M=[new n([],a,this._parent,this._document),new n(s,null,this._parent,this._document),new n(c,null,this._parent,this._document),new n([],l,this._parent,this._document),new n(u,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,M)},t.prototype.merge=function(t){var e=Ne(Ne([],Ce(this._elements),!1),Ce(t._elements),!1),r=Ne(Ne([],Ce(this._transitions),!1),Ce(t._transitions),!1);return new n(e,null,this._parent,this._document,void 0,r)},t.prototype.createElement=function(t){if(this._document)return this._document.createElement(t,{});var e=n.registry[t];return e?new e:function(t){throw new Error(t)}("Unknown node type: ".concat(t))},t.prototype.join=function(t,e,n,r,i){void 0===t&&(t=function(t){return t}),void 0===e&&(e=function(t){return t}),void 0===n&&(n=function(t){return t.remove()}),void 0===r&&(r=function(t){return t}),void 0===i&&(i=function(t){return t.remove()});var o=t(this._enter),a=e(this._update),s=n(this._exit),c=r(this._merge),l=i(this._split);return a.merge(o).merge(s).merge(c).merge(l)},t.prototype.remove=function(){for(var t=function(t){var n=e._elements[t],r=e._transitions[t];r?r.then((function(){return n.remove()})):n.remove()},e=this,r=0;r<this._elements.length;r++)t(r);return new n([],null,this._parent,this._document,void 0,this._transitions)},t.prototype.each=function(t){for(var e=0;e<this._elements.length;e++){var n=this._elements[e],r=n.__data__;t.call(n,r,e)}return this},t.prototype.attr=function(t,e){var n="function"!=typeof e?function(){return e}:e;return this.each((function(r,i){void 0!==e&&(this[t]=n.call(this,r,i))}))},t.prototype.style=function(t,e,n){void 0===n&&(n=!0);var r="function"==typeof e&&n?e:function(){return e};return this.each((function(n,i){void 0!==e&&(this.style[t]=r.call(this,n,i))}))},t.prototype.styles=function(t,e){return void 0===t&&(t={}),void 0===e&&(e=!0),this.each((function(n,r){var i=this;Object.entries(t).forEach((function(t){var o=Ce(t,2),a=o[0],s=o[1],c="function"==typeof s&&e?s:function(){return s};void 0!==s&&i.attr(a,c.call(i,n,r))}))}))},t.prototype.update=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.maybeUpdate=function(t,e){void 0===e&&(e=!0);var n="function"==typeof t&&e?t:function(){return t};return this.each((function(e,r){t&&this.update&&this.update(n.call(this,e,r))}))},t.prototype.transition=function(t){var e=this._transitions;return this.each((function(n,r){e[r]=t.call(this,n,r)}))},t.prototype.on=function(t,e){return this.each((function(){this.addEventListener(t,e)})),this},t.prototype.call=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t.call.apply(t,Ne([this._parent,this],Ce(e),!1)),this},t.prototype.node=function(){return this._elements[0]},t.prototype.nodes=function(){return this._elements},t.prototype.transitions=function(){return this._transitions.filter((function(t){return!!t}))},t.prototype.parent=function(){return this._parent},n=t,e=new WeakSet,r=function(t,e){var r=this._elements[0],i=r.querySelector(t);if(i)return new n([i],null,this._parent,this._document);var o="string"==typeof e?this.createElement(e):e();return r.appendChild(o),new n([o],null,this._parent,this._document)},t.registry={g:Kp,rect:ig,circle:qp,path:eg,text:sv,ellipse:Zp,image:Jp,line:tg,polygon:ng,polyline:rg,html:Qp},t}();function Yv(t){return new Vv([t],null,t,t.ownerDocument)}function Uv(t){if(j(t))return[t,t,t,t];if(w(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}function qv(t){var e=t.getLocalBounds(),n=Ce([e.min,e.max],2),r=Ce(n[0],2),i=r[0],o=r[1],a=Ce(n[1],2),s=a[0],c=a[1];return{x:i,y:o,width:s-i,height:c-o,left:i,bottom:c,top:o,right:s}}function Xv(t,e){var n=Ce(t,2),r=n[0],i=n[1],o=Ce(e,2),a=o[0],s=o[1];return r!==a&&i===s}function Zv(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Kv(t,e,n){var r;void 0===n&&(n=!0);var i=e||(null===(r=t.match(/^([a-z][a-z0-9]+)/))||void 0===r?void 0:r[0])||"",o=t.replace(new RegExp("^(".concat(i,")")),"");return n?function(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}(o):o}var Qv=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function Jv(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i=Ce(t,2),o=i[0],a=i[1];if("className"===o||"class"===o);else if(Qv(o,"show")&&Qv(Kv(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(Zv(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(Zv(e)),"")]=a;else if(!Qv(o,"show")&&Qv(o,e)!==n){var s=Kv(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}})),r}function tb(t,e){return Object.entries(t).reduce((function(t,n){var r=Ce(n,2),i=r[0],o=r[1];return i.startsWith("show")?t["show".concat(e).concat(i.slice(4))]=o:t["".concat(e).concat(Zv(i))]=o,t}),{})}function eb(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(t).forEach((function(t){var o=Ce(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)})),[r,i]}function nb(t,e){if(e)try{var n=e.replace(/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,(function(e,n,r){return"translate(".concat(function(t,e,n){var r=t.getBBox(),i=r.width,o=r.height,a=Ce([e,n].map((function(t,e){var n;return t.includes("%")?parseFloat((null===(n=t.match(/[+-]?([0-9]*[.])?[0-9]+/))||void 0===n?void 0:n[0])||"0")/100*(0===e?i:o):t})),2);return[a[0],a[1]]}(t,n,r),")")}));t.attr("transform",n)}catch(t){}}function rb(){iv(this,"hidden"!==this.attributes.visibility)}var ib=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,gv({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return Ee(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=av(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),e.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e.prototype.attributeChangedCallback=function(t){"visibility"===t&&rb.call(this)},e.prototype.update=function(t,e){var n;return this.attr(gv({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e.prototype.getSubShapeStyle=function(t){return Se(t,["x","y","transform","transformOrigin","class","className","zIndex"])},e}(Xp),ob=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},ab=ob,sb=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},cb=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},lb=cb;var ub=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function fb(t){var e=function(t){var e="default";if(M(t)&&t instanceof Image)e="image";else if(y(t))e="symbol";else if(C(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var db=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ee(e,t),e.prototype.render=function(t,n){var r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o,s=this.getSubShapeStyle(t),c=s.symbol,l=s.size,u=void 0===l?16:l,f=Se(s,["symbol","size"]),d=fb(c);Ev(!!d,Yv(n),(function(t){t.maybeAppendByClassName("marker",d).attr("className","marker ".concat(d,"-marker")).call((function(t){if("image"===d){var n=2*u;t.styles({img:c,width:n,height:n,x:i-u,y:a-u})}else{n=u/2;var r=y(c)?c:e.getSymbol(c);t.styles(ke({d:null==r?void 0:r(i,a,n)},f))}}))}))},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(ib);db.registerSymbol("cross",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]})),db.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),db.registerSymbol("line",sb),db.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),db.registerSymbol("tick",(function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]})),db.registerSymbol("circle",ob),db.registerSymbol("point",ab),db.registerSymbol("bowtie",(function(t,e,n){var r=n-1.5;return[["M",t-n,e-r],["L",t+n,e+r],["L",t+n,e-r],["L",t-n,e+r],["Z"]]})),db.registerSymbol("hexagon",(function(t,e,n){var r=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+r,e-n/2],["L",t+r,e+n/2],["L",t,e+n],["L",t-r,e+n/2],["L",t-r,e-n/2],["Z"]]})),db.registerSymbol("square",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]})),db.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),db.registerSymbol("triangle",(function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+r],["L",t,e-r],["L",t+n,e+r],["Z"]]})),db.registerSymbol("triangle-down",(function(t,e,n){var r=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-r],["L",t+n,e-r],["L",t,e+r],["Z"]]})),db.registerSymbol("line",sb),db.registerSymbol("dot",cb),db.registerSymbol("dash",lb),db.registerSymbol("smooth",(function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]})),db.registerSymbol("hv",(function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]})),db.registerSymbol("vh",(function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]})),db.registerSymbol("hvh",(function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]})),db.registerSymbol("vhv",(function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}));var hb=function(t){function e(e){var n=this,r=e.style,i=Se(e,["style"]);return(n=t.call(this,K({},{type:"column"},ke({style:r},i)))||this).columnsGroup=new Kp({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return Ee(e,t),e.prototype.render=function(){var t=this.attributes,e=t.columns,n=t.x,r=t.y;this.columnsGroup.style.transform="translate(".concat(n,", ").concat(r,")"),Yv(this.columnsGroup).selectAll(".column").data(e.flat()).join((function(t){return t.append("rect").attr("className","column").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.update=function(t){this.attr(gv({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Up),pb=function(t){function e(e){var n=this,r=e.style,i=Se(e,["style"]);return(n=t.call(this,K({},{type:"lines"},ke({style:r},i)))||this).linesGroup=n.appendChild(new Kp),n.areasGroup=n.appendChild(new Kp),n.render(),n}return Ee(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas,r=t.x,i=t.y;this.style.transform="translate(".concat(r,", ").concat(i,")"),e&&this.renderLines(e),n&&this.renderAreas(n)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(gv({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){Yv(this.linesGroup).selectAll(".line").data(t).join((function(t){return t.append("path").attr("className","line").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.renderAreas=function(t){Yv(this.linesGroup).selectAll(".area").data(t).join((function(t){return t.append("path").attr("className","area").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.style(t)}))}),(function(t){return t.remove()}))},e}(Up);function gb(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return Ne([e===n?"M":"L"],Ce(t),!1)}));return e?r.reverse():r}function mb(t,e){if(void 0===e&&(e=!1),t.length<=2)return gb(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];tt(o,n.slice(-2))||n.push.apply(n,Ne([],Ce(o),!1))}var a=zv(n,!1);return e?a.unshift(Ne(["M"],Ce(t[r-1]),!1)):a.unshift(Ne(["M"],Ce(t[0]),!1)),a}function yb(t,e,n){var r=U(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function vb(t){return 0===t.length?[0,0]:[T(D(t,(function(t){return T(t)||0}))),_(B(t,(function(t){return _(t)||0})))]}function bb(t){for(var e=U(t),n=e[0].length,r=Ce([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],o=r[1],a=0;a<e.length;a+=1)for(var s=e[a],c=0;c<n;c+=1)s[c]>=0?(s[c]+=i[c],i[c]=s[c]):(s[c]+=o[c],o[c]=s[c]);return e}var xb=function(t){function e(e){return t.call(this,e,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return Ee(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=U(t);return j(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?bb(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=Ce(t.getOptions().domain||[0,0],2),n=e[0],r=e[1];return r<0?t.map(r):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,r=e.isStack,i=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var o=Jv(this.attributes,"area"),a=Jv(this.attributes,"line"),s=this.containerShape.width,c=this.data;if(0===c[0].length)return{lines:[],areas:[]};var l=this.scales,u=function(t,e){var n,r=e.x,i=e.y,o=Ce(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=Ce([a,s],2),s=n[0],a=n[1]),t.map((function(t){return t.map((function(t,e){return[r.map(e),L(i.map(t),s,a)]}))}))}(c,{type:"line",x:l.x,y:l.y}),f=[];if(o){var d=this.baseline;f=r?i?function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=t[i],a=mb(o),s=void 0;if(0===i)s=yb(a,e,n);else{var c=mb(t[i-1],!0),l=o[0];c[0][0]="L",s=Ne(Ne(Ne([],Ce(a),!1),Ce(c),!1),[Ne(["M"],Ce(l),!1),["Z"]],!1)}r.push(s)}return r}(u,s,d):function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=gb(t[i]),a=void 0;if(0===i)a=yb(o,e,n);else{var s=gb(t[i-1],!0);s[0][0]="L",a=Ne(Ne(Ne([],Ce(o),!1),Ce(s),!1),[["Z"]],!1)}r.push(a)}return r}(u,s,d):function(t,e,n,r){return t.map((function(t){return yb(e?mb(t):gb(t),n,r)}))}(u,i,s,d)}return{lines:u.map((function(e,n){return ke({stroke:t.getColor(n),d:i?mb(e):gb(e)},a)})),areas:f.map((function(e,n){return ke({d:e,fill:t.getColor(n)},o)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=Jv(this.attributes,"column"),n=this.attributes,r=n.isStack,i=n.type,o=n.scale;if("column"!==i)throw new Error("columnsStyle can only be used in column type");var a=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};r&&(s=bb(s));var c=this.createScales(s),l=c.x,u=c.y,f=Ce(vb(s),2),d=f[0],h=f[1],p=new ia({domain:[0,h-(d>0?0:d)],range:[0,a*o]}),g=l.getBandWidth(),m=this.rawData;return{columns:s.map((function(n,i){return n.map((function(n,o){var a=g/s.length;return ke(ke({fill:t.getColor(i)},e),r?{x:l.map(o),y:u.map(n),width:g,height:p.map(m[i][o])}:{x:l.map(o)+a*i,y:n>=0?u.map(n):u.map(0),width:a,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?Yv(n).select(r):Yv(n).append(i)).attr("className","container").node();var o=t.type,a=t.x,s=t.y,c="spark".concat(o),l=ke({x:a,y:s},"line"===o?this.linesStyle:this.columnsStyle);Yv(e).selectAll(".spark").data([o]).join((function(t){return t.append((function(t){return"line"===t?new pb({className:c,style:l}):new hb({className:c,style:l})})).attr("className","spark ".concat(c))}),(function(t){return t.update(l)}),(function(t){return t.remove()}))},e.prototype.getColor=function(t){var e=this.attributes.color;return w(e)?e[t%e.length]:y(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,r=this.attributes,i=r.type,o=r.scale,a=r.range,s=void 0===a?[]:a,c=r.spacing,l=this.containerShape,u=l.width,f=l.height,d=Ce(vb(t),2),h=d[0],p=d[1],g=new ia({domain:[null!==(e=s[0])&&void 0!==e?e:h,null!==(n=s[1])&&void 0!==n?n:p],range:[f,f*(1-o)]});return"line"===i?{type:i,x:new ia({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new zo({domain:t[0].map((function(t,e){return e})),range:[0,u],paddingInner:c,paddingOuter:c/2,align:.5}),y:g}},e.tag="sparkline",e}(ib);function wb(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter((function(t){var n=Ce(t,1)[0];return!e.includes(n)})));return Object.fromEntries(e.map((function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,ke(ke({},t[e]),n)]:[e,n]})))}function Mb(t,e){t?t.finished.then(e):e()}function Ob(t,e){"update"in t?t.update(e):t.attr(e)}function Eb(t,e,n){return 0===e.length?null:n?t.animate(e,n):(Ob(t,{style:e.slice(-1)[0]}),null)}function kb(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=Ce(e,2),o=n[0],a=n[1];if(!v(a)){var s=t.style[o]||t.parsedStyle[o]||0;s!==a&&(r[o]=s,i[o]=a)}})),n?Eb(t,[r,i],ke({fill:"both"},n)):(Ob(t,i),null)}function Sb(t,e){return t.style.opacity||(t.style.opacity=1),kb(t,{opacity:0},e)}var Ab={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},_b={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Tb={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},Pb=hv({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),Cb=hv({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),Nb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ee(e,t),e.prototype.render=function(t,e){var n=t.x,r=t.y,i=t.size,o=void 0===i?10:i,a=t.radius,s=void 0===a?o/4:a,c=t.orientation,l=Se(t,["x","y","size","radius","orientation"]),u=o,f=2.4*u,d=Yv(e).maybeAppendByClassName(Cb.iconRect,"rect").styles(ke(ke({},l),{width:u,height:f,radius:s,x:n-u/2,y:r-f/2,transformOrigin:"center"})),h=n+1/3*u-u/2,p=n+2/3*u-u/2,g=r+1/4*f-f/2,m=r+3/4*f-f/2;d.maybeAppendByClassName("".concat(Cb.iconLine,"-1"),"line").styles(ke({x1:h,x2:h,y1:g,y2:m},l)),d.maybeAppendByClassName("".concat(Cb.iconLine,"-2"),"line").styles(ke({x1:p,x2:p,y1:g,y2:m},l)),"vertical"===c&&(d.node().style.transform="rotate(90)")},e}(ib),Lb=function(t){function e(e){return t.call(this,e,Tb)||this}return Ee(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,o=n.showLabel,a=Jv(this.attributes,"label"),s=a.x,c=void 0===s?0:s,l=a.y,u=void 0===l?0:l,f=a.transform,d=a.transformOrigin,h=Ce(eb(Se(a,["x","y","transform","transformOrigin"]),[]),2),p=h[0],g=h[1],m=Yv(t).maybeAppendByClassName(Cb.labelGroup,"g").styles(g),y=ke(ke({},_b),p),v=y.text,b=Se(y,["text"]);Ev(!!o,m,(function(t){e.label=t.maybeAppendByClassName(Cb.label,"text").styles(ke(ke({},b),{x:r+c,y:i+u,transform:f,transformOrigin:d,text:"".concat(v)})),e.label.on("mousedown",(function(t){t.stopPropagation()})),e.label.on("touchstart",(function(t){t.stopPropagation()}))}))},e.prototype.renderIcon=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,o=e.type,a=ke(ke({x:n,y:r,orientation:i},Ab),Jv(this.attributes,"icon")),s=this.attributes.iconShape,c=void 0===s?function(){return new Nb({style:a})}:s;Yv(t).maybeAppendByClassName(Cb.iconGroup,"g").selectAll(Cb.icon.class).data([c]).join((function(t){return t.append("string"==typeof c?c:function(){return c(o)}).attr("className",Cb.icon.name)}),(function(t){return t.update(a)}),(function(t){return t.remove()}))},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(ib),jb=function(t){function e(e){var n=t.call(this,e,ke(ke(ke({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},tb(Tb,"handle")),tb(Ab,"handleIcon")),tb(_b,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(Mv(e));var r=n.availableSpace,i=r.x,o=r.y,a=n.getBBox(),s=a.x,c=a.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([i,o])-n.getOrientVal([+s,+c])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,r=e.slidable,i=e.brushable,o=e.type;t.stopPropagation();var a=n.getOrientVal(Mv(t)),s=a-n.prevPos;if(s){var c=n.getRatio(s);switch(n.target){case"start":r&&n.setValuesOffset(c);break;case"end":r&&n.setValuesOffset(0,c);break;case"selection":r&&n.setValuesOffset(c,c);break;case"track":if(!i)return;n.selectionWidth+=c,"range"===o?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0)}n.prevPos=a}},n.onDragEnd=function(){document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointermove",n.onDragging),document.removeEventListener("pointerup",n.onDragEnd),n.target="",n.updateHandlesPosition(!1)},n.onValueChange=function(t){var e=n.attributes,r=e.onChange,i=e.type,o="range"===i?t:t[1],a="range"===i?n.getValues():n.getValues()[1],s=new up("valuechange",{detail:{oldValue:o,value:a}});n.dispatchEvent(s),null==r||r(a)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return Ee(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=Jv(this.attributes,"sparkline");return ke(ke({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,r=Ce(this.getOrientVal([[e,n],[n,e]]),2);return{width:r[0],height:r[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=Ce(Uv(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],i=t[3],o=this.shape;return{x:i,y:e,width:o.width-(i+n),height:o.height-(e+r)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll(Pb.selection.class).each((function(n,r){kb(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&kb(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&kb(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,r=this.clampValues(t);this.attributes.values=r,this.setValues(r),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=this.attributes,n=e.x,r=e.y,i=Jv(this.attributes,"track");this.trackShape=Yv(t).maybeAppendByClassName(Pb.track,"rect").styles(ke(ke({x:n,y:r},this.shape),i))},e.prototype.renderBrushArea=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.brushable;this.brushArea=Yv(t).maybeAppendByClassName(Pb.brushArea,"rect").styles(ke({x:n,y:r,fill:"transparent",cursor:i?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this,n=this.attributes,r=n.x,i=n.y;Ev("horizontal"===n.orientation,Yv(t).maybeAppendByClassName(Pb.sparklineGroup,"g"),(function(t){var n=ke(ke({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName(Pb.sparkline,(function(){return new xb({style:n})})).update(n)}))},e.prototype.renderHandles=function(){var t,e=this,n=this.attributes,r=n.showHandle,i=n.type,o=r?"range"===i?["start","end"]:["end"]:[],a=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(Pb.handle.class).data(o.map((function(t){return{type:t}})),(function(t){return t.type})).join((function(t){return t.append((function(t){var n=t.type;return new Lb({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(Pb.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");a[n]=this,this.addEventListener("pointerdown",a.onDragStart(e))}))}),(function(t){return t.each((function(t){var e=t.type;this.update(a.getHandleStyle(e))}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");a[n]=void 0})).remove()}))},e.prototype.renderSelection=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.type,o=e.selectionType;this.foregroundGroup=Yv(t).maybeAppendByClassName(Pb.foreground,"g");var a=Jv(this.attributes,"selection"),s=function(t){return t.style("visibility",(function(t){return t.show?"visible":"hidden"})).style("cursor",(function(t){return"select"===o?"grab":"invert"===o?"crosshair":"default"})).styles(ke(ke({},a),{transform:"translate(".concat(n,", ").concat(r,")")}))},c=this;this.foregroundGroup.selectAll(Pb.selection.class).data("value"===i?[]:this.calcSelectionArea().map((function(t,e){return{style:ke({},t),index:e,show:"select"===o?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",Pb.selection.name).call(s).each((function(t,e){var n=this;1===e?(c.selectionShape=Yv(this),this.on("pointerdown",(function(t){n.attr("cursor","grabbing"),c.onDragStart("selection")(t)})),c.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),c.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),c.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",(function(){n.attr("cursor","grabbing")})),this.addEventListener("pointerup",(function(){n.attr("cursor","pointer")})),this.addEventListener("pointerover",(function(){n.attr("cursor","pointer")}))):this.on("pointerdown",c.onDragStart("track"))}))}),(function(t){return t.call(s)}),(function(t){return t.remove()})),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var r=Ce(this.range,2),i=r[0],o=r[1],a=Ce(this.getValues().map((function(t){return Dv(t,e)})),2),s=a[0],c=a[1],l=Ce(((Array.isArray(t)?t:[s,null!=t?t:c])||[s,c]).map((function(t){return Dv(t,e)})),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,L(f,i,o)];u>f&&(u=(n=Ce([f,u],2))[0],f=n[1]);var d=f-u;return d>o-i?[i,o]:u<i?s===i&&c===f?[i,f]:[i,d+i]:f>o?c===o&&s===u?[u,o]:[o-d,o]:[u,f]},e.prototype.calcSelectionArea=function(t){var e=Ce(this.clampValues(t),2),n=e[0],r=e[1],i=this.availableSpace,o=i.x,a=i.y,s=i.width,c=i.height;return this.getOrientVal([[{y:a,height:c,x:o,width:n*s},{y:a,height:c,x:n*s+o,width:(r-n)*s},{y:a,height:c,x:r*s,width:(1-r)*s}],[{x:o,width:s,y:a,height:n*c},{x:o,width:s,y:n*c+a,height:(r-n)*c},{x:o,width:s,y:r*c,height:(1-r)*c}]])},e.prototype.calcHandlePosition=function(t){var e=this.attributes.handleIconOffset,n=this.availableSpace,r=n.x,i=n.y,o=n.width,a=n.height,s=Ce(this.clampValues(),2),c=s[0],l=s[1],u="start"===t?-e:e,f=("start"===t?c:l)*this.getOrientVal([o,a])+u;return{x:r+this.getOrientVal([f,o/2]),y:i+this.getOrientVal([a/2,f])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:"end"===t?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.type,i=n.orientation,o=n.formatter,a=n.autoFitLabel,s=Jv(this.attributes,"handle"),c=Jv(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),d=o("start"===t?f[0]:f[1]),h=new sv({style:ke(ke(ke({},c),this.inferTextStyle(t)),{text:d})}),p=h.getBBox(),g=p.width,m=p.height;if(h.destroy(),!a){if("value"===r)return{text:d,x:0,y:-m-l};var y=l+u+("horizontal"===i?g/2:0);return(e={text:d})["horizontal"===i?"x":"y"]="start"===t?-y:y,e}var v=0,b=0,x=this.availableSpace,w=x.width,M=x.height,O=this.calcSelectionArea()[1],E=O.x,k=O.y,S=O.width,A=O.height,_=l+u;if("horizontal"===i){var T=_+g/2;if("start"===t)v=E-_-g>0?-T:T;else v=w-E-S-_>g?T:-T}else{var P=m+_;b="start"===t?k-u>m?-P:_:M-(k+A)-u>m?P:-_}return{x:v,y:b,text:d}},e.prototype.getHandleLabelStyle=function(t){var e=Jv(this.attributes,"handleLabel");return ke(ke(ke({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=Jv(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return ke({cursor:n,shape:t,size:r},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.showLabel,o=e.showLabelOnInteraction,a=e.orientation,s=this.calcHandlePosition(t),c=s.x,l=s.y,u=this.calcHandleText(t),f=i;return!i&&o&&(f=!!this.target),ke(ke(ke({},tb(this.getHandleIconStyle(),"icon")),tb(ke(ke({},this.getHandleLabelStyle(t)),u),"label")),{transform:"translate(".concat(c+n,", ").concat(l+r,")"),orientation:a,showLabel:f,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,r=t.height;return e||Math.floor((this.getOrientVal([+r,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=Ce(t,2),n=e[0],r=e[1];return"horizontal"===this.attributes.orientation?n:r},e.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var r=this.attributes.type,i=Ce(this.getValues(),2),o=[i[0]+("range"===r?t:0),i[1]+e].sort();n?this.setValues(o):this.innerSetValues(o,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,r=e.height;return t/this.getOrientVal([n,r])},e.prototype.dispatchCustomEvent=function(t,e,n){var r=this;t.on(e,(function(t){t.stopPropagation(),r.dispatchEvent(new up(n,{detail:t}))}))},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,r=this.getRatio(n);this.setValuesOffset(r,r,!0)}},e.tag="slider",e}(ib),Rb=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return n.range=[0,1],n.onValueChange=function(t){var e=n.attributes.value;if(t!==e){var r={detail:{oldValue:t,value:e}};n.dispatchEvent(new up("scroll",r)),n.dispatchEvent(new up("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=Ce(n.getLocalPosition(),2),r=e[0],i=e[1],o=Ce(n.padding,4),a=o[0],s=o[3],c=n.getOrientVal([r+s,i+a]),l=(n.getOrientVal(Mv(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new up("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new up("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new up("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new up("trackMouseleave",{detail:t.detail}))},n}return Ee(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return Uv(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=Ce(this.range,2),n=e[0],r=e[1];return L(t,n,r)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackLength",{get:function(){var t=this.attributes,e=t.viewportLength,n=t.trackLength;return void 0===n?e:n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes.trackSize,e=this.trackLength,n=Ce(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=Ce(this.getOrientVal([[e,t],[t,e]]),2);return{x:a,y:r,width:+s[0]-(a+i),height:+s[1]-(r+o)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"trackRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.trackSize;return e?n/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thumbRadius",{get:function(){var t=this.attributes,e=t.isRound,n=t.thumbRadius;if(!e)return 0;var r=this.availableSpace,i=r.width,o=r.height;return n||this.getOrientVal([o,i])/2},enumerable:!1,configurable:!0}),e.prototype.getValues=function(t){void 0===t&&(t=this.value);var e=this.attributes,n=e.viewportLength/e.contentLength,r=Ce(this.range,2),i=r[0],o=t*(r[1]-i-n);return[o,o+n]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,o=e.trackSize,a=e.padding,s=e.slidable,c=Jv(this.attributes,"track"),l=Jv(this.attributes,"thumb"),u=ke(ke({x:n,y:r,brushable:!1,orientation:i,padding:a,selectionRadius:this.thumbRadius,showHandle:!1,slidable:s,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:o,values:this.getValues()},tb(c,"track")),tb(l,"selection"));this.slider=Yv(t).maybeAppendByClassName("scrollbar",(function(){return new jb({style:u})})).update(u).node()},e.prototype.render=function(t,e){this.renderSlider(e)},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.attributes.value,r=Ce(this.range,2),i=r[0],o=r[1];this.slider.setValues(this.getValues(L(t,i,o)),e),this.onValueChange(n)},e.prototype.bindEvents=function(){var t=this;this.slider.addEventListener("trackClick",(function(e){e.stopPropagation(),t.onTrackClick(e.detail)})),this.onHover()},e.prototype.getOrientVal=function(t){return"horizontal"===this.attributes.orientation?t[0]:t[1]},e.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},e.tag="scrollbar",e}(ib),Ib={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new eg({style:{d:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]};K({},Ib,{style:{type:"arc"}}),K({},Ib,{style:{}});var Bb=hv({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"),Db=hv({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Fb(t){return t.reduce((function(t,e,n){return t.push(Ne([0===n?"M":"L"],Ce(e),!1)),t}),[])}function zb(t,e,n){return"surround"===e.type?function(t,e,n){var r=e.connect,i=void 0===r?"line":r,o=e.center;if("line"===i)return Fb(t);if(!o)return[];var a=Iv(t[0],o),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push(Ne(["M"],Ce(e),!1)):t.push(Ne(["A",a,a,0,0,s],Ce(e),!1)),t}),[])}(t,e,n):Fb(t)}function Gb(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=Ce([zb(t,n),zb(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=Ce([t[0],e.slice(-1)[0]],2),f=u[0],d=u[1],h=function(t,e){return[c,t,l,e,a].flat()};if("line"===i||"surround"===r)return h([Ne(["L"],Ce(d),!1)],[Ne(["L"],Ce(f),!1)]);if(!o)throw new Error("Arc grid need to specified center");var p=Ce([Iv(d,o),Iv(f,o)],2),g=p[0],m=p[1];return h([Ne(["A",g,g,0,0,1],Ce(d),!1),Ne(["L"],Ce(d),!1)],[Ne(["A",m,m,0,0,0],Ce(f),!1),Ne(["L"],Ce(f),!1)])}var Wb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ee(e,t),e.prototype.render=function(t,e){var n=Se(t,["type","center","areaFill","closed"]),r=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map((function(t){var e=t.points,n=Ce(e,1)[0];return ke(ke({},t),{points:Ne(Ne([],Ce(e),!1),[n],!1)})})):n}(t),i=Yv(e).maybeAppendByClassName(Db.lineGroup,"g"),o=Yv(e).maybeAppendByClassName(Db.regionGroup,"g"),a=function(t,e,n,r){var i=n.animate,o=n.isBillboard,a=e.map((function(t,e){return{id:t.id||"grid-line-".concat(e),d:zb(t.points,n)}}));return t.selectAll(Db.line.class).data(a,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=fv($v(ke({d:t.d},r)),[t,e,a]);this.attr(ke({class:Db.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))}))}),(function(t){return t.transition((function(t,e){return kb(this,fv($v(ke({d:t.d},r)),[t,e,a]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=Sb(this,i.exit);return Mb(e,(function(){return t.remove()})),e}))})).transitions()}(i,r,t,n),s=function(t,e,n){var r=n.animate,i=n.connect,o=n.areaFill;if(e.length<2||!o||!i)return[];for(var a=Array.isArray(o)?o:[o,"transparent"],s=function(t){return a[t%a.length]},c=[],l=0;l<e.length-1;l++){var u=Ce([e[l].points,e[l+1].points],2),f=Gb(u[0],u[1],n);c.push({d:f,fill:s(l)})}return t.selectAll(Db.region.class).data(c,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=fv(t,[t,e,c]);this.attr(n)})).attr("className",Db.region.name)}),(function(t){return t.transition((function(t,e){return kb(this,fv(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=Sb(this,r.exit);return Mb(e,(function(){return t.remove()})),e}))})).transitions()}(o,r,t);return Ne(Ne([],Ce(a),!1),Ce(s),!1)},e}(ib);function $b(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=Ce(t,2);return[n[0],fv(n[1],e)]})))}function Hb(t,e){return e&&y(e)?t.filter(e):t}function Vb(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function Yb(t,e){if("linear"===e.type){var n=Ce(e.startPos,2),r=n[0],i=n[1],o=Ce(e.endPos,2),a=Ce([o[0]-r,o[1]-i],2);return Bv([a[0],a[1]])}var s=cv(Vb(t,e));return[-Math.sin(s),Math.cos(s)]}function Ub(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(Yb(t,n),"positive"!==e)}function qb(t,e){return Ub(t,e.labelDirection,e)}function Xb(t,e){return"linear"===e.type?function(t,e){var n=Ce(e.startPos,2),r=n[0],i=n[1],o=Ce(e.endPos,2),a=Ce([o[0]-r,o[1]-i],2);return[r+a[0]*t,i+a[1]*t]}(t,e):function(t,e){var n=e.radius,r=Ce(e.center,2),i=r[0],o=r[1],a=cv(Vb(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function Zb(t){return 0===Yb(0,t)[1]}function Kb(t){return 0===Yb(0,t)[0]}function Qb(t,e){return e-t==360}function Jb(t,e,n,r,i){var o=e-t,a=Ce([i,i],2),s=a[0],c=a[1],l=Ce([cv(t),cv(e)],2),u=l[0],f=l[1],d=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},h=Ce(d(u),2),p=h[0],g=h[1],m=Ce(d(f),2),y=m[0],v=m[1];if(Qb(t,e)){var b=Ce(d((f+u)/2),2);return[["M",p,g],["A",s,c,0,1,0,b[0],b[1]],["A",s,c,0,1,0,y,v]]}var x=o>180?1:0,w=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(c,",0,").concat(x,",").concat(w,",").concat(y,",").concat(v)}function tx(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(Bb.line.class).data([{d:Jb.apply(void 0,Ne(Ne([i,o],Ce(a),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",Bb.line.name).styles(e).styles({d:function(t){return t.d}})}),(function(t){return t.transition((function(){var t=this,e=function(t,e,n,r){if(!r)return t.attr("__keyframe_data__",n),null;var i=r.duration,o=void 0===i?0:i,a=Av(e,n),s=Math.ceil(+o/16),c=new Array(s).fill(0).map((function(t,e,n){return{__keyframe_data__:a(e/(n.length-1))}}));return t.animate(c,ke({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return Ne(Ne([n,r],Ce(i),!1),[o],!1)}(this),Ne(Ne([i,o],Ce(a),!1),[s],!1),r.update);if(e){var n=function(){var e=et(t.attributes,"__keyframe_data__");t.style.d=Jb.apply(void 0,Ne([],Ce(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function ex(t){var e=Ce(t,2),n=Ce(e[0],2),r=n[0],i=n[1],o=Ce(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function nx(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,c=e.lineExtension,l=Ce([o,a],2),u=Ce(l[0],2),f=u[0],d=u[1],h=Ce(l[1],2),p=h[0],g=h[1],m=Ce(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=Ce([t,e,n],3),i=Ce(r[0],2),o=i[0],a=i[1],s=Ce(r[1],2),c=s[0],l=s[1],u=Ce(r[2],2),f=u[0],d=u[1],h=Ce([c-o,l-a],2),p=h[0],g=h[1],m=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),y=Ce([-f/m,d/m],2),v=y[0],b=y[1];return[v*p,v*g,b*p,b*g]}(o,a,c):new Array(4).fill(0),4),y=m[0],v=m[1],b=m[2],x=m[3],w=function(e){return t.selectAll(Bb.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(Bb.line.name," ").concat(t.className)})).styles(n).transition((function(t){return kb(this,ex(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return kb(this,ex(t.line),r.update)}))}),(function(t){return t.remove()})).transitions()};if(!i||!s)return w([{line:[[f+y,d+v],[p+b,g+x]],className:Bb.line.name}]);var M=Ce(s,2),O=M[0],E=M[1],k=p-f,S=g-d,A=Ce([f+k*O,d+S*O],2),_=A[0],T=A[1],P=Ce([f+k*E,d+S*E],2),C=P[0],N=P[1];return w([{line:[[f+y,d+v],[_,T]],className:Bb.lineFirst.name},{line:[[C,N],[p+b,g+x]],className:Bb.lineSecond.name}])}function rx(t,e,n){var r,i=e.type,o=Jv(e,"line");return r="linear"===i?nx(t,e,Fv(o,"arrow"),n):tx(t,e,Fv(o,"arrow"),n),function(t,e,n,r){var i,o=n.showArrow,a=n.showTrunc,s=n.lineArrow,c=n.lineArrowOffset,l=n.lineArrowSize;if(i="arc"===e?t.select(Bb.line.class):a?t.select(Bb.lineSecond.class):t.select(Bb.line.class),!o||!s||"arc"===n.type&&Qb(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=Ov(s);f.attr(r),Hv(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function ix(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function ox(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=Ce(Xb(i,e),2),a=o[0],s=o[1],c=Ce(Cv(function(t,e){return Ub(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}}))}function ax(t,e,n,r){var i=Jv(n,"grid"),o=i.type,a=i.areaFill,s=ix(n),c=Hb(e,n.gridFilter),l="segment"===o?ox(c,n):function(t,e){var n=e.gridControlAngles,r=ix(e);if(!r)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var i=Ce(r,2),o=i[0],a=i[1];return t.map((function(t,r){var i=Ce(Xb(t.value,e),2),s=i[0],c=i[1],l=Ce([s-o,c-a],2),u=l[0],f=l[1],d=[];return n.forEach((function(t){var e=cv(t),n=Ce([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=u*r-f*i+o,c=u*i+f*r+a;d.push([s,c])})),{points:d,id:r}}))}(c,n),u=ke(ke({},i),{center:s,areaFill:y(a)?c.map((function(t,e){return fv(a,[t,e,c])})):a,animate:r,data:l});return t.selectAll(Bb.grid.class).data([1]).join((function(t){return t.append((function(){return new Wb({style:u})})).attr("className",Bb.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}var sx=function(){function t(t,e,n,r){this.set(t,e,n,r)}return Object.defineProperty(t.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),t.prototype.rotatedPoints=function(t,e,n){var r=this,i=r.x1,o=r.y1,a=r.x2,s=r.y2,c=Math.cos(t),l=Math.sin(t),u=e-e*c+n*l,f=n-e*l-n*c;return[[c*i-l*s+u,l*i+c*s+f],[c*a-l*s+u,l*a+c*s+f],[c*i-l*o+u,l*i+c*o+f],[c*a-l*o+u,l*a+c*o+f]]},t.prototype.set=function(t,e,n,r){return n<t?(this.x2=t,this.x1=n):(this.x1=t,this.x2=n),r<e?(this.y2=e,this.y1=r):(this.y1=e,this.y2=r),this},t.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},t}();function cx(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getBounds(),i=Ce(r.min,2),o=i[0],a=i[1],s=Ce(r.max,2),c=s[0],l=s[1],u=t.getBBox(),f=u.width,d=u.height,h=0,p=0,g=o,m=a,y=bv(t);if(y){d-=1.5;var v=y.style.textAlign,b=y.style.textBaseline;"center"===v?g=(o+c)/2:"right"!==v&&"end"!==v||(g=c),"middle"===b?m=(a+l)/2:"bottom"===b&&(m=l)}var x=Ce(Uv(e),4),w=x[0],M=void 0===w?0:w,O=x[1],E=void 0===O?0:O,k=x[2],S=void 0===k?M:k,A=x[3],_=new sx((h+=o)-(void 0===A?E:A),(p+=a)-M,h+f+E,p+d+S);return t.setEulerAngles(n),_.rotatedPoints(cv(n),g,m)}function lx(t,e){return e[0]<=Math.max(t[0][0],t[1][0])&&e[0]<=Math.min(t[0][0],t[1][0])&&e[1]<=Math.max(t[0][1],t[1][1])&&e[1]<=Math.min(t[0][1],t[1][1])}function ux(t,e,n){var r=(e[1]-t[1])*(n[0]-e[0])-(e[0]-t[0])*(n[1]-e[1]);return 0===r?0:r<0?2:1}function fx(t,e){return e.every((function(e){return function(t,e){var n=t.length;if(n<3)return!1;var r,i,o,a,s,c,l=[e,[9999,e[1]]],u=0,f=0;do{var d=[t[f],t[(f+1)%n]];if(i=l,o=void 0,a=void 0,s=void 0,c=void 0,o=ux((r=d)[0],r[1],i[0]),a=ux(r[0],r[1],i[1]),s=ux(i[0],i[1],r[0]),c=ux(i[0],i[1],r[1]),o!==a&&s!==c||0===o&&lx(r,i[0])||0===a&&lx(r,i[1])||0===s&&lx(i,r[0])||0===c&&lx(i,r[1])){if(0===ux(d[0],e,d[1]))return lx(d,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(t,e)}))}function dx(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some((function(t){return function(t,e){var n=Ce(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=Ce(e,4),c=s[0],l=s[1],u=o-r,f=a-i,d=s[2]-c,h=s[3]-l,p=u*h-d*f;if(0===p)return!1;var g=p>0,m=r-c,y=i-l,v=u*y-f*m;if(v<0===g)return!1;var b=d*y-h*m;return b<0!==g&&v>p!==g&&b>p!==g}(e,t)}))}function hx(t,e,n){var r,i,o=e.crossPadding,a=new Set,s=null,c=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var o=t.center,a=t.radius,s=Ce(o,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-a-u,d=a+u,h=Ce(Uv(e),4),p=h[0],g=h[1],m=h[2],y=h[3];return new sx(c+f-y,l+f-p,c+d+g,l+d+m)}var v=Ce(t.startPos,2),b=v[0],x=v[1],w=Ce(t.endPos,2),M=w[0],O=w[1],E=Ce(Kb(t)?[-e,0,e,0]:[0,e,0,-e],4),k=E[0],S=E[1],A=E[2],_=E[3],T=Cv(qb(0,t),i),P=new sx(b,x,M,O);return P.x1+=_,P.y1+=k,P.x2+=S+T[0],P.y2+=A+T[1],P}(e,o),l=function(t){return!c||function(t,e,n){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;return fx([[r,o],[i,o],[i,a],[r,a]],cx(e,n))}(c,t)},u=function(t,e){return!t||!t.firstChild||!function(t,e,n){var r,i,o=cx(t,n).flat(1),a=cx(e,n).flat(1),s=[[o[0],o[1],o[2],o[3]],[o[0],o[1],o[4],o[5]],[o[4],o[5],o[6],o[7]],[o[2],o[3],o[6],o[7]]];try{for(var c=Pe(s),l=c.next();!l.done;l=c.next())if(dx(a,l.value))return!0}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return!1}(t.firstChild,e.firstChild,Uv(n))};try{for(var f=Pe(t),d=f.next();!d.done;d=f.next()){var h=d.value;l(h)?!s||u(s,h)?s=h:(a.add(s),a.add(h)):a.add(h)}}catch(t){r={error:t}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(a)}function px(t,e){return void 0===e&&(e={}),v(t)?0:"number"==typeof t?t:Math.floor(yv(t,e))}var gx=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(rv(t),!1)}))};var mx=new Map([["hide",function(t,e,n,r){var i=t.length,o=e.keepHeader,a=e.keepTail;if(!(i<=1||2===i&&o&&a)){var s,c,l,u=gx,f=function(t){return t.forEach(r.show),t},d=2,h=t.slice(),p=t.slice(),g=Math.min.apply(Math,Ne([1],Ce(t.map((function(t){return t.getBBox().width}))),!1));if("linear"===n.type&&(Zb(n)||Kb(n))){var m=qv(t[0]).left,y=qv(t[i-1]).right,v=Math.abs(y-m)||1;d=Math.max(Math.floor(i*g/v),d)}for(o&&(s=h.splice(0,1)[0]),a&&(c=h.splice(-1,1)[0],h.reverse()),f(h);d<t.length&&hx((l=c?Ne(Ne([c],Ce(p),!1),[s],!1):Ne([s],Ce(p),!1),l.filter(mv)),n,null==e?void 0:e.margin).length;){if(c&&!s&&d%2==0)h.splice(0,1).forEach(r.hide);else if(c&&s){h.splice(0,1).forEach(r.hide)}p=u(f(h),{seq:d}),d++}}}],["rotate",function(t,e,n,r){var i,o,a=e.optionalAngles,s=void 0===a?[0,45,90]:a,c=e.margin,l=e.recoverWhenFailed,u=void 0===l||l,f=t.map((function(t){return t.getLocalEulerAngles()})),d=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.rotate(t,+i)}))};try{for(var h=Pe(s),p=h.next();!p.done;p=h.next()){if(d(p.value),hx(t,n,c).length<1)return}}catch(t){i={error:t}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}u&&d(f)}],["ellipsis",function(t,e,n,r){if(!(t.length<=1)){var i=e.suffix,o=void 0===i?"...":i,a=e.minLength,s=e.maxLength,c=void 0===s?1/0:s,l=e.step,u=void 0===l?" ":l,f=e.margin,d=void 0===f?[0,0,0,0]:f,h=vv(r.getTextShape(t[0])),p=px(u,h),g=a?px(a,h):p,m=px(c,h);(v(m)||m===1/0)&&(m=Math.max.apply(null,t.map((function(t){return t.getBBox().width}))));var y=t.slice();Ce(d,4);for(var b=function(e){if(y.forEach((function(t){r.ellipsis(r.getTextShape(t),e,o)})),(y=hx(t,n,d)).length<1)return{value:void 0}},x=m;x>g+p;x-=p){var w=b(x);if("object"==typeof w)return w.value}}}],["wrap",function(t,e,n,r){var i=e.wordWrapWidth,o=void 0===i?50:i,a=e.maxLines,s=void 0===a?3:a,c=e.recoverWhenFailed,l=void 0===c||c,u=e.margin,f=void 0===u?[0,0,0,0]:u,d=t.map((function(t){return t.attr("maxLines")||1})),h=Math.min.apply(Math,Ne([],Ce(d),!1)),p=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&Zb(t)?"negative"===n?"bottom":"top":"middle"}(n),g=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,o,i,p)}))};if(!(h>s)){for(var m=h;m<=s;m++)if(g(m),hx(t,n,f).length<1)return;l&&g(d)}}]]);function yx(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return t*function(t){return"positive"===t?-1:1}(e)}),1)}function vx(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function bx(t,e){var n=Ce(t,2),r=n[0],i=n[1],o=Ce(e,2),a=o[0],s=o[1],c=Ce([r*a+i*s,r*s-i*a],2),l=c[0],u=c[1];return Math.atan2(u,l)}function xx(t,e,n){var r,i=n.labelAlign;if(null===(r=e.style.transform)||void 0===r?void 0:r.includes("rotate"))return e.getLocalEulerAngles();var o=qb(t.value,n),a=Yb(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return kv(e,-90,90)||(e+=180),e}(lv("perpendicular"===i?bx([1,0],o):bx([a[0]<0?-1:1,0],a)))}function wx(t,e,n){var r=n.type,i=n.labelAlign,o=qb(t,n),a=vx(e),s=vx(lv(bx([1,0],o))),c="center",l="middle";return"linear"===r?[90,270].includes(s)&&0===a?(c="center",l=1===o[1]?"top":"bottom"):s%180||![90,270].includes(a)?0===s?(kv(a,0,90,!1,!0)||kv(a,0,90)||kv(a,270,360))&&(c="start"):90===s?kv(a,0,90,!1,!0)?c="start":(kv(a,90,180)||kv(a,270,360))&&(c="end"):270===s?kv(a,0,90,!1,!0)?c="end":(kv(a,90,180)||kv(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(kv(a,0,90)||kv(a,270,360))&&(c="end")):c="center":"parallel"===i?l=kv(s,0,180,!0)?"top":"bottom":"horizontal"===i?kv(s,90,270,!1)?c="end":(kv(s,270,360,!1)||kv(s,0,90))&&(c="start"):"perpendicular"===i&&(c=kv(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function Mx(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=fv(s,[t,c,e]),u=Ce([qb(t.value,n),yx(a,o)],2),f=Ce(Nv(Cv(u[0],l+(1===u[1]?fv(r?i:0,[t,c,e]):0)),Xb(t.value,n)),2);return{x:f[0],y:f[1]}}function Ox(t,e){"text"===t.nodeName&&t.attr(e)}function Ex(t){!function(t,e,n){var r=e.labelOverlap,i=void 0===r?[]:r;i.length&&i.forEach((function(r){var i=r.type,o=mx.get(i);(function(t,e,n){return!(e.labelOverlap.length<1)&&("hide"===n?!function(t){for(var e=t;e;){if("offscreen"===e.className)return!0;e=e.parent}return!1}(t[0]):"rotate"===n?!t.some((function(t){var e;return!!(null===(e=t.attr("transform"))||void 0===e?void 0:e.includes("rotate"))})):"ellipsis"!==n&&"wrap"!==n||t.filter((function(t){return t.querySelector("text")})).length>1)})(t,e,i)&&(null==o||o(t,r,e,n))}))}(this.node().childNodes,t,{hide:rv,show:nv,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=wx(e.__data__.value,t,n),i=e.querySelector(Bb.labelItem.class);i&&Ox(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&wv(t,e||1/0,n)},wrap:function(t,e,n){var r,i;t&&(void 0===(r=n)&&(r=2),void 0===i&&(i="top"),xv(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function kx(t,e,n,r,i){var o=n.indexOf(e),a=Yv(t).append(function(t,e,n,r){var i=r.labelFormatter;return y(i)?function(){return Ov(fv(i,[t,e,n,qb(t.value,r)]))}:function(){return Ov(t.label||"")}}(e,o,n,i)).attr("className",Bb.labelItem.name).node(),s=Ce(eb($b(r,[e,o,n])),2),c=s[0],l=s[1],u=l.transform,f=Se(l,["transform"]);nb(a,u);var d=xx(e,a,i);return a.getLocalEulerAngles()||a.setLocalEulerAngles(d),Ox(a,ke(ke({},wx(e.value,d,i)),c)),t.attr(f),a}function Sx(t,e,n,r){var i=Hb(e,n.labelFilter),o=Jv(n,"label");return t.selectAll(Bb.label.class).data(i,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",Bb.label.name).transition((function(t){kx(this,t,e,o,n);var r=Mx(t,e,n),i=r.x,a=r.y;return this.style.transform="translate(".concat(i,", ").concat(a,")"),null})).call((function(){Ex.call(t,n)}))}),(function(i){return i.transition((function(t){var i=function(t,e,n,r){if(void 0===r&&(r="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var i=function(){"destroy"===r?t.destroy():"hide"===r&&rv(t),e.isVisible()&&nv(e)};if(!n)return i(),[null];var o=n.duration,a=void 0===o?0:o,s=n.delay,c=void 0===s?0:s,l=Math.ceil(+a/2),u=+a/4,f=Ce(t.getGeometryBounds().center,2),d=f[0],h=f[1],p=Ce(e.getGeometryBounds().center,2),g=Ce([(d+p[0])/2-d,(h+p[1])/2-h],2),m=g[0],y=g[1],v=t.style.opacity,b=void 0===v?1:v,x=e.style.opacity,w=void 0===x?1:x,M=t.style.transform||"",O=e.style.transform||"",E=t.animate([{opacity:b,transform:"translate(0, 0) ".concat(M)},{opacity:0,transform:"translate(".concat(m,", ").concat(y,") ").concat(M)}],ke(ke({fill:"both"},n),{duration:c+l+u})),k=e.animate([{opacity:0,transform:"translate(".concat(-m,", ").concat(-y,") ").concat(O),offset:.01},{opacity:w,transform:"translate(0, 0) ".concat(O)}],ke(ke({fill:"both"},n),{duration:l+u,delay:c+l-u}));return Mb(k,i),[E,k]}(this.querySelector(Bb.labelItem.class),kx(this,t,e,o,n),r.update),a=Mx(t,e,n),s=a.x,c=a.y,l=kb(this,{transform:"translate(".concat(s,", ").concat(c,")")},r.update);return Ne(Ne([],Ce(i),!1),[l],!1)})).call((function(e){var r,i,o=et(e,"_transitions").flat().filter(mv);i=function(){Ex.call(t,n)},0===(r=o).length?i():Promise.all(r.map((function(t){return null==t?void 0:t.finished}))).then(i)}))}),(function(t){return t.transition((function(){var t=this,e=Sb(this.childNodes[0],r.exit);return Mb(e,(function(){return Yv(t).remove()})),e}))})).transitions()}function Ax(t,e){return Ub(t,e.tickDirection,e)}function _x(t,e,n,r,i){var o=Ce(function(t,e){var n=Ce(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,fv(i.tickLength,[t,e,n])),2),a=Ce(o[0],2),s=a[0],c=a[1],l=Ce(o[1],2);return{x1:s,x2:l[0],y1:c,y2:l[1]}}function Tx(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=Ax(e.value,i),s="line";return y(o)&&(s=function(){return fv(o,[e,n,r,a])}),t.append(s).attr("className",Bb.tickItem.name)}(Yv(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=Ax(t.value,o),c=_x(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,d=c.y2,h=Ce(eb($b(a,[t,e,n,s])),2),p=h[0],g=h[1];"line"===r.node().nodeName&&r.styles(ke({x1:l,x2:u,y1:f,y2:d},p)),i.attr(g),r.styles(p)}(t,e,n,a,this,r,i);var s=Ce(Xb(t.value,r),2),c=s[0],l=s[1];return kb(this,{transform:"translate(".concat(c,", ").concat(l,")")},o)}var Px=hv({text:"text"},"title");function Cx(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function Nx(t,e){var n=Object.entries(e).reduce((function(e,n){var r=Ce(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e}),{});t.styles(n)}var Lx=function(t){function e(e){return t.call(this,e,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return Ee(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=t.position,i=t.spacing,o=t.inset,a=this.querySelector(Px.text.class);if(!a)return new uv(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=Ce(Uv(i),4),f=u[0],d=u[1],h=u[2],p=u[3],g=Ce([0,0,+e,+n],4),m=g[0],y=g[1],v=g[2],b=g[3],x=Cx(r);if(x.includes("i"))return new uv(m,y,v,b);x.forEach((function(t,r){var i,o,a,s;"t"===t&&(i=Ce(0===r?[l+h,+n-l-h]:[0,+n],2),y=i[0],b=i[1]),"r"===t&&(o=Ce([+e-c-p],1),v=o[0]),"b"===t&&(a=Ce([+n-l-f],1),b=a[0]),"l"===t&&(s=Ce(0===r?[c+d,+e-c-d]:[0,+e],2),m=s[0],v=s[1])}));var w=Ce(Uv(o),4),M=w[0],O=w[1],E=w[2],k=w[3],S=Ce([k+O,M+E],2),A=S[0],_=S[1];return new uv(m+k,y+M,v-A,b-_)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new uv(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=Se(t,["width","height","position","spacing"]),i=Ce(eb(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,c=o.position,l=Ce([+a/2,+s/2],2),u=Ce([+l[0],+l[1],"center","middle"],4),f=u[0],d=u[1],h=u[2],p=u[3],g=Cx(c);return g.includes("l")&&(f=(e=Ce([0,"start"],2))[0],h=e[1]),g.includes("r")&&(f=(n=Ce([+a,"end"],2))[0],h=n[1]),g.includes("t")&&(d=(r=Ce([0,"top"],2))[0],p=r[1]),g.includes("b")&&(d=(i=Ce([+s,"bottom"],2))[0],p=i[1]),{x:f,y:d,textAlign:h,textBaseline:p}}(t),a=o.x,s=o.y,c=o.textAlign,l=o.textBaseline;Ev(!!r.text,Yv(e),(function(t){n.title=t.maybeAppendByClassName(Px.text,"text").styles(i).call(Nx,{x:a,y:s,textAlign:c,textBaseline:l}).node()}))},e}(ib);function jx(t,e,n,r,i){var o=Ce(eb(Jv(r,"title")),2),a=o[0],s=o[1],c=s.transform,l=s.transformOrigin,u=Se(s,["transform","transformOrigin"]);e.styles(u);var f=c||function(t,e,n){var r=2*t.getGeometryBounds().halfExtents[1];if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(r/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(r/2,")")}return""}(t.node(),a.direction,a.position);t.styles(ke(ke({},a),{transformOrigin:l})),nb(t.node(),f);var d=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=Cx(i),s=t.node().getLocalBounds(),c=Ce(s.min,2),l=c[0],u=c[1],f=Ce(s.halfExtents,2),d=f[0],h=f[1],p=Ce(e.node().getLocalBounds().halfExtents,2),g=p[0],m=p[1],y=Ce([l+d,u+h],2),v=y[0],b=y[1],x=Ce(Uv(o),4),w=x[0],M=x[1],O=x[2],E=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var k=n.startPos,S=n.endPos,A=Ce("start"===i?[k,S]:[S,k],2),_=A[0],T=A[1],P=Ce(Cv(Bv([-T[0]+_[0],-T[1]+_[1]]),w),2),C=P[0],N=P[1];return{x:_[0]+C,y:_[1]+N}}return a.includes("t")&&(b-=h+m+w),a.includes("r")&&(v+=d+g+M),a.includes("l")&&(v-=d+g+E),a.includes("b")&&(b+=h+m+O),{x:v,y:b}}(Yv(n._offscreen||n.querySelector(Bb.mainGroup.class)),e,r),h=d.x,p=d.y;return kb(e.node(),{transform:"translate(".concat(h,", ").concat(p,")")},i)}function Rx(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=Ev(i,e.maybeAppendByClassName(Bb.lineGroup,"g"),(function(e){return rx(e,t,r)}))||[],c=Ev(o,e.maybeAppendByClassName(Bb.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=Hb(e,n.tickFilter),o=Jv(n,"tick");return t.selectAll(Bb.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",Bb.tick.name).transition((function(t,e){return Tx.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),Tx.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=Sb(this.childNodes[0],r.exit);return Mb(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=Ev(a,e.maybeAppendByClassName(Bb.labelGroup,"g"),(function(e){return Sx(e,n,t,r)}))||[];return Ne(Ne(Ne([],Ce(s),!1),Ce(c),!1),Ce(l),!1).filter((function(t){return!!t}))}var Ix=function(t){function e(e){return t.call(this,e,Ib)||this}return Ee(e,t),e.prototype.render=function(t,e,n){var r=this,i=t.titleText,o=t.data,a=t.animate,s=t.showTitle,c=t.showGrid,l=t.dataThreshold,u=t.truncRange,f=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),r=[],i=0;i<t.length;i+=n)r.push(t[i]);return r}(o,l).filter((function(t){var e=t.value;return!(u&&e>u[0]&&e<u[1])})),d=wb(void 0===n?a:n),h=Ev(c,Yv(e).maybeAppendByClassName(Bb.gridGroup,"g"),(function(e){return ax(e,f,t,d)}))||[],p=Yv(e).maybeAppendByClassName(Bb.mainGroup,"g");i&&(!this.initialized&&d.enter||this.initialized&&d.update)&&Rx(t,Yv(this.offscreenGroup),f,wb(!1));var g=Rx(t,Yv(p.node()),f,d),m=Ev(s,Yv(e).maybeAppendByClassName(Bb.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(Bb.title.class).data([{title:i}].filter((function(t){return!!t.title})),(function(t,e){return t.title})).join((function(o){return o.append((function(){return Ov(i)})).attr("className",Bb.title.name).transition((function(){return jx(Yv(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return jx(Yv(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,d)}))||[];return Ne(Ne(Ne([],Ce(h),!1),Ce(g),!1),Ce(m),!1).flat().filter((function(t){return!!t}))},e}(ib),Bx=hv({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),Dx=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:ub(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new Kp({class:Bx.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new Kp({class:Bx.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return Ee(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return L(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=Ce(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map((function(e,n){return t.map((function(t){return t[n]}))})))||[]}(this.pageViews.map((function(t){var e=t.getBBox();return[e.width,e.height]}))).map((function(t){return Math.max.apply(Math,Ne([],Ce(t),!1))})),2),e=t[0],n=t[1],r=this.attributes,i=r.pageWidth,o=void 0===i?e:i,a=r.pageHeight;return{pageWidth:o,pageHeight:void 0===a?n:a}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,o=this.pageShape,a=o.pageWidth,s=o.pageHeight;return new uv(n,r,a+i.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,r=this,i=r.currPage,o=r.playState,a=r.playWindow,s=r.pageViews;if("idle"!==o||t<0||s.length<=0||t>=s.length)return null;s[i].setLocalPosition(0,0),this.prepareFollowingPage(t);var c=Ce(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=Eb(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return Mb(f,(function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()})),f},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var r=t?(n-1+e)%e:L(n-1,0,e);return this.goTo(r)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var r=t?(n+1)%e:L(n+1,0,e);return this.goTo(r)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,r=e.pageHeight;n&&r?(this.clipPath=t.maybeAppendByClassName(Bx.clipPath,"rect").styles({width:n,height:r}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach((function(e,n){t.includes(n)?nv(e):rv(e)}))},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,o=i.orientation,a=i.controllerPadding,s=r.getBBox().width,c=Ce("horizontal"===o?[-180,0]:[-90,90],2),l=c[0],u=c[1];e.setLocalEulerAngles(l),n.setLocalEulerAngles(u);var f=e.getBBox(),d=f.width,h=f.height,p=n.getBBox(),g=p.width,m=p.height,y=Math.max(d,s,g),v="horizontal"===o?{offset:[[0,0],[d/2+a,0],[d+s+2*a,0]],textAlign:"start"}:{offset:[[y/2,-h-a],[y/2,0],[y/2,m+a]],textAlign:"center"},b=Ce(v.offset,3),x=Ce(b[0],2),w=x[0],M=x[1],O=Ce(b[1],2),E=O[0],k=O[1],S=Ce(b[2],2),A=S[0],_=S[1],T=v.textAlign,P=r.querySelector("text");P&&(P.style.textAlign=T),e.setLocalPosition(w,M),r.setLocalPosition(E,k),n.setLocalPosition(A,_)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,r=e.pageViews,i=e.attributes.formatter;r.length<2||(null===(t=this.pageInfoGroup.querySelector(Bx.pageInfo.class))||void 0===t||t.attr("text",i(n+1,r.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=t<e?-1:1;return"horizontal"===n?[a*i,0]:[0,a*o]},e.prototype.prepareFollowingPage=function(t){var e=this.currPage,n=this.pageViews;if(this.setVisiblePages([t,e]),t!==e){var r=Ce(this.getFollowingPageDiff(t),2),i=r[0],o=r[1];n[t].setLocalPosition(i,o)}},e.prototype.renderController=function(t){var e=this,n=this.attributes.controllerSpacing,r=this.pageShape,i=r.pageWidth,o=r.pageHeight,a=this.pageViews.length>=2,s=t.maybeAppendByClassName(Bx.controller,"g");if(iv(s.node(),a),a){var c=Jv(this.attributes,"button"),l=Jv(this.attributes,"pageNum"),u=Ce(eb(c),2),f=u[0],d=u[1],h=f.size,p=Se(f,["size"]),g=!s.select(Bx.prevBtnGroup.class).node(),m=s.maybeAppendByClassName(Bx.prevBtnGroup,"g").styles(d);this.prevBtnGroup=m.node();var y=m.maybeAppendByClassName(Bx.prevBtn,"path"),v=s.maybeAppendByClassName(Bx.nextBtnGroup,"g").styles(d);this.nextBtnGroup=v.node(),[y,v.maybeAppendByClassName(Bx.nextBtn,"path")].forEach((function(t){t.styles(ke(ke({},p),{transformOrigin:"center"})),Hv(t.node(),h,!0)}));var b=s.maybeAppendByClassName(Bx.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(Bx.pageInfo,"text").styles(l),this.updatePageInfo(),s.node().setLocalPosition(i+n,o/2),g&&(this.prevBtnGroup.addEventListener("click",(function(){e.prev()})),this.nextBtnGroup.addEventListener("click",(function(){e.next()})))}},e.prototype.render=function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i;this.attr("transform","translate(".concat(r,", ").concat(o,")"));var a=Yv(e);this.renderClipPath(a),this.renderController(a),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=q((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener(gp.INSERTED,e),this.playWindow.addEventListener(gp.REMOVED,e)},e}(ib);function Fx(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}db.registerSymbol("hiddenHandle",(function(t,e,n){var r=1.4*n;return[["M",t-n,e-r],["L",t+n,e-r],["L",t+n,e+r],["L",t-n,e+r],["Z"]]})),db.registerSymbol("verticalHandle",(function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=t+.4*r;return[["M",t,e],["L",a,e+i],["L",t+r,e+i],["L",t+r,e-i],["L",a,e-i],["Z"],["M",a,e+o],["L",t+r-2,e+o],["M",a,e-o],["L",t+r-2,e-o]]})),db.registerSymbol("horizontalHandle",(function(t,e,n){var r=1.4*n,i=n/2,o=n/6,a=e+.4*r;return[["M",t,e],["L",t-i,a],["L",t-i,e+r],["L",t+i,e+r],["L",t+i,a],["Z"],["M",t-o,a],["L",t-o,e+r-2],["M",t+o,a],["L",t+o,e+r-2]]}));var zx=hv({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");var Gx=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new qp({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return Ee(e,t),Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,r=t.node().getBBox(),i=r.width,o=r.height,a=e.node().getBBox(),s=a.width,c=a.height;return{markerWidth:n,labelWidth:i,valueWidth:s,height:Math.max(n,o,c)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=Ce(Uv(t),2),n=e[0],r=e[1],i=this.showValue?r:0,o=n+i;return[n/o,i/o]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,r=e.width,i=this.actualSpace,o=i.markerWidth,a=i.height,s=this.actualSpace,c=s.labelWidth,l=s.valueWidth,u=Ce(this.spacing,2),f=u[0],d=u[1];if(r){var h=r-n-f-d,p=Ce(this.span,2);c=(t=Ce([p[0]*h,p[1]*h],2))[0],l=t[1]}return{width:o+c+l+f+d,height:a,markerWidth:o,labelWidth:c,valueWidth:l}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes.spacing;if(!t)return[0,0];var e=Ce(Uv(t),2),n=e[0],r=e[1];return this.showValue?[n,r]:[n,0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,r=t.valueWidth,i=t.width,o=t.height,a=Ce(this.spacing,2),s=a[0];return{height:o,width:i,markerWidth:e,labelWidth:n,valueWidth:r,position:[e/2,e+s,e+n+s+a[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(zx.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,r=e.markerStrokeWidth,i=void 0===r?t.strokeWidth:r,o=e.markerLineWidth,a=void 0===o?t.lineWidth:o,s=e.markerStroke,c=void 0===s?t.stroke:s,l=+(i||a||(c?1:0))*Math.sqrt(2),u=this.markerGroup.node().getBBox(),f=u.width,d=u.height;return(1-l/Math.max(f,d))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=Jv(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(zx.markerGroup,"g").style("zIndex",0),Ev(!!n,this.markerGroup,(function(){var t,i=e.markerGroup.node(),o=null===(t=i.childNodes)||void 0===t?void 0:t[0],a="string"==typeof n?new db({style:{symbol:n},className:zx.marker.name}):n();o?a.nodeName===o.nodeName?o instanceof db?o.update(ke(ke({},r),{symbol:n})):(!function(t,e){var n,r,i=e.attributes;try{for(var o=Pe(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=Ce(a.value,2),c=s[0],l=s[1];"id"!==c&&"className"!==c&&t.attr(c,l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(o,a),Yv(o).styles(r)):(o.remove(),Yv(a).attr("className",zx.marker.name).styles(r),i.appendChild(a)):(a instanceof db||Yv(a).attr("className",zx.marker.name).styles(r),i.appendChild(a)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var s=Hv(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(s,")")}))},e.prototype.renderLabel=function(t){var e=Jv(this.attributes,"label"),n=e.text,r=Se(e,["text"]);this.labelGroup=t.maybeAppendByClassName(zx.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(zx.label,(function(){return Ov(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=Jv(this.attributes,"value"),r=n.text,i=Se(n,["text"]);this.valueGroup=t.maybeAppendByClassName(zx.valueGroup,"g").style("zIndex",0),Ev(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(zx.value,(function(){return Ov(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=Jv(this.attributes,"background");this.background=t.maybeAppendByClassName(zx.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(zx.background,"rect").styles(ke({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=Ce(t.position,3),o=i[0],a=i[1],s=i[2],c=r/2;this.markerGroup.styles({transform:"translate(".concat(o,", ").concat(c,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(a,", ").concat(c,")")}),wv(this.labelGroup.select(zx.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(c,")")}),wv(this.valueGroup.select(zx.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=Yv(e),r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o;n.styles({transform:"translate(".concat(i,", ").concat(a,")")}),this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()},e}(ib),Wx=hv({page:"item-page",navigator:"navigator",item:"item"},"items"),$x=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Hx=function(t){function e(e){var n=t.call(this,e,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:at,mouseenter:at,mouseleave:at})||this;return n.navigatorShape=[0,0],n}return Ee(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,r=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,r.length]:[r.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,r=Jv(this.attributes,"item"),i=e.map((function(t,i){var o=t.id,a=void 0===o?i:o,s=t.label,c=t.value;return{id:"".concat(a),index:i,style:ke({layout:n,labelText:s,valueText:c},Object.fromEntries(Object.entries(r).map((function(n){var r=Ce(n,2);return[r[0],fv(r[1],[t,i,e])]}))))}}));return i},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,r=e.width,i=e.rowPadding,o=e.colPadding,a=Ce(this.navigatorShape,1)[0],s=Ce(this.grid,2),c=s[0],l=s[1],u=l*c,f=0;return this.pageViews.children.map((function(e,s){var d,h,p=Math.floor(s/u),g=s%u,m=t.ifHorizontal(l,c),y=[Math.floor(g/m),g%m];"vertical"===n&&y.reverse();var v=Ce(y,2),b=v[0],x=v[1],w=(r-a-(l-1)*o)/l,M=e.getBBox().height,O=Ce([0,0],2),E=O[0],k=O[1];return"horizontal"===n?(E=(d=Ce([f,b*(M+i)],2))[0],k=d[1],f=x===l-1?0:f+w+o):(E=(h=Ce([x*(w+o),f],2))[0],k=h[1],f=b===c-1?0:f+M+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:w,height:M,x:E,y:k}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,o=Ce(this.navigatorShape,1)[0],a=Ce(this.grid,2),s=a[0],c=a[1],l=Ce([e-o,n],2),u=l[0],f=l[1],d=Ce([0,0,0,0,0,0,0,0],8),h=d[0],p=d[1],g=d[2],m=d[3],y=d[4],v=d[5],b=d[6],x=d[7];return this.pageViews.children.map((function(t,e){var n,o,a,l,d=t.getBBox(),w=d.width,M=d.height,O=0===b?0:i,E=b+O+w;return E<=u&&$x(y,(function(t){return t<c}))?(n=Ce([b+O,x,E],3),h=n[0],p=n[1],b=n[2],{width:w,height:M,x:h,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}):(o=Ce([v+1,0,0,x+M+r],4),v=o[0],y=o[1],b=o[2],(x=o[3])+M<=f&&$x(v,(function(t){return t<s}))?(a=Ce([b,x,w],3),h=a[0],p=a[1],b=a[2],{width:w,height:M,x:h,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}):(l=Ce([0,0,w,0,g+1,0,0,0],8),h=l[0],p=l[1],b=l[2],x=l[3],g=l[4],m=l[5],v=l[6],y=l[7],{width:w,height:M,x:h,y:p,page:g,index:e,pageIndex:m++,row:v,col:y++}))}))},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Fx(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(Wx.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(Wx.page.class).forEach((function(e){t.removeChild(e).destroy()}))},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,r=e.mouseenter,i=e.mouseleave;this.flattenPage(t);var o=this.dispatchCustomEvent.bind(this);Yv(t).selectAll(Wx.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new Gx({style:e})})).attr("className",Wx.item.name).on("click",(function(){null==n||n(this),o("itemClick",{item:this})})).on("pointerenter",(function(){null==r||r(this),o("itemMouseenter",{item:this})})).on("pointerleave",(function(){null==i||i(this),o("itemMouseleave",{item:this})}))}),(function(t){return t.each((function(t){var e=t.style;this.update(e)}))}),(function(t){return t.remove()}))},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,r=e.width,i=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,o=Ce(this.navigatorShape,2),a=o[0],s=o[1];this.navigator.update("grid"===n?{pageWidth:r-a,pageHeight:i-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,r=Object.entries((t=this.itemsLayout,e="page",t.reduce((function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t}),{}))).map((function(t){var e=Ce(t,2);return{page:e[0],layouts:e[1]}})),i=Ne([],Ce(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new Kp({className:Wx.page.name}));e.forEach((function(t){var e=t.x,n=t.y,o=t.index,a=t.width,s=t.height,c=i[o];r.appendChild(c),function(t,e,n){var r=t,i=C(e)?e.split("."):e;i.forEach((function(t,e){e<i.length-1?(M(r[t])||(r[t]=j(i[e+1])?[]:{}),r=r[t]):r[t]=n}))}(c,"__layout__",t),c.update({x:e,y:n,width:a,height:s})}))})),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=Jv(this.attributes,"nav"),r=gv({orientation:e},n),i=this;return t.selectAll(Wx.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new Dx({style:r})})).attr("className",Wx.navigator.name).each((function(){i.navigator=this}))}),(function(t){return t.each((function(){this.update(r)}))}),(function(t){return t.remove()})),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,e){var n=this.attributes.data;if(n&&0!==n.length){var r=this.renderNavigator(Yv(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new up(t,{detail:e});this.dispatchEvent(n)},e}(ib),Vx=hv({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Yx={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},Ux=function(t){function e(e){return t.call(this,e,Yx)||this}return Ee(e,t),e.prototype.render=function(t,e){var n=Yv(e).maybeAppendByClassName(Vx.markerGroup,"g");this.renderMarker(n);var r=Yv(e).maybeAppendByClassName(Vx.labelGroup,"g");this.renderLabel(r)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,r=n.orientation,i=n.markerSymbol,o=void 0===i?Fx(r,"horizontalHandle","verticalHandle"):i;Ev(!!o,t,(function(t){var n=Jv(e.attributes,"marker"),r=ke({symbol:o},n);e.marker=t.maybeAppendByClassName(Vx.marker,(function(){return new db({style:r})})).update(r)}))},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.showLabel,i=n.orientation,o=n.spacing,a=void 0===o?0:o,s=n.formatter;Ev(r,t,(function(t){var n,r=Jv(e.attributes,"label"),o=r.text,c=Se(r,["text"]),l=(null===(n=t.select(Vx.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,d=l.height,h=Ce(Fx(i,[0,(void 0===d?0:d)+a,"center","top"],[f+a,0,"start","middle"]),4),p=h[0],g=h[1],m=h[2],y=h[3];t.maybeAppendByClassName(Vx.label,"text").styles(ke(ke({},c),{x:p,y:g,text:s(o).toString(),textAlign:m,textBaseline:y}))}))},e}(ib),qx={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},Xx=gv({},qx,{}),Zx=gv({},qx,tb(Yx,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),Kx=hv({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),Qx=function(t){function e(e){return t.call(this,e,Xx)||this}return Ee(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=Ce(eb(Jv(this.attributes,"title")),2),s=a[0],c=a[1];this.titleGroup=t.maybeAppendByClassName(Kx.titleGroup,"g").styles(c);var l=ke(ke({width:e,height:n},s),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(Kx.title,(function(){return new Lx({style:l})})).update(l)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,o=e.height,a=Ce(eb(Jv(this.attributes,"title",!0)),2),s=a[0],c=a[1],l=ke(ke({},s),{width:i,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Kx.itemsGroup,"g").styles(ke(ke({},c),{transform:"translate(".concat(n,", ").concat(r,")")}));var u=this;this.itemsGroup.selectAll(Kx.items.class).data(["items"]).join((function(t){return t.append((function(){return new Hx({style:l})})).attr("className",Kx.items.name).each((function(){u.items=Yv(this)}))}),(function(t){return t.update(l)}),(function(t){return t.remove()}))},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().style.transform="translate(".concat(e,", ").concat(n,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,r=t.height;return e?this.title.node().getAvailableSpace():new uv(0,0,n,r)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,r=null===(e=this.title)||void 0===e?void 0:e.node(),i=null===(n=this.items)||void 0===n?void 0:n.node();return r&&i?function(t,e){var n=t.attributes,r=n.position,i=n.spacing,o=n.inset,a=n.text,s=t.getBBox(),c=e.getBBox(),l=Cx(r),u=Ce(Uv(a?i:0),4),f=u[0],d=u[1],h=u[2],p=u[3],g=Ce(Uv(o),4),m=g[0],y=g[1],v=g[2],b=g[3],x=Ce([p+d,f+h],2),w=x[0],M=x[1],O=Ce([b+y,m+v],2),E=O[0],k=O[1];if("l"===l[0])return new uv(s.x,s.y,c.width+s.width+w+E,Math.max(c.height+k,s.height));if("t"===l[0])return new uv(s.x,s.y,Math.max(c.width+E,s.width),c.height+s.height+M+k);var S=Ce([e.attributes.width||c.width,e.attributes.height||c.height],2),A=S[0],_=S[1];return new uv(c.x,c.y,A+s.width+w+E,_+s.height+M+k)}(r,i):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=this.attributes,r=n.width,i=n.height,o=n.x,a=void 0===o?0:o,s=n.y,c=void 0===s?0:s,l=Yv(e);e.style.transform="translate(".concat(a,", ").concat(c,")"),this.renderTitle(l,r,i),this.renderItems(l,this.availableSpace),this.adjustLayout()},e}(ib),Jx={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},tw=hv({background:"background",labelGroup:"label-group",label:"label"},"indicator"),ew=function(t){function e(e){var n=t.call(this,e,Jx)||this;return n.point=[0,0],n.group=n.appendChild(new Kp({})),n.isMutationObserved=!0,n}return Ee(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=Ce(Uv(t.padding),4),r=n[0],i=n[1],o=n[2],a=n[3],s=this.label.node().getLocalBounds(),c=s.min,l=s.max,u=new uv(c[0]-a,c[1]-r,l[0]+i-c[0]+a,l[1]+o-c[1]+r),f=this.getPath(e,u),d=Jv(this.attributes,"background");this.background=Yv(this.group).maybeAppendByClassName(tw.background,"path").styles(ke(ke({},d),{d:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=Ce(eb(Jv(this.attributes,"label")),2),i=r[0],o=r[1],a=Se(i,["text"]);(this.label=Yv(this.group).maybeAppendByClassName(tw.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(tw.label,(function(){return Ov(e(n))})).style("text",e(n).toString()).selectAll("text").styles(a)},e.prototype.adjustLayout=function(){var t=Ce(this.point,2),e=t[0],n=t[1],r=this.attributes,i=r.x,o=r.y;this.group.attr("transform","translate(".concat(i-e,", ").concat(o-n,")"))},e.prototype.getPath=function(t,e){var n=this.attributes.radius,r=e.x,i=e.y,o=e.width,a=e.height,s=[["M",r+n,i],["L",r+o-n,i],["A",n,n,0,0,1,r+o,i+n],["L",r+o,i+a-n],["A",n,n,0,0,1,r+o-n,i+a],["L",r+n,i+a],["A",n,n,0,0,1,r,i+a-n],["L",r,i+n],["A",n,n,0,0,1,r+n,i],["Z"]],c={top:4,right:6,bottom:0,left:2}[t],l=this.createCorner([s[c].slice(-2),s[c+1].slice(-2)]);return s.splice.apply(s,Ne([c+1,1],Ce(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=Xv.apply(void 0,Ne([],Ce(t),!1)),r=Ce(t,2),i=Ce(r[0],2),o=i[0],a=i[1],s=Ce(r[1],2),c=s[0],l=s[1],u=Ce(n?[c-o,[o,c]]:[l-a,[a,l]],2),f=u[0],d=Ce(u[1],2),h=d[0],p=d[1],g=f/2,m=e*(f/Math.abs(f)),y=m/2,v=m*Math.sqrt(3)/2*.8,b=Ce([h,h+g-y,h+g,h+g+y,p],5),x=b[0],w=b[1],M=b[2],O=b[3],E=b[4];return n?(this.point=[M,a-v],[["L",x,a],["L",w,a],["L",M,a-v],["L",O,a],["L",E,a]]):(this.point=[o+v,M],[["L",o,x],["L",o,w],["L",o+v,M],["L",o,O],["L",o,E]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?rv(this):nv(this)},e.prototype.bindEvents=function(){this.label.on(gp.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(ib);function nw(t,e){var n=Ce(function(t,e){for(var n=1;n<t.length;n+=1){var r=t[n-1],i=t[n];if(e>=r&&e<=i)return[r,i]}return[e,e]}(t,e),2),r=n[0],i=n[1];return{tick:e>(r+i)/2?i:r,range:[r,i]}}var rw=hv({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function iw(t){var e=t.orientation,n=t.size,r=t.length;return Fx(e,[r,n],[n,r])}function ow(t){var e=t.type,n=Ce(iw(t),2),r=n[0],i=n[1];return"size"===e?[["M",0,i],["L",0+r,0],["L",0+r,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+r,0],["L",0+r,i],["Z"]]}function aw(t){return ow(t)}function sw(t){var e,n=t.orientation,r=t.color,i=t.block,o=t.partition;if(y(r)){e=new Array(20).fill(0).map((function(t,e,n){return r(e/(n.length-1))}))}else e=r;var a=e.length,s=e.map((function(t){return $f(t).toString()}));return a?1===a?s[0]:i?function(t,e,n){var r=Array.from(e),i=t.length;return new Array(i).fill(0).reduce((function(e,n,o){var a=r[o%r.length];return e+" ".concat(t[o],":").concat(a).concat(o<i-1?" ".concat(t[o+1],":").concat(a):"")}),"l(".concat("horizontal"===n?"0":"270",")"))}(o,s,n):s.reduce((function(t,e,n){return t+" ".concat(n/(a-1),":").concat(e)}),"l(".concat(Fx(n,"0","270"),")")):""}function cw(t){var e=t.orientation,n=t.range;if(!n)return[];var r=Ce(iw(t),2),i=r[0],o=r[1],a=Ce(n,2),s=a[0],c=a[1],l=Fx(e,s*i,0),u=Fx(e,0,s*o),f=Fx(e,c*i,i),d=Fx(e,o,c*o);return[["M",l,u],["L",l,d],["L",f,d],["L",f,u],["Z"]]}var lw=function(t){function e(e){return t.call(this,e,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}return Ee(e,t),e.prototype.render=function(t,e){!function(t,e){var n=Jv(e,"track");t.maybeAppendByClassName(rw.track,"path").styles(ke({d:ow(e)},n))}(Yv(e).maybeAppendByClassName(rw.trackGroup,"g"),t),function(t,e){var n=Jv(e,"selection"),r=sw(e),i=t.maybeAppendByClassName(rw.selection,"path").styles(ke({d:aw(e),fill:r},n)),o=i.maybeAppendByClassName(rw.clipPath,"path").styles({d:cw(e)}).node();i.style("clipPath",o)}(Yv(e).maybeAppendByClassName(rw.selectionGroup,"g"),t)},e}(ib);var uw=function(t){function e(e){var n=t.call(this,e,Zx)||this;return n.eventToOffsetScale=new ia({}),n.innerRibbonScale=new ia({}),n.cacheLabelBBox=null,n.cacheHandleBBox=null,n.onHovering=function(t){var e=n.attributes,r=e.data,i=e.block;t.stopPropagation();var o=n.getValueByCanvasPoint(t);if(i){var a=nw(r.map((function(t){return t.value})),o).range,s=n.getRealSelection(a);n.showIndicator((a[0]+a[1])/2,"".concat(s[0],"-").concat(s[1])),n.dispatchIndicated(o,a)}else{var c=n.getTickValue(o);n.showIndicator(c,"".concat(n.getRealValue(c))),n.dispatchIndicated(c)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=Ce(n.selection,2),i=r[0],o=r[1],a=n.getTickValue(n.getValueByCanvasPoint(t)),s=a-n.prevValue;"start"===e?i!==a&&n.updateSelection(a,o):"end"===e?o!==a&&n.updateSelection(i,a):"ribbon"===e&&0!==s&&(n.prevValue=a,n.updateSelection(s,s,!0))},n.onDragEnd=function(){n.style.cursor="pointer",document.removeEventListener("mousemove",n.onDragging),document.removeEventListener("touchmove",n.onDragging),document.removeEventListener("mouseup",n.onDragEnd),document.removeEventListener("touchend",n.onDragEnd)},n}return Ee(e,t),Object.defineProperty(e.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.width,n=t.height;return new uv(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(Yv(e));var i=this.availableSpace,o=i.x,a=i.y,s=Yv(e).maybeAppendByClassName(Kx.contentGroup,"g").styles({transform:"translate(".concat(o,", ").concat(a,")")});Ev(!!r,s.maybeAppendByClassName(Kx.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(Kx.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(Kx.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(c),this.renderIndicator(s),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(e.prototype,"range",{get:function(){var t=this.attributes,e=t.data,n=t.domain;return n?{min:n[0],max:n[1]}:function(t){return{min:Math.min.apply(Math,Ne([],Ce(t.map((function(t){return t.value}))),!1)),max:Math.max.apply(Math,Ne([],Ce(t.map((function(t){return t.value}))),!1))}}(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonScale",{get:function(){var t=this.range,e=t.min,n=t.max;return this.innerRibbonScale.update({domain:[e,n],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonRange",{get:function(){var t=Ce(this.selection,2),e=t[0],n=t[1],r=this.ribbonScale;return[r.map(e),r.map(n)]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){var t=this.range,e=t.min,n=t.max,r=this.attributes.defaultValue,i=Ce(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Fx(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},e.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,o=e.height,a=Jv(this.attributes,"title"),s=ke(ke({},a),{width:i,height:o,text:r}),c=this;t.selectAll(Kx.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new Lx({style:s})})).attr("className",Kx.title.name).each((function(){c.title=this}))}),(function(t){return t.update(s)}),(function(t){return t.each((function(){c.title=void 0})).remove()}))},Object.defineProperty(e.prototype,"availableSpace",{get:function(){if(this.title)return this.title.getAvailableSpace();var t=this.attributes,e=t.width,n=t.height;return new uv(0,0,e,n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelFixedSpacing",{get:function(){return this.attributes.showTick?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelPosition",{get:function(){var t=this.attributes,e=t.orientation,n=t.labelDirection;return{vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}}[e][n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelBBox",{get:function(){var t;if(!this.attributes.showLabel)return new uv(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(Bb.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new uv(0,0,n,r),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var t=this.attributes,e=t.showLabel,n=t.labelSpacing,r=void 0===n?0:n;if(!e)return{width:0,height:0,size:0,length:0};var i=this.labelBBox,o=i.width,a=i.height;return{width:o,height:a,size:this.ifHorizontal(a,o)+r+this.labelFixedSpacing,length:this.ifHorizontal(o,a)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,n=t.ribbonSize,r=this.availableSpace,i=r.width,o=r.height,a=this.labelShape,s=a.size,c=a.length,l=Ce(this.ifHorizontal([o,i],[i,o]),2),u=l[0],f=l[1],d=e?this.handleShape:{size:0,length:0},h=d.size,p=d.length,g=this.handleOffsetRatio,m=0,y=this.labelPosition;m=n||(["bottom","right"].includes(y)?Math.min(u-s,(u-h)/g):u*(1-g)>h?Math.max(u-s,0):Math.max((u-s-h)/g,0));var v=Math.max(p,c),b=f-v,x=Ce(this.ifHorizontal([b,m],[m,b]),2),w=x[0],M=x[1],O=["top","left"].includes(y)?s:0,E=Ce(this.ifHorizontal([v/2,O],[O,v/2]),2),k=E[0],S=E[1];return new uv(k,S,w,M)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,o=e.color,a=e.block,s=Jv(this.attributes,"ribbon"),c=this.range,l=c.min,u=c.max,f=this.ribbonBBox,d=f.x,h=f.y,p=this.ribbonShape,g=p.length,m=p.size,y=gv({transform:"translate(".concat(d,", ").concat(h,")"),length:g,size:m,type:r,orientation:i,color:o,block:a,partition:n.map((function(t){return(t.value-l)/(u-l)})),range:this.ribbonRange},s);this.ribbon=t.maybeAppendByClassName(Kx.ribbon,(function(){return new lw({style:y})})).update(y)},e.prototype.getHandleClassName=function(t){return"".concat(Kx.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=Jv(this.attributes,"handle"),i=Ce(this.selection,2),o=i[0],a=i[1],s=ke(ke({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?Ux:Lb,u=this;this.handlesGroup.selectAll(Kx.handle.class).data(e?[{value:o,type:"start"},{value:a,type:"end"}]:[],(function(t){return t.type})).join((function(t){return t.append((function(){return new l({style:s})})).attr("className",(function(t){var e=t.type;return"".concat(Kx.handle," ").concat(u.getHandleClassName(e))})).each((function(t){var e=t.type,n=t.value;this.update({labelText:n});var r="".concat(e,"Handle");u[r]=this,this.addEventListener("pointerdown",u.onDragStart(e))}))}),(function(t){return t.update(s).each((function(t){var e=t.value;this.update({labelText:e})}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");u[n]=void 0})).remove()}))},e.prototype.adjustHandles=function(){var t=Ce(this.selection,2),e=t[0],n=t[1];this.setHandlePosition("start",e),this.setHandlePosition("end",n)},Object.defineProperty(e.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new uv(0,0,0,0);var t=this.startHandle.getBBox(),e=t.width,n=t.height,r=this.endHandle.getBBox(),i=r.width,o=r.height,a=Ce([Math.max(e,i),Math.max(n,o)],2),s=a[0],c=a[1];return this.cacheHandleBBox=new uv(0,0,s,c),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"handleShape",{get:function(){var t=this.handleBBox,e=t.width,n=t.height,r=Ce(this.ifHorizontal([n,e],[e,n]),2);return{width:e,height:n,size:r[0],length:r[1]}},enumerable:!1,configurable:!0}),e.prototype.setHandlePosition=function(t,e){var n=this.attributes.handleFormatter,r=this.ribbonBBox,i=r.x,o=r.y,a=this.ribbonShape.size,s=this.getOffset(e),c=Ce(this.ifHorizontal([i+s,o+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,o+s]),2),l=c[0],u=c[1],f=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==f||f.update({transform:"translate(".concat(l,", ").concat(u,")"),formatter:n})},e.prototype.renderIndicator=function(t){var e=Jv(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Kx.indicator,(function(){return new ew({})})).update(e)},Object.defineProperty(e.prototype,"labelData",{get:function(){var t=this;return this.attributes.data.reduce((function(e,n,r,i){var o,a,s=null!==(o=null==n?void 0:n.id)&&void 0!==o?o:r.toString();if(e.push(ke(ke({},n),{id:s,index:r,type:"value",label:null!==(a=null==n?void 0:n.label)&&void 0!==a?a:n.value.toString(),value:t.ribbonScale.map(n.value)})),r<i.length-1){var c=i[r+1],l=Ce([n.value,c.value],2),u=l[0],f=l[1],d=(u+f)/2;e.push(ke(ke({},n),{id:s,index:r,type:"range",range:[u,f],label:[u,f].join("~"),value:t.ribbonScale.map(d)}))}return e}),[])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelStyle",{get:function(){var t=Ce(["center","middle"],2),e=t[0],n=t[1],r=this.labelPosition;return"top"===r?n="bottom":"bottom"===r?n="top":"left"===r?e="end":"right"===r&&(e="start"),{labelTextAlign:e,labelTextBaseline:n}},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,r=void 0!==n&&n,i=e.labelFilter,o=e.labelFormatter,a=Jv(this.attributes,"tick"),s=Jv(this.attributes,"label"),c=s.align,l=gv(ke({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),tb(a,"tick"),tb(s,"label"),{data:this.labelData}),u={tickFilter:function(t,e,n){return"value"===(null==t?void 0:t.type)&&(!i||i(t,t.index,n.filter((function(t){return"value"!==t.type}))))},labelFilter:function(t,e,n){return(null==t?void 0:t.type)===c&&(!i||i(t,t.index,n.filter((function(t){return t.type===c}))))},labelFormatter:o},f=ke(ke(ke({},l),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(Kx.label,(function(){return new Ix({style:f})})).node(),this.label.update(f,!1)},Object.defineProperty(e.prototype,"labelAxisStyle",{get:function(){var t=this.attributes,e=t.showTick,n=t.labelDirection,r=t.labelSpacing,i=t.tickLength,o=this.ribbonShape.size,a=this.labelPosition,s=this.labelFixedSpacing,c=Ce([0,0,0],3),l=c[0],u=c[1],f=c[2],d=null!=i?i:o;return e?(f=d,u=s,"positive"===n?"right"===a?(l=d,f=d):"bottom"===a&&(l=f):"negative"===n&&("top"===a||"left"===a)&&(l=o)):"positive"===n?"right"===a?u=d:"bottom"===a&&(l=o+s,u=r):"negative"===n&&("left"===a||"top"===a)&&(u=r),{offset:l,spacing:u,tickLength:f}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,o=this.labelAxisStyle,a=o.offset,s=o.spacing,c=o.tickLength,l=Ce(this.ifHorizontal([[e,n+a],[e+r,n+a]],[[e+a,n+i],[e+a,n]]),2),u=l[0],f=l[1];this.label.update({startPos:u,endPos:f,tickLength:c,labelSpacing:s},!1)}},e.prototype.bindEvents=function(){this.style.cursor="pointer",this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},e.prototype.showIndicator=function(t,e){if(void 0===e&&(e="".concat(t)),this.attributes.showIndicator&&"number"==typeof t){var n=this.range,r=n.min,i=n.max,o=this.ribbonBBox,a=o.x,s=o.y,c=L(t,r,i),l=this.getOffset(c),u=this.ifHorizontal([l+a,s],[a,l+s]);this.indicator.update({x:u[0],y:u[1],position:this.ifHorizontal("top","left"),labelText:e}),nv(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){rv(this.indicator.node())},e.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},e.prototype.setSelection=function(t,e){this.updateSelection(t,e)},e.prototype.updateSelection=function(t,e,n){var r;void 0===n&&(n=!1);var i=Ce(this.selection,2),o=i[0],a=i[1],s=Ce([t,e],2),c=s[0],l=s[1];n&&(c+=o,l+=a);var u=this.range;r=Ce(function(t,e,n,r){var i,o=Ce(t,2),a=o[0],s=o[1],c=Ce(e,2),l=c[0],u=c[1],f=Ce(n,2),d=f[0],h=f[1],p=Ce([l,u],2),g=p[0],m=p[1],y=m-g;return g>m&&(g=(i=Ce([m,g],2))[0],m=i[1]),y>s-a?[a,s]:g<a?d===a&&h===m?[a,m]:[a,y+a]:m>s?h===s&&d===g?[g,s]:[s-y,s]:[g,m]}([u.min,u.max],[c,l],this.selection),2),c=r[0],l=r[1],this.update({defaultValue:[c,l]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return V(e)?Dv(.01*(i-r),0):e},enumerable:!1,configurable:!0}),e.prototype.getTickValue=function(t){var e=this.attributes,n=e.data,r=e.block,i=this.range.min;return r?nw(n.map((function(t){return t.value})),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t){var e=this.range,n=e.min,r=e.max,i=Ce(this.ribbon.node().getPosition(),2),o=i[0],a=i[1],s=this.ifHorizontal(o,a),c=this.ifHorizontal.apply(this,Ne([],Ce(Mv(t)),!1))-s;return L(this.getOffset(c,!0),n,r)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,o=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,i],range:[0,o]}),e?a.invert(t):a.map(t)},e.prototype.getRealSelection=function(t){var e=this.range.max,n=Ce(t,2),r=n[0],i=n[1];return this.ifHorizontal([r,i],[e-i,e-r])},e.prototype.getRealValue=function(t){var e=this.range.max;return this.ifHorizontal(t,e-t)},e.prototype.dispatchSelection=function(){var t=this.getRealSelection(this.selection),e=new up("valuechange",{detail:{value:t}});this.dispatchEvent(e)},e.prototype.dispatchIndicated=function(t,e){var n=this,r=this.range.max,i=this.ifHorizontal((function(){return{value:t,range:e}}),(function(){return{value:r-t,range:e?n.getRealSelection(e):void 0}})),o=new up("indicate",{detail:i});this.dispatchEvent(o)},e}(ib);function fw(t){return void 0===t&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var dw={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function hw(t){var e;void 0===t&&(t="");var n=fw(t);return(e={})[".".concat(n.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=ke({flex:1},dw),e[".".concat(n.VALUE)]=ke({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},dw),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var pw=function(t){function e(e){var n,r,i=this,o=null===(r=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===r?void 0:r.prefixCls,a=fw(o);return(i=t.call(this,e,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(a.CONTAINER,'"></div>'),title:'<div class="'.concat(a.TITLE,'"></div>'),item:'<li class="'.concat(a.LIST_ITEM,'" data-index={index}>\n <span class="').concat(a.NAME,'">\n <span class="').concat(a.MARKER,'" style="background:{color}"></span>\n <span class="').concat(a.NAME_LABEL,'" title="{name}">{name}</span>\n </span>\n <span class="').concat(a.VALUE,'" title="{value}">{value}</span>\n </li>')},style:hw(o)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return Ee(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map((function(t,e){var r=t.name,i=void 0===r?"":r,o=t.color,a=void 0===o?"black":o,s=t.index,c=Se(t,["name","color","index"]),l=ke({name:i,color:a,index:null!=s?s:e},c);return vn(function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t}(n.item,l))}))},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=function(){n.attributes.x=null!=t?t:n.attributes.x,n.attributes.y=null!=e?e:n.attributes.y,n.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(r):r()}this.element.style.visibility="visible"},e.prototype.hide=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.attributes.enterable&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=vn(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:this.element.replaceChildren(t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,r=n.template,i=n.title,o=n.enterable,a=n.style,s=n.content,c=fw(r.prefixCls),l=this.element;if(this.element.style.pointerEvents=o?"auto":"none",s)this.renderCustomContent();else{i?(l.innerHTML=r.title,l.getElementsByClassName(c.TITLE)[0].innerHTML=i):null===(e=null===(t=l.getElementsByClassName(c.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var u=this.HTMLTooltipItemsElements,f=document.createElement("ul");f.className=c.LIST,f.replaceChildren.apply(f,Ne([],Ce(u),!1));var d=this.element.querySelector(".".concat(c.LIST));d?d.replaceWith(f):l.appendChild(f)}!function(t,e){Object.entries(e).forEach((function(e){var n=Ce(e,2),r=n[0],i=n[1];Ne([t],Ce(t.querySelectorAll(r)),!1).filter((function(t){return t.matches(r)})).forEach((function(t){t&&(t.style.cssText+=Object.entries(i).reduce((function(t,e){return"".concat(t).concat(e.join(":"),";")}),""))}))}))}(l,a)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,r=e.offset,i=(t||n).split("-"),o={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},a=this.elementSize,s=a.width,c=a.height,l=[-s/2,-c/2];return i.forEach((function(t){var e=Ce(l,2),n=e[0],i=e[1],a=Ce(o[t],2),u=a[0],f=a[1];l=[n+(s/2+r[0])*u,i+(c/2+r[1])*f]})),l},e.prototype.setOffsetPosition=function(t){var e=Ce(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=void 0===o?0:o,s=i.y,c=void 0===s?0:s,l=i.container,u=l.x,f=l.y;this.element.style.left="".concat(+a+u+n,"px"),this.element.style.top="".concat(+c+f+r,"px")},e.prototype.updatePosition=function(){var t=this.attributes.showDelay,e=void 0===t?60:t,n=Date.now();this.timestamp>0&&n-this.timestamp<e||(this.timestamp=n,this.setOffsetPosition(this.autoPosition(this.getRelativeOffsetFromCursor())))},e.prototype.autoPosition=function(t){var e=Ce(t,2),n=e[0],r=e[1],i=this.attributes,o=i.x,a=i.y,s=i.bounding,c=i.position;if(!s)return[n,r];var l=this.element,u=l.offsetWidth,f=l.offsetHeight,d=Ce([+o+n,+a+r],2),h=d[0],p=d[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},m=s.x,y=s.y,v={left:h<m,right:h+u>m+s.width,top:p<y,bottom:p+f>y+s.height},b=[];c.split("-").forEach((function(t){v[t]?b.push(g[t]):b.push(t)}));var x=b.join("-");return this.getRelativeOffsetFromCursor(x)},e.prototype.isCursorEntered=function(t,e){if(this.element){var n=this.element.getBoundingClientRect(),r=n.x,i=n.y,o=n.width,a=n.height;return new uv(r,i,o,a).isPointIn(t,e)}return!1},e.prototype.closeTransition=function(t){var e=this,n=this.element.style.transition;this.element.style.transition="none",t(),setTimeout((function(){e.element.style.transition=n}),10)},e.tag="tooltip",e}(ib),gw=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[gp.BOUNDS_CHANGED,gp.INSERTED,gp.REMOVED],n.$margin=Uv(0),n.$padding=Uv(0);var r=e.style||{},i=r.margin,o=void 0===i?0:i,a=r.padding,s=void 0===a?0:a;return n.margin=o,n.padding=s,n.isMutationObserved=!0,n.bindEvents(),n}return Ee(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Uv(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Uv(t)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var t=this.attributes,e=t.x,n=void 0===e?0:e,r=t.y,i=void 0===r?0:r,o=t.width,a=t.height,s=Ce(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new uv(n-f,i-c,o+f+l,a+c+u)},e.prototype.appendChild=function(e,n){return e.isMutationObserved=!0,t.prototype.appendChild.call(this,e,n),e},e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,r=Ce(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],c=Ce(this.$margin,4),l=c[0],u=c[3];return new uv(s+u,i+l,e-s-o,n-i-a)},e.prototype.layout=function(){if(this.attributes.display&&this.isConnected&&!this.children.some((function(t){return!t.isConnected})))try{var t=this.attributes,e=t.x,n=t.y;this.style.transform="translate(".concat(e,", ").concat(n,")");var r=function(t,e,n){if(0===e.length)return[];var r={flex:Tv,grid:Pv},i=n.display in r?r[n.display]:null;return(null==i?void 0:i.call(null,t,e,n))||[]}(this.getAvailableSpace(),this.children.map((function(t){return t.getBBox()})),this.attributes);this.children.forEach((function(t,e){var n=r[e],i=n.x,o=n.y;t.style.transform="translate(".concat(i,", ").concat(o,")")}))}catch(t){}},e.prototype.bindEvents=function(){var t=this;this.layoutEvents.forEach((function(e){t.addEventListener(e,(function(e){e.target.isMutationObserved=!0,t.layout()}))}))},e.prototype.attributeChangedCallback=function(t,e,n){"margin"===t?this.margin=n:"padding"===t&&(this.padding=n),this.layout()},e}(Kp);function mw(t,e,n,r){const[[i,o],[a,s]]=e,[c,l]=function(t){const{min:[e,n],max:[r,i]}=t.getLocalBounds();let o=0,a=0;return e>0&&(o=e),r<0&&(o=r),n>0&&(a=n),i<0&&(a=i),[o,a]}(t);if(i===a&&o===s)return cc()([[0,0],[c,l]]);const u=[[i-a,o-s]].concat(n.length?n:[[0,0]]),f=[r[0]-a,r[1]-s],[d,h]=u;if(((t,e,n)=>{const r=ps(t,e),i=ps(e,n),o=ps(n,t);return(Math.pow(r,2)+Math.pow(i,2)-Math.pow(o,2))/(2*r*i)})(f,d,h)>0){const e=(()=>{const{min:e,max:n}=t.getLocalBounds(),r=d[0]+(d[1]-f[1])*(d[1]-0)/(d[0]-f[0]);return n[0]<f[0]?Math.min(n[0],r):Math.max(e[0],r)})();u.splice(1,1,[e,0])}return cc()(u)}const yw=Ym((t=>{const e=t.attributes,{className:n,class:r,transform:i,rotate:o,labelTransform:a,labelTransformOrigin:s,x:c,y:l,x0:u=c,y0:f=l,text:d,background:h,connector:p,startMarker:g,endMarker:m,coordCenter:y,innerHTML:v}=e,b=Se(e,["className","class","transform","rotate","labelTransform","labelTransformOrigin","x","y","x0","y0","text","background","connector","startMarker","endMarker","coordCenter","innerHTML"]);if(t.style.transform=`translate(${c}, ${l})`,[c,l,u,f].some((t=>!j(t))))return void t.children.forEach((t=>t.remove()));const x=kr(b,"background"),{padding:w}=x,M=Se(x,["padding"]),O=kr(b,"connector"),{points:E=[]}=O,k=Se(O,["points"]),S=[[+u,+f],[+c,+l]];let A;A=v?Sm(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",v).call(Pm,Object.assign({transform:a,transformOrigin:s},b)).node():Sm(t).maybeAppend("text","text").style("zIndex",0).style("text",d).call(Pm,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const _=Sm(t).maybeAppend("background","rect").style("zIndex",-1).call(Pm,function(t,e=[]){const[n=0,r=0,i=n,o=r]=e,a=t.parentNode,s=a.getEulerAngles();a.setEulerAngles(0);const{min:c,halfExtents:l}=t.getLocalBounds(),[u,f]=c,[d,h]=l;return a.setEulerAngles(s),{x:u-o,y:f-n,width:2*d+o+r,height:2*h+n+i}}(A,w)).call(Pm,h?M:{}).node(),T=mw(_,S,E,y),P=g&&new db({id:"startMarker",style:Object.assign({x:0,y:0},kr(b,"startMarker"))}),C=m&&new db({id:"endMarker",style:Object.assign({x:0,y:0},kr(b,"endMarker"))});Sm(t).maybeAppend("connector","path").style("zIndex",0).style("d",T).style("markerStart",P).style("markerEnd",C).call(Pm,p?k:{})})),vw=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:o,text:a="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(a),stroke:o,fill:o,fontSize:s},[[f,d]]=e;return Sm(new yw).style("x",f).style("y",d).call(Pm,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(Pm,u).call(Pm,t).node()}};vw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const bw=Ym((t=>{const e=Se(t.attributes,["class","x","y","transform"]),n=kr(e,"marker"),{size:r=24}=n,i=()=>function(t){const e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[o,a]=[0,0],[s,c]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,s,c],["L",o,a],["Z"]]}(r/2),o=Sm(t).maybeAppend("marker",(()=>new db({}))).call((t=>t.node().update(Object.assign({symbol:i},n)))).node(),[a,s]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(o);Sm(t).maybeAppend("text","text").style("x",a).style("y",s).call(Pm,e)})),xw=(t,e)=>{const n=Se(t,[]);return(t,e,r)=>{const{color:i}=r,o=Se(r,["color"]),{color:a=i,text:s=""}=e,c={text:String(s),stroke:a,fill:a},[[l,u]]=t;return Sm(new bw).call(Pm,o).style("transform",`translate(${l},${u})`).call(Pm,c).call(Pm,n).node()}};xw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ww=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const{color:o,text:a="",fontSize:s,rotate:c=0,transform:l=""}=r,u={text:String(a),stroke:o,fill:o,fontSize:s,textAlign:"center",textBaseline:"middle"},[[f,d]]=e;return Sm(new og).style("x",f).style("y",d).call(Pm,i).style("transformOrigin","center center").style("transform",`${l}rotate(${c}deg)`).style("coordCenter",n.getCenter()).call(Pm,u).call(Pm,t).node()}};ww.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Mw=Ym((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;Sm(t).maybeAppend("connect-path",(()=>o.createElement("path",{}))).style("d",n).call(Pm,i),Sm(t).maybeAppend("area-path",(()=>o.createElement("path",{}))).style("d",e).call(Pm,r)})),Ow=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=t=>!Number.isNaN(t)&&null!=t,connect:o=!1}=t,a=Se(t,["curve","gradient","defined","connect"]),{coordinate:s,document:c}=e;return(t,e,l)=>{const{color:u}=l,{color:f=u,seriesColor:d,seriesX:h,seriesY:p}=e,g=Bc(s),m=Im(s,e),y=r&&d?Nm(d,h,p,r,void 0,g):f,v=Object.assign(Object.assign(Object.assign(Object.assign({},l),{stroke:y,fill:y}),m&&{transform:m}),a),[b,x]=function(t,e){const n=[],r=[],i=[];let o=!1,a=null;const s=t.length/2;for(let c=0;c<s;c++){const l=t[c],u=t[c+s];if([...l,...u].some((t=>!e(t))))o=!0;else{if(n.push(l),r.push(u),o&&a){o=!1;const[t,e]=a;i.push([t,l,e,u])}a=[l,u]}}return[n.concat(r),i]}(t,i),w=kr(v,"connect"),M=!!x.length,O=t=>Sm(c.createElement("path",{})).style("d",t||"").call(Pm,v).node();if(Dc(s)){const e=t=>{const e=s.getCenter(),r=t.slice(0,t.length/2),o=t.slice(t.length/2);return function(){var t=lc().curve(uc),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return hc(n())},delete t.lineX0,t.lineEndAngle=function(){return hc(r())},delete t.lineX1,t.lineInnerRadius=function(){return hc(i())},delete t.lineY0,t.lineOuterRadius=function(){return hc(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(dc(t)):e()._curve},t}().angle(((t,n)=>ms(ds(r[n],e)))).outerRadius(((t,n)=>ps(r[n],e))).innerRadius(((t,n)=>ps(o[n],e))).defined(((t,e)=>[...r[e],...o[e]].every(i))).curve(n)(o)};return!M||o&&!Object.keys(w).length?O(e(b)):M&&!o?O(e(t)):Sm(new Mw).style("areaStyle",v).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return g?lc().y(((t,n)=>e[n][1])).x1(((t,n)=>e[n][0])).x0(((t,e)=>r[e][0])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e):lc().x(((t,n)=>e[n][0])).y1(((t,n)=>e[n][1])).y0(((t,e)=>r[e][1])).defined(((t,n)=>[...e[n],...r[n]].every(i))).curve(n)(e)};return!M||o&&!Object.keys(w).length?O(e(b)):M&&!o?O(e(t)):Sm(new Mw).style("areaStyle",v).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};Ow.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ew=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Dc(n)?Oc:oc;return Ow(Object.assign({curve:i},t),e)(...r)}};Ew.props=Object.assign(Object.assign({},Ow.props),{defaultMarker:"square"});const kw=(t,e)=>{const n=Se(t,[]),{coordinate:r}=e;return(...t)=>{const i=Dc(r)?wc:Bc(r)?Nc:Cc;return Ow(Object.assign({curve:i},n),e)(...t)}};kw.props=Object.assign(Object.assign({},Ow.props),{defaultMarker:"smooth"});const Sw=(t,e)=>(...n)=>Ow(Object.assign({curve:jc},t),e)(...n);Sw.props=Object.assign(Object.assign({},Ow.props),{defaultMarker:"hvh"});const Aw=(t,e)=>(...n)=>Ow(Object.assign({curve:Rc},t),e)(...n);Aw.props=Object.assign(Object.assign({},Ow.props),{defaultMarker:"vh"});const _w=(t,e)=>(...n)=>Ow(Object.assign({curve:Ic},t),e)(...n);_w.props=Object.assign(Object.assign({},Ow.props),{defaultMarker:"hv"});const Tw=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>tv(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};Tw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Pw=(t,e)=>{const n=Se(t,[]),{document:r}=e;return(t,e,i)=>{const{color:o}=i,a=Se(i,["color"]),{color:s=o,transform:c}=e,[l,u]=t,f=qs();return f.moveTo(l[0],l[1]),f.bezierCurveTo(l[0]/2+u[0]/2,l[1],l[0]/2+u[0]/2,u[1],u[0],u[1]),Sm(r.createElement("path",{})).call(Pm,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(Pm,n).node()}};function Cw(t,e,n,r){const i=qs();if(Dc(n)){const o=n.getCenter(),a=ps(t,o),s=(ps(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),Cm(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return Bc(n)?(i.moveTo(t[0],t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,t[1]),i.lineTo(t[0]+(e[0]-t[0])*r,e[1]),i.lineTo(e[0],e[1]),i):(i.moveTo(t[0],t[1]),i.lineTo(t[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],t[1]+(e[1]-t[1])*r),i.lineTo(e[0],e[1]),i)}Pw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Nw=(t,e)=>{const{cornerRatio:n=1/3}=t,r=Se(t,["cornerRatio"]),{coordinate:i,document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Se(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,d]=t,h=Cw(f,d,i,n);return Sm(o.createElement("path",{})).call(Pm,c).style("d",h.toString()).style("stroke",l).style("transform",u).call(Pm,r).node()}};Nw.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Lw=(t,e)=>{const n=Se(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Se(o,["color"]),{color:c=a,transform:l}=e,[u,f]=t,d=qs();if(d.moveTo(u[0],u[1]),Dc(r)){const t=r.getCenter();d.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{Cm(d,u,f,bs(u,f),ps(u,f)/2)}return Sm(i.createElement("path",{})).call(Pm,s).style("d",d.toString()).style("stroke",c).style("transform",l).call(Pm,n).node()}};function jw(t={}){const{shapes:e}=t;return[{name:"color"},{name:"opacity"},{name:"shape",range:e},{name:"enterType"},{name:"enterDelay",scaleKey:"enter"},{name:"enterDuration",scaleKey:"enter"},{name:"enterEasing"},{name:"key",scale:"identity"},{name:"groupKey",scale:"identity"},{name:"label",scale:"identity"}]}function Rw(t={}){return[...jw(t),{name:"title",scale:"identity"}]}function Iw(){return[{type:Qr,channel:"color"},{type:fi,channel:["x","y"]}]}function Bw(){return[{type:Qr,channel:"x"},{type:fi,channel:["y"]}]}function Dw(t={}){return jw(t)}function Fw(){return[{type:ri}]}function zw(t,e){return t.getBandWidth(t.invert(e))}function Gw(t,e,n={}){const{x:r,y:i,series:o}=e,{x:a,y:s,series:c}=t,{style:{bandOffset:l=(c?0:.5),bandOffsetX:u=l,bandOffsetY:f=l}={}}=n,d=!!(null==a?void 0:a.getBandWidth),h=!!(null==s?void 0:s.getBandWidth),p=!!(null==c?void 0:c.getBandWidth);return d||h?(t,e)=>{const n=d?zw(a,r[e]):0,l=h?zw(s,i[e]):0,g=p&&o?(zw(c,o[e])/2+ +o[e])*n:0,[m,y]=t;return[m+u*n+g,y+f*l]}:t=>t}function Ww(t){return parseFloat(t)/100}function $w(t,e,n,r){const{x:i,y:o}=n,{innerWidth:a,innerHeight:s}=r.getOptions();return[t,Array.from(t,(t=>{const e=i[t],n=o[t];return[["string"==typeof e?Ww(e)*a:+e,"string"==typeof n?Ww(n)*s:+n]]}))]}Lw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Hw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Se(o,["color"]),{color:c=a,src:l="",size:u=32,transform:f=""}=i;let{width:d=u,height:h=u}=t;const[[p,g]]=e,[m,y]=n.getSize();d="string"==typeof d?Ww(d)*m:d,h="string"==typeof h?Ww(h)*y:h;const v=p-Number(d)/2,b=g-Number(h)/2;return Sm(r.createElement("image",{})).call(Pm,s).style("x",v).style("y",b).style("src",l).style("stroke",c).style("transform",f).call(Pm,t).style("width",d).style("height",h).node()}};function Vw(t,e){const n=qs();if(Dc(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>ps(t,r)));return i.forEach(((e,i)=>{if(0===i)return void n.moveTo(e[0],e[1]);const a=o[i],s=t[i-1],c=o[i-1];void 0!==c&&Math.abs(a-c)<1e-10?Cm(n,s,e,r,a):n.lineTo(e[0],e[1])})),n.closePath(),n}return function(t,e){return e.forEach(((e,n)=>0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1]))),t.closePath(),t}(n,t)}Hw.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Yw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Se(o,["color"]),{color:c=a,transform:l}=i,u=Vw(e,n);return Sm(r.createElement("path",{})).call(Pm,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(Pm,t).node()}};function Uw(t,e){const[n,r,i,o]=t,a=qs();if(Dc(e)){const t=e.getCenter(),s=ps(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),Cm(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),Cm(a,r,n,t,s),a.closePath(),a}return a.moveTo(n[0],n[1]),a.bezierCurveTo(n[0]/2+i[0]/2,n[1],n[0]/2+i[0]/2,i[1],i[0],i[1]),a.lineTo(o[0],o[1]),a.bezierCurveTo(o[0]/2+r[0]/2,o[1],o[0]/2+r[0]/2,r[1],r[0],r[1]),a.lineTo(n[0],n[1]),a.closePath(),a}Yw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const qw=(t,e)=>{const n=Se(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Se(o,["color"]),{color:c=a,transform:l}=e,u=Uw(t,r);return Sm(i.createElement("path",{})).call(Pm,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(Pm,n).node()}};function Xw(t,e){const n=qs();if(Dc(e)){const r=e.getCenter(),[i,o]=r,a=gs(ds(t[0],r)),s=gs(ds(t[1],r)),c=ps(r,t[2]),l=ps(r,t[3]),u=ps(r,t[8]),f=ps(r,t[10]),d=ps(r,t[11]);n.moveTo(...t[0]),n.arc(i,o,c,a,s),n.arc(i,o,c,s,a,!0),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.arc(i,o,l,a,s),n.lineTo(...t[6]),n.arc(i,o,f,s,a,!0),n.closePath(),n.moveTo(...t[8]),n.arc(i,o,u,a,s),n.arc(i,o,u,s,a,!0),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.arc(i,o,d,a,s),n.arc(i,o,d,s,a,!0)}else n.moveTo(...t[0]),n.lineTo(...t[1]),n.moveTo(...t[2]),n.lineTo(...t[3]),n.moveTo(...t[4]),n.lineTo(...t[5]),n.lineTo(...t[6]),n.lineTo(...t[7]),n.closePath(),n.moveTo(...t[8]),n.lineTo(...t[9]),n.moveTo(...t[10]),n.lineTo(...t[11]),n.moveTo(...t[12]),n.lineTo(...t[13]);return n}qw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Zw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=o,f=Se(o,["color","fill","stroke"]),d=Xw(e,n);return Sm(r.createElement("path",{})).call(Pm,f).style("d",d.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Pm,t).node()}};function Kw(t,e,n=4){const r=qs();if(!Dc(e))return r.moveTo(...t[2]),r.lineTo(...t[3]),r.lineTo(t[3][0]-n,t[3][1]),r.lineTo(t[10][0]-n,t[10][1]),r.lineTo(t[10][0]+n,t[10][1]),r.lineTo(t[3][0]+n,t[3][1]),r.lineTo(...t[3]),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]),r.moveTo(t[3][0]+n/2,t[8][1]),r.arc(t[3][0],t[8][1],n/2,0,2*Math.PI),r.closePath(),r;const i=e.getCenter(),[o,a]=i,s=ps(i,t[3]),c=ps(i,t[8]),l=ps(i,t[10]),u=gs(ds(t[2],i)),f=Math.asin(n/c),d=u-f,h=u+f;r.moveTo(...t[2]),r.lineTo(...t[3]),r.moveTo(Math.cos(d)*s+o,Math.sin(d)*s+a),r.arc(o,a,s,d,h),r.lineTo(Math.cos(h)*l+o,Math.sin(h)*l+a),r.arc(o,a,l,h,d,!0),r.lineTo(Math.cos(d)*s+o,Math.sin(d)*s+a),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]);const p=(d+h)/2;return r.moveTo(Math.cos(p)*(c+n/2)+o,Math.sin(p)*(c+n/2)+a),r.arc(Math.cos(p)*c+o,Math.sin(p)*c+a,n/2,p,2*Math.PI+p),r.closePath(),r}Zw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Qw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a,transform:s}=i,{color:c,fill:l=c,stroke:u=c}=o,f=Se(o,["color","fill","stroke"]),d=Kw(e,n,4);return Sm(r.createElement("path",{})).call(Pm,f).style("d",d.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Pm,t).node()}};Qw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Jw=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=Se(t,["arrow","arrowSize"]),{coordinate:o,document:a}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=Se(s,["color","lineWidth"]),{color:f=c,size:d=l}=e,h=n?function(t,e,n){return t.createElement("path",{style:Object.assign({d:`M ${e},${e} L -${e},0 L ${e},-${e} L 0,0 Z`,transformOrigin:"center"},n)})}(a,r,Object.assign({fill:i.stroke||f,stroke:i.stroke||f},kr(i,"arrow"))):null,p=function(t,e){if(!Dc(e))return cc().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return nc()({startAngle:0,endAngle:2*Math.PI,outerRadius:ps(t[0],n),innerRadius:ps(t[1],n)})}(t,o),g=function(t,e){if(!Dc(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,e.transform);return Sm(a.createElement("path",{})).call(Pm,u).style("d",p).style("stroke",f).style("lineWidth",d).style("transform",g).style("markerEnd",h).call(Pm,i).node()}};function tM(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}Jw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const eM=(t,e)=>{const{offset:n=0,offset1:r=n,offset2:i=n,connectLength1:o,endMarker:a=!0}=t,s=Se(t,["offset","offset1","offset2","connectLength1","endMarker"]),{coordinate:c}=e;return(t,e,n)=>{const{color:l,connectLength1:u}=n,f=Se(n,["color","connectLength1"]),{color:d,transform:h}=e,p=function(t,e,n,r,i=0){const[[o,a],[s,c]]=e;if(Bc(t)){const t=o+n,e=t+i;return[[t,a],[e,a],[e,c],[s+r,c]]}const l=a-n,u=l-i;return[[o,l],[o,u],[s,u],[s,c-r]]}(c,t,r,i,null!=o?o:u),g=kr(Object.assign(Object.assign({},s),n),"endMarker");return Sm(new eg).call(Pm,f).style("d",function(t){return cc().x((t=>t[0])).y((t=>t[1]))(t)}(p)).style("stroke",d||l).style("transform",h).style("markerEnd",a?new db({className:"marker",style:Object.assign(Object.assign({},g),{symbol:tM})}):null).call(Pm,s).node()}};function nM(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function rM(t,e,n,r){const{bounds:i}=n,[[o,a],[s,c]]=i,l=s-o,u=c-a,f=t=>{const{x:e,y:r}=t,i=_r(n.x,l),s=_r(n.y,u);return Object.assign(Object.assign({},t),{x:(i||e)+o,y:(s||r)+a})};return f("left"===t?{x:0,y:u/2,textAlign:"start",textBaseline:"middle"}:"right"===t?{x:l,y:u/2,textAlign:"end",textBaseline:"middle"}:"top"===t?{x:l/2,y:0,textAlign:"center",textBaseline:"top"}:"bottom"===t?{x:l/2,y:u,textAlign:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAlign:"start",textBaseline:"top"}:"top-right"===t?{x:l,y:0,textAlign:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAlign:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:l,y:u,textAlign:"end",textBaseline:"bottom"}:{x:l/2,y:u/2,textAlign:"center",textBaseline:"middle"})}function iM(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=jm(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:d,endAngle:h}=l,p="inside"===t?(d+h)/2:h,g=aM(p,a,s),m=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?oM(c,p,i):bs(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},m),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function oM(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function aM(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function sM(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=jm(r,e,[i,o]),{startAngle:f,endAngle:d}=u,h=r.getCenter(),p=(f+d)/2,g={textAlign:"center",textBaseline:"middle",rotate:aM(p,a,s)},{innerRadius:m,outerRadius:y}=u,v=m+(y-m)*c+l,[b,x]=oM(h,p,v);return Object.assign({x:b,y:x},g)}function cM(t){return void 0===t?null:t}function lM(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:cM(o[0]),y:cM(o[1])}}function uM(t,e,n,r){const{bounds:i}=n;if(1===i.length)return lM(0,0,n);return(Fc(r)?iM:$c(r)?sM:rM)(t,e,n,r)}function fM(t,e,n){const r=jm(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function dM(t,e,n){const r=jm(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function hM(t,e,n,r){const{autoRotate:i,rotateToAlignArc:o,offset:a=0,connector:s=!0,connectorLength:c=a,connectorLength2:l=0,connectorDistance:u=0}=n,f=r.getCenter(),d=dM(e,n,r),h=Math.sin(d)>0?1:-1,p=aM(d,i,o),g={textAlign:h>0||Fc(r)?"start":"end",textBaseline:"middle",rotate:p},m=fM(e,n,r),y=m+(s?c:a),[[v,b],[x,w],[M,O]]=function(t,e,n,r,i){const[o,a]=oM(t,e,n),[s,c]=oM(t,e,r);return[[o,a],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,d,m,y,s?l:0),E=s?+u*h:0,k=M+E,S={connector:s,connectorPoints:[[x-k,w-O],[M-k,O-O]]};return Object.assign(Object.assign({x0:v,y0:b,x:M+E,y:O},g),S)}eM.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var pM=Object.freeze({__proto__:null,area:function(t,e,n,r){const i=e.length/2,o=e.slice(0,i),a=e.slice(i);let s=lr(o,((t,e)=>Math.abs(t[1]-a[e][1])));s=Math.max(Math.min(s,i-2),1);const c=t=>[o[t][0],(o[t][1]+a[t][1])/2],l=c(s),u=c(s-1),f=gs(ds(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:uM,bottomLeft:uM,bottomRight:uM,inside:uM,left:uM,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?lM(0,0,n):(Fc(r)?iM:$c(r)?hM:rM)(t,e,n,r)},right:uM,spider:function(t,e,n,r){if(!$c(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=Se(hM(0,e,n,r),[]),c=r.getCenter(),l=fM(e,n,r),u=dM(e,n,r),f=l+i+o,d=Math.sin(u)>0?1:-1,h=c[0]+(f+ +a)*d,{x:p}=s,g=h-p;return s.x+=g,s.connectorPoints[0][0]-=g,s},surround:function(t,e,n,r){if(!$c(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=Se(hM(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if($c(t)){const[e,n]=t.getSize(),r=t.getOptions().transformations.find((t=>"polar"===t[0]));if(r)return Math.max(e,n)/2*r[4]}return 0}(r),d=f+i,h=ms([c-u[0],l-u[1]]),p=Math.sin(h)>0?1:-1,[g,m]=oM(u,h,d);return s.x=g+(o+a)*p,s.y=m,s},top:uM,topLeft:uM,topRight:uM});function gM(t,e,n,r,i){const{position:o}=e,{render:a}=i,s=function(t,e){return void 0!==t?t:$c(e)?"inside":Bc(e)?"right":"top"}(o,n),c=r[a?"htmlLabel":"inside"===s?"innerLabel":"label"],l=Object.assign({},c,e),u=pM[nM(s)];if(!u)throw new Error(`Unknown position: ${s}`);return Object.assign(Object.assign({},c),u(s,t,l,n,i))}const mM=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,o)=>{const{text:a,x:s,y:c,transform:l="",transformOrigin:u,className:f=""}=o,d=Se(o,["text","x","y","transform","transformOrigin","className"]),h=gM(e,o,n,r,t),{rotate:p=0,transform:g=""}=h,m=Se(h,["rotate","transform"]);return Sm(new yw).call(Pm,m).style("text",`${a}`).style("className",`${f} g2-label`).style("innerHTML",i?i(a,o.datum,o.index):void 0).style("labelTransform",`${g} rotate(${+p}) ${l}`.trim()).style("labelTransformOrigin",u).style("coordCenter",n.getCenter()).call(Pm,d).node()}};mM.props={defaultMarker:"point"};const yM=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=Se(t,["arrow","colorAttribute"]),{coordinate:o,document:a}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=Se(n,["color","stroke"]),{d:u,color:f=s}=e,[d,h]=o.getSize();return Sm(a.createElement("path",{})).call(Pm,l).style("d","function"==typeof u?u({width:d,height:h}):u).style(r,f).call(Pm,i).node()}};yM.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const vM=(t,e)=>yM(Object.assign({colorAttribute:"fill"},t),e);vM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const bM=(t,e)=>yM(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);bM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xM=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:o}=r,{color:a}=i,s=Se(i,["color"]),{color:c=a}=r,[l,...u]=e,f=qs();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),Sm(n.createElement("path",{})).call(Pm,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(Pm,t).node()}};function wM(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 MM(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}xM.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},wM(3);const OM=function(t,e=(...t)=>`${t[0]}`,n=16){const r=wM(n);return(...n)=>{const i=e(...n);let o=r.get(i);return r.has(i)?r.get(i):(o=t(...n),r.set(i,o),o)}}(((t,e,n)=>{const r=MM(n,2*t,2*t),i=r.getContext("2d"),o=t,a=t;if(1===e)i.beginPath(),i.arc(o,a,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const n=i.createRadialGradient(o,a,t*e,o,a,t);n.addColorStop(0,"rgba(0,0,0,1)"),n.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=n,i.fillRect(0,0,2*t,2*t)}return r}),(t=>`${t}`));function EM(t,e,n,r,i,o,a){const s=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},o);s.minOpacity*=255,s.opacity*=255,s.maxOpacity*=255;const c=MM(a,t,e).getContext("2d"),l=function(t,e){const n=MM(e,256,1).getContext("2d"),r=n.createLinearGradient(0,0,256,1);return function(t){return"string"==typeof t?t.split(" ").map((t=>{const[e,n]=t.split(":");return[+e,n]})):t}(t).forEach((([t,e])=>{r.addColorStop(t,e)})),n.fillStyle=r,n.fillRect(0,0,256,1),n.getImageData(0,0,256,1).data}(s.gradient,a);c.clearRect(0,0,t,e),function(t,e,n,r,i,o){const{blur:a}=i;let s=r.length;for(;s--;){const{x:i,y:c,value:l,radius:u}=r[s],f=Math.min(l,n),d=i-u,h=c-u,p=OM(u,1-a,o),g=(f-e)/(n-e);t.globalAlpha=Math.max(g,.001),t.drawImage(p,d,h)}}(c,n,r,i,s,a);const u=function(t,e,n,r,i){const{minOpacity:o,opacity:a,maxOpacity:s,useGradientOpacity:c}=i,l=e,u=n,f=t.getImageData(0,0,l,u),d=f.data,h=d.length;for(let t=3;t<h;t+=4){const e=d[t],n=4*e;if(!n)continue;const i=a||Math.max(0,Math.min(s,Math.max(o,e)));d[t-3]=r[n],d[t-2]=r[n+1],d[t-1]=r[n+2],d[t]=c?r[n+3]:i}return f}(c,t,e,l,s),f=MM(a,t,e).getContext("2d");return f.putImageData(u,0,0),f}const kM=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:o,blur:a,useGradientOpacity:s}=t,c=Se(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:l,createCanvas:u,document:f}=e;return(t,e,d)=>{const{transform:h}=e,[p,g]=l.getSize(),m=t.map((t=>({x:t[0],y:t[1],value:t[2],radius:t[3]}))),y=ur(t,(t=>t[2])),v=cr(t,(t=>t[2])),b=p&&g?EM(p,g,y,v,m,(x={gradient:n,opacity:r,minOpacity:o,maxOpacity:i,blur:a,useGradientOpacity:s},w=t=>void 0===t,Object.keys(x).reduce(((t,e)=>{const n=x[e];return w(n,e)||(t[e]=n),t}),{})),u):{canvas:null};var x,w;return Sm(f.createElement("image",{})).call(Pm,d).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas).style("transform",h).call(Pm,c).node()}};kM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const SM=(t,e)=>{const{render:n}=t,r=Se(t,["render"]);return t=>{const[[i,o]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:o}),e)}};function AM(t,e){return t.getBandWidth(t.invert(e))}SM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const _M={rect:zm,hollow:Gm,funnel:$m,pyramid:Vm},TM=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,series:s,size:c}=n,l=e.x,u=e.series,[f]=r.getSize(),d=c?c.map((t=>+t/f)):null,h=c?(t,e,n)=>{const r=t+e/2,i=d[n];return[r-i/2,r+i/2]}:(t,e,n)=>[t,t+e],p=Array.from(t,(t=>{const e=AM(l,i[t]),n=e*(u?AM(u,null==s?void 0:s[t]):1),c=(+(null==s?void 0:s[t])||0)*e,f=+i[t]+c,[d,p]=h(f,n,t),g=+o[t],m=+a[t];return[[d,g],[p,g],[p,m],[d,m]].map((t=>r.map(t)))}));return[t,p]};TM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:_M,channels:[...Rw({shapes:Object.keys(_M)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Fw(),{type:An},{type:Jr}],postInference:[...Bw()],interaction:{shareTooltip:!0}};const PM={rect:zm,hollow:Gm},CM=()=>(t,e,n,r)=>{const{x:i,x1:o,y:a,y1:s}=n,c=Array.from(t,(t=>[[+i[t],+a[t]],[+o[t],+a[t]],[+o[t],+s[t]],[+i[t],+s[t]]].map((t=>r.map(t)))));return[t,c]};CM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:PM,channels:[...Rw({shapes:Object.keys(PM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Fw(),{type:An}],postInference:[...Bw()],interaction:{shareTooltip:!0}};const NM={line:Xm,smooth:Zm,hv:Km,vh:Qm,hvh:Jm,trail:ey},LM=(t,e,n,r)=>{var i,o;const{series:a,x:s,y:c}=n,{x:l,y:u}=e;if(void 0===s||void 0===c)throw new Error("Missing encode for x or y channel.");const f=a?Array.from(Vn(t,(t=>a[t])).values()):[t],d=f.map((t=>t[0])).filter((t=>void 0!==t)),h=((null===(i=null==l?void 0:l.getBandWidth)||void 0===i?void 0:i.call(l))||0)/2,p=((null===(o=null==u?void 0:u.getBandWidth)||void 0===o?void 0:o.call(u))||0)/2,g=Array.from(f,(t=>t.map((t=>r.map([+s[t]+h,+c[t]+p])))));return[d,g,f]},jM=(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("position"))).map((([,t])=>t));if(0===i.length)throw new Error("Missing encode for position channel.");return[t,Array.from(t,(t=>{const e=i.map((e=>+e[t])),n=r.map(e),o=[];for(let t=0;t<n.length;t+=2)o.push([n[t],n[t+1]]);return o}))]},RM=()=>(t,e,n,r)=>(Gc(r)?jM:LM)(t,e,n,r);RM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:NM,channels:[...Rw({shapes:Object.keys(NM)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Fw(),{type:mi},{type:ii}],postInference:[...Bw(),{type:Qr,channel:"color"},{type:fi,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const IM={hollow:Ry,hollowDiamond:Ly,hollowHexagon:jy,hollowSquare:Iy,hollowTriangleDown:Dy,hollowTriangle:By,hollowBowtie:Ny,hollowCircle:Gy,point:Xy,plus:qy,diamond:Hy,square:Zy,triangle:Qy,hexagon:Vy,cross:$y,bowtie:Wy,hyphen:Yy,line:Uy,tick:Ky,triangleDown:Jy,circle:zy},BM=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s,y1:c,size:l,dx:u,dy:f}=r,[d,h]=i.getSize(),p=Gw(n,r,t),g=t=>{const e=+((null==u?void 0:u[t])||0),n=+((null==f?void 0:f[t])||0);return[(s?(+o[t]+ +s[t])/2:+o[t])+e,(c?(+a[t]+ +c[t])/2:+a[t])+n]};return[e,l?Array.from(e,(t=>{const[e,n]=g(t),r=+l[t],o=r/d,a=r/h,s=[e-o,n-a],c=[e+o,n+a];return[i.map(p(s,t)),i.map(p(c,t))]})):Array.from(e,(t=>[i.map(p(g(t),t))]))]};BM.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:IM,channels:[...Rw({shapes:Object.keys(IM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size",quantitative:"sqrt"},{name:"dx",scale:"identity"},{name:"dy",scale:"identity"}],preInference:[...Fw(),{type:Jr},{type:ti}],postInference:[{type:ni},...Iw()]};const DM={text:vw,badge:xw,tag:ww},FM=t=>{const{cartesian:e=!1}=t;return e?$w:(e,n,r,i)=>{const{x:o,y:a}=r,s=Gw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};FM.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:DM,channels:[...Rw({shapes:Object.keys(DM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize",scale:"identity"},{name:"rotate",scale:"identity"}],preInference:[...Fw(),{type:gi},{type:hi}],postInference:[...Iw()]};const zM={cell:zm,hollow:Gm},GM=()=>(t,e,n,r)=>{const{x:i,y:o}=n,a=e.x,s=e.y,c=Array.from(t,(t=>{const e=a.getBandWidth(a.invert(+i[t])),n=s.getBandWidth(s.invert(+o[t])),c=+i[t],l=+o[t];return[[c,l],[c+e,l],[c+e,l+n],[c,l+n]].map((t=>r.map(t)))}));return[t,c]};GM.props={defaultShape:"cell",defaultLabelShape:"label",shape:zM,composite:!1,channels:[...Rw({shapes:Object.keys(zM)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Fw(),{type:Jr},{type:ti},{type:di}],postInference:[...Iw()]};const WM={area:Ew,smooth:kw,hvh:Sw,vh:Aw,hv:_w},$M=()=>(t,e,n,r)=>{var i,o;const{x:a,y:s,y1:c,series:l}=n,{x:u,y:f}=e,d=l?Array.from(Vn(t,(t=>l[t])).values()):[t],h=d.map((t=>t[0])).filter((t=>void 0!==t)),p=((null===(i=null==u?void 0:u.getBandWidth)||void 0===i?void 0:i.call(u))||0)/2,g=((null===(o=null==f?void 0:f.getBandWidth)||void 0===o?void 0:o.call(f))||0)/2;return[h,Array.from(d,(t=>{const e=t.length,n=new Array(2*e);for(let i=0;i<t.length;i++){const o=t[i];n[i]=r.map([+a[o]+p,+s[o]+g]),n[e+i]=r.map([+a[o]+p,+c[o]+g])}return n})),d]};$M.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:WM,channels:[...Rw({shapes:Object.keys(WM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Fw(),{type:ii},{type:An},{type:di}],postInference:[...Bw()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const HM={link:Tw,arc:Lw,smooth:Pw,vhv:Nw},VM=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=Gw(n,r,t),u=e.map((t=>[i.map(l([+o[t],+a[t]],t)),i.map(l([+s[t],+c[t]],t))]));return[e,u]};VM.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:HM,channels:[...Rw({shapes:Object.keys(HM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Fw(),{type:si},{type:ci}],postInference:[...Iw()]};const YM={image:Hw},UM=t=>{const{cartesian:e}=t;return e?$w:(e,n,r,i)=>{const{x:o,y:a}=r,s=Gw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};UM.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:YM,channels:[...Rw({shapes:Object.keys(YM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Fw(),{type:gi},{type:hi}],postInference:[...Iw()]};const qM={polygon:Yw,ribbon:qw},XM=()=>(t,e,n,r)=>{const i=Object.entries(n).filter((([t])=>t.startsWith("x"))).map((([,t])=>t)),o=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),a=t.map((t=>{const e=[];for(let n=0;n<i.length;n++){const a=i[n][t];if(void 0===a)break;const s=o[n][t];e.push(r.map([+a,+s]))}return e}));return[t,a]};XM.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:qM,channels:[...Rw({shapes:Object.keys(qM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Fw()],postInference:[...Iw()]};const ZM={box:Zw,violin:Qw},KM=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,y2:s,y3:c,y4:l,series:u}=n,f=e.x,d=e.series,h=Array.from(t,(t=>{const e=f.getBandWidth(f.invert(+i[t])),n=e*(d?d.getBandWidth(d.invert(+(null==u?void 0:u[t]))):1),h=(+(null==u?void 0:u[t])||0)*e,p=+i[t]+h+n/2,[g,m,y,v,b]=[+o[t],+a[t],+s[t],+c[t],+l[t]];return[[p-n/2,b],[p+n/2,b],[p,b],[p,v],[p-n/2,v],[p+n/2,v],[p+n/2,m],[p-n/2,m],[p-n/2,y],[p+n/2,y],[p,m],[p,g],[p-n/2,g],[p+n/2,g]].map((t=>r.map(t)))}));return[t,h]};KM.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:ZM,channels:[...Rw({shapes:Object.keys(ZM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Fw(),{type:Jr}],postInference:[...Bw()],interaction:{shareTooltip:!0}};const QM={vector:tv},JM=()=>(t,e,n,r)=>{const{x:i,y:o,size:a,rotate:s}=n,[c,l]=r.getSize(),u=t.map((t=>{const e=+s[t]/180*Math.PI,n=+a[t],u=n/l,f=n/c*Math.cos(e),d=-u*Math.sin(e);return[r.map([+i[t]-f/2,+o[t]-d/2]),r.map([+i[t]+f/2,+o[t]+d/2])]}));return[t,u]};JM.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:QM,channels:[...Rw({shapes:Object.keys(QM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Fw()],postInference:[...Iw()]};const tO={line:Jw},eO=t=>(e,n,r,i)=>{const{y:o}=r,a=Gw(n,r,K({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[0,o[t]],[1,o[t]]].map((e=>i.map(a(e,t))))));return[e,s]};eO.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:tO,channels:[...Dw({shapes:Object.keys(tO)}),{name:"y",required:!0}],preInference:[...Fw(),{type:oi}],postInference:[]};const nO={line:Jw},rO=t=>(e,n,r,i)=>{const{x:o}=r,a=Gw(n,r,K({style:{bandOffset:0}},t)),s=Array.from(e,(t=>[[o[t],1],[o[t],0]].map((e=>i.map(a(e,t))))));return[e,s]};rO.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:nO,channels:[...Dw({shapes:Object.keys(nO)}),{name:"x",required:!0}],preInference:[...Fw(),{type:ai}],postInference:[]};const iO={connector:eM},oO=(...t)=>VM(...t);function aO(t,e,n,r){if(e)return()=>[0,1];const{[t]:i,[`${t}1`]:o}=n;return t=>{var e;const n=(null===(e=r.getBandWidth)||void 0===e?void 0:e.call(r,r.invert(+o[t])))||0;return[i[t],o[t]+n]}}function sO(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=aO("x",e,i,r.x),s=aO("y",n,i,r.y),c=Array.from(t,(t=>{const[e,n]=a(t),[r,i]=s(t);return[[e,r],[n,r],[n,i],[e,i]].map((t=>o.map(t)))}));return[t,c]}}oO.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:iO,channels:[...Dw({shapes:Object.keys(iO)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Fw()],postInference:[]};const cO={range:zm},lO=()=>sO();lO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:cO,channels:[...Dw({shapes:Object.keys(cO)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Fw()],postInference:[]};const uO={range:zm},fO=()=>sO({extendY:!0});fO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:uO,channels:[...Dw({shapes:Object.keys(uO)}),{name:"x",required:!0}],preInference:[...Fw(),{type:li}],postInference:[]};const dO={range:zm},hO=()=>sO({extendX:!0});hO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:dO,channels:[...Dw({shapes:Object.keys(dO)}),{name:"y",required:!0}],preInference:[...Fw(),{type:ui}],postInference:[]};const pO={path:vM,hollow:bM},gO=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];function mO(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}function yO(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=bO)):void 0===e&&(e=vO);for(var n,r,i,o,a,s=new MO(t),c=[s];n=c.pop();)if((i=e(n.data))&&(a=(i=Array.from(i)).length))for(n.children=i,o=a-1;o>=0;--o)c.push(r=i[o]=new MO(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(wO)}function vO(t){return t.children}function bO(t){return Array.isArray(t)?t[1]:null}function xO(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function wO(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function MO(t){this.data=t,this.depth=this.height=0,this.parent=null}function OO(t){return null==t?null:EO(t)}function EO(t){if("function"!=typeof t)throw new Error;return t}function kO(){return 0}function SO(t){return function(){return t}}function AO(t){t.x0=Math.round(t.x0),t.y0=Math.round(t.y0),t.x1=Math.round(t.x1),t.y1=Math.round(t.y1)}function _O(t,e,n,r,i){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(r-e)/t.value;++s<c;)(o=a[s]).y0=n,o.y1=i,o.x0=e,o.x1=e+=o.value*l}gO.props={defaultShape:"path",defaultLabelShape:"label",shape:pO,composite:!1,channels:[...Rw({shapes:Object.keys(pO)}),{name:"d",scale:"identity"}],preInference:[...Fw()],postInference:[]},MO.prototype=yO.prototype={constructor:MO,count:function(){return this.eachAfter(mO)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],c=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)t.call(e,o,++c,this);return this},eachBefore:function(t,e){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(t.call(e,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return yO(this).eachBefore(xO)},[Symbol.iterator]:function*(){var t,e,n,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,e=i.children)for(n=0,r=e.length;n<r;++n)o.push(e[n])}while(o.length)}};var TO={depth:-1},PO={},CO={};function NO(t){return t.id}function LO(t){return t.parentId}function jO(){var t,e=NO,n=LO;function r(r){var i,o,a,s,c,l,u,f,d=Array.from(r),h=e,p=n,g=new Map;if(null!=t){const e=d.map(((e,n)=>function(t){t=`${t}`;let e=t.length;IO(t,e-1)&&!IO(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(RO),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(RO(t)),d.push(CO));h=(t,n)=>e[n],p=(t,e)=>n[e]}for(a=0,i=d.length;a<i;++a)o=d[a],l=d[a]=new MO(o),null!=(u=h(o,a,r))&&(u+="")&&(f=l.id=u,g.set(f,g.has(f)?PO:l)),null!=(u=p(o,a,r))&&(u+="")&&(l.parent=u);for(a=0;a<i;++a)if(u=(l=d[a]).parent){if(!(c=g.get(u)))throw new Error("missing: "+u);if(c===PO)throw new Error("ambiguous: "+u);c.children?c.children.push(l):c.children=[l],l.parent=c}else{if(s)throw new Error("multiple roots");s=l}if(!s)throw new Error("no root");if(null!=t){for(;s.data===CO&&1===s.children.length;)s=s.children[0],--i;for(let t=d.length-1;t>=0&&(l=d[t]).data===CO;--t)l.data=null}if(s.parent=TO,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(wO),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=OO(t),r):e},r.parentId=function(t){return arguments.length?(n=OO(t),r):n},r.path=function(e){return arguments.length?(t=OO(e),r):t},r}function RO(t){let e=t.length;if(e<2)return"";for(;--e>1&&!IO(t,e););return t.slice(0,e)}function IO(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function BO(t,e,n,r,i){for(var o,a=t.children,s=-1,c=a.length,l=t.value&&(i-n)/t.value;++s<c;)(o=a[s]).x0=e,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var DO=(1+Math.sqrt(5))/2;function FO(t,e,n,r,i,o){for(var a,s,c,l,u,f,d,h,p,g,m,y=[],v=e.children,b=0,x=0,w=v.length,M=e.value;b<w;){c=i-n,l=o-r;do{u=v[x++].value}while(!u&&x<w);for(f=d=u,m=u*u*(g=Math.max(l/c,c/l)/(M*t)),p=Math.max(d/m,m/f);x<w;++x){if(u+=s=v[x].value,s<f&&(f=s),s>d&&(d=s),m=u*u*g,(h=Math.max(d/m,m/f))>p){u-=s;break}p=h}y.push(a={value:u,dice:c<l,children:v.slice(b,x)}),a.dice?_O(a,n,r,i,M?r+=l*u/M:o):BO(a,n,r,M?n+=c*u/M:i,o),M-=u,b=x}return y}var zO=function t(e){function n(t,n,r,i,o){FO(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(DO);function GO(t,e,n,r,i){var o,a,s=t.children,c=s.length,l=new Array(c+1);for(l[0]=a=o=0;o<c;++o)l[o+1]=a+=s[o].value;!function t(e,n,r,i,o,a,c){if(e>=n-1){var u=s[e];return u.x0=i,u.y0=o,u.x1=a,void(u.y1=c)}var f=l[e],d=r/2+f,h=e+1,p=n-1;for(;h<p;){var g=h+p>>>1;l[g]<d?h=g+1:p=g}d-l[h-1]<l[h]-d&&e+1<h&&--h;var m=l[h]-f,y=r-m;if(a-i>c-o){var v=r?(i*y+a*m)/r:a;t(e,h,m,i,o,v,c),t(h,n,y,v,o,a,c)}else{var b=r?(o*y+c*m)/r:c;t(e,h,m,i,o,a,b),t(h,n,y,i,b,a,c)}}(0,c,t.value,e,n,r,i)}function WO(t,e,n,r,i){(1&t.depth?BO:_O)(t,e,n,r,i)}var $O=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,s,c,l,u,f=-1,d=a.length,h=t.value;++f<d;){for(c=(s=a[f]).children,l=s.value=0,u=c.length;l<u;++l)s.value+=c[l].value;s.dice?_O(s,n,r,i,h?r+=(o-r)*s.value/h:o):BO(s,n,r,h?n+=(i-n)*s.value/h:i,o),h-=s.value}else t._squarify=a=FO(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(DO);function HO(t,e=[t.data.name]){t.id=t.id||t.data.name,t.path=e,t.children&&t.children.forEach((n=>{n.id=`${t.id}/${n.data.name}`,n.path=[...e,n.data.name],HO(n,n.path)}))}function VO(t){const e=et(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach((t=>{VO(t)}))}function YO(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:GO,treemapDice:_O,treemapSlice:BO,treemapSliceDice:WO,treemapSquarify:zO,treemapResquarify:$O},r="treemapSquarify"===t?n[t].ratio(e):n[t];if(!r)throw new TypeError("Invalid tile method!");return r}(e.tile,e.ratio),o=function(t,e){return Array.isArray(t)?"function"==typeof e?jO().path(e)(t):jO()(t):yO(t)}(t,e.path);w(t)?VO(o):HO(o),r?o.sum((t=>e.ignoreParentValue&&t.children?0:function(t){return"function"==typeof t?t:e=>e[t]}(r)(t))).sort(e.sort):o.count(),function(){var t=zO,e=!1,n=1,r=1,i=[0],o=kO,a=kO,s=kO,c=kO,l=kO;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(AO),t}function f(e){var n=i[e.depth],r=e.x0+n,u=e.y0+n,f=e.x1-n,d=e.y1-n;f<r&&(r=f=(r+f)/2),d<u&&(u=d=(u+d)/2),e.x0=r,e.y0=u,e.x1=f,e.y1=d,e.children&&(n=i[e.depth+1]=o(e)/2,r+=l(e)-n,u+=a(e)-n,(f-=s(e)-n)<r&&(r=f=(r+f)/2),(d-=c(e)-n)<u&&(u=d=(u+d)/2),t(e,r,u,f,d))}return u.round=function(t){return arguments.length?(e=!!t,u):e},u.size=function(t){return arguments.length?(n=+t[0],r=+t[1],u):[n,r]},u.tile=function(e){return arguments.length?(t=EO(e),u):t},u.padding=function(t){return arguments.length?u.paddingInner(t).paddingOuter(t):u.paddingInner()},u.paddingInner=function(t){return arguments.length?(o="function"==typeof t?t:SO(+t),u):o},u.paddingOuter=function(t){return arguments.length?u.paddingTop(t).paddingRight(t).paddingBottom(t).paddingLeft(t):u.paddingTop()},u.paddingTop=function(t){return arguments.length?(a="function"==typeof t?t:SO(+t),u):a},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:SO(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"==typeof t?t:SO(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:SO(+t),u):l},u}().tile(i).size(e.size).round(e.round).paddingInner(e.paddingInner).paddingOuter(e.paddingOuter).paddingTop(e.paddingTop).paddingRight(e.paddingRight).paddingBottom(e.paddingBottom).paddingLeft(e.paddingLeft)(o);const a=o.descendants().map((t=>Object.assign(t,{id:t.id.replace(/^\//,""),x:[t.x0,t.x1],y:[t.y0,t.y1]}))),s=a.filter("function"==typeof e.layer?e.layer:t=>t.height===e.layer);return[s,a]}const UO=t=>{const{cartesian:e}=t;return e?$w:(e,n,r,i)=>{const{x:o,y:a}=r,s=Gw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};UO.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:SM},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Fw(),{type:gi},{type:hi},{type:pi}]};const qO=(t,e)=>_e(void 0,void 0,void 0,(function*(){const{width:n,height:r}=e,{data:i,encode:o={},scale:a,style:s={},layout:c={}}=t,l=Se(t,["data","encode","scale","style","layout"]),u=function(t,e){const{text:n="text",value:r="value"}=e;return t.map((t=>Object.assign(Object.assign({},t),{text:t[n],value:t[r]})))}(i,o);return K({},{axis:!1,type:"text",encode:{x:"x",y:"y",text:"text",rotate:"rotate",fontSize:"size",shape:"tag"},scale:{x:{range:[0,1]},y:{range:[0,1]}},style:{fontFamily:t=>t.fontFamily}},Object.assign(Object.assign({data:{value:u,transform:[Object.assign({type:"wordCloud",size:[n,r]},c)]},encode:o,scale:a,style:s},l),{axis:!1}))}));qO.props={};const XO={density:xM},ZO=()=>(t,e,n,r)=>{const{x:i,series:o}=n,a=Object.entries(n).filter((([t])=>t.startsWith("y"))).map((([,t])=>t)),s=Object.entries(n).filter((([t])=>t.startsWith("size"))).map((([,t])=>t));if(void 0===i||void 0===a||void 0===s)throw new Error("Missing encode for x or y or size channel.");const c=e.x,l=e.series,u=Array.from(t,(e=>{const n=c.getBandWidth(c.invert(+i[e])),u=n*(l?l.getBandWidth(l.invert(+(null==o?void 0:o[e]))):1),f=(+(null==o?void 0:o[e])||0)*n,d=+i[e]+f+u/2;return[...a.map(((n,r)=>[d+ +s[r][e]/t.length,+a[r][e]])),...a.map(((n,r)=>[d-+s[r][e]/t.length,+a[r][e]])).reverse()].map((t=>r.map(t)))}));return[t,u]};ZO.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:XO,channels:[...Rw({shapes:Object.keys(XO)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"size",required:!0},{name:"series",scale:"band"},{name:"size",required:!0,scale:"identity"}],preInference:[...Fw(),{type:An},{type:Jr}],postInference:[...Bw()],interaction:{shareTooltip:!0}};const KO={heatmap:kM},QO=t=>(t,e,n,r)=>{const{x:i,y:o,size:a,color:s}=n;return[[0],[Array.from(t,(t=>{const e=a?+a[t]:40;return[...r.map([+i[t],+o[t]]),s[t],e]}))]]};QO.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:KO,channels:[...Rw({shapes:Object.keys(KO)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Fw(),{type:Jr},{type:ti}],postInference:[...Iw()]};const JO=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];JO.props={};const tE=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];tE.props={};const eE=t=>new zo(t);eE.props={};const nE=t=>new ia(t);nE.props={};const rE=t=>new Bo(t);rE.props={};const iE=t=>new Jo(t);iE.props={};const oE=t=>new oa(t);oE.props={};const aE=t=>new _a(t);aE.props={};const sE=t=>new fa(t);sE.props={};const cE=t=>new sa(t);cE.props={};const lE=t=>new la(t);lE.props={};const uE=t=>new pa(t);uE.props={};const fE=t=>new da(t);fE.props={};const dE=t=>new ca(t);dE.props={};const hE=t=>new Ca(t);hE.props={};const pE=t=>new Wo(t);function gE({colorDefault:t,colorBlack:e,colorWhite:n,colorStroke:r,colorBackground:i,padding1:o,padding2:a,padding3:s,alpha90:c,alpha65:l,alpha45:u,alpha25:f,alpha10:d,category10:h,category20:p,sizeDefault:g=1,padding:m="auto",margin:y=16}){return{padding:m,margin:y,size:g,color:t,category10:h,category20:p,enter:{duration:300,fill:"both",delay:0},update:{duration:300,fill:"both",delay:0},exit:{duration:300,fill:"both",delay:0},view:{viewFill:i,plotFill:"transparent",mainFill:"transparent",contentFill:"transparent"},line:{line:{fill:"",strokeOpacity:1,lineWidth:1,lineCap:"round"}},point:{point:{r:3,fillOpacity:.95,lineWidth:0},hollow:{r:3,strokeOpacity:.95,lineWidth:1},plus:{r:3,strokeOpacity:.95,lineWidth:3},diamond:{r:3,strokeOpacity:.95,lineWidth:1}},interval:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},area:{area:{fillOpacity:.85,lineWidth:0}},polygon:{polygon:{fillOpacity:.95}},cell:{cell:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},rect:{rect:{fillOpacity:.95},hollow:{fill:"",strokeOpacity:1,lineWidth:2}},link:{link:{fill:"",strokeOpacity:1}},vector:{vector:{fillOpacity:1}},box:{box:{fillOpacity:.95,stroke:e,lineWidth:1}},text:{text:{fill:"#1D2129",fontSize:12,lineWidth:0,connectorStroke:r,connectorStrokeOpacity:.45,connectorLineWidth:1,backgroundFill:r,backgroundFillOpacity:.15,backgroundPadding:[2,4],startMarkerSymbol:"circle",startMarkerSize:4,endMarkerSymbol:"circle",endMarkerSize:4},badge:{fill:"#1D2129",fillOpacity:.65,lineWidth:0,fontSize:10,textAlign:"center",textBaseline:"middle",markerFill:r,markerFillOpacity:.25,markerStrokeOpacity:0}},lineX:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},lineY:{line:{stroke:r,strokeOpacity:.45,lineWidth:1}},rangeX:{range:{fill:r,fillOpacity:.15,lineWidth:0}},rangeY:{range:{fill:r,fillOpacity:.15,lineWidth:0}},connector:{connector:{stroke:r,strokeOpacity:.45,lineWidth:1,connectLength1:12,endMarker:!0,endMarkerSize:6,endMarkerFill:r,endMarkerFillOpacity:.95}},axis:{arrow:!1,gridLineDash:[3,4],gridLineWidth:.5,gridStroke:e,gridStrokeOpacity:d,labelAlign:"horizontal",labelFill:e,labelOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:o,line:!1,lineLineWidth:.5,lineStroke:e,lineStrokeOpacity:u,tickLength:4,tickLineWidth:1,tickStroke:e,tickOpacity:u,titleFill:e,titleOpacity:c,titleFontSize:12,titleFontWeight:"normal",titleSpacing:12,titleTransformOrigin:"center",lineArrowOffset:6,lineArrowSize:6},axisTop:{gridDirection:"positive",labelDirection:"negative",tickDirection:"negative",titlePosition:"top",titleSpacing:12,labelSpacing:4,titleTextBaseline:"middle"},axisBottom:{gridDirection:"negative",labelDirection:"positive",tickDirection:"positive",titlePosition:"bottom",titleSpacing:12,labelSpacing:4,titleTextBaseline:"bottom",titleTransform:"translate(0, 8)"},axisLeft:{gridDirection:"positive",labelDirection:"negative",labelSpacing:4,tickDirection:"negative",titlePosition:"left",titleSpacing:12,titleTextBaseline:"middle",titleDirection:"vertical",titleTransform:"rotate(-90) translate(0, -8)",titleTransformOrigin:"center"},axisRight:{gridDirection:"negative",labelDirection:"positive",labelSpacing:4,tickDirection:"positive",titlePosition:"right",titleSpacing:12,titleTextBaseline:"top",titleDirection:"vertical",titleTransformOrigin:"center"},axisLinear:{girdClosed:!0,gridConnect:"arc",gridDirection:"negative",gridType:"surround",titlePosition:"top",titleSpacing:0},axisArc:{title:!1,titlePosition:"inner",line:!1,tick:!0,labelSpacing:4},axisRadar:{girdClosed:!0,gridStrokeOpacity:.3,gridType:"surround",label:!1,tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[o,o],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:o,colPadding:a,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:c,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:c,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:l,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"},tooltip:{css:{".g2-tooltip":{"font-family":"sans-serif"}}}}}pE.props={};const mE=gE({colorBlack:"#1D2129",colorWhite:"#ffffff",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),yE=t=>K({},mE,t);yE.props={};const vE=t=>K({},yE(),{category10:"category10",category20:"category20"},t);vE.props={};const bE=gE({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),xE=t=>K({},bE,{tooltip:{crosshairsStroke:"#fff",crosshairsLineWidth:1,crosshairsStrokeOpacity:.25,css:{".g2-tooltip":{background:"#1f1f1f",opacity:.95},".g2-tooltip-title":{color:"#A6A6A6"},".g2-tooltip-list-item-name-label":{color:"#A6A6A6"},".g2-tooltip-list-item-value":{color:"#A6A6A6"}}}},t),wE=t=>Object.assign({},xE(),{category10:"category10",category20:"category20"},t);wE.props={};const ME=gE({colorBlack:"#000",colorWhite:"#fff",colorStroke:"#888",colorDefault:"#4e79a7",colorBackground:"transparent",category10:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],category20:["#4e79a7","#f28e2c","#e15759","#76b7b2","#59a14f","#edc949","#af7aa1","#ff9da7","#9c755f","#bab0ab"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.1}),OE=t=>K({},ME,{text:{text:{fontSize:10}},axis:{gridLineDash:[0,0],gridLineWidth:1,gridStroke:"#ddd",gridStrokeOpacity:1,labelOpacity:1,labelStrokeOpacity:1,labelFontSize:10,line:!0,lineLineWidth:1,lineStroke:"#888",lineStrokeOpacity:1,tickLength:5,tickStrokeOpacity:1,titleOpacity:1,titleStrokeOpacity:1,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},axisLeft:{gridFilter:(t,e)=>0!==e},axisRight:{gridFilter:(t,e)=>0!==e},legendCategory:{itemLabelFillOpacity:1,itemLabelFontSize:10,itemValueFillOpacity:1,itemValueFontSize:10,titleFillOpacity:1,titleFontSize:11,titleFontWeight:"bold"},legendContinuous:{handleLabelFontSize:10,labelFillOpacity:.45,labelFontSize:10},label:{fontSize:10},innerLabel:{fontSize:10},htmlLabel:{fontSize:10},slider:{handleLabelFontSize:10,trackFillOpacity:.05}},t);function EE(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}OE.props={};var kE,SE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function AE(t){if(!(e=SE.exec(t)))throw new Error("invalid format: "+t);var e;return new _E({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function _E(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function TE(t,e){var n=EE(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}AE.prototype=_E.prototype,_E.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var PE={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>TE(100*t,e),r:TE,s:function(t,e){var n=EE(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(kE=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+EE(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function CE(t){return t}var NE,LE,jE=Array.prototype.map,RE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function IE(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?CE:(e=jE.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),o.push(t.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?CE:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(jE.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function f(t){var e=(t=AE(t)).fill,n=t.align,f=t.sign,d=t.symbol,h=t.zero,p=t.width,g=t.comma,m=t.precision,y=t.trim,v=t.type;"n"===v?(g=!0,v="g"):PE[v]||(void 0===m&&(m=12),y=!0,v="g"),(h||"0"===e&&"="===n)&&(h=!0,e="0",n="=");var b="$"===d?i:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===d?o:/[%p]/.test(v)?c:"",w=PE[v],M=/[defgprs%]/.test(v);function O(t){var i,o,c,d=b,O=x;if("c"===v)O=w(t)+O,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),m),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0==+t&&"+"!==f&&(E=!1),d=(E?"("===f?f:l:"-"===f||"("===f?"":f)+d,O=("s"===v?RE[8+kE/3]:"")+O+(E&&"("===f?")":""),M)for(i=-1,o=t.length;++i<o;)if(48>(c=t.charCodeAt(i))||c>57){O=(46===c?a+t.slice(i+1):t.slice(i))+O,t=t.slice(0,i);break}}g&&!h&&(t=r(t,1/0));var k=d.length+t.length+O.length,S=k<p?new Array(p-k+1).join(e):"";switch(g&&h&&(t=r(S+t,S.length?p-O.length:1/0),S=""),n){case"<":t=d+t+O+S;break;case"=":t=d+S+t+O;break;case"^":t=S.slice(0,k=S.length>>1)+d+t+O+S.slice(k);break;default:t=S+d+t+O}return s(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),O.toString=function(){return t+""},O}return{format:f,formatPrefix:function(t,e){var n=f(((t=AE(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=EE(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=RE[8+r/3];return function(t){return n(i*t)+o}}}}function BE(t,e,n){return t.querySelector(e)?Sm(t).select(e):Sm(t).append(n)}function DE(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function FE(t,e){let{flexDirection:n,justifyContent:r,alignItems:i}={display:"flex",flexDirection:"row",justifyContent:"flex-start",alignItems:"center"};const o={top:["row","flex-start","center"],bottom:["row","flex-start","center"],left:["column","flex-start","center"],right:["column","flex-start","center"],center:["column","center","center"]};return t in o&&([n,r,i]=o[t]),Object.assign({display:"flex",flexDirection:n,justifyContent:r,alignItems:i},e)}NE=IE({thousands:",",grouping:[3],currency:["$",""]}),LE=NE.format;class zE extends gw{get child(){var t;return null===(t=this.children)||void 0===t?void 0:t[0]}update(t){var e;this.attr(t);const{subOptions:n}=t;null===(e=this.child)||void 0===e||e.update(n)}}class GE extends zE{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function WE(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function $E(t){return"vertical"===t||t===-Math.PI/2}function HE(t,e,n){const{bbox:r}=t,{position:i="top",size:o,length:a}=e,s=["top","bottom","center"].includes(i),[c,l]=s?[r.height,r.width]:[r.width,r.height],{defaultSize:u,defaultLength:f}=n.props,d=o||u||c,h=a||f||l,p=s?"horizontal":"vertical",[g,m]=s?[h,d]:[d,h];return{orientation:p,width:g,height:m,size:d,length:h}}function VE(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=Se(t,["style"]),i={};return Object.entries(r).forEach((([t,n])=>{e.includes(t)?i[`show${W(t)}`]=n:i[t]=n})),Object.assign(Object.assign({},i),n)}function YE(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function UE(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function qE(t,e,n,r,i,o,a,s){var c;void 0===n&&void 0===o||t.update(Object.assign(Object.assign({},n&&{tickCount:n}),o&&{tickMethod:o}));const l=function(t,e,n){if(t.getTicks)return t.getTicks();if(!n)return e;const[r,i]=zn(e,(t=>+t)),{tickCount:o}=t.getOptions();return n(r,i,o)}(t,e,o),u=i?l.filter(i):l,f=t=>t instanceof Date?String(t):"object"==typeof t&&t?t:String(t),d=r||(null===(c=t.getFormatter)||void 0===c?void 0:c.call(t))||f,h=function(t,e){if(Dc(e))return t=>t;const n=e.getOptions(),{innerWidth:r,innerHeight:i,insetTop:o,insetBottom:a,insetLeft:s,insetRight:c}=n,[l,u,f]="left"===t||"right"===t?[o,a,i]:[s,c,r],d=new ia({domain:[0,1],range:[l/f,1-u/f]});return t=>d.map(t)}(a,s),p=function(t,e){const{width:n,height:r}=e.getOptions();return i=>{if(!Wc(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new ia({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new ia({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return Dc(s)||Bc(s)?u.map(((e,n,r)=>{var i,o;const c=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,l=h(t.map(e)+c);return{value:Fc(s)&&"center"===a||Bc(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||Bc(s)&&g(a)?1-l:l,label:f(d(Tm(e),n,r)),id:String(n)}})):u.map(((e,n,r)=>{var i;const o=(null===(i=t.getBandWidth)||void 0===i?void 0:i.call(t,e))/2||0,s=p(h(t.map(e)+o));return{value:g(a)?1-s:s,label:f(d(Tm(e),n,r)),id:String(n)}}))}function XE(t=[],e){if(t.length>0)return t;const{labelAutoRotate:n,labelAutoHide:r,labelAutoEllipsis:i,labelAutoWrap:o}=e,a=[],s=(t,e)=>{e&&a.push(Object.assign(Object.assign({},t),e))};return s({type:"rotate",optionalAngles:[0,15,30,45,60,90]},n),s({type:"ellipsis",minLength:20},i),s({type:"hide"},r),s({type:"wrap",wordWrapWidth:100,maxLines:3,recoveryWhenFail:!0},o),a}function ZE(t,e,n){return!function(t){return Dc(t)&&Bc(t)}(e)&&!Gc(e)&&(void 0===t?!!n.getTicks:t)}function KE(t,e,n,r,i,o){const a=function(t,e,n,r,i,o){const a=n.axis,s=["top","right","bottom","left"].includes(i)?n[`axis${xr(i)}`]:n.axisLinear,c=t.getOptions().name,l=n[`axis${W(c)}`]||{};return Object.assign({},a,s,l)}(t,0,n,0,i);return"center"===i?Object.assign(Object.assign(Object.assign(Object.assign({},a),{labelDirection:"right"===r?"negative":"positive"}),"center"===r?{labelTransform:"translate(50%,0)"}:null),{tickDirection:"right"===r?"negative":"positive",labelSpacing:"center"===r?0:4,titleSpacing:$E(o)?10:0,tick:"center"!==r&&void 0}):a}const QE=t=>e=>{const{labelFormatter:n,labelFilter:r=()=>!0}=e;return i=>{var o;const{scales:[a]}=i,s=(null===(o=a.getTicks)||void 0===o?void 0:o.call(a))||a.getOptions().domain,c="string"==typeof n?LE(n):n,l=Object.assign(Object.assign({},e),{labelFormatter:c,labelFilter:(t,e,n)=>r(s[e],e,s),scale:a});return t(l)(i)}},JE=QE((t=>{const{direction:e="left",important:n={},labelFormatter:r,order:i,orientation:o,actualPosition:a,position:s,size:c,style:l={},title:u,tickCount:f,tickFilter:d,tickMethod:h,transform:p,indexBBox:g}=t,m=Se(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:i,value:y,coordinate:v,theme:b})=>{const{bbox:x}=y,[w]=i,{domain:M,xScale:O}=w.getOptions(),E=KE(w,0,b,e,s,o),k=Object.assign(Object.assign(Object.assign({},E),l),m),S=function(t,e,n="xy"){const[r,i,o]=UE(e);return"xy"===n?t.includes("bottom")||t.includes("top")?i:r:"xz"===n?t.includes("bottom")||t.includes("top")?o:r:t.includes("bottom")||t.includes("top")?i:o}(a||s,v,t.plane),A=function(t,e,n,r,i){const{x:o,y:a,width:s,height:c}=n;if("bottom"===t)return{startPos:[o,a],endPos:[o+s,a]};if("left"===t)return{startPos:[o+s,a+c],endPos:[o+s,a]};if("right"===t)return{startPos:[o,a+c],endPos:[o,a]};if("top"===t)return{startPos:[o,a+c],endPos:[o+s,a+c]};if("center"===t){if("vertical"===e)return{startPos:[o,a],endPos:[o,a+c]};if("horizontal"===e)return{startPos:[o,a],endPos:[o+s,a]};if("number"==typeof e){const[t,n]=r.getCenter(),[l,u]=Hc(r),[f,d]=Vc(r),h=Math.min(s,c)/2,{insetLeft:p,insetTop:g}=r.getOptions(),m=l*h,y=u*h,[v,b]=[t+o-p,n+a-g],[x,w]=[Math.cos(e),Math.sin(e)],M=[v+y*x,b+y*w],O=[v+m*x,b+m*w],E=()=>{const{domain:t}=i.getOptions();return t.length},k=Dc(r)&&i?E():3;return{startPos:M,endPos:O,gridClosed:Math.abs(d-f-360)<1e-6,gridCenter:[v,b],gridControlAngles:new Array(k).fill(0).map(((t,e,n)=>(d-f)/k*e))}}}return{}}(s,o,x,v,O),_=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(v),T=qE(w,M,f,r,d,h,s,v),P=g?T.map(((t,e)=>{const n=g.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):T,C=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},k),{type:"linear",data:P,crossSize:c,titleText:DE(u),labelOverlap:XE(p,k),grid:ZE(k.grid,v,w),gridLength:S,line:!0,indexBBox:g}),k.line?null:{lineOpacity:0}),A),_),n),N=C.labelOverlap.find((t=>"hide"===t.type));return N&&(C.crossSize=!1),new Ix({className:"axis",style:VE(C)})}})),tk=QE((t=>{const{order:e,size:n,position:r,orientation:i,labelFormatter:o,tickFilter:a,tickCount:s,tickMethod:c,important:l={},style:u={},indexBBox:f,title:d,grid:h=!1}=t,p=Se(t,["order","size","position","orientation","labelFormatter","tickFilter","tickCount","tickMethod","important","style","indexBBox","title","grid"]);return({scales:[t],value:e,coordinate:n,theme:i})=>{const{bbox:u}=e,{domain:g}=t.getOptions(),m=qE(t,g,s,o,a,c,r,n),y=f?m.map(((t,e)=>{const n=f.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):m,[v,b]=Hc(n),x=function(t,e,n,r,i){const{x:o,y:a,width:s,height:c}=e,l=[o+s/2,a+c/2],u=Math.min(s,c)/2,[f,d]=Vc(i),[h,p]=UE(i),g={center:l,radius:u,startAngle:f,endAngle:d,gridLength:(r-n)*(Math.min(h,p)/2)};if("inner"===t){const{insetLeft:t,insetTop:e}=i.getOptions();return Object.assign(Object.assign({},g),{center:[l[0]-t,l[1]-e],labelAlign:"perpendicular",labelDirection:"positive",tickDirection:"positive",gridDirection:"negative"})}return Object.assign(Object.assign({},g),{labelAlign:"parallel",labelDirection:"negative",tickDirection:"negative",gridDirection:"positive"})}(r,u,v,b,n),{axis:w,axisArc:M={}}=i,O=VE(K({},w,M,x,Object.assign(Object.assign({type:"arc",data:y,titleText:DE(d),grid:h},p),l)));return new Ix({style:it(O,["transform"])})}}));JE.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},tk.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const ek=t=>(...e)=>{const n=JE(Object.assign({},{crossPadding:50},t))(...e);return YE(n,t),n};ek.props=Object.assign(Object.assign({},JE.props),{defaultPosition:"bottom"});const nk=t=>(...e)=>{const n=JE(Object.assign({},{crossPadding:10},t))(...e);return YE(n,t),n};function rk(t,e,n,r){const{radar:i}=t,[o]=r,a=o.getOptions().name,[s,c]=Vc(n),{axisRadar:l={}}=e;return Object.assign(Object.assign({},l),{grid:"position"===a,gridConnect:"line",gridControlAngles:new Array(i.count).fill(0).map(((t,e)=>(c-s)/i.count*e))})}nk.props=Object.assign(Object.assign({},JE.props),{defaultPosition:"left"});const ik=t=>{const{important:e={}}=t,n=Se(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return JE(Object.assign(Object.assign(Object.assign({},n),function(t){const e=t%(2*Math.PI);return e===Math.PI/2?{titleTransform:"translate(0, 50%)"}:e>-Math.PI/2&&e<Math.PI/2?{titleTransform:"translate(50%, 0)"}:e>Math.PI/2&&e<3*Math.PI/2?{titleTransform:"translate(-50%, 0)"}:{}}(t.orientation)),{important:Object.assign(Object.assign({},rk(t,i,o,a)),e)}))(r)}};function ok(t,e){const{scales:n,library:r,markState:i}=e,[o,a]=function(t,e){const n=WE(t,"shape"),r=WE(t,"color"),i=n?n.clone():null,o=[];for(const[t,n]of e){const e=t.type,a=((null==r?void 0:r.getOptions().domain.length)>0?null==r?void 0:r.getOptions().domain:n.data).map(((e,r)=>{var o;return i?i.map(e||"point"):(null===(o=null==t?void 0:t.style)||void 0===o?void 0:o.shape)||n.defaultShape||"point"}));"string"==typeof e&&o.push([e,a])}if(0===o.length)return["point",["point"]];if(1===o.length)return o[0];if(!n)return o[0];const{range:a}=n.getOptions();return o.map((([t,e])=>{let n=0;for(let t=0;t<o.length;t++){const r=a[t%a.length];e[t]===r&&n++}return[n/e.length,[t,e]]})).sort(((t,e)=>e[0]-t[0]))[0][1]}(n,i),{itemMarker:s,itemMarkerSize:c}=t,l=(t,e)=>{var n,i,a;const s=(null===(a=null===(i=null===(n=r[`mark.${o}`])||void 0===n?void 0:n.props)||void 0===i?void 0:i.shape[t])||void 0===a?void 0:a.props.defaultMarker)||N(t.split(".")),l="function"==typeof c?c(e):c;return()=>function(t,e){var{d:n,fill:r,lineWidth:i,path:o,stroke:a,color:s}=e,c=Se(e,["d","fill","lineWidth","path","stroke","color"]);const l=Ty.get(t)||Ty.get("point");return(...t)=>new eg({style:Object.assign(Object.assign({},c),{d:l(...t),stroke:l.style.includes("stroke")?s||a:"",fill:l.style.includes("fill")?s||r:"",lineWidth:l.style.includes("lineWidth")?i||i||2:0})})}(s,{color:e.color})(0,0,l)},u=t=>`${a[t]}`;return WE(n,"shape")&&!s?(t,e)=>l(u(e),t):"function"==typeof s?(t,e)=>{const n=s(t.id,e);return"string"==typeof n?l(n,t):n}:(t,e)=>l(s||u(e),t)}function ak(t){const e=WE(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function sk(t,e){const{labelFormatter:n=t=>`${t}`}=t,{scales:r,theme:i}=e,o=function(t,e){const n=WE(t,"size");return n instanceof Jo?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:ok(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:ak(r)},s="string"==typeof n?LE(n):n,c=WE(r,"color"),l=function(t){return t.find((t=>t.getOptions().domain.length>0)).getOptions().domain}(r),u=c?t=>c.map(t):()=>e.theme.color;return Object.assign(Object.assign({},a),{data:l.map((t=>({id:t,label:s(t),color:u(t)})))})}ik.props=Object.assign(Object.assign({},JE.props),{defaultPosition:"center"});const ck=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,cols:c,itemMarker:l}=t,u=Se(t,["labelFormatter","layout","order","orientation","position","size","title","cols","itemMarker"]),{gridRow:f}=u;return e=>{const{value:r,theme:i}=e,{bbox:a}=r,{width:l,height:d}=function(t,e,n){const{position:r}=e;if("center"===r){const{bbox:e}=t,{width:n,height:r}=e;return{width:n,height:r}}const{width:i,height:o}=HE(t,e,n);return{width:i,height:o}}(r,t,ck),h=FE(o,n),p=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(o)?"vertical":"horizontal",width:l,height:d,layout:void 0!==c?"grid":"flex"},void 0!==c&&{gridCol:c}),void 0!==f&&{gridRow:f}),{titleText:DE(s)}),sk(t,e)),{legendCategory:g={}}=i,m=VE(Object.assign({},g,p,u)),y=new GE({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},h),{subOptions:m})});return y.appendChild(new Qx({className:"legend-category",style:m})),y}};function lk(t,e,n,r,i){const o=e.thresholds,a=function(t){return e=>({value:e/t,label:String(e)})}(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...o,r].map(a)})}function uk(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],Rr(e)];return[n,r]}function fk(t,e,n,r,i,o){const{length:a}=t,s=n||r,c=i.color?o.legendContinuous.ribbonFill||"black":o.color,l=e||function(t,e){const n=t.getOptions(),r=t.clone();return r.update(Object.assign(Object.assign({},n),{range:[$f(e).toString()]})),r}(s,c),[u,f]=uk(l),[d,h]=uk([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof Wo))));return Object.assign(Object.assign({},t),{domain:[d,h],data:l.getTicks().map((t=>({value:t}))),color:new Array(Math.floor(a)).fill(0).map(((t,e)=>{const n=(f-u)/(a-1)*e+u,i=l.map(n)||c,o=r?r.map(n):1;return i.replace(/rgb[a]*\(([\d]{1,3}) *, *([\d]{1,3}) *, *([\d]{1,3})[\S\s]*\)/,((t,e,n,r)=>`rgba(${e}, ${n}, ${r}, ${o})`))}))})}function dk(t,e,n,r,i,o){const a=WE(t,"color"),s=function(t,e,n){const{size:r}=e,i=HE(t,e,n);return function(t,e,n){return t.size=e,function(t){return"horizontal"===t||0===t}(n)?t.height=e:t.width=e,t}(i,r,i.orientation)}(n,r,i);if(a instanceof la){const{range:t}=a.getOptions(),[e,n]=uk(a);return a instanceof da||a instanceof pa?lk(s,a,e,n,t):function(t,e,n){const r=[-1/0,...e.thresholds,1/0].map(((t,e)=>({value:e,label:t})));return Object.assign(Object.assign({},t),{data:r,color:n,labelFilter:(t,e)=>e>0&&e<r.length-1})}(s,a,t)}return fk(s,a,WE(t,"size"),WE(t,"opacity"),e,o)}ck.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const hk=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,style:c,crossPadding:l,padding:u}=t,f=Se(t,["labelFormatter","layout","order","orientation","position","size","title","style","crossPadding","padding"]);return({scales:r,value:i,theme:a,scale:l})=>{const{bbox:u}=i,{x:d,y:h,width:p,height:g}=u,m=FE(o,n),{legendContinuous:y={}}=a,v=VE(Object.assign({},y,Object.assign(Object.assign({titleText:DE(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>LE(e)(t.label):e},dk(r,l,i,t,hk,a)),c),f)),b=new zE({style:Object.assign(Object.assign({x:d,y:h,width:p,height:g},m),{subOptions:v})});return b.appendChild(new uw({className:"legend-continuous",style:v})),b}};hk.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const pk=t=>(...e)=>hk(Object.assign({},{block:!0},t))(...e);pk.props=Object.assign(Object.assign({},hk.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const gk=t=>e=>{const{scales:n}=e,r=WE(n,"size");return hk(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};gk.props=Object.assign(Object.assign({},hk.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const mk=t=>gk(Object.assign({},{block:!0},t));function yk(t,e,n,r){switch(r){case"center":return{x:t+n/2,y:e,textAlign:"middle"};case"right":return{x:t+n,y:e,textAlign:"right"};default:return{x:t,y:e,textAlign:"left"}}}mk.props=Object.assign(Object.assign({},hk.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const vk=(bk={render(t,e){const{width:n,title:r,subtitle:i,spacing:o=2,align:a="left",x:s,y:c}=t,l=Se(t,["width","title","subtitle","spacing","align","x","y"]);e.style.transform=`translate(${s}, ${c})`;const u=kr(l,"title"),f=kr(l,"subtitle"),d=BE(e,".title","text").attr("className","title").call(Pm,Object.assign(Object.assign(Object.assign({},yk(0,0,n,a)),{fontSize:14,textBaseline:"top",text:r}),u)).node().getLocalBounds();BE(e,".sub-title","text").attr("className","sub-title").call((t=>{if(!i)return t.node().remove();t.node().attr(Object.assign(Object.assign(Object.assign({},yk(0,d.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),f))}))}},class extends Xp{constructor(t){super(t),this.descriptor=bk}connectedCallback(){var t,e;null===(e=(t=this.descriptor).render)||void 0===e||e.call(t,this.attributes,this)}update(t={}){var e,n;this.attr(K({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var bk;const xk=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new vk({style:K({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};function wk(t){return!!t.getBandWidth}function Mk(t,e,n){if(!wk(t))return t.invert(e);const{adjustedRange:r}=t,{domain:i}=t.getOptions(),o=n?-1:0,a=t.getStep(),s=n?r:r.map((t=>t+a)),c=function(t,e,n){return Math.min(n,Math.max(e,t))}(Rn(s,e)+o,0,i.length-1);return i[c]}function Ok(t,e,n){if(!e)return t.getOptions().domain;if(!wk(t)){const r=Zn(e);if(!n)return r;const[i]=r,{range:o}=t.getOptions(),[a,s]=o,c=a>s?-1:1;return[i,t.invert(t.map(i)+c*n)]}const{domain:r}=t.getOptions(),i=e[0],o=r.indexOf(i);if(n){const t=o+Math.round(r.length*n);return r.slice(o,t)}const a=e[e.length-1],s=r.indexOf(a);return r.slice(o,s+1)}function Ek(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[Mk(a,n,e),Mk(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[Ok(a,[l[0],u[0]]),Ok(s,[l[1],u[1]])]}function kk(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}xk.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const Sk=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:o}=t,a=Se(t,["orientation","labelFormatter","size","style","position"]);return r=>{var s;const{scales:[c],value:l,theme:u,coordinate:f}=r,{bbox:d}=l,{width:h,height:p}=d,{slider:g={}}=u,m=(null===(s=c.getFormatter)||void 0===s?void 0:s.call(c))||(t=>t+""),y="string"==typeof n?LE(n):n,v="horizontal"===e,b=Bc(f)&&v,{trackSize:x=g.trackSize}=i,[w,M]=function(t,e,n){const{x:r,y:i,width:o,height:a}=t;return"left"===e?[r+o-n,i]:"right"===e||"bottom"===e?[r,i]:"top"===e?[r,i+a-n]:void 0}(d,o,x);return new jb({className:"slider",style:Object.assign({},g,Object.assign(Object.assign({x:w,y:M,trackLength:v?h:p,orientation:e,formatter:t=>(y||m)(Mk(c,b?1-t:t,!0)),sparklineData:Ak(t,r)},i),a))})}};function Ak(t,e){const{markState:n}=e;return w(t.sparklineData)?t.sparklineData:function(t,e){const[n]=Array.from(t.entries()).filter((([t])=>"line"===t.type||"area"===t.type)).filter((([t])=>t.slider)).map((([t])=>{const{encode:n,slider:r}=t;if(null==r?void 0:r.x){const t=t=>{const e=n[t];return[t,e?e.value:void 0]};return Object.fromEntries(e.map(t))}}));if(!(null==n?void 0:n.series))return null==n?void 0:n.y;const r=n.series.reduce(((t,e,r)=>(t[e]=t[e]||[],t[e].push(n.y[r]),t)),{});return Object.values(r)}(n,["y","series"])}Sk.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const _k=t=>Sk(Object.assign(Object.assign({},t),{orientation:"horizontal"}));_k.props=Object.assign(Object.assign({},Sk.props),{defaultPosition:"bottom"});const Tk=t=>Sk(Object.assign(Object.assign({},t),{orientation:"vertical"}));Tk.props=Object.assign(Object.assign({},Sk.props),{defaultPosition:"left"});const Pk=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=Se(t,["orientation","labelFormatter","style"]);return({scales:[t],value:n,theme:o})=>{const{bbox:a}=n,{x:s,y:c,width:l,height:u}=a,{scrollbar:f={}}=o,{ratio:d,range:h}=t.getOptions(),p="horizontal"===e?l:u,g=p/d,[m,y]=h,v=y>m?0:1;return new Rb({className:"g2-scrollbar",style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:c,trackLength:p,value:v}),i),{orientation:e,contentLength:g,viewportLength:p}))})}};Pk.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const Ck=t=>Pk(Object.assign(Object.assign({},t),{orientation:"horizontal"}));Ck.props=Object.assign(Object.assign({},Pk.props),{defaultPosition:"bottom"});const Nk=t=>Pk(Object.assign(Object.assign({},t),{orientation:"vertical"}));Nk.props=Object.assign(Object.assign({},Pk.props),{defaultPosition:"left"});const Lk=t=>()=>new Kp;Lk.props={};const jk=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=Bc(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],d=[{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l}];return o.animate(d,Object.assign(Object.assign({},i),t))}},Rk=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=Bc(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],d=[{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return o.animate(d,Object.assign(Object.assign({},i),t))}},Ik=(t,e)=>{const n=1e-4,{coordinate:r}=e;return sg({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:Tf.NUMBER}),(e,i,o)=>{const[a]=e;return Dc(r)?(e=>{const{__data__:i,style:a}=e,{radius:s=0,inset:c=0,fillOpacity:l=1,strokeOpacity:u=1,opacity:f=1}=a,{points:d,y:h,y1:p}=i,g=jm(r,d,[h,p]),{innerRadius:m,outerRadius:y}=g,v=nc().cornerRadius(s).padAngle(c*Math.PI/180),b=new eg({}),x=t=>(b.attr({d:v(t)}),Od(b)),w=[{scaleInYRadius:m+n,fillOpacity:0,strokeOpacity:0,opacity:0},{scaleInYRadius:m+n,fillOpacity:l,strokeOpacity:u,opacity:f,offset:.01},{scaleInYRadius:y,fillOpacity:l,strokeOpacity:u,opacity:f}],M=e.animate(w,Object.assign(Object.assign({},o),t));return M.onframe=function(){e.style.d=x(Object.assign(Object.assign({},g),{outerRadius:Number(e.style.scaleInYRadius)}))},M.onfinish=function(){e.style.d=x(Object.assign(Object.assign({},g),{outerRadius:y}))},M})(a):(e=>{const{style:n}=e,{transform:i="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=n,[l,u]=Bc(r)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],f=[{transform:`${i} ${u}`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${i} ${u}`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.01},{transform:`${i} scale(1, 1)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c}];return e.animate(f,Object.assign(Object.assign({},o),t))})(a)}},Bk=(t,e)=>{const{coordinate:n}=e;return(e,r,i)=>{const[o]=e,{transform:a="",fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=o.style,[u,f]=Bc(n)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],d=[{transform:`${a} scale(1, 1)`.trimStart(),transformOrigin:u},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.99},{transform:`${a} ${f}`.trimStart(),transformOrigin:u,fillOpacity:0,strokeOpacity:0,opacity:0}];return o.animate(d,Object.assign(Object.assign({},i),t))}},Dk=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:o,strokeOpacity:a,opacity:s}];return i.animate(c,Object.assign(Object.assign({},r),t))};Dk.props={};const Fk=t=>(e,n,r)=>{const[i]=e,{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=i.style,c=[{fillOpacity:o,strokeOpacity:a,opacity:s},{fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(c,Object.assign(Object.assign({},r),t))};Fk.props={};const zk={opacity:1,strokeOpacity:1,fillOpacity:1,lineWidth:0,x:0,y:0,cx:0,cy:0,r:0,rx:0,ry:0,width:0,height:0},Gk={[cu.CIRCLE]:["cx","cy","r"],[cu.ELLIPSE]:["cx","cy","rx","ry"],[cu.RECT]:["x","y","width","height"],[cu.IMAGE]:["x","y","width","height"],[cu.LINE]:["x1","y1","x2","y2"],[cu.POLYLINE]:["points"],[cu.POLYGON]:["points"]};function Wk(t,e,n=!1){const r={};for(const i of e){const e=t.style[i];e?r[i]=e:n&&(r[i]=zk[i])}return r}const $k=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function Hk(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function Vk(t){const[e,n,r,i]=t;return`\n M ${e} ${n}\n L ${e+r} ${n}\n L ${e+r} ${n+i}\n L ${e} ${n+i}\n Z\n `}function Yk(t,e){const[n,r,i,o]=Hk(t),a=o/i,s=Math.ceil(Math.sqrt(e/a)),c=[],l=o/Math.ceil(e/s);let u=0,f=e;for(;f>0;){const t=Math.min(f,s),e=i/t;for(let i=0;i<t;i++){const t=n+i*e,o=r+u*l;c.push(Vk([t,o,e,l]))}f-=t,u+=1}return c}function Uk(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function qk(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function Xk(t){const e=Od(t);if(e&&!function(t){return!qk(t,"m")||!qk(t,"M")}(e))return e}function Zk(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=Xk(e),s=Xk(n);if(i===o&&"path"!==i||(void 0===a||void 0===s))return function(t,e,n){let{transform:r}=t.style;const{transform:i}=e.style;Uk(e,t);let o=$k;if(t.nodeName===cu.GROUP){const[n,i,o,a]=Hk(t),[s,c,l,u]=Hk(e);r=`translate(${n-s}, ${i-c}) scale(${o/l}, ${a/u})`}else o=o.concat(Gk[t.nodeName]||[]);const a=[Object.assign({transform:null!=r?r:"none"},Wk(t,o,!0)),Object.assign({transform:null!=i?i:"none"},Wk(e,o,!0))];return e.animate(a,n)}(e,n,r);const c=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new eg({style:Object.assign(Object.assign({},Wk(t,$k)),{d:e})});return Uk(r,t),r}(t,a),l=[Object.assign({},Wk(e,$k)),Object.assign({},Wk(n,$k))];if(a!==s){l[0].d=a,l[1].d=s;const t=c.animate(l,r);return t.onfinish=()=>{const t=c.style.d;Mr(c,n),c.style.d=t,c.style.transform="none"},c.style.transform="none",t}return null}const Kk=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:Yk}(t.split),o=Object.assign(Object.assign({},r),t),{length:a}=e,{length:s}=n;if(1===a&&1===s||a>1&&s>1){const[t]=e,[r]=n;return Zk(t,t,r,o)}if(1===a&&s>1){const[t]=e;return function(t,e,n,r){t.style.visibility="hidden";const i=r(t,e.length);return e.map(((e,r)=>Zk(e,new eg({style:Object.assign({d:i[r]},Wk(t,$k))}),e,n)))}(t,n,o,i)}if(a>1&&1===s){const[t]=n;return function(t,e,n,r){const i=r(e,t.length),{fillOpacity:o=1,strokeOpacity:a=1,opacity:s=1}=e.style,c=[{fillOpacity:0,strokeOpacity:0,opacity:0},{fillOpacity:0,strokeOpacity:0,opacity:0,offset:.99},{fillOpacity:o,strokeOpacity:a,opacity:s}],l=e.animate(c,n),u=t.map(((t,r)=>Zk(t,t,new eg({style:{d:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,o,i)}return null};Kk.props={};const Qk=(t,e)=>{const n=1e-4;sg({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:Tf.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!Dc(r))return jk(t,e)(i,o,a);const{__data__:c,style:l}=s,{radius:u=0,inset:f=0,fillOpacity:d=1,strokeOpacity:h=1,opacity:p=1}=l,{points:g,y:m,y1:y}=c,v=nc().cornerRadius(u).padAngle(f*Math.PI/180),b=jm(r,g,[m,y]),{startAngle:x,endAngle:w}=b,M=[{waveInArcAngle:x+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:x+n,fillOpacity:d,strokeOpacity:h,opacity:p,offset:.01},{waveInArcAngle:w,fillOpacity:d,strokeOpacity:h,opacity:p}],O=s.animate(M,Object.assign(Object.assign({},a),t));return O.onframe=function(){s.style.d=v(Object.assign(Object.assign({},b),{endAngle:Number(s.style.waveInArcAngle)}))},O.onfinish=function(){s.style.d=v(Object.assign(Object.assign({},b),{endAngle:w}))},O}};Qk.props={};const Jk=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.01},{transform:`${o} scale(1)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c}];return i.animate(u,Object.assign(Object.assign({},r),t))},tS=t=>(e,n,r)=>{const[i]=e,{transform:o="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=i.style,l="center center",u=[{transform:`${o} scale(1)`.trimStart(),transformOrigin:l},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:a,strokeOpacity:s,opacity:c,offset:.99},{transform:`${o} scale(0.0001)`.trimStart(),transformOrigin:l,fillOpacity:0,strokeOpacity:0,opacity:0}];return i.animate(u,Object.assign(Object.assign({},r),t))},eS=t=>(e,n,r)=>{var i,o;const[a]=e,s=(null===(o=(i=a).getTotalLength)||void 0===o?void 0:o.call(i))||0,c=[{lineDash:[0,s]},{lineDash:[s,0]}];return a.animate(c,Object.assign(Object.assign({},r),t))};eS.props={};const nS=(t,e)=>(n,r,i)=>{const[o]=n,{min:[a,s],halfExtents:c}=o.getLocalBounds(),l=2*c[0],u=2*c[1],f=new eg({style:{d:`M${a},${s}L${a+l},${s}L${a+l},${s+u}L${a},${s+u}Z`}});o.appendChild(f),o.style.clipPath=f;return jk(t,e)([f],r,i)};nS.props={};const rS=(t,e)=>(n,r,i)=>{const[o]=n,{min:[a,s],halfExtents:c}=o.getLocalBounds(),l=2*c[0],u=2*c[1],f=new eg({style:{d:`M${a},${s}L${a+l},${s}L${a+l},${s+u}L${a},${s+u}Z`}});o.appendChild(f),o.style.clipPath=f;return Ik(t,e)([f],r,i)};rS.props={};const iS="main-layer",oS="label-layer",aS="element",sS="view",cS="plot",lS="component",uS="label",fS="area";function dS(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.r;t.arc(r,o,a,0,2*Math.PI,!1)}function hS(t,e){var n=e.cx,r=void 0===n?0:n,i=e.cy,o=void 0===i?0:i,a=e.rx,s=e.ry;if(t.ellipse)t.ellipse(r,o,a,s,0,0,2*Math.PI,!1);else{var c=a>s?a:s,l=a>s?1:a/s,u=a>s?s/a:1;t.save(),t.scale(l,u),t.arc(r,o,c,0,2*Math.PI)}}function pS(t,e){var n,r,i=e.x1,o=e.y1,a=e.x2,s=e.y2,c=e.markerStart,l=e.markerEnd,u=e.markerStartOffset,f=e.markerEndOffset,d=0,h=0,p=0,g=0,m=0;c&&Fp(c)&&u&&(n=a-i,r=s-o,m=Math.atan2(r,n),d=Math.cos(m)*(u||0),h=Math.sin(m)*(u||0)),l&&Fp(l)&&f&&(n=i-a,r=o-s,m=Math.atan2(r,n),p=Math.cos(m)*(f||0),g=Math.sin(m)*(f||0)),t.moveTo(i+d,o+h),t.lineTo(a+p,s+g)}function gS(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,c=e.d,l=c.absolutePath,u=c.segments,f=0,d=0,h=0,p=0,g=0;if(i&&Fp(i)&&a){var m=Ce(i.parentNode.getStartTangent(),2),y=m[0],v=m[1];n=y[0]-v[0],r=y[1]-v[1],g=Math.atan2(r,n),f=Math.cos(g)*(a||0),d=Math.sin(g)*(a||0)}if(o&&Fp(o)&&s){var b=Ce(o.parentNode.getEndTangent(),2);y=b[0],v=b[1];n=y[0]-v[0],r=y[1]-v[1],g=Math.atan2(r,n),h=Math.cos(g)*(s||0),p=Math.sin(g)*(s||0)}for(var x=0;x<l.length;x++){var w=l[x],M=w[0],O=l[x+1],E=0===x&&(0!==f||0!==d),k=(x===l.length-1||O&&("M"===O[0]||"Z"===O[0]))&&0!==h&&0!==p;switch(M){case"M":E?(t.moveTo(w[1]+f,w[2]+d),t.lineTo(w[1],w[2])):t.moveTo(w[1],w[2]);break;case"L":k?t.lineTo(w[1]+h,w[2]+p):t.lineTo(w[1],w[2]);break;case"Q":t.quadraticCurveTo(w[1],w[2],w[3],w[4]),k&&t.lineTo(w[3]+h,w[4]+p);break;case"C":t.bezierCurveTo(w[1],w[2],w[3],w[4],w[5],w[6]),k&&t.lineTo(w[5]+h,w[6]+p);break;case"A":var S=u[x].arcParams,A=S.cx,_=S.cy,T=S.rx,P=S.ry,C=S.startAngle,N=S.endAngle,L=S.xRotation,j=S.sweepFlag;if(t.ellipse)t.ellipse(A,_,T,P,L,C,N,!!(1-j));else{var R=T>P?T:P,I=T>P?1:T/P,B=T>P?P/T:1;t.translate(A,_),t.rotate(L),t.scale(I,B),t.arc(0,0,R,C,N,!!(1-j)),t.scale(1/I,1/B),t.rotate(-L),t.translate(-A,-_)}k&&t.lineTo(w[6]+h,w[7]+p);break;case"Z":t.closePath()}}}function mS(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,c=e.points.points,l=c.length,u=c[0][0],f=c[0][1],d=c[l-1][0],h=c[l-1][1],p=0,g=0,m=0,y=0,v=0;i&&Fp(i)&&a&&(n=c[1][0]-c[0][0],r=c[1][1]-c[0][1],v=Math.atan2(r,n),p=Math.cos(v)*(a||0),g=Math.sin(v)*(a||0)),o&&Fp(o)&&s&&(n=c[l-1][0]-c[0][0],r=c[l-1][1]-c[0][1],v=Math.atan2(r,n),m=Math.cos(v)*(s||0),y=Math.sin(v)*(s||0)),t.moveTo(u+(p||m),f+(g||y));for(var b=1;b<l-1;b++){var x=c[b];t.lineTo(x[0],x[1])}t.lineTo(d,h)}function yS(t,e){var n,r,i=e.markerStart,o=e.markerEnd,a=e.markerStartOffset,s=e.markerEndOffset,c=e.points.points,l=c.length,u=c[0][0],f=c[0][1],d=c[l-1][0],h=c[l-1][1],p=0,g=0,m=0,y=0,v=0;i&&Fp(i)&&a&&(n=c[1][0]-c[0][0],r=c[1][1]-c[0][1],v=Math.atan2(r,n),p=Math.cos(v)*(a||0),g=Math.sin(v)*(a||0)),o&&Fp(o)&&s&&(n=c[l-2][0]-c[l-1][0],r=c[l-2][1]-c[l-1][1],v=Math.atan2(r,n),m=Math.cos(v)*(s||0),y=Math.sin(v)*(s||0)),t.moveTo(u+p,f+g);for(var b=1;b<l-1;b++){var x=c[b];t.lineTo(x[0],x[1])}t.lineTo(d+m,h+y)}function vS(t,e){var n=e.x,r=void 0===n?0:n,i=e.y,o=void 0===i?0:i,a=e.radius,s=e.width,c=e.height,l=s,u=c;if(a&&a.some((function(t){return 0!==t}))){var f=s>0?1:-1,d=c>0?1:-1,h=f+d===0,p=Ce(a.map((function(t){return L(t,0,Math.min(Math.abs(l)/2,Math.abs(u)/2))})),4),g=p[0],m=p[1],y=p[2],v=p[3];t.moveTo(f*g+r,o),t.lineTo(l-f*m+r,o),0!==m&&t.arc(l-f*m+r,d*m+o,m,-d*Math.PI/2,f>0?0:Math.PI,h),t.lineTo(l+r,u-d*y+o),0!==y&&t.arc(l-f*y+r,u-d*y+o,y,f>0?0:Math.PI,d>0?Math.PI/2:1.5*Math.PI,h),t.lineTo(f*v+r,u+o),0!==v&&t.arc(f*v+r,u-d*v+o,v,d>0?Math.PI/2:-Math.PI/2,f>0?Math.PI:0,h),t.lineTo(r,d*g+o),0!==g&&t.arc(f*g+r,d*g+o,g,f>0?Math.PI:0,d>0?1.5*Math.PI:Math.PI/2,h)}else t.rect(r,o,l,u)}var bS=function(t){function e(){var e=t.apply(this,Ne([],Ce(arguments),!1))||this;return e.name="canvas-path-generator",e}return Ee(e,t),e.prototype.init=function(){var t,e=((t={})[cu.CIRCLE]=dS,t[cu.ELLIPSE]=hS,t[cu.RECT]=vS,t[cu.LINE]=pS,t[cu.POLYLINE]=yS,t[cu.POLYGON]=mS,t[cu.PATH]=gS,t[cu.TEXT]=void 0,t[cu.GROUP]=void 0,t[cu.IMAGE]=void 0,t[cu.HTML]=void 0,t[cu.MESH]=void 0,t);this.context.pathGeneratorFactory=e},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(fu),xS=qt(),wS=qt(),MS=qt(),OS=ht(),ES=function(){function t(){var t=this;this.isHit=function(e,n,r,i){var o=t.context.pointInPathPickerFactory[e.nodeName];if(o){var a=bt(OS,r),s=se(wS,Jt(MS,n[0],n[1],0),a);if(o(e,new Bu(s[0],s[1]),i,t.isPointInPath,t.context,t.runtime))return!0}return!1},this.isPointInPath=function(e,n){var r=t.runtime.offscreenCanvasCreator.getOrCreateContext(t.context.config.offscreenCanvas),i=t.context.pathGeneratorFactory[e.nodeName];return i&&(r.beginPath(),i(r,e.parsedStyle),r.closePath()),r.isPointInPath(n.x,n.y)}}return t.prototype.apply=function(e,n){var r,i=this,o=e.renderingService,a=e.renderingContext;this.context=e,this.runtime=n;var s=null===(r=a.root)||void 0===r?void 0:r.ownerDocument;o.hooks.pick.tapPromise(t.tag,(function(t){return _e(i,void 0,void 0,(function(){return Te(this,(function(e){return[2,this.pick(s,t)]}))}))})),o.hooks.pickSync.tap(t.tag,(function(t){return i.pick(s,t)}))},t.prototype.pick=function(t,e){var n,r,i=e.topmost,o=e.position,a=o.x,s=o.y,c=Jt(xS,a,s,0),l=t.elementsFromBBox(c[0],c[1],c[0],c[1]),u=[];try{for(var f=Pe(l),d=f.next();!d.done;d=f.next()){var h=d.value,p=h.getWorldTransform();if(this.isHit(h,c,p,!1)){var g=wh(h);if(g){var m=g.parsedStyle.clipPath;if(this.isHit(m,c,m.getWorldTransform(),!0)){if(i)return e.picked=[h],e;u.push(h)}}else{if(i)return e.picked=[h],e;u.push(h)}}}}catch(t){n={error:t}}finally{try{d&&!d.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return e.picked=u,e},t.tag="CanvasPicker",t}();function kS(t,e,n){var r=t.parsedStyle,i=r.cx,o=void 0===i?0:i,a=r.cy,s=void 0===a?0:a,c=r.r,l=r.fill,u=r.stroke,f=r.lineWidth,d=void 0===f?1:f,h=r.increasedLineWidthForHitTesting,p=void 0===h?0:h,g=r.pointerEvents,m=void 0===g?"auto":g,y=(d+p)/2,v=Wl(o,s,e.x,e.y),b=Ce(kh(m,l,u),2),x=b[0],w=b[1];return x&&w||n?v<=c+y:x?v<=c:!!w&&(v>=c-y&&v<=c+y)}function SS(t,e,n,r){return t/(n*n)+e/(r*r)}function AS(t,e,n){var r=t.parsedStyle,i=r.cx,o=void 0===i?0:i,a=r.cy,s=void 0===a?0:a,c=r.rx,l=r.ry,u=r.fill,f=r.stroke,d=r.lineWidth,h=void 0===d?1:d,p=r.increasedLineWidthForHitTesting,g=void 0===p?0:p,m=r.pointerEvents,y=void 0===m?"auto":m,v=e.x,b=e.y,x=Ce(kh(y,u,f),2),w=x[0],M=x[1],O=(h+g)/2,E=(v-o)*(v-o),k=(b-s)*(b-s);return w&&M||n?SS(E,k,c+O,l+O)<=1:w?SS(E,k,c,l)<=1:!!M&&(SS(E,k,c-O,l-O)>=1&&SS(E,k,c+O,l+O)<=1)}function _S(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function TS(t,e,n,r,i,o,a,s){var c=(Math.atan2(s-e,a-t)+2*Math.PI)%(2*Math.PI),l={x:t+n*Math.cos(c),y:e+n*Math.sin(c)};return Wl(l.x,l.y,a,s)<=o/2}function PS(t,e,n,r,i,o,a){var s=Math.min(t,n),c=Math.max(t,n),l=Math.min(e,r),u=Math.max(e,r),f=i/2;return o>=s-f&&o<=c+f&&a>=l-f&&a<=u+f&&Kl(t,e,n,r,o,a)<=i/2}function CS(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(PS(t[a][0],t[a][1],t[a+1][0],t[a+1][1],e,n,r))return!0}if(i){var s=t[0],c=t[o-1];if(PS(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}var NS=1e-6;function LS(t){return Math.abs(t)<NS?0:t<0?-1:1}function jS(t,e,n){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])&&Math.min(t[0],e[0])<=n[0]&&n[0]<=Math.max(t[0],e[0])&&Math.min(t[1],e[1])<=n[1]&&n[1]<=Math.max(t[1],e[1])}function RS(t,e,n){var r=!1,i=t.length;if(i<=2)return!1;for(var o=0;o<i;o++){var a=t[o],s=t[(o+1)%i];if(jS(a,s,[e,n]))return!0;LS(a[1]-n)>0!=LS(s[1]-n)>0&&LS(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function IS(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=RS(t[i],e,n))break}return r}function BS(t,e,n){var r=t.parsedStyle,i=r.x1,o=r.y1,a=r.x2,s=r.y2,c=r.lineWidth,l=void 0===c?1:c,u=r.increasedLineWidthForHitTesting,f=void 0===u?0:u,d=r.pointerEvents;return!(!Ce(kh(void 0===d?"auto":d,r.fill,r.stroke),2)[1]&&!n||!l)&&PS(i,o,a,s,l+f,e.x,e.y)}function DS(t,e,n,r,i,o){var a=t.parsedStyle,s=a.lineWidth,c=void 0===s?1:s,l=a.increasedLineWidthForHitTesting,u=void 0===l?0:l,f=a.stroke,d=a.fill,h=a.d,p=a.pointerEvents,g=void 0===p?"auto":p,m=h.segments,y=h.hasArc,v=h.polylines,b=h.polygons,x=Ce(kh(g,(null==b?void 0:b.length)&&d,f),2),w=x[0],M=x[1],O=fd(t),E=!1;return w||n?E=y?r(t,e):IS(b,e.x,e.y)||IS(v,e.x,e.y):((M||n)&&(E=function(t,e,n,r,i){for(var o=!1,a=e/2,s=0;s<t.length;s++){var c=t[s],l=c.currentPoint,u=c.params,f=c.prePoint,d=c.box;if(!d||_S(d.x-a,d.y-a,d.width+e,d.height+e,n,r))switch(c.command){case"L":case"Z":if(o=PS(f[0],f[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(o=au(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=eu(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],n,r,i)<=e/2)return!0;break;case"A":c.cubicParams||(c.cubicParams=Je(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var h=c.cubicParams,p=f,g=0;g<h.length;g+=6){var m=eu(p[0],p[1],h[g],h[g+1],h[g+2],h[g+3],h[g+4],h[g+5],n,r,i);if(p=[h[g+4],h[g+5]],o=m<=e/2)return!0}}}return o}(m,c+u,e.x,e.y,O)),E)}function FS(t,e,n){var r=t.parsedStyle,i=r.stroke,o=r.fill,a=r.lineWidth,s=void 0===a?1:a,c=r.increasedLineWidthForHitTesting,l=void 0===c?0:c,u=r.points,f=r.pointerEvents,d=Ce(kh(void 0===f?"auto":f,o,i),2),h=d[0],p=!1;return(d[1]||n)&&(p=CS(u.points,s+l,e.x,e.y,!0)),p||!h&&!n||(p=RS(u.points,e.x,e.y)),p}function zS(t,e,n){var r=t.parsedStyle,i=r.lineWidth,o=void 0===i?1:i,a=r.increasedLineWidthForHitTesting,s=void 0===a?0:a,c=r.points,l=r.pointerEvents;return!(!Ce(kh(void 0===l?"auto":l,r.fill,r.stroke),2)[1]&&!n||!o)&&CS(c.points,o+s,e.x,e.y,!1)}function GS(t,e,n,r,i){var o=t.parsedStyle,a=o.radius,s=o.fill,c=o.stroke,l=o.lineWidth,u=void 0===l?1:l,f=o.increasedLineWidthForHitTesting,d=void 0===f?0:f,h=o.x,p=void 0===h?0:h,g=o.y,m=void 0===g?0:g,y=o.width,v=o.height,b=o.pointerEvents,x=Ce(kh(void 0===b?"auto":b,s,c),2),w=x[0],M=x[1],O=u+d;if(a&&a.some((function(t){return 0!==t}))){var E=!1;return(M||n)&&(E=function(t,e,n,r,i,o,a,s){var c=Ce(i,4),l=c[0],u=c[1],f=c[2],d=c[3];return PS(t+l,e,t+n-u,e,o,a,s)||PS(t+n,e+u,t+n,e+r-f,o,a,s)||PS(t+n-f,e+r,t+d,e+r,o,a,s)||PS(t,e+r-d,t,e+l,o,a,s)||TS(t+n-u,e+u,u,Math.PI,Math.PI,o,a,s)||TS(t+n-f,e+r-f,f,0,Math.PI,o,a,s)||TS(t+d,e+r-d,d,Math.PI,Math.PI,o,a,s)||TS(t+l,e+l,l,Math.PI,Math.PI,o,a,s)}(p,m,y,v,a.map((function(t){return L(t,0,Math.min(Math.abs(y)/2,Math.abs(v)/2))})),O,e.x,e.y)),E||!w&&!n||(E=r(t,e)),E}var k=O/2;return w&&M||n?_S(p-k,m-k,y+k,v+k,e.x,e.y):w?_S(p,m,y,v,e.x,e.y):!!M&&function(t,e,n,r,i,o,a){var s=i/2;return _S(t-s,e-s,n,i,o,a)||_S(t+n-s,e-s,i,r,o,a)||_S(t+s,e+r-s,n,i,o,a)||_S(t-s,e+s,i,r,o,a)}(p,m,y,v,O,e.x,e.y)}function WS(t,e,n,r,i,o){var a=t.parsedStyle,s=a.pointerEvents,c=void 0===s?"auto":s,l=a.x,u=void 0===l?0:l,f=a.y,d=void 0===f?0:f,h=a.width,p=a.height;if("non-transparent-pixel"===c){var g=i.config.offscreenCanvas,m=o.offscreenCanvasCreator.getOrCreateCanvas(g),y=o.offscreenCanvasCreator.getOrCreateContext(g,{willReadFrequently:!0});return m.width=h,m.height=p,i.defaultStyleRendererFactory[cu.IMAGE].render(y,ke(ke({},t.parsedStyle),{x:0,y:0}),t,void 0,void 0,void 0),y.getImageData(e.x-u,e.y-d,1,1).data.every((function(t){return 0!==t}))}return!0}var $S=function(t){function e(){var e=t.apply(this,Ne([],Ce(arguments),!1))||this;return e.name="canvas-picker",e}return Ee(e,t),e.prototype.init=function(){var t,e=((t={})[cu.CIRCLE]=kS,t[cu.ELLIPSE]=AS,t[cu.RECT]=GS,t[cu.LINE]=BS,t[cu.POLYLINE]=zS,t[cu.POLYGON]=FS,t[cu.PATH]=DS,t[cu.TEXT]=function(){return!0},t[cu.GROUP]=null,t[cu.IMAGE]=WS,t[cu.HTML]=null,t[cu.MESH]=null,t);this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new ES)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(fu),HS=function(){function t(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=ht(),this.dprMatrix=ht(),this.tmpMat4=ht(),this.vec3a=qt(),this.vec3b=qt(),this.vec3c=qt(),this.vec3d=qt()}return t.prototype.apply=function(e,n){var r=this;this.context=e;var i=e.config,o=e.camera,a=e.renderingService,s=e.renderingContext,c=e.rBushRoot,l=e.pathGeneratorFactory;this.rBush=c,this.pathGeneratorFactory=l;var u=e.contextService,f=s.root.ownerDocument.defaultView,d=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},h=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};a.hooks.init.tap(t.tag,(function(){f.addEventListener(gp.UNMOUNTED,d),f.addEventListener(gp.CULLED,h);var t=u.getDPR(),e=i.width,n=i.height,o=u.getContext();r.clearRect(o,0,0,e*t,n*t,i.background)})),a.hooks.destroy.tap(t.tag,(function(){f.removeEventListener(gp.UNMOUNTED,d),f.removeEventListener(gp.CULLED,h),r.renderQueue=[],r.removedRBushNodeAABBs=[],r.restoreStack=[]})),a.hooks.beginFrame.tap(t.tag,(function(){var t,e=u.getContext(),n=u.getDPR(),o=i.width,s=i.height,c=r.canvasRendererPluginOptions,l=c.dirtyObjectNumThreshold,d=c.dirtyObjectRatioThreshold,h=a.getStats(),p=h.total,g=h.rendered,m=g/p;r.clearFullScreen=r.clearFullScreenLastFrame||!(null===(t=f.context.renderingPlugins[1])||void 0===t?void 0:t.isFirstTimeRenderingFinished)||a.disableDirtyRectangleRendering()||g>l&&m>d,e&&(e.resetTransform?e.resetTransform():e.setTransform(1,0,0,1,0,0),r.clearFullScreen&&r.clearRect(e,0,0,o*n,s*n,i.background))}));var p=function(t,e){t.isVisible()&&!t.isCulled()&&r.renderDisplayObject(t,e,r.context,r.restoreStack,n),(t.sortable.sorted||t.childNodes).forEach((function(t){p(t,e)}))};a.hooks.endFrame.tap(t.tag,(function(){if(0!==s.root.childNodes.length){r.clearFullScreenLastFrame=!1;var t=u.getContext(),e=u.getDPR();if(At(r.dprMatrix,[e,e,1]),wt(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)p(s.root,t);else{var a=r.safeMergeAABB.apply(r,Ne([r.mergeDirtyAABBs(r.renderQueue)],Ce(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new Cu;return o.setMinMax([e,n,0],[r,i,0]),o}))),!1));if(r.removedRBushNodeAABBs=[],Cu.isEmpty(a))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(a),l=c.x,d=c.y,h=c.width,g=c.height,m=se(r.vec3a,[l,d,0],r.vpMatrix),y=se(r.vec3b,[l+h,d,0],r.vpMatrix),v=se(r.vec3c,[l,d+g,0],r.vpMatrix),b=se(r.vec3d,[l+h,d+g,0],r.vpMatrix),x=Math.min(m[0],y[0],b[0],v[0]),w=Math.min(m[1],y[1],b[1],v[1]),M=Math.max(m[0],y[0],b[0],v[0]),O=Math.max(m[1],y[1],b[1],v[1]),E=Math.floor(x),k=Math.floor(w),S=Math.ceil(M-x),A=Math.ceil(O-w);t.save(),r.clearRect(t,E,k,S,A,i.background),t.beginPath(),t.rect(E,k,S,A),t.clip(),t.setTransform(r.vpMatrix[0],r.vpMatrix[1],r.vpMatrix[4],r.vpMatrix[5],r.vpMatrix[12],r.vpMatrix[13]),i.renderer.getConfig().enableDirtyRectangleRenderingDebug&&f.dispatchEvent(new up(zp.DIRTY_RECTANGLE,{dirtyRect:{x:E,y:k,width:S,height:A}})),r.searchDirtyObjects(a).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&r.renderDisplayObject(e,t,r.context,r.restoreStack,n)})),t.restore(),r.renderQueue.forEach((function(t){r.saveDirtyAABB(t)})),r.renderQueue=[]}r.restoreStack.forEach((function(){t.restore()})),r.restoreStack=[]}else r.clearFullScreenLastFrame=!0})),a.hooks.render.tap(t.tag,(function(t){r.clearFullScreen||r.renderQueue.push(t)}))},t.prototype.clearRect=function(t,e,n,r,i,o){t.clearRect(e,n,r,i),o&&(t.fillStyle=o,t.fillRect(e,n,r,i))},t.prototype.renderDisplayObject=function(t,e,n,r,i){var o=t.nodeName,a=r[r.length-1];!a||t.compareDocumentPosition(a)&dp.DOCUMENT_POSITION_CONTAINS||(e.restore(),r.pop());var s=this.context.styleRendererFactory[o],c=this.pathGeneratorFactory[o],l=t.parsedStyle.clipPath;if(l){this.applyWorldTransform(e,l);var u=this.pathGeneratorFactory[l.nodeName];u&&(e.save(),r.push(t),e.beginPath(),u(e,l.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),c&&(e.beginPath(),c(e,t.parsedStyle),t.nodeName!==cu.LINE&&t.nodeName!==cu.PATH&&t.nodeName!==cu.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,i),e.restore()),t.renderable.dirty=!1},t.prototype.convertAABB2Rect=function(t){var e=t.getMin(),n=t.getMax(),r=Math.floor(e[0]),i=Math.floor(e[1]);return{x:r,y:i,width:Math.ceil(n[0])-r,height:Math.ceil(n[1])-i}},t.prototype.mergeDirtyAABBs=function(t){var e=new Cu;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var r=t.renderable.dirtyRenderBounds;r&&e.add(r)})),e},t.prototype.searchDirtyObjects=function(t){var e=Ce(t.getMin(),2),n=e[0],r=e[1],i=Ce(t.getMax(),2),o=i[0],a=i[1];return this.rBush.search({minX:n,minY:r,maxX:o,maxY:a}).map((function(t){return t.displayObject}))},t.prototype.saveDirtyAABB=function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new Cu);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)},t.prototype.applyAttributesToContext=function(t,e){var n=e.parsedStyle,r=n.stroke,i=n.fill,o=n.opacity,a=n.lineDash,s=n.lineDashOffset;a&&t.setLineDash(a),v(s)||(t.lineDashOffset=s),v(o)||(t.globalAlpha*=o),v(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),v(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},t.prototype.applyWorldTransform=function(t,e,n){n?(gt(this.tmpMat4,e.getLocalTransform()),wt(this.tmpMat4,n,this.tmpMat4),wt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(gt(this.tmpMat4,e.getWorldTransform()),wt(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.setTransform(this.tmpMat4[0],this.tmpMat4[1],this.tmpMat4[4],this.tmpMat4[5],this.tmpMat4[12],this.tmpMat4[13])},t.prototype.safeMergeAABB=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=new Cu;return t.forEach((function(t){n.add(t)})),n},t.tag="CanvasRenderer",t}(),VS=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n,r,i,o){var a=e.fill,s=e.fillRule,c=e.opacity,l=void 0===c?1:c,u=e.fillOpacity,f=void 0===u?1:u,d=e.stroke,h=e.strokeOpacity,p=void 0===h?1:h,g=e.lineWidth,m=void 0===g?1:g,y=e.lineCap,b=e.lineJoin,x=e.shadowType,w=e.shadowColor,M=e.shadowBlur,O=e.filter,E=e.miterLimit,k=a&&!a.isNone,S=d&&!d.isNone&&m>0,A=0===(null==a?void 0:a.alpha),_=!(!O||!O.length),T=!v(w)&&M>0,P=n.nodeName,C="inner"===x,N=S&&T&&(P===cu.PATH||P===cu.LINE||P===cu.POLYLINE||A||C);k&&(t.globalAlpha=l*f,N||YS(n,t,T),XS(t,n,a,s,r,i,o,this.imagePool),N||this.clearShadowAndFilter(t,_,T)),S&&(t.globalAlpha=l*p,t.lineWidth=m,v(E)||(t.miterLimit=E),v(y)||(t.lineCap=y),v(b)||(t.lineJoin=b),N&&(C&&(t.globalCompositeOperation="source-atop"),YS(n,t,!0),C&&(ZS(t,n,d,r,i,o,this.imagePool),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,_,!0))),ZS(t,n,d,r,i,o,this.imagePool))},t.prototype.clearShadowAndFilter=function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!v(r)&&r.indexOf("drop-shadow")>-1&&(t.filter=r.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}},t}();function YS(t,e,n){var r=t.parsedStyle,i=r.filter,o=r.shadowColor,a=r.shadowBlur,s=r.shadowOffsetX,c=r.shadowOffsetY;i&&i.length&&(e.filter=t.style.filter),n&&(e.shadowColor=o.toString(),e.shadowBlur=a||0,e.shadowOffsetX=s||0,e.shadowOffsetY=c||0)}function US(t,e,n,r,i,o,a){var s,c;if("rect"===t.image.nodeName){var l=t.image.parsedStyle,u=l.width,f=l.height;c=r.contextService.getDPR();var d=r.config.offscreenCanvas;(s=o.offscreenCanvasCreator.getOrCreateCanvas(d)).width=u*c,s.height=f*c;var h=o.offscreenCanvasCreator.getOrCreateContext(d),p=[];t.image.forEach((function(t){i.renderDisplayObject(t,h,r,p,o)})),p.forEach((function(){h.restore()}))}return a.getOrCreatePatternSync(t,n,s,c,e.getGeometryBounds().min,(function(){e.renderable.dirty=!0,r.renderingService.dirtify()}))}function qS(t,e,n,r){var i;if(t.type===Qu.LinearGradient||t.type===Qu.RadialGradient){var o=e.getGeometryBounds(),a=o&&2*o.halfExtents[0]||1,s=o&&2*o.halfExtents[1]||1,c=o&&o.min||[0,0];i=r.getOrCreateGradient(ke(ke({type:t.type},t.value),{min:c,width:a,height:s}),n)}return i}function XS(t,e,n,r,i,o,a,s,c){void 0===c&&(c=!1),Array.isArray(n)?n.forEach((function(n){t.fillStyle=qS(n,e,t,s),c||(r?t.fill(r):t.fill())})):(Gf(n)&&(t.fillStyle=US(n,e,t,i,o,a,s)),c||(r?t.fill(r):t.fill()))}function ZS(t,e,n,r,i,o,a,s){void 0===s&&(s=!1),Array.isArray(n)?n.forEach((function(n){t.strokeStyle=qS(n,e,t,a),s||t.stroke()})):(Gf(n)&&(t.strokeStyle=US(n,e,t,r,i,o,a)),s||t.stroke())}var KS=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n){var r,i=e.x,o=void 0===i?0:i,a=e.y,s=void 0===a?0:a,c=e.width,l=e.height,u=e.src,f=e.shadowColor,d=e.shadowBlur,h=c,p=l;if(C(u)?r=this.imagePool.getImageSync(u):(h||(h=u.width),p||(p=u.height),r=u),r){YS(n,t,!v(f)&&d>0);try{t.drawImage(r,o,s,h,p)}catch(t){}}},t}(),QS=function(){function t(t){this.imagePool=t}return t.prototype.render=function(t,e,n,r,i,o){n.getBounds();var a=e,s=a.lineWidth,c=void 0===s?1:s,l=a.textAlign,u=void 0===l?"start":l,f=a.textBaseline,d=void 0===f?"alphabetic":f,h=a.lineJoin,p=void 0===h?"miter":h,g=a.miterLimit,m=void 0===g?10:g,y=a.letterSpacing,b=void 0===y?0:y,x=a.stroke,w=a.fill,M=a.fillRule,O=a.fillOpacity,E=void 0===O?1:O,k=a.strokeOpacity,S=void 0===k?1:k,A=a.opacity,_=void 0===A?1:A,T=a.metrics,P=a.x,C=void 0===P?0:P,N=a.y,L=void 0===N?0:N,j=a.dx,R=a.dy,I=a.shadowColor,B=a.shadowBlur,D=T.font,F=T.lines,z=T.height,G=T.lineHeight,W=T.lineMetrics;t.font=D,t.lineWidth=c,t.textAlign="middle"===u?"center":u;var $=d;o.enableCSSParsing||"alphabetic"!==$||($="bottom"),t.lineJoin=p,v(m)||(t.miterLimit=m);var H=L;"middle"===d?H+=-z/2-G/2:"bottom"===d||"alphabetic"===d||"ideographic"===d?H+=-z:"top"!==d&&"hanging"!==d||(H+=-G);var V=C+(j||0);H+=R||0,1===F.length&&("bottom"===$?($="middle",H-=.5*z):"top"===$&&($="middle",H+=.5*z)),t.textBaseline=$,YS(n,t,!v(I)&&B>0);for(var Y=0;Y<F.length;Y++){var U=c/2+V;H+=G,v(x)||x.isNone||!c||this.drawLetterSpacing(t,n,F[Y],W[Y],u,U,H,b,w,M,E,x,S,_,!0,r,i,o),v(w)||this.drawLetterSpacing(t,n,F[Y],W[Y],u,U,H,b,w,M,E,x,S,_,!1,r,i,o)}},t.prototype.drawLetterSpacing=function(t,e,n,r,i,o,a,s,c,l,u,f,d,h,p,g,m,y){if(0!==s){var v=t.textAlign;t.textAlign="left";var b=o;"center"===i||"middle"===i?b=o-r.width/2:"right"!==i&&"end"!==i||(b=o-r.width);for(var x=Array.from(n),w=t.measureText(n).width,M=0,O=0;O<x.length;++O){var E=x[O];p?this.strokeText(t,e,E,b,a,f,d,g,m,y):this.fillText(t,e,E,b,a,c,l,u,h,g,m,y),b+=w-(M=t.measureText(n.substring(O+1)).width)+s,w=M}t.textAlign=v}else p?this.strokeText(t,e,n,o,a,f,d,g,m,y):this.fillText(t,e,n,o,a,c,l,u,h,g,m,y)},t.prototype.fillText=function(t,e,n,r,i,o,a,s,c,l,u,f){var d;XS(t,e,o,a,l,u,f,this.imagePool,!0);var h=!v(s)&&1!==s;h&&(d=t.globalAlpha,t.globalAlpha=s*c),t.fillText(n,r,i),h&&(t.globalAlpha=d)},t.prototype.strokeText=function(t,e,n,r,i,o,a,s,c,l){var u;ZS(t,e,o,s,c,l,this.imagePool,!0);var f=!v(a)&&1!==a;f&&(u=t.globalAlpha,t.globalAlpha=a),t.strokeText(n,r,i),f&&(t.globalAlpha=u)},t}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Ee(e,t)}(VS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Ee(e,t)}(VS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Ee(e,t)}(VS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Ee(e,t)}(VS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Ee(e,t)}(VS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Ee(e,t)}(VS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Ee(e,t)}(VS);var JS=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="canvas-renderer",n}return Ee(e,t),e.prototype.init=function(){var t,e=ke({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new VS(n),i=((t={})[cu.CIRCLE]=r,t[cu.ELLIPSE]=r,t[cu.RECT]=r,t[cu.IMAGE]=new KS(n),t[cu.TEXT]=new QS(n),t[cu.LINE]=r,t[cu.POLYLINE]=r,t[cu.POLYGON]=r,t[cu.PATH]=r,t[cu.GROUP]=void 0,t[cu.HTML]=void 0,t[cu.MESH]=void 0,t);this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new HS(e))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(fu),tA=function(){function t(){}return t.prototype.apply=function(e,n){var r=this,i=e.renderingService,o=e.renderingContext,a=e.config;this.context=e;var s=o.root.ownerDocument.defaultView,c=function(t){i.hooks.pointerMove.call(t)},l=function(t){i.hooks.pointerUp.call(t)},u=function(t){i.hooks.pointerDown.call(t)},f=function(t){i.hooks.pointerOver.call(t)},d=function(t){i.hooks.pointerOut.call(t)},h=function(t){i.hooks.pointerCancel.call(t)},p=function(t){i.hooks.pointerWheel.call(t)},g=function(t){i.hooks.click.call(t)};i.hooks.init.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",c,!0),t.addEventListener("pointerdown",u,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",h,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",f,!0),n.globalThis.addEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",u,!0),t.addEventListener("touchend",l,!0),t.addEventListener("touchmove",c,!0),t.addEventListener("touchcancel",h,!0)}(t),a.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})})),i.hooks.destroy.tap(t.tag,(function(){var t=r.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",c,!0),t.removeEventListener("pointerdown",u,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",f,!0),n.globalThis.removeEventListener("pointerup",l,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",c,!0),t.removeEventListener("mousedown",u,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",f,!0),n.globalThis.removeEventListener("mouseup",l,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",u,!0),t.removeEventListener("touchend",l,!0),t.removeEventListener("touchmove",c,!0),t.removeEventListener("touchcancel",h,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)}))},t.tag="DOMInteraction",t}(),eA=function(t){function e(){var e=t.apply(this,Ne([],Ce(arguments),!1))||this;return e.name="dom-interaction",e}return Ee(e,t),e.prototype.init=function(){this.addRenderingPlugin(new tA)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(fu),nA=function(){function t(){this.displayObjectHTMLElementMap=new WeakMap}return t.prototype.joinTransformMatrix=function(t){return"matrix(".concat([t[0],t[1],t[4],t[5],t[12],t[13]].join(","),")")},t.prototype.apply=function(e,n){var r=this,i=e.camera,o=e.renderingContext,a=e.renderingService;this.context=e;var s=o.root.ownerDocument.defaultView,c=s.context.eventService.nativeHTMLMap,l=function(t,e){e.style.transform=r.joinTransformMatrix(t.getWorldTransform())},u=function(t){var e=t.target;if(e.nodeName===cu.HTML){r.$camera||(r.$camera=r.createCamera(i));var o=r.getOrCreateEl(e);if(r.$camera.appendChild(o),n.enableCSSParsing){var a=e.ownerDocument.documentElement.attributes;Object.keys(a).forEach((function(t){o.style[t]=a[t]}))}Object.keys(e.attributes).forEach((function(t){r.updateAttribute(t,e)})),l(e,o),c.set(o,e)}},f=function(t){var e=t.target;if(e.nodeName===cu.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),c.delete(n))}},d=function(t){var e=t.target;if(e.nodeName===cu.HTML){var n=t.attrName;r.updateAttribute(n,e)}},h=function(t){var e=t.target;if(e.nodeName===cu.HTML){var n=r.getOrCreateEl(e);l(e,n)}},p=function(){if(r.$camera){var t=r.context.config,e=t.width,n=t.height;r.$camera.style.width="".concat(e||0,"px"),r.$camera.style.height="".concat(n||0,"px")}};a.hooks.init.tap(t.tag,(function(){s.addEventListener(zp.RESIZE,p),s.addEventListener(gp.MOUNTED,u),s.addEventListener(gp.UNMOUNTED,f),s.addEventListener(gp.ATTR_MODIFIED,d),s.addEventListener(gp.BOUNDS_CHANGED,h)})),a.hooks.endFrame.tap(t.tag,(function(){r.$camera&&o.renderReasons.has(op.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),a.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(zp.RESIZE,p),s.removeEventListener(gp.MOUNTED,u),s.removeEventListener(gp.UNMOUNTED,f),s.removeEventListener(gp.ATTR_MODIFIED,d),s.removeEventListener(gp.BOUNDS_CHANGED,h)}))},t.prototype.createCamera=function(t){var e=this.context.config,n=e.document,r=e.width,i=e.height,o=this.context.contextService.getDomElement(),a=o.parentNode;if(a){var s="g-canvas-camera",c=a.querySelector("#"+s);if(!c){var l=(n||document).createElement("div");c=l,l.id=s,l.style.position="absolute",l.style.left="".concat(o.offsetLeft||0,"px"),l.style.top="".concat(o.offsetTop||0,"px"),l.style.transformOrigin="left top",l.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),l.style.overflow="hidden",l.style.pointerEvents="none",l.style.width="".concat(r||0,"px"),l.style.height="".concat(i||0,"px"),a.appendChild(l)}return c}return null},t.prototype.getOrCreateEl=function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform())),n},t.prototype.updateAttribute=function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var r=e.parsedStyle.innerHTML;C(r)?n.innerHTML=r:(n.innerHTML="",n.appendChild(r));break;case"x":n.style.left="".concat(e.parsedStyle.x,"px");break;case"y":n.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var i=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(i[0].value," ").concat(i[1].value);break;case"width":if(this.context.enableCSSParsing){var o=e.computedStyleMap().get("width");n.style.width=o.toString()}else{o=e.parsedStyle.width;n.style.width=j(o)?"".concat(o,"px"):o.toString()}break;case"height":if(this.context.enableCSSParsing){var a=e.computedStyleMap().get("height");n.style.height=a.toString()}else{a=e.parsedStyle.height;n.style.height=j(a)?"".concat(a,"px"):a.toString()}break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var c=e.parsedStyle.visibility;n.style.visibility=c;break;case"pointerEvents":var l=e.parsedStyle.pointerEvents,u=void 0===l?"auto":l;n.style.pointerEvents=u;break;case"opacity":var f=e.parsedStyle.opacity;n.style.opacity="".concat(f);break;case"fill":var d=e.parsedStyle.fill,h="";Wf(d)?h=d.isNone?"transparent":e.getAttribute("fill"):Array.isArray(d)&&(h=e.getAttribute("fill")),n.style.background=h;break;case"stroke":var p=e.parsedStyle.stroke,g="";Wf(p)?g=p.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(p)&&(g=e.getAttribute("stroke")),n.style["border-color"]=g,n.style["border-style"]="solid";break;case"lineWidth":var m=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(m||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var y=e.style.filter;n.style.filter=y;break;default:v(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}},t.tag="HTMLRendering",t}(),rA=function(t){function e(){var e=t.apply(this,Ne([],Ce(arguments),!1))||this;return e.name="html-renderer",e}return Ee(e,t),e.prototype.init=function(){this.addRenderingPlugin(new nA)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(fu),iA=function(){function t(t){this.canvasConfig=t,this.imageCache={},this.gradientCache={},this.patternCache={}}return t.prototype.getImageSync=function(t,e){return this.imageCache[t]?e&&e(this.imageCache[t]):this.getOrCreateImage(t).then((function(t){e&&e(t)})),this.imageCache[t]},t.prototype.getOrCreateImage=function(t){var e=this;if(this.imageCache[t])return Promise.resolve(this.imageCache[t]);var n=this.canvasConfig.createImage;return new Promise((function(r,i){var o;n?o=n(t):vh&&(o=new window.Image),o&&(o.onload=function(){e.imageCache[t]=o,r(o)},o.onerror=function(t){i(t)},o.crossOrigin="Anonymous",o.src=t)}))},t.prototype.getOrCreatePatternSync=function(t,e,n,r,i,o){var a=this.generatePatternKey(t);if(a&&this.patternCache[a])return this.patternCache[a];var s,c=t.image,l=t.repetition,u=t.transform,f=!1;C(c)?s=this.getImageSync(c,o):n?(s=n,f=!0):s=c;var d=s&&e.createPattern(s,l);if(d){var h=void 0;h=u?Uh(jd(u),new Up({})):yt(ht()),f&&Ot(h,h,[1/r,1/r,1]),d.setTransform({a:h[0],b:h[1],c:h[4],d:h[5],e:h[12]+i[0],f:h[13]+i[1]})}return a&&d&&(this.patternCache[a]=d),d},t.prototype.getOrCreateGradient=function(t,e){var n=this.generateGradientKey(t),r=t.type,i=t.steps,o=t.min,a=t.width,s=t.height,c=t.angle,l=t.cx,u=t.cy,f=t.size;if(this.gradientCache[n])return this.gradientCache[n];var d=null;if(r===Qu.LinearGradient){var h=function(t,e,n,r){var i=bu(r.value),o=0+e/2,a=0+n/2,s=Math.abs(e*Math.cos(i))+Math.abs(n*Math.sin(i));return{x1:t[0]+o-Math.cos(i)*s/2,y1:t[1]+a-Math.sin(i)*s/2,x2:t[0]+o+Math.cos(i)*s/2,y2:t[1]+a+Math.sin(i)*s/2}}(o,a,s,c),p=h.x1,g=h.y1,m=h.x2,y=h.y2;d=e.createLinearGradient(p,g,m,y)}else if(r===Qu.RadialGradient){var v=function(t,e,n,r,i,o){var a=r.value,s=i.value;r.unit===Gu.kPercentage&&(a=r.value/100*e),i.unit===Gu.kPercentage&&(s=i.value/100*n);var c=Math.max(on([0,0],[a,s]),on([0,n],[a,s]),on([e,n],[a,s]),on([e,0],[a,s]));return o&&(o instanceof pf?c=o.value:o instanceof af&&("closest-side"===o.value?c=Math.min(a,e-a,s,n-s):"farthest-side"===o.value?c=Math.max(a,e-a,s,n-s):"closest-corner"===o.value&&(c=Math.min(on([0,0],[a,s]),on([0,n],[a,s]),on([e,n],[a,s]),on([e,0],[a,s]))))),{x:a+t[0],y:s+t[1],r:c}}(o,a,s,l,u,f),b=v.x,x=v.y,w=v.r;d=e.createRadialGradient(b,x,0,b,x,w)}return d&&(i.forEach((function(t){var e=t.offset,n=t.color;e.unit===Gu.kPercentage&&(null==d||d.addColorStop(e.value/100,n.toString()))})),this.gradientCache[n]=d),this.gradientCache[n]},t.prototype.generateGradientKey=function(t){var e=t.type,n=t.min,r=t.width,i=t.height,o=t.steps,a=t.angle,s=t.cx,c=t.cy,l=t.size;return"gradient-".concat(e,"-").concat((null==a?void 0:a.toString())||0,"-").concat((null==s?void 0:s.toString())||0,"-").concat((null==c?void 0:c.toString())||0,"-").concat((null==l?void 0:l.toString())||0,"-").concat(n[0],"-").concat(n[1],"-").concat(r,"-").concat(i,"-").concat(o.map((function(t){var e=t.offset,n=t.color;return"".concat(e).concat(n)})).join("-"))},t.prototype.generatePatternKey=function(t){var e=t.image,n=t.repetition;return C(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0},t}(),oA=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService,r=e.renderingContext,i=e.imagePool,o=r.root.ownerDocument.defaultView,a=function(t,e,n){var r=t.parsedStyle,i=r.width,o=r.height;i&&!o?t.setAttribute("height",n/e*i):!i&&o&&t.setAttribute("width",e/n*o)},s=function(t){var e=t.target,r=e.nodeName,o=e.attributes;if(r===cu.IMAGE){var s=o.src,c=o.keepAspectRatio;C(s)&&i.getImageSync(s,(function(t){var r=t.width,i=t.height;c&&a(e,r,i),e.renderable.dirty=!0,n.dirtify()}))}},c=function(t){var e=t.target,r=t.attrName,o=t.newValue;e.nodeName===cu.IMAGE&&"src"===r&&C(o)&&i.getOrCreateImage(o).then((function(t){var r=t.width,i=t.height;e.attributes.keepAspectRatio&&a(e,r,i),e.renderable.dirty=!0,n.dirtify()}))};n.hooks.init.tap(t.tag,(function(){o.addEventListener(gp.MOUNTED,s),o.addEventListener(gp.ATTR_MODIFIED,c)})),n.hooks.destroy.tap(t.tag,(function(){o.removeEventListener(gp.MOUNTED,s),o.removeEventListener(gp.ATTR_MODIFIED,c)}))},t.tag="LoadImage",t}(),aA=function(t){function e(){var e=t.apply(this,Ne([],Ce(arguments),!1))||this;return e.name="image-loader",e}return Ee(e,t),e.prototype.init=function(){this.context.imagePool=new iA(this.context.config),this.addRenderingPlugin(new oA)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(fu),sA=function(){function t(t){this.renderingContext=t.renderingContext,this.canvasConfig=t.config}return t.prototype.init=function(){var t=this.canvasConfig,e=t.container,n=t.canvas;if(n)this.$canvas=n,e&&n.parentElement!==e&&e.appendChild(n),this.$container=n.parentElement,this.canvasConfig.container=this.$container;else if(e&&(this.$container=C(e)?document.getElementById(e):e,this.$container)){var r=document.createElement("canvas");this.$container.appendChild(r),this.$container.style.position||(this.$container.style.position="relative"),this.$canvas=r}this.context=this.$canvas.getContext("2d"),this.resize(this.canvasConfig.width,this.canvasConfig.height)},t.prototype.getContext=function(){return this.context},t.prototype.getDomElement=function(){return this.$canvas},t.prototype.getDPR=function(){return this.dpr},t.prototype.getBoundingClientRect=function(){if(this.$canvas.getBoundingClientRect)return this.$canvas.getBoundingClientRect()},t.prototype.destroy=function(){this.$container&&this.$canvas&&this.$canvas.parentNode&&this.$container.removeChild(this.$canvas)},t.prototype.resize=function(t,e){var n=this.canvasConfig.devicePixelRatio||vh&&window.devicePixelRatio||1;n=n>=1?Math.ceil(n):1,this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){vh&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(op.CAMERA_CHANGED)},t.prototype.applyCursorStyle=function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)},t.prototype.toDataURL=function(t){return void 0===t&&(t={}),_e(this,void 0,void 0,(function(){var e,n;return Te(this,(function(r){return e=t.type,n=t.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]}))}))},t}(),cA=function(t){function e(){var e=t.apply(this,Ne([],Ce(arguments),!1))||this;return e.name="canvas-context-register",e}return Ee(e,t),e.prototype.init=function(){this.context.ContextService=sA},e.prototype.destroy=function(){delete this.context.ContextService},e}(fu),lA=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new cA),n.registerPlugin(new aA),n.registerPlugin(new bS),n.registerPlugin(new JS),n.registerPlugin(new eA),n.registerPlugin(new $S),n.registerPlugin(new rA),n}return Ee(e,t),e}(du),uA=function(){function t(t){this.dragndropPluginOptions=t}return t.prototype.apply=function(e){var n=this,r=e.renderingService,i=e.renderingContext.root.ownerDocument,o=i.defaultView,a=function(t){var e=t.target,r=e===i,a=r&&n.dragndropPluginOptions.isDocumentDraggable?i:e.closest&&e.closest("[draggable=true]");if(a){var s=!1,c=t.timeStamp,l=[t.clientX,t.clientY],u=null,f=[t.clientX,t.clientY],d=function(t){return _e(n,void 0,void 0,(function(){var n,o,d,h,p,g;return Te(this,(function(m){switch(m.label){case 0:if(!s){if(n=t.timeStamp-c,o=on([t.clientX,t.clientY],l),n<=this.dragndropPluginOptions.dragstartTimeThreshold||o<=this.dragndropPluginOptions.dragstartDistanceThreshold)return[2];t.type="dragstart",a.dispatchEvent(t),s=!0}return t.type="drag",t.dx=t.clientX-f[0],t.dy=t.clientY-f[1],a.dispatchEvent(t),f=[t.clientX,t.clientY],r?[3,2]:(d="pointer"===this.dragndropPluginOptions.overlap?[t.canvasX,t.canvasY]:e.getBounds().center,[4,i.elementsFromPoint(d[0],d[1])]);case 1:h=m.sent(),p=h[h.indexOf(e)+1],g=(null==p?void 0:p.closest("[droppable=true]"))||(this.dragndropPluginOptions.isDocumentDroppable?i:null),u!==g&&(u&&(t.type="dragleave",t.target=u,u.dispatchEvent(t)),g&&(t.type="dragenter",t.target=g,g.dispatchEvent(t)),(u=g)&&(t.type="dragover",t.target=u,u.dispatchEvent(t))),m.label=2;case 2:return[2]}}))}))};o.addEventListener("pointermove",d);var h=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();u&&(e.type="drop",e.target=u,u.dispatchEvent(e)),e.type="dragend",a.dispatchEvent(e),s=!1}o.removeEventListener("pointermove",d)};e.addEventListener("pointerup",h,{once:!0}),e.addEventListener("pointerupoutside",h,{once:!0})}};r.hooks.init.tap(t.tag,(function(){o.addEventListener("pointerdown",a)})),r.hooks.destroy.tap(t.tag,(function(){o.removeEventListener("pointerdown",a)}))},t.tag="Dragndrop",t}(),fA=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="dragndrop",n}return Ee(e,t),e.prototype.init=function(){this.addRenderingPlugin(new uA(ke({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e.prototype.setOptions=function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)},e}(fu),dA=function(){function t(){this._events={}}return t.prototype.on=function(t,e,n){return this._events[t]||(this._events[t]=[]),this._events[t].push({callback:e,once:!!n}),this},t.prototype.once=function(t,e){return this.on(t,e,!0)},t.prototype.emit=function(t){for(var e=this,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=this._events[t]||[],o=this._events["*"]||[],a=function(r){for(var i=r.length,o=0;o<i;o++)if(r[o]){var a=r[o],s=a.callback;a.once&&(r.splice(o,1),0===r.length&&delete e._events[t],i--,o--),s.apply(e,n)}};a(i),a(o)},t.prototype.off=function(t,e){if(t)if(e){for(var n=this._events[t]||[],r=n.length,i=0;i<r;i++)n[i].callback===e&&(n.splice(i,1),r--,i--);0===n.length&&delete this._events[t]}else delete this._events[t];else this._events={};return this},t.prototype.getEvents=function(){return this._events},t}(),hA=dA;const pA={BEFORE_RENDER:"beforerender",AFTER_RENDER:"afterrender",BEFORE_PAINT:"beforepaint",AFTER_PAINT:"afterpaint",BEFORE_CHANGE_DATA:"beforechangedata",AFTER_CHANGE_DATA:"afterchangedata",BEFORE_CLEAR:"beforeclear",AFTER_CLEAR:"afterclear",BEFORE_DESTROY:"beforedestroy",AFTER_DESTROY:"afterdestroy",BEFORE_CHANGE_SIZE:"beforechangesize",AFTER_CHANGE_SIZE:"afterchangesize",POINTER_TAP:"pointertap",POINTER_DOWN:"pointerdown",POINTER_UP:"pointerup",POINTER_OVER:"pointerover",POINTER_OUT:"pointerout",POINTER_MOVE:"pointermove",POINTER_ENTER:"pointerenter",POINTER_LEAVE:"pointerleave",POINTER_UPOUTSIDE:"pointerupoutside",DRAG_START:"dragstart",DRAG:"drag",DRAG_END:"dragend",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"DROP",CLICK:"click",DBLCLICK:"dblclick"},gA=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];var mA={}.toString,yA=function(t,e){return mA.call(t)==="[object "+e+"]"},vA=function(t){return Array.isArray?Array.isArray(t):yA(t,"Array")},bA=function(t){return"object"==typeof t&&null!==t},xA=function(t){if(!bA(t)||!yA(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 wA(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(e.hasOwnProperty(i)){var o=e[i];null!==o&&xA(o)?(xA(t[i])||(t[i]={}),n<r?wA(t[i],o,n+1,r):t[i]=e[i]):vA(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var MA=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)wA(t,e[r]);return t},OA=function(t){return t};function EA(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return t?e.reduce((function(t,e){return function(n){return e(t(n))}}),t):OA}function kA(t){return t instanceof Float32Array||t instanceof Array}var SA=window&&window.__read||function(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},AA=window&&window.__spreadArray||function(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 _A(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var TA=window&&window.__read||function(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},PA=function(t,e,n,r,i){var o,a,s=TA(t,2),c=s[0],l=s[1],u=ft();return a=[c,l],(o=u)[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=a[0],o[7]=a[1],o[8]=1,o},CA=window&&window.__read||function(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},NA=function(t,e,n,r,i){var o=new ia({range:[e,e+r]}),a=new ia({range:[n,n+i]});return{transform:function(t){var e=CA(t,2),n=e[0],r=e[1];return[o.map(n),a.map(r)]},untransform:function(t){var e=CA(t,2),n=e[0],r=e[1];return[o.invert(n),a.invert(r)]}}},LA=window&&window.__read||function(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},jA=function(t,e,n,r,i){return(0,LA(t,1)[0])(e,n,r,i)},RA=window&&window.__read||function(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},IA=function(t,e,n,r,i){return RA(t,1)[0]},BA=window&&window.__read||function(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},DA=function(t,e,n,r,i){var o=BA(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new ia({range:[c,l]}),f=new ia({range:[a,s]}),d=i/r,h=d>1?1:d,p=d>1?1/d:1;return{transform:function(t){var e=BA(t,2),n=e[0],r=e[1],i=f.map(n),o=u.map(r);return[.5*(o*Math.cos(i)*h)+.5,.5*(o*Math.sin(i)*p)+.5]},untransform:function(t){var e=BA(t,2),n=e[0],r=e[1],i=2*(n-.5)/h,o=2*(r-.5)/p,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),l=_A(Math.atan2(o,i),a,s);return[f.invert(l),u.invert(c)]}}},FA=window&&window.__read||function(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},zA=function(t,e,n,r,i){return{transform:function(t){var e=FA(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=FA(t,2),n=e[0];return[e[1],n]}}},GA=window&&window.__read||function(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},WA=function(t,e,n,r,i){var o,a,s=GA(t,2),c=s[0],l=s[1],u=ft();return a=[c,l],(o=u)[0]=a[0],o[1]=0,o[2]=0,o[3]=0,o[4]=a[1],o[5]=0,o[6]=0,o[7]=0,o[8]=1,o},$A=window&&window.__read||function(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},HA=window&&window.__spreadArray||function(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))},VA=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return WA.apply(void 0,HA([[-1,-1]],$A(e),!1))},YA=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return WA.apply(void 0,HA([[-1,1]],$A(e),!1))},UA=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return WA.apply(void 0,HA([[1,-1]],$A(e),!1))},qA=window&&window.__read||function(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},XA=function(t,e,n,r,i){var o=qA(t,1)[0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}(ft(),o)},ZA=window&&window.__read||function(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},KA=function(t,e,n,r,i){var o=ZA(t,4),a=o[0],s=o[1],c=o[2],l=(o[3]-c)/((s-0)/(2*Math.PI)+1),u=l/(2*Math.PI),f=new ia({range:[c,c+.99*l]}),d=new ia({range:[a,s]}),h=i/r,p=h>1?1:h,g=h>1?1/h:1;return{transform:function(t){var e=ZA(t,2),n=e[0],r=e[1],i=d.map(n),o=f.map(r);return[.5*(Math.cos(i)*(u*i+o)*p)+.5,.5*(Math.sin(i)*(u*i+o)*g)+.5]},untransform:function(t){var e=ZA(t,2),n=e[0],r=e[1],i=2*(n-.5)/p,o=2*(r-.5)/g,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),h=_A(Math.atan2(o,i)+Math.floor(c/l)*Math.PI*2,a,s),m=c-u*h;return[d.invert(h),f.invert(m)]}}},QA=window&&window.__read||function(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},JA=function(t,e,n,r,i){var o=QA(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new ia({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new oa({domain:new Array(n).fill(0).map((function(t,e){return e})),range:[a,s]}),i=0;i<n;i++){var o=t[i],c=r.map(i),l=u.map(o);e.push(c,l)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},t_=window&&window.__read||function(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 e_(t){return 1/Math.tan(t)}var n_=function(t,e,n,r,i){var o=e_(t_(t,1)[0]);return{transform:function(t){var e=t_(t,2),n=e[0],r=e[1];return[n+r*o,r]},untransform:function(t){var e=t_(t,2),n=e[0],r=e[1];return[n-r*o,r]}}},r_=function(t,e,n,r,i){var o=e_(t_(t,1)[0]);return{transform:function(t){var e=t_(t,2),n=e[0];return[n,e[1]+n*o]},untransform:function(t){var e=t_(t,2),n=e[0];return[n,e[1]-n*o]}}},i_=window&&window.__read||function(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 o_(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r,s=o?-1:1;return s*a*(n+1)/(n+a/((t-e)*s))+e}function a_(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r;return a/(a*(n+1)/(t-e)-n*(o?-1:1))+e}function s_(t,e,n){return n?new ia({range:[0,1],domain:[0,e]}).map(t):t}var c_=function(t,e,n,r,i){var o=i_(t,3),a=o[0],s=o[1],c=o[2],l=s_(a,r,void 0!==c&&c);return{transform:function(t){var e=i_(t,2),n=e[0],r=e[1];return[o_(n,l,s,0,1),r]},untransform:function(t){var e=i_(t,2),n=e[0],r=e[1];return[a_(n,l,s,0,1),r]}}},l_=function(t,e,n,r,i){var o=i_(t,3),a=o[0],s=o[1],c=o[2],l=s_(a,i,void 0!==c&&c);return{transform:function(t){var e=i_(t,2);return[e[0],o_(e[1],l,s,0,1)]},untransform:function(t){var e=i_(t,2);return[e[0],a_(e[1],l,s,0,1)]}}},u_=function(t,e,n,r,i){var o=i_(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,d=s_(a,r,f),h=s_(s,i,f);return{transform:function(t){var e=i_(t,2),n=e[0],r=e[1];return[o_(n,d,c,0,1),o_(r,h,l,0,1)]},untransform:function(t){var e=i_(t,2),n=e[0],r=e[1];return[a_(n,d,c,0,1),a_(r,h,l,0,1)]}}},f_=function(t,e,n,r,i){var o=i_(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,d=new ia({range:[0,r]}),h=new ia({range:[0,i]}),p=f?a:d.map(a),g=f?s:h.map(s);return{transform:function(t){var e=i_(t,2),n=e[0],r=e[1],i=d.map(n)-p,o=h.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=o_(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),m=g+s*Math.sin(u);return[d.invert(f),h.invert(m)]},untransform:function(t){var e=i_(t,2),n=e[0],r=e[1],i=d.map(n)-p,o=h.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=a_(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),m=g+s*Math.sin(u);return[d.invert(f),h.invert(m)]}}},d_=window&&window.__read||function(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},h_=function(t,e,n,r,i,o,a){var s=new ia({range:[e,e+i]}),c=new ia({range:[n,n+o]}),l=new ia({range:[r,r+a]});return{transform:function(t){var e=d_(t,3),n=e[0],r=e[1],i=e[2];return[s.map(n),c.map(r),l.map(i)]},untransform:function(t){var e=d_(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},p_=window&&window.__read||function(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},g_=function(t,e,n,r,i,o,a){var s=p_(t,3),c=s[0],l=s[1],u=s[2];return St(ht(),[c,l,u])},m_=window&&window.__read||function(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},y_=function(t,e,n,r,i,o,a){return{transform:function(t){var e=m_(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=m_(t,3),n=e[0];return[e[1],n,e[2]]}}},v_=window&&window.__read||function(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},b_=function(t,e,n,r,i,o,a){var s=v_(t,3),c=s[0],l=s[1],u=s[2];return At(ht(),[c,l,u])},x_=window&&window.__read||function(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},w_=window&&window.__spreadArray||function(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))},M_=window&&window.__values||function(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.")},O_=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:NA,translate:PA,custom:jA,matrix:IA,polar:DA,transpose:zA,scale:WA,"shear.x":n_,"shear.y":r_,reflect:VA,"reflect.x":YA,"reflect.y":UA,rotate:XA,helix:KA,parallel:JA,fisheye:u_,"fisheye.x":c_,"fisheye.y":l_,"fisheye.circular":f_},this.update(t)}return t.prototype.update=function(t){this.options=MA({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:w_(w_([],x_(n),!1),[w_([],x_(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?w_([],x_(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],o=t(i);n.push.apply(n,AA([],SA(o),!1))}return n}}(t):t)};try{for(var c=M_(r),l=c.next();!l.done;l=c.next()){var u=x_(l.value),f=u[0],d=u.slice(1),h=this.transformers[f];if(h){var p=this.options,g=p.x,m=p.y,y=p.width,v=p.height,b=h(w_([],x_(d),!1),g,m,y,v);if(kA(b))o.push(b);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(b)||OA,"parallel"!==f)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return EA.apply(void 0,w_([],x_(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n,r,i=ft();return e&&t.reverse(),t.forEach((function(t){return dt(i,i,t)})),e&&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=u*a-s*l,d=-u*o+s*c,h=l*o-a*c,p=n*f+r*d+i*h;p&&(p=1/p,t[0]=f*p,t[1]=(-u*r+i*l)*p,t[2]=(s*r-i*a)*p,t[3]=d*p,t[4]=(u*n-i*c)*p,t[5]=(-s*n+i*o)*p,t[6]=h*p,t[7]=(-l*n+r*c)*p,t[8]=(a*n-r*o)*p)}(i,(n=i,(r=new ut(9))[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=n[3],r[4]=n[4],r[5]=n[5],r[6]=n[6],r[7]=n[7],r[8]=n[8],r)),function(t){var e=[t[0],t[1],1];return ce(e,e,i),[e[0],e[1]]}},t}(),E_=window&&window.__read||function(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},k_=window&&window.__spreadArray||function(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))},S_=window&&window.__values||function(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.")},A_=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:h_,translate3D:g_,scale3D:b_,transpose3D:y_},this.update(t)}return t.prototype.update=function(t){this.options=MA({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y,r=t.z;return[(2*e+t.width)/2,(2*n+t.height)/2,(2*r+t.depth)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:k_(k_([],E_(n),!1),[k_([],E_(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?k_([],E_(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],o=t(i);n.push.apply(n,AA([],SA(o),!1))}return n}}(t):t)};try{for(var c=S_(r),l=c.next();!l.done;l=c.next()){var u=E_(l.value),f=u[0],d=u.slice(1),h=this.transformers[f];if(h){var p=this.options,g=p.x,m=p.y,y=p.z,v=p.width,b=p.height,x=p.depth,w=h(k_([],E_(d),!1),g,m,y,v,b,x);if(kA(w))o.push(w);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(w)||OA,!0)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return EA.apply(void 0,k_([],E_(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=ht();return e&&t.reverse(),t.forEach((function(t){return Vt(n,n,t)})),e&&bt(n,pt(n)),function(t){var e=[t[0],t[1],t[2],1];return he(e,e,n),[e[0],e[1],e[2]]}},t}();function __(t){return(e,...n)=>K({},t(e,...n),e)}function T_(t){return(e,...n)=>K({},e,t(e,...n))}function P_(t,e){if(!t)return e;if(Array.isArray(t))return t;const{value:n=e}=t,r=Se(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}const C_=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{x:n=0,y:r=0,width:i,height:o,data:a}=t;return e.map((t=>{var{data:e,x:s,y:c,width:l,height:u}=t,f=Se(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:P_(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})}))};C_.props={};const N_=()=>t=>{const{children:e}=t;if(!Array.isArray(e))return[];const{direction:n="row",ratio:r=e.map((()=>1)),padding:i=0,data:o}=t,[a,s,c,l]="col"===n?["y","height","width","x"]:["x","width","height","y"],u=r.reduce(((t,e)=>t+e)),f=t[s]-i*(e.length-1),d=r.map((t=>f*(t/u))),h=[];let p=t[a]||0;for(let n=0;n<d.length;n+=1){const r=e[n],{data:u}=r,f=Se(r,["data"]),g=P_(u,o);h.push(Object.assign({[a]:p,[s]:d[n],[l]:t[l]||0,[c]:t[c],data:g},f)),p+=d[n]+i}return h};N_.props={};const L_=()=>t=>{const{children:e}=t,n=Se(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:c=[]}=n,l=Se(n,["data","scale","axis","legend","encode","transform"]),u=e.map((t=>{var{data:e,scale:n={},axis:l={},legend:u={},encode:f={},transform:d=[]}=t,h=Se(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:P_(e,r),scale:K({},i,n),encode:K({},s,f),transform:[...c,...d],axis:!(!l||!o)&&K({},o,l),legend:!(!u||!a)&&K({},a,u)},h)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};L_.props={};const j_=({static:t=!1}={})=>e=>{const{width:n,height:r,depth:i,paddingLeft:o,paddingRight:a,paddingTop:s,paddingBottom:c,padding:l,inset:u,insetLeft:f,insetTop:d,insetRight:h,insetBottom:p,margin:g,marginLeft:m,marginBottom:y,marginTop:v,marginRight:b,data:x,coordinate:w,theme:M,component:O,interaction:E,x:k,y:S,z:A,key:_,frame:T,labelTransform:P,parentKey:C,clip:N,viewStyle:L,title:j}=e,R=Se(e,["width","height","depth","paddingLeft","paddingRight","paddingTop","paddingBottom","padding","inset","insetLeft","insetTop","insetRight","insetBottom","margin","marginLeft","marginBottom","marginTop","marginRight","data","coordinate","theme","component","interaction","x","y","z","key","frame","labelTransform","parentKey","clip","viewStyle","title"]);return[Object.assign(Object.assign({type:"standardView",x:k,y:S,z:A,key:_,width:n,height:r,depth:i,padding:l,paddingLeft:o,paddingRight:a,paddingTop:s,inset:u,insetLeft:f,insetTop:d,insetRight:h,insetBottom:p,paddingBottom:c,theme:M,coordinate:w,component:O,interaction:E,frame:T,labelTransform:P,margin:g,marginLeft:m,marginBottom:y,marginTop:v,marginRight:b,parentKey:C,clip:N,style:L},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${_}-0`,data:x}),t&&{title:j})]})]};j_.props={};class R_{constructor(t){this.$value=t}static of(t){return new R_(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const I_=__((t=>{const{encode:e,data:n,scale:r,shareSize:i=!1}=t,{x:o,y:a}=e,s=(t,e)=>{var o;if(void 0===t||!i)return{};const a=Vn(n,(e=>e[t])),s=(null===(o=null==r?void 0:r[e])||void 0===o?void 0:o.domain)||Array.from(a.keys()),c=s.map((t=>a.has(t)?a.get(t).length:1));return{domain:s,flex:c}};return{scale:{x:Object.assign(Object.assign({paddingOuter:0,paddingInner:.1,guide:void 0===o?null:{position:"top"}},void 0===o&&{paddingInner:0}),s(o,"x")),y:Object.assign(Object.assign({range:[0,1],paddingOuter:0,paddingInner:.1,guide:void 0===a?null:{position:"right"}},void 0===a&&{paddingInner:0}),s(a,"y"))}}})),B_=__((t=>{const{data:e,scale:n}=t,r=[t];let i,o,a;for(;r.length;){const t=r.shift(),{children:e,encode:n={},scale:s={},legend:c={}}=t,{color:l}=n,{color:u}=s,{color:f}=c;void 0!==l&&(i=l),void 0!==u&&(o=u),void 0!==f&&(a=f),Array.isArray(e)&&r.push(...e)}const s="string"==typeof i?i:"",[c,l]=(()=>{var t;const r=null===(t=null==n?void 0:n.color)||void 0===t?void 0:t.domain;if(void 0!==r)return[r];if(void 0===i)return[void 0];const o="function"==typeof i?i:t=>t[i],a=e.map(o);return a.some((t=>"number"==typeof t))?[zn(a)]:[Array.from(new Set(a)),"ordinal"]})();return{encode:{color:i},scale:{color:K({},o,{domain:c,type:l})},legend:{color:K({title:s},a)}}})),D_=__((()=>({animate:{enterType:"fadeIn"}}))),F_=T_((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),z_=T_((()=>({type:"cell"}))),G_=T_((t=>{const{data:e}=t,n={type:"custom",callback:()=>{const{data:e,encode:n}=t,{x:r,y:i}=n,o=r?Array.from(new Set(e.map((t=>t[r])))):[],a=i?Array.from(new Set(e.map((t=>t[i])))):[];return(()=>{if(o.length&&a.length){const t=[];for(const e of o)for(const n of a)t.push({[r]:e,[i]:n});return t}return o.length?o.map((t=>({[r]:t}))):a.length?a.map((t=>({[i]:t}))):void 0})()}};return{data:{type:"inline",value:e,transform:[n]}}})),W_=T_(((t,e=$_,n=V_,r=Y_,i={})=>{const{data:o,encode:a,children:s,scale:c,x:l=0,y:u=0,shareData:f=!1,key:d}=t,{value:h}=o,{x:p,y:g}=a,{color:m}=c,{domain:y}=m;return{children:(t,o,a)=>{const{x:c,y:m}=o,{paddingLeft:v,paddingTop:b,marginLeft:x,marginTop:w}=a,{domain:M}=c.getOptions(),{domain:O}=m.getOptions(),E=Lr(t),k=t.map(e),S=t.map((({x:t,y:e})=>[c.invert(t),m.invert(e)])),A=S.map((([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)})),_=A.map((t=>h.filter(t))),T=f?cr(_,(t=>t.length)):void 0,P=S.map((([t,e])=>({columnField:p,columnIndex:M.indexOf(t),columnValue:t,columnValuesLength:M.length,rowField:g,rowIndex:O.indexOf(e),rowValue:e,rowValuesLength:O.length}))),C=P.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return E.flatMap((t=>{const[e,o,a,s]=k[t],c=P[t],f=_[t];return C[t].map((m=>{var M,O,{scale:E,key:k,facet:S=!0,axis:A={},legend:_={}}=m,P=Se(m,["scale","key","facet","axis","legend"]);const C=(null===(M=null==E?void 0:E.y)||void 0===M?void 0:M.guide)||A.y,N=(null===(O=null==E?void 0:E.x)||void 0===O?void 0:O.guide)||A.x,L={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=S?f:0===f.length?[]:h,R={color:{domain:y}},I={x:U_(N,n)(c,j),y:U_(C,r)(c,j)};return Object.assign(Object.assign({key:`${k}-${t}`,data:j,margin:0,x:e+v+l+x,y:o+b+u+w,parentKey:d,width:a,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:T,scale:K(L,E,R),axis:K({},A,I),legend:!1},P),i)}))}))}}}));function $_(t){const{points:e}=t;return vs(e)}function H_(t,e){return e.length?K({title:!1,tick:null,label:null},t):K({title:!1,tick:null,label:null,grid:null},t)}function V_(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return H_(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return K({title:s,grid:c},t)}}function Y_(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return H_(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return K({title:o,grid:a},t)}}function U_(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const q_=()=>t=>[R_.of(t).call(z_).call(B_).call(D_).call(I_).call(F_).call(G_).call(W_).value()];q_.props={};const X_=__((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),Z_=T_((t=>{const{data:e,children:n,x:r=0,y:i=0,key:o}=t;return{children:(t,a,s)=>{const{x:c,y:l}=a,{paddingLeft:u,paddingTop:f,marginLeft:d,marginTop:h}=s,{domain:p}=c.getOptions(),{domain:g}=l.getOptions(),m=Lr(t),y=t.map((({points:t})=>vs(t))),v=t.map((({x:t,y:e})=>[c.invert(t),l.invert(e)])),b=v.map((([t,e])=>({columnField:t,columnIndex:p.indexOf(t),columnValue:t,columnValuesLength:p.length,rowField:e,rowIndex:g.indexOf(e),rowValue:e,rowValuesLength:g.length}))),x=b.map((t=>Array.isArray(n)?n:[n(t)].flat(1)));return m.flatMap((t=>{const[n,a,s,c]=y[t],[l,p]=v[t],g=b[t];return x[t].map((m=>{var y,v;const{scale:b,key:x,encode:w,axis:M,interaction:O}=m,E=Se(m,["scale","key","encode","axis","interaction"]),k=null===(y=null==b?void 0:b.y)||void 0===y?void 0:y.guide,S={x:Q_(null===(v=null==b?void 0:b.x)||void 0===v?void 0:v.guide)(g,e),y:J_(k)(g,e)};return Object.assign({data:e,parentKey:o,key:`${x}-${t}`,x:n+u+r+d,y:a+f+i+h,width:s,height:c,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:K({x:{facet:!1},y:{facet:!1}},b),axis:K({x:{tickCount:5},y:{tickCount:5}},M,S),legend:!1,encode:K({},w,{x:l,y:p}),interaction:K({},O,{legendFilter:!1})},E)}))}))}}})),K_=T_((t=>{const{encode:e}=t,n=Se(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=Se(e,["position","x","y"]),s=[];for(const t of[i].flat(1))for(const e of[o].flat(1))s.push({$x:t,$y:e});return Object.assign(Object.assign({},n),{data:s,encode:Object.assign(Object.assign({},a),{x:"$x",y:"$y"}),scale:Object.assign(Object.assign({},1===[i].flat(1).length&&{x:{paddingInner:0}}),1===[o].flat(1).length&&{y:{paddingInner:0}})})}));function Q_(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return H_(t,n)}}function J_(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return H_(t,n)}}const tT=()=>t=>[R_.of(t).call(z_).call(B_).call(Z_).call(K_).call(D_).call(F_).call(X_).value()],eT=__((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),nT=__((t=>({coordinate:{type:"polar"}}))),rT=t=>{const{encode:e}=t,n=Se(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function iT(t){return t=>null}function oT(t){const{points:e}=t,[n,r,i,o]=e,a=ps(n,o),s=ds(n,o),c=ys(s,ds(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[d,h]=i,p=ms(s)+c/2,g=u*l;return[d+g*Math.sin(p)-f/2,h-g*Math.cos(p)-f/2,f,f]}const aT=()=>t=>[R_.of(t).call(z_).call(rT).call(B_).call(nT).call(G_).call(W_,oT,iT,iT,{frame:!1}).call(D_).call(F_).call(eT).value()];function sT(t,e,n){const r=[0,n],i=[1-n,1];return"normal"===t?r:"reverse"===t?i:"alternate"===t?e%2==0?r:i:"reverse-alternate"===t?e%2==0?i:r:void 0}const cT=()=>t=>{const{children:e=[],duration:n=1e3,iterationCount:r=1,direction:i="normal",easing:o="ease-in-out-sine"}=t,a=e.length;if(!Array.isArray(e)||0===a)return[];const{key:s}=e[0],c=e.map((t=>Object.assign(Object.assign({},t),{key:s}))).map((t=>function(t,e,n){const r=[t];for(;r.length;){const t=r.pop();t.animate=K({enter:{duration:e},update:{duration:e,easing:n,type:"morphing",fill:"both"},exit:{type:"fadeOut",duration:e}},t.animate||{});const{children:i}=t;Array.isArray(i)&&r.push(...i)}return t}(t,n,o)));return function*(){let t,e=0;for(;"infinite"===r||e<r;){const[n,r]=sT(i,e,a);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield c[n]),t=n}e++}}};function lT(t,e){const{__data__:n}=t,{markKey:r,index:i,seriesIndex:o}=n,{markState:a}=e,s=Array.from(a.keys()).find((t=>t.key===r));if(s)return o?o.map((t=>s.data[t])):s.data[i]}function uT(t,e,n,r=t=>!0){return i=>{if(!r(i))return;n.emit(`plot:${t}`,i);const{target:o}=i;if(!o)return;const{className:a}=o;if("plot"===a)return;const s=hL(o,(t=>"element"===t.className));const c=function(t){return hL(t,(t=>"component"===t.className))}(o),l=function(t){return hL(t,(t=>"label"===t.className))}(o),u=s||c||l;if(!u)return;const{className:f,markType:d}=u,h=Object.assign(Object.assign({},i),{nativeEvent:!0});"element"===f?(h.data={data:lT(u,e)},n.emit(`element:${t}`,h),n.emit(`${d}:${t}`,h)):"label"===f?(h.data={data:u.attributes.datum},n.emit(`label:${t}`,h),n.emit(`${a}:${t}`,h)):(n.emit(`component:${t}`,h),n.emit(`${a}:${t}`,h))}}function fT(){return(t,e,n)=>{const{container:r,view:i}=t,o=uT(pA.CLICK,i,n,(t=>1===t.detail)),a=uT(pA.DBLCLICK,i,n,(t=>2===t.detail)),s=uT(pA.POINTER_TAP,i,n),c=uT(pA.POINTER_DOWN,i,n),l=uT(pA.POINTER_UP,i,n),u=uT(pA.POINTER_OVER,i,n),f=uT(pA.POINTER_OUT,i,n),d=uT(pA.POINTER_MOVE,i,n),h=uT(pA.POINTER_ENTER,i,n),p=uT(pA.POINTER_LEAVE,i,n),g=uT(pA.POINTER_UPOUTSIDE,i,n),m=uT(pA.DRAG_START,i,n),y=uT(pA.DRAG,i,n),v=uT(pA.DRAG_END,i,n),b=uT(pA.DRAG_ENTER,i,n),x=uT(pA.DRAG_LEAVE,i,n),w=uT(pA.DRAG_OVER,i,n),M=uT(pA.DROP,i,n);return r.addEventListener("click",o),r.addEventListener("click",a),r.addEventListener("pointertap",s),r.addEventListener("pointerdown",c),r.addEventListener("pointerup",l),r.addEventListener("pointerover",u),r.addEventListener("pointerout",f),r.addEventListener("pointermove",d),r.addEventListener("pointerenter",h),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",m),r.addEventListener("drag",y),r.addEventListener("dragend",v),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",M),()=>{r.removeEventListener("click",o),r.removeEventListener("click",a),r.removeEventListener("pointertap",s),r.removeEventListener("pointerdown",c),r.removeEventListener("pointerup",l),r.removeEventListener("pointerover",u),r.removeEventListener("pointerout",f),r.removeEventListener("pointermove",d),r.removeEventListener("pointerenter",h),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",m),r.removeEventListener("drag",y),r.removeEventListener("dragend",v),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",M)}}}function dT(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":ik,"component.axisLinear":JE,"component.axisArc":tk,"component.legendContinuousBlock":pk,"component.legendContinuousBlockSize":mk,"component.legendContinuousSize":gk,"interaction.event":fT,"composition.mark":j_,"composition.view":L_,"shape.label.label":mM}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||wr(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=Se(t,["type"]);n||wr("Plot type is required!");const o=r(n);return null==o?void 0:o(i,e)},r]}function hT(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||wr("Cannot find library document")}function pT(t,e){const{coordinate:n={},coordinates:r}=t,i=Se(t,["coordinate","coordinates"]);if(r)return t;const{type:o,transform:a=[]}=n,s=Se(n,["type","transform"]);if(!o)return Object.assign(Object.assign({},i),{coordinates:a});const[,c]=dT("coordinate",e),{transform:l=!1}=c(o).props||{};if(l)throw new Error(`Unknown coordinate: ${o}.`);return Object.assign(Object.assign({},i),{coordinates:[Object.assign({type:o},s),...a]})}function gT(t,e){return t.filter((t=>t.type===e))}function mT(t){return gT(t,"polar").length>0}function yT(t){return gT(t,"transpose").length%2==1}function vT(t){return gT(t,"theta").length>0}function bT(t){return gT(t,"radial").length>0}function xT(t){for(var e=t.length/6|0,n=new Array(e),r=0;r<e;)n[r]="#"+t.slice(6*r,6*++r);return n}cT.props={},fT.props={reapplyWhenUpdate:!0};var wT=xT("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),MT=xT("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),OT=xT("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),ET=xT("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),kT=xT("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),ST=xT("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),AT=xT("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),_T=xT("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),TT=xT("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),PT=xT("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),CT=xT("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");var NT=t=>()=>t;function LT(t,e){return function(n){return t+n*e}}function jT(t){return 1==(t=+t)?RT:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):NT(isNaN(e)?n:e)}}function RT(t,e){var n=e-t;return n?LT(t,n):NT(isNaN(t)?e:t)}!function t(e){var n=jT(e);function r(t,e){var r=n((t=yl(t)).r,(e=yl(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=RT(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);var IT,BT=(IT=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return function(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}((n-r/e)*e,a,i,o,s)}},function(t){var e,n,r=t.length,i=new Array(r),o=new Array(r),a=new Array(r);for(e=0;e<r;++e)n=yl(t[e]),i[e]=n.r||0,o[e]=n.g||0,a[e]=n.b||0;return i=IT(i),o=IT(o),a=IT(a),n.opacity=1,function(t){return n.r=i(t),n.g=o(t),n.b=a(t),n+""}});function DT(t){return function e(n){function r(e,r){var i=t((e=zl(e)).h,(r=zl(r)).h),o=RT(e.s,r.s),a=RT(e.l,r.l),s=RT(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=s(t),e+""}}return n=+n,r.gamma=e,r}(1)}DT((function(t,e){var n=e-t;return n?LT(t,n>180||n<-180?n-360*Math.round(n/360):n):NT(isNaN(t)?e:t)}));var FT=DT(RT),zT=t=>BT(t[t.length-1]),GT=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(xT),WT=zT(GT),$T=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(xT),HT=zT($T),VT=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(xT),YT=zT(VT),UT=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(xT),qT=zT(UT),XT=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(xT),ZT=zT(XT),KT=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(xT),QT=zT(KT),JT=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(xT),tP=zT(JT),eP=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(xT),nP=zT(eP),rP=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(xT),iP=zT(rP),oP=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(xT),aP=zT(oP),sP=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(xT),cP=zT(sP),lP=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(xT),uP=zT(lP),fP=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(xT),dP=zT(fP),hP=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(xT),pP=zT(hP),gP=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(xT),mP=zT(gP),yP=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(xT),vP=zT(yP),bP=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(xT),xP=zT(bP),wP=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(xT),MP=zT(wP),OP=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(xT),EP=zT(OP),kP=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(xT),SP=zT(kP),AP=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(xT),_P=zT(AP),TP=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(xT),PP=zT(TP),CP=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(xT),NP=zT(CP),LP=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(xT),jP=zT(LP),RP=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(xT),IP=zT(RP),BP=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(xT),DP=zT(BP),FP=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(xT),zP=zT(FP);var GP=FT(zl(300,.5,0),zl(-240,.5,1)),WP=FT(zl(-100,.75,.35),zl(80,1.5,.8)),$P=FT(zl(260,.75,.35),zl(80,1.5,.8)),HP=zl();var VP=yl(),YP=Math.PI/3,UP=2*Math.PI/3;function qP(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var XP=qP(xT("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),ZP=qP(xT("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),KP=qP(xT("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),QP=qP(xT("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),JP=Object.freeze({__proto__:null,schemeCategory10:wT,schemeAccent:MT,schemeDark2:OT,schemeObservable10:ET,schemePaired:kT,schemePastel1:ST,schemePastel2:AT,schemeSet1:_T,schemeSet2:TT,schemeSet3:PT,schemeTableau10:CT,interpolateBrBG:WT,schemeBrBG:GT,interpolatePRGn:HT,schemePRGn:$T,interpolatePiYG:YT,schemePiYG:VT,interpolatePuOr:qT,schemePuOr:UT,interpolateRdBu:ZT,schemeRdBu:XT,interpolateRdGy:QT,schemeRdGy:KT,interpolateRdYlBu:tP,schemeRdYlBu:JT,interpolateRdYlGn:nP,schemeRdYlGn:eP,interpolateSpectral:iP,schemeSpectral:rP,interpolateBuGn:aP,schemeBuGn:oP,interpolateBuPu:cP,schemeBuPu:sP,interpolateGnBu:uP,schemeGnBu:lP,interpolateOrRd:dP,schemeOrRd:fP,interpolatePuBuGn:pP,schemePuBuGn:hP,interpolatePuBu:mP,schemePuBu:gP,interpolatePuRd:vP,schemePuRd:yP,interpolateRdPu:xP,schemeRdPu:bP,interpolateYlGnBu:MP,schemeYlGnBu:wP,interpolateYlGn:EP,schemeYlGn:OP,interpolateYlOrBr:SP,schemeYlOrBr:kP,interpolateYlOrRd:_P,schemeYlOrRd:AP,interpolateBlues:PP,schemeBlues:TP,interpolateGreens:NP,schemeGreens:CP,interpolateGreys:jP,schemeGreys:LP,interpolatePurples:IP,schemePurples:RP,interpolateReds:DP,schemeReds:BP,interpolateOranges:zP,schemeOranges:FP,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:GP,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return HP.h=360*t-100,HP.s=1.5-1.5*e,HP.l=.8-.9*e,HP+""},interpolateWarm:WP,interpolateCool:$P,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,VP.r=255*(e=Math.sin(t))*e,VP.g=255*(e=Math.sin(t+YP))*e,VP.b=255*(e=Math.sin(t+UP))*e,VP+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:XP,interpolateMagma:ZP,interpolateInferno:KP,interpolatePlasma:QP});function tC(t,e,n,r,i,o){const{guide:a={}}=n,s=function(t,e,n){const{type:r,domain:i,range:o,quantitative:a,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return mC(t,Tr)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return fC(t,s);if(void 0!==i)return pC([i])?fC(t,s):gC(e)?"time":dC(t,o,a);return pC(e)?fC(t,s):gC(e)?"time":dC(t,o,a)}(t,e,n);if("string"!=typeof s)return n;const c=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return hC(function(t,e){const{zero:n=!1}=e;let r=1/0,i=-1/0;for(const e of t)for(const t of e)Or(t)&&(r=Math.min(r,+t),i=Math.max(i,+t));return r===1/0?[]:n?[Math.min(0,r),i]:[r,i]}(n,r),r);case"band":case"ordinal":case"point":return function(t){return Array.from(new Set(t.flat()))}(n);case"quantile":return function(t){return t.flat().sort()}(n);case"sequential":return hC(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)Or(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),l=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(sC({type:t}))return function(t,e,n){const r=t.map(Number),i=new ia({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map((t=>new Date(i.map(t)))):t.map((t=>i.map(t)))}(e,r,t);return cC({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,c,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=Ao,nice:r=!1,tickCount:i=5}=e;return Object.assign(Object.assign({},e),{interpolate:n,nice:r,tickCount:i})}(0,r);case"band":case"point":return function(t,e,n,r){if(void 0!==r.padding||void 0!==r.paddingInner||void 0!==r.paddingOuter)return Object.assign(Object.assign({},r),{unknown:NaN});const i=function(t,e,n){return"enterDelay"===e||"enterDuration"===e||"size"===e?0:"band"===t?vT(n)?0:.1:"point"===t?.5:0}(t,e,n),{paddingInner:o=i,paddingOuter:a=i}=r;return Object.assign(Object.assign({},r),{paddingInner:o,paddingOuter:a,padding:i,unknown:NaN})}(t,e,i,r);case"sequential":return function(t){const{palette:e="ylGnBu",offset:n}=t,r=W(e),i=JP[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(s,t,0,n,r)),{domain:l,range:lC(s,t,e,n,l,i,o),expectedDomain:c,guide:a,name:t,type:s})}function eC(t,e){const n={};for(const r of t){const{values:t,name:i}=r,o=e[i];for(const e of t){const{name:t,value:r}=e;n[t]=r.map((t=>o.map(t)))}}return n}function nC(t,e){const n=Object.keys(t);for(const r of Object.values(e)){const{name:e}=r.getOptions();if(e in t){const i=n.filter((t=>t.startsWith(e))).map((t=>+(t.replace(e,"")||0))),o=cr(i)+1,a=`${e}${o}`;t[a]=r,r.getOptions().key=a}else t[e]=r}return t}function rC(t,e){const[n]=dT("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[vr,vr];let e,n;return[r=>{var i;e=r.map.bind(r),n=null===(i=r.invert)||void 0===i?void 0:i.bind(r);const o=t.filter((([t])=>"function"==typeof t)),a=t.filter((([t])=>"function"!=typeof t)),s=new Map(a);if(r.map=t=>{for(const[e,n]of o)if(e(t))return n;return s.has(t)?s.get(t):e(t)},!n)return r;const c=new Map(a.map((([t,e])=>[e,t]))),l=new Map(o.map((([t,e])=>[e,t])));return r.invert=t=>l.has(t)?t:c.has(t)?c.get(t):n(t),r},t=>(null!==e&&(t.map=e),null!==n&&(t.invert=n),t)]}(r);return i(n(t))}function iC(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));aC(e,"x"),aC(e,"y")}function oC(t){const{channels:e=[],type:n,scale:r={}}=t,i=["shape","color","opacity","size"];return 0!==e.length?e:"axisX"===n?["x"]:"axisY"===n?["y"]:"legends"===n?Object.keys(r).filter((t=>i.includes(t))):[]}function aC(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(sC)?zn(r):n.every(cC)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function sC(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function cC(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function lC(t,e,n,r,i,o,a){const{range:s}=r;if("string"==typeof s)return function(t){return t.split("-")}(s);if(void 0!==s)return s;const{rangeMin:c,rangeMax:l}=r;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":{const t=uC(n,r,i,o,a),[s,u]=function(t,e){return"enterDelay"===t?[0,1e3]:"enterDuration"==t?[300,1e3]:t.startsWith("y")||t.startsWith("position")?[1,0]:"color"===t?[jr(e),Rr(e)]:"opacity"===t?[0,1]:"size"===t?[1,10]:[0,1]}(e,t);return[null!=c?c:s,null!=l?l:u]}case"band":case"point":return[null!=c?c:"size"===e?5:0,null!=l?l:"size"===e?10:1];case"ordinal":return uC(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function uC(t,e,n,r,i){const[o]=dT("palette",i),{category10:a,category20:s}=r,c=function(t){return Array.from(new Set(t))}(t.flat()).length<=a.length?a:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return o({type:l})}catch(t){const e=function(t,e,n=t=>t){if(!t)return null;const r=W(t),i=JP[`scheme${r}`],o=JP[`interpolate${r}`];if(!i&&!o)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map(((t,r)=>o(n(r/e.length))))}(l,n,u);if(e)return e;throw new Error(`Unknown Component: ${l} `)}}function fC(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function dC(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function hC(t,e){if(0===t.length)return t;const{domainMin:n,domainMax:r}=e,[i,o]=t;return[null!=n?n:i,null!=r?r:o]}function pC(t){return mC(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function gC(t){return mC(t,(t=>t instanceof Date))}function mC(t,e){for(const n of t)if(n.some(e))return!0;return!1}const yC={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},vC={threshold:"threshold",quantize:"quantize",quantile:"quantile"},bC={ordinal:"ordinal",band:"band",point:"point"},xC={constant:"constant"};function wC(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=dT("component",n),a=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=dT("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?yT(n)?`${e}Y`:`${e}X`:"y"===t?yT(n)?`${e}X`:`${e}Y`:null}(e,t,i);if(!o||!a)return;const{props:s}=r(a),{defaultPosition:c,defaultSize:l,defaultOrder:u,defaultCrossPadding:[f]}=s;return Object.assign(Object.assign({position:c,defaultSize:l,order:u,type:a,crossPadding:f},o),{scales:[n]})}return e.filter((t=>t.slider||t.scrollbar)).flatMap((t=>{const{slider:e,scrollbar:n,name:r}=t;return[o("slider",r,t,e),o("scrollbar",r,t,n)]})).filter((t=>!!t))}(e,t,n);if(s.push(...c),i){const{props:t}=o("title"),{defaultPosition:e,defaultOrientation:n,defaultOrder:r,defaultSize:a,defaultCrossPadding:c}=t,l="string"==typeof i?{title:i}:i;s.push(Object.assign({type:"title",position:e,orientation:n,order:r,crossPadding:c[0],defaultSize:a},l))}const l=function(t,e){const n=t.filter((t=>function(t){if(!t||!t.type)return!1;if("function"==typeof t.type)return!0;const{type:e,domain:n,range:r,interpolator:i}=t,o=n&&n.length>0,a=r&&r.length>0;return!!(["linear","sqrt","log","time","pow","threshold","quantize","quantile","ordinal","band","point"].includes(e)&&o&&a)||!(!["sequential"].includes(e)||!o||!a&&!i)||!(!["constant","identity"].includes(e)||!a)}(t)));return[...EC(n),...SC(n,e)]}(a,r);return l.forEach((([t,e])=>{const{props:n}=o(t),{defaultPosition:i,defaultPlane:c="xy",defaultOrientation:l,defaultSize:u,defaultOrder:f,defaultLength:d,defaultPadding:h=[0,0],defaultCrossPadding:p=[0,0]}=n,g=K({},...e),{guide:m,field:y}=g,v=Array.isArray(m)?m:[m];for(const n of v){const[o,g]=TC(t,i,l,n,e,a,r);if(!o&&!g)continue;const m="left"===o||"right"===o,v=m?h[1]:h[0],b=m?p[1]:p[0],{size:x,order:w=f,length:M=d,padding:O=v,crossPadding:E=b}=n;s.push(Object.assign(Object.assign({title:y},n),{defaultSize:u,length:M,position:o,plane:c,orientation:g,padding:O,order:w,crossPadding:E,size:x,type:t,scales:e}))}})),s}function MC(t,e,n,r,i){const[o]=dT("component",r),{scaleInstances:a,scale:s,bbox:c}=t,l={bbox:c,library:r};return o(Se(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:a,theme:n,value:l,scale:s})}function OC(t,e){const n=["left","right","bottom","top"],r=Yn(t,(({type:t,position:e,group:r})=>n.includes(e)?void 0===r?t.startsWith("legend")?`legend-${e}`:Symbol("independent"):"independent"===r?Symbol("independent"):r:Symbol("independent")));return r.flatMap((([,t])=>{if(1===t.length)return t[0];if(void 0!==e){const n=t.filter((t=>void 0!==t.length)).map((t=>t.length)),r=yr(n);if(r>e)return t.forEach((t=>t.group=Symbol("independent"))),t;const i=(e-r)/(t.length-n.length);t.forEach((t=>{void 0===t.length&&(t.length=i)}))}const n=cr(t,(t=>t.size)),r=cr(t,(t=>t.order)),i=cr(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function EC(t,e){const n=["shape","size","color","opacity"],r=t.filter((({type:t,name:e})=>"string"==typeof t&&n.includes(e)&&!((t,e)=>"constant"===t&&"size"===e)(t,e))),i=r.filter((({type:t})=>"constant"===t)),o=Yn(r.filter((({type:t})=>"constant"!==t)),(t=>t.field?t.field:Symbol("independent"))).map((([t,e])=>[t,[...e,...i]])).filter((([,t])=>t.some((t=>"constant"!==t.type)))),a=new Map(o);if(0===a.size)return[];const s=t=>t.sort((([t],[e])=>t.localeCompare(e))),c=Array.from(a).map((([,t])=>{const e=function(t){if(1===t.length)return[t];const e=[];for(let n=1;n<=t.length;n++)e.push(...Br(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,kC(t)]))})));for(const{option:t,combination:e}of n)if(!t.every((t=>"constant"===t[1]))&&t.every((t=>"discrete"===t[1]||"constant"===t[1])))return["legendCategory",e];for(const[t,e]of gA)for(const{option:r,combination:i}of n)if(e.some((t=>tt(s(t),s(r)))))return[t,i];return null})).filter(Or);return c}function kC(t){const{type:e}=t;return"string"!=typeof e?null:e in yC?"continuous":e in bC?"discrete":e in vC?"distribution":e in xC?"constant":null}function SC(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return gT(t,"helix").length>0}(e)||vT(e))return null;if(yT(e)&&(mT(e)||bT(e)))return null;if(n.startsWith("x"))return mT(e)?["axisArc",[t]]:bT(e)?["axisLinear",[t]]:[yT(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return mT(e)?["axisLinear",[t]]:bT(e)?["axisArc",[t]]:[yT(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(function(t){return gT(t,"radar").length>0}(e))return["axisRadar",[t]];if(!mT(e))return["axisY",[t]]}return null})).filter(Or)}function AC(t){const e=gT(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=gT(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=a(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function _C(t,e,n,r,i){const{name:o}=n[0];if("axisRadar"===t){const t=r.filter((t=>t.name.startsWith("position"))),e=function(t){const e=/position(\d*)/g.exec(t);return e?+e[1]:null}(o);if(o===t.slice(-1)[0].name||null===e)return[null,null];const[n,a]=AC(i);return["center",(a-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return gT(t,"parallel").length>0}(i))return yT(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=AC(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:mT(i)||bT(i)?["center",null]:"axisX"===t&&function(t){return gT(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return gT(t,"reflectY").length>0}(i)?["top",null]:e}function TC(t,e,n,r,i,o,a){const[s]=AC(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?_C(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&mT(a)&&"center"===r.position?["center","vertical"]:c}function PC(t,e,n,r,i,o){const{type:a}=t;if(!["left","right","bottom","top"].includes(r))return;if("string"!=typeof a)return;const s=a;return(s.startsWith("axis")?RC:s.startsWith("group")?CC:s.startsWith("legendContinuous")?IC:"legendCategory"===s?BC:s.startsWith("slider")?jC:"title"===s?LC:s.startsWith("scrollbar")?NC:()=>{})(t,e,n,r,i,o)}function CC(t,e,n,r,i,o){const{children:a}=t,s=cr(a,(t=>t.crossPadding));a.forEach((t=>t.crossPadding=s)),a.forEach((t=>PC(t,e,n,r,i,o)));const c=cr(a,(t=>t.size));t.size=c,a.forEach((t=>t.size=c))}function NC(t,e,n,r,i,o){const{trackSize:a=6}=K({},i.scrollbar,t);t.size=a}function LC(t,e,n,r,i,o){const a=K({},i.title,t),{title:s,subtitle:c,spacing:l=0}=a,u=Se(a,["title","subtitle","spacing"]);if(s){const e=$C(s,kr(u,"title"));t.size=e.height}if(c){const e=$C(c,kr(u,"subtitle"));t.size+=l+e.height}}function jC(t,e,n,r,i,o){const{trackSize:a,handleIconSize:s}=(()=>{const{slider:e}=i;return K({},e,t)})(),c=Math.max(a,2.4*s);t.size=c}function RC(t,e,n,r,i,o){var a;t.transform=t.transform||[{type:"hide"}];const s="left"===r||"right"===r,c=GC(t,r,i),{tickLength:l=0,labelSpacing:u=0,titleSpacing:f=0,labelAutoRotate:d}=c,h=Se(c,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),p=DC(t,o),g=FC(h,p),m=l+u;if(g&&g.length){const r=cr(g,(t=>t.width)),i=cr(g,(t=>t.height));if(s)t.size=r+m;else{const{tickFilter:o,labelTransform:s}=t;!function(t,e,n,r,i){const o=yr(e,(t=>t.width));if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=WC(t,i),c=s.map((t=>a.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(a,t))),l=s.map(((t,e)=>e)),u=-r[0],f=n+r[1],d=(t,e)=>{const{width:n}=e;return[t-n/2,t+n/2]};for(let t=0;t<l.length;t++){const n=c[t],[r,i]=d(n,e[t]);if(r<u||i>f)return!0;const o=c[t+1];if(o){const[n]=d(o,e[t+1]);if(i>n)return!0}}return!1}(p,g,e,n,o)||s||!1===d||null===d?(t.labelTransform=null!==(a=t.labelTransform)&&void 0!==a?a:"rotate(0)",t.size=i+m):(t.labelTransform="rotate(90)",t.size=r+m)}}else t.size=l;const y=zC(h);y&&(t.size+=s?f+y.width:f+y.height)}function IC(t,e,n,r,i,o){const a=(()=>{const{legendContinuous:e}=i;return K({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=a,l=Se(a,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=kr(l,"ribbon"),{size:d}=f,h=kr(l,"handleIcon"),{size:p}=h,g=Math.max(d,2.4*p);t.size=g;const m=FC(l,DC(t,o));if(m){const e=u?"width":"height",n=cr(m,(t=>t[e]));t.size+=n+s}const y=zC(l);y&&(u?t.size=Math.max(t.size,y.width):t.size+=c+y.height)}function BC(t,e,n,r,i,o){const a=(()=>{const{legendCategory:e}=i,{title:n}=t,[r,o]=Array.isArray(n)?[n,void 0]:[void 0,n];return K({title:r},e,Object.assign(Object.assign({},t),{title:o}))})(),{itemSpacing:s,itemMarkerSize:c,titleSpacing:l,rowPadding:u,colPadding:f,maxCols:d=1/0,maxRows:h=1/0}=a,p=Se(a,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:m}=t,y=t=>Math.min(t,h),v=t=>Math.min(t,d),b="left"===r||"right"===r,x=void 0===m?e+(b?0:n[0]+n[1]):m,w=zC(p),M=FC(p,DC(t,o),"itemLabel"),O=Math.max(M[0].height,c)+u,E=(t,e=0)=>c+t+s[0]+e;b?(()=>{let e=-1/0,n=0,r=1,i=0,o=-1/0,a=-1/0;const s=w?w.height:0,c=x-s;for(const{width:t}of M){const s=E(t,f);e=Math.max(e,s),n+O>c?(r++,o=Math.max(o,i),a=Math.max(a,n),i=1,n=O):(n+=O,i++)}r<=1&&(o=i,a=n),t.size=e*v(r),t.length=a+s,K(t,{cols:v(r),gridRow:o})})():"number"==typeof g?(()=>{const e=Math.ceil(M.length/g),n=cr(M,(t=>E(t.width)))*g;t.size=O*y(e)-u,t.length=Math.min(n,x)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of M){const i=E(t,f);n+i>x?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=O*y(e)-u,t.length=r})(),w&&(b?t.size=Math.max(t.size,w.width):t.size+=l+w.height)}function DC(t,e){const[n]=dT("scale",e),{scales:r,tickCount:i,tickMethod:o}=t,a=r.find((t=>"constant"!==t.type&&"identity"!==t.type));return void 0!==i&&(a.tickCount=i),void 0!==o&&(a.tickMethod=o),n(a)}function FC(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=Se(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=function(t,e,n){const r=WC(t,n),i=r.map((t=>"number"==typeof t?Tm(t):t)),o=e?"string"==typeof e?LE(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(o)}(e,r,i),c=kr(a,n),l=s.map(((t,e)=>Object.fromEntries(Object.entries(c).map((([n,r])=>[n,"function"==typeof r?r(t,e):r]))))),u=s.map(((t,e)=>$C(t,l[e]))),f=l.some((t=>t.transform));if(!f){const e=s.map(((t,e)=>e));t.indexBBox=new Map(e.map((t=>[t,[s[t],u[t]]])))}return u}function zC(t){const{title:e}=t,n=Se(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=kr(n,"title"),{direction:i,transform:o}=r,a=Array.isArray(e)?e.join(","):e;if("string"!=typeof a)return null;return $C(a,Object.assign(Object.assign({},r),{transform:o||("vertical"===i?"rotate(-90)":"")}))}function GC(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${xr(e)}`]:s}=n;return K({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function WC(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function $C(t,e){const n=function(t){return t instanceof Up?t:new og({style:{text:`${t}`}})}(t),r=Se(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function HC(t,e,n,r){var i,o;const{width:a,height:s,depth:c,x:l=0,y:u=0,z:f=0,inset:d=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:h=d,insetTop:p=d,insetBottom:g=d,insetRight:m=d,margin:y=(null!==(o=n.margin)&&void 0!==o?o:0),marginLeft:v=y,marginBottom:b=y,marginTop:x=y,marginRight:w=y,padding:M=n.padding,paddingBottom:O=M,paddingLeft:E=M,paddingRight:k=M,paddingTop:S=M}=function(t,e,n,r){const{coordinates:i}=e;if(!mT(i)&&!bT(i))return e;const o=t.filter((t=>"string"==typeof t.type&&t.type.startsWith("axis")));if(0===o.length)return e;const a=o.map((t=>GC(t,"axisArc"===t.type?"arc":"linear",n))),s=cr(a,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=o.flatMap(((t,e)=>FC(a[e],DC(t,r)))).filter(Or),l=cr(c,(t=>t.height))+s,u=o.flatMap(((t,e)=>zC(a[e]))).filter((t=>null!==t)),f=0===u.length?0:cr(u,(t=>t.height)),{inset:d=l,insetLeft:h=d,insetBottom:p=d,insetTop:g=d+f,insetRight:m=d}=e;return Object.assign(Object.assign({},e),{insetLeft:h,insetBottom:p,insetTop:g,insetRight:m})}(t,e,n,r),A=(t,n,r,i,o)=>{const{marks:a}=e;if(0===a.length)return[i,o];if(t-i-o-.25*t>0)return[i,o];const s=.75*t;return["auto"===n?s*i/(i+o):i,"auto"===r?s*o/(i+o):o]},_=t=>"auto"===t?20:null!=t?t:20,T=_(S),P=_(O),C=VC(t,s-T-P,[T+x,P+b],["left","right"],e,n,r),{paddingLeft:N,paddingRight:L}=C,j=a-v-w,[R,I]=A(j,E,k,N,L),B=j-R-I,D=VC(t,B,[R+v,I+w],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=D,G=s-b-x,[W,$]=A(G,O,S,z,F);return{width:a,height:s,depth:c,insetLeft:h,insetTop:p,insetBottom:g,insetRight:m,innerWidth:B,innerHeight:G-W-$,paddingLeft:R,paddingRight:I,paddingTop:$,paddingBottom:W,marginLeft:v,marginBottom:b,marginTop:x,marginRight:w,x:l,y:u,z:f}}function VC(t,e,n,r,i,o,a){const s=Vn(t,(t=>t.position)),{padding:c=o.padding,paddingLeft:l=c,paddingRight:u=c,paddingBottom:f=c,paddingTop:d=c}=i,h={paddingBottom:f,paddingLeft:l,paddingTop:d,paddingRight:u};for(const t of r){const r=`padding${xr(nM(t))}`,i=s.get(t)||[],c=h[r],l=t=>{void 0===t.size&&(t.size=t.defaultSize)},u=t=>{"group"===t.type?(t.children.forEach(l),t.size=cr(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(PC(r,e,n,t,o,a),l(r)))},d=t=>{t.type.startsWith("axis")&&void 0===t.labelAutoHide&&(t.labelAutoHide=!0)},p="bottom"===t||"top"===t,g=ur(i,(t=>t.order)),m=i.filter((t=>t.type.startsWith("axis")&&t.order==g));if(m.length&&(m[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(d);else if(0===i.length)h[r]=0;else{const t=OC(i,p?e+n[0]+n[1]:e);t.forEach(f);const o=t.reduce(((t,{size:e,crossPadding:n=12})=>t+e+n),0);h[r]=o}}return h}function YC({width:t,height:e,paddingLeft:n,paddingRight:r,paddingTop:i,paddingBottom:o,marginLeft:a,marginTop:s,marginBottom:c,marginRight:l,innerHeight:u,innerWidth:f,insetBottom:d,insetLeft:h,insetRight:p,insetTop:g}){const m=n+a,y=i+s,v=r+l,b=o+c,x=t-a-l,w=[m+h,y+g,f-h-p,u-g-d,"center",null,null];return{top:[m,0,f,y,"vertical",!0,_n,a,x],right:[t-v,y,v,u,"horizontal",!1,_n],bottom:[m,e-b,f,b,"vertical",!1,_n,a,x],left:[0,y,m,u,"horizontal",!0,_n],"top-left":[m,0,f,y,"vertical",!0,_n],"top-right":[m,0,f,y,"vertical",!0,_n],"bottom-left":[m,e-b,f,b,"vertical",!1,_n],"bottom-right":[m,e-b,f,b,"vertical",!1,_n],center:w,inner:w,outer:w}}function UC(t,e,n,r){const[i,o]=Ir(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return Gc(t)&&Dc(t)}(e)?function(t,e,n,r){const[i,o,a,s]=n;for(const e of t)e.bbox={x:i,y:o,width:a,height:s},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):Dc(e)?function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n):Gc(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==1)).map((t=>t+i));for(let e=0;e<t.length;e++){const n=t[e],i=c[e],a=c[e+1]-i;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==0)).map((t=>t+r));for(let e=0;e<t.length;e++){const n=t[e],r=c[e],a=c[e+1]-r;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,o]=n,[a,s]=e.getCenter(),[c]=Hc(e),l=c*(o/2),u=a-l,f=s-l;for(let e=0;e<t.length;e++){t[e].bbox={x:r+u,y:i+f,width:2*l,height:2*l}}}(t,e,n):"outer"===r&&function(t,e,n){const[r,i,o,a]=n;for(const e of t)e.bbox={x:r,y:i,width:o,height:a}}(t,0,n)}(i,e,n,r),function(t,e,n){if(0===t.length)return;const[r,i,o,a]=n,[s]=Hc(e),c=a/2*s/Math.sqrt(2),l=r+o/2,u=i+a/2;for(let e=0;e<t.length;e++){t[e].bbox={x:l-c,y:u-c,width:2*c,height:2*c}}}(o,e,n)}function qC(t,e,n){const[r,i,o,a,s,c,l,u,f]=n,[d,h,p,g,m,y,v,b]="vertical"===s?["y",i,"x",r,"height",a,"width",o]:["x",r,"y",i,"width",o,"height",a];t.sort(((t,e)=>null==l?void 0:l(t.order,e.order)));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),w=(t,e,n)=>void 0===n?e:x(t)?n:e,M=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?h+y:h;e<t.length;e++){const r=t[e],{crossPadding:i=0,type:o}=r,{size:a}=r;r.bbox={[d]:c?n-a-i:n+i,[p]:M(o,g,u),[m]:a,[v]:w(o,b,f)},n+=(a+i)*(c?-1:1)}const O=t.filter((t=>"group"===t.type));for(const t of O){const{bbox:e,children:n}=t,r=e[v],i=r/n.length,o=n.reduce(((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t}),"flex-start"),a=n.map(((t,e)=>{const{length:r=i,padding:o=0}=t;return r+(e===n.length-1?0:o)})),s=r-yr(a),c="flex-start"===o?0:"center"===o?s/2:s;for(let t=0,r=e[p]+c;t<n.length;t++){const i=n[t],{padding:s=0}=i,c=t===n.length-1?0:s;i.bbox={[m]:e[m],[d]:e[d],[p]:r,[v]:a[t]-c},K(i,{layout:{justifyContent:o}}),r+=a[t]}}}function XC(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=Se(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function ZC(t,e,n){return _e(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=dT("data",t),o=function(t){if(j(t))return{type:"inline",value:t};if(!t)return{type:"inline",value:null};if(Array.isArray(t))return{type:"inline",value:t};const{type:e="inline"}=t,n=Se(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:a=[]}=o,s=[Se(o,["transform"]),...a].map((t=>i(t,n))),c=yield function(t){return t.reduce(((t,e)=>n=>_e(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),vr)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?Lr(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function KC(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i={};for(const[t,e]of Object.entries(r))if(Array.isArray(e))for(let n=0;n<e.length;n++){i[`${t}${0===n?"":n}`]=e[n]}else i[t]=e;return[t,Object.assign(Object.assign({},e),{encode:i})]}function QC(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=Nr(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return Or(e)}(t))return t;const e=function(t,e){return"function"==typeof e?"transform":"string"==typeof e&&function(t,e){return!!Array.isArray(t)&&t.some((t=>void 0!==t[e]))}(t,e)?"field":"constant"}(i,t);return{type:e,value:t}}));return[t,Object.assign(Object.assign({},e),{encode:o})]}function JC(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=Nr(r,((t,e)=>{const{type:n}=t;return"constant"!==n||function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||"enterDelay"===t||"enterDuration"===t||"updateDelay"===t||"updateDuration"===t||"exitDelay"===t||"exitDuration"===t}(e)?t:Object.assign(Object.assign({},t),{constant:!0})}));return[t,Object.assign(Object.assign({},e),{encode:i})]}function tN(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=dT("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:sN(n)})}(o),s=Nr(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function eN(t,e,n){const{tooltip:r={}}=e;return Pr(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:Tr(r)&&function(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function nN(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(Pr(o))return[t,e];const a=e=>{if(!e)return e;if("string"==typeof e)return t.map((t=>({name:e,value:r[t][e]})));if(Tr(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:c=t=>t}=e,l="string"==typeof c?LE(c):c,u=o&&i[o],f=u&&i[o].field,d=s||f||o,h=[];for(const e of t){const t=n?r[e][n]:u?i[o].value[e]:null;h[e]={name:d,color:a,value:l(t)}}return h}if("function"==typeof e){const n=[];for(const o of t){const t=e(r[o],o,r,i);Tr(t)?n[o]=t:n[o]={value:t}}return n}return e},{title:s,items:c=[]}=o,l=Se(o,["title","items"]),u=Object.assign({title:a(s),items:Array.isArray(c)?c.map(a):[]},l);return[t,Object.assign(Object.assign({},e),{tooltip:u})]}function rN(t,e,n){const{encode:r}=e,i=Se(e,["encode"]);if(!r)return[t,e];const o=Object.entries(r),a=o.filter((([,t])=>{const{value:e}=t;return Array.isArray(e[0])})).flatMap((([e,n])=>{const r=[[e,new Array(t.length).fill(void 0)]],{value:i}=n,o=Se(n,["value"]);for(let n=0;n<i.length;n++){const o=i[n];if(Array.isArray(o))for(let i=0;i<o.length;i++){const a=r[i]||[`${e}${i}`,new Array(t).fill(void 0)];a[1][n]=o[i],r[i]=a}}return r.map((([t,e])=>[t,Object.assign({type:"column",value:e},o)]))})),s=Object.fromEntries([...o,...a]);return[t,Object.assign(Object.assign({},i),{encode:s})]}function iN(t,e,n){const{axis:r={},legend:i={},slider:o={},scrollbar:a={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y","z",...Object.keys(r)])):["x","y","z"];return K(e,{scale:Object.assign(Object.assign({},Object.fromEntries(c.map((t=>{const e=s(a,t);return[t,Object.assign({guide:s(r,t),slider:s(o,t),scrollbar:e},e&&{ratio:void 0===e.ratio?.5:e.ratio})]})))),{color:{guide:s(i,"color")},size:{guide:s(i,"size")},shape:{guide:s(i,"shape")},opacity:{guide:s(i,"opacity")}})}),[t,e]}function oN(t,e,n){const{animate:r}=e;return r||void 0===r||K(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function aN(t,e,n){return _e(this,void 0,void 0,(function*(){const[r,i]=yield function(t,e,n){return _e(this,void 0,void 0,(function*(){const{library:r}=n,[i]=dT("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[XC,ZC,KC,QC,JC,tN,rN,oN,iN,eN,...o.map(i),...s.map(i),...a.map(i),nN];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]}))}(t,e,n),{encode:o,scale:a,data:s,tooltip:c}=i;if(!1===Array.isArray(s))return null;const{channels:l}=e,u=qn(Object.entries(o).filter((([,t])=>Or(t))),(t=>t.map((([t,e])=>Object.assign({name:t},e)))),(([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=l.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),f=l.filter((t=>{const{name:e,required:n}=t;if(u.find((([t])=>t===e)))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1})).flatMap((t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:o,ordinal:s}=t;return u.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const l=e.some((t=>t.visual)),u=e.some((t=>t.constant)),f=a[t]||{},{independent:d=!1,key:h=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=Se(f,["independent","key","type"]),m="constant"===p,y=m?void 0:i;return{name:t,values:e,scaleKey:d||m?Symbol("independent"):h,scale:Object.assign(Object.assign({type:p,range:y},g),{quantitative:o,ordinal:s})}}))}));return[i,Object.assign(Object.assign({},e),{index:r,channels:f,tooltip:c})]}))}function sN(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function cN(t,e,n){var r;return _e(this,void 0,void 0,(function*(){const{library:i}=n,[o]=dT("composition",i),[a]=dT("interaction",i),s=new Set(Object.keys(i).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Or)),c=new Set(Object.keys(i).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Or)),l=t=>{const{type:e}=t;if("function"==typeof e){const{props:t={}}=e,{composite:n=!0}=t;if(n)return"mark"}return"string"!=typeof e?e:s.has(e)||c.has(e)?"mark":e},u=t=>"mark"===l(t),f=t=>"standardView"===l(t),d=t=>{const{type:e}=t;return"string"==typeof e&&!!c.has(e)},h=t=>{if(f(t))return[t];const e=l(t);return o({type:e,static:d(t)})(t)},p=[],g=new Map,m=new Map,y=[t],v=[];for(;y.length;){const t=y.shift();if(f(t)){const e=m.get(t),[r,o]=e?pN(e,t,i):yield fN(t,n);g.set(r,t),p.push(r);const a=o.flatMap(h).map((t=>pT(t,i)));if(y.push(...a),a.every(f)){const t=yield Promise.all(a.map((t=>dN(t,n))));iC(t);for(let e=0;e<a.length;e++){const n=a[e],r=t[e];m.set(n,r)}}}else{const e=h(u(t)?t:yield TN(t,n));Array.isArray(e)?y.push(...e):"function"==typeof e&&v.push(e())}}n.emitter.emit(pA.BEFORE_PAINT);const b=new Map,x=new Map,M=[];e.selectAll(LN(sS)).data(p,(t=>t.key)).join((t=>t.append("g").attr("className",sS).attr("id",(t=>t.key)).call(lN).each((function(t,e,r){gN(t,Sm(r),M,n),b.set(t,r)}))),(t=>t.call(lN).each((function(t,e,r){gN(t,Sm(r),M,n),x.set(t,r)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const O=(t,e,r)=>Array.from(t.entries()).map((([i,o])=>{const a=r||new Map,s=g.get(i),c=function(t,e,n){const{library:r}=n,i=function(t){const[,e]=dT("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(r),o=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,a=_N(e),s=a.map(i).filter(o).map((t=>t[0]));return(e,r,i)=>_e(this,void 0,void 0,(function*(){const o=[],[a,c]=yield fN(e,n);gN(a,t,o,n);for(const i of s.filter((t=>t!==r)))uN(i,t,e,a,n);for(const e of c)cN(e,t,n);return i(),{options:e,view:a}}))}(Sm(o),s,n);return{view:i,container:o,options:s,setState:(t,e=t=>t)=>a.set(t,e),update:(n,r)=>_e(this,void 0,void 0,(function*(){const i=br(Array.from(a.values()))(s);return yield c(i,n,(()=>{w(r)&&e(t,r,a)}))}))}})),E=(t=x,e,r)=>{var i;const o=O(t,E,r);for(const t of o){const{options:r,container:s}=t,c=s.nameInteraction;let l=_N(r);e&&(l=l.filter((t=>e.includes(t[0]))));for(const e of l){const[r,s]=e,l=c.get(r);if(l&&(null===(i=l.destroy)||void 0===i||i.call(l)),s){const e=hN(t.view,r,s,a)(t,o,n.emitter);c.set(r,{destroy:e})}}}},k=O(b,E);for(const t of k){const{options:e}=t,r=new Map;t.container.nameInteraction=r;for(const i of _N(e)){const[e,o]=i;if(o){const i=hN(t.view,e,o,a)(t,k,n.emitter);r.set(e,{destroy:i})}}}E();const{width:S,height:A}=t,_=[];for(const t of v){const r=new Promise((r=>_e(this,void 0,void 0,(function*(){for(const r of t){const t=Object.assign({width:S,height:A},r);yield cN(t,e,n)}r()}))));_.push(r)}n.views=p,null===(r=n.animations)||void 0===r||r.forEach((t=>null==t?void 0:t.cancel())),n.animations=M,n.emitter.emit(pA.AFTER_PAINT);const T=M.filter(Or).map(EN).map((t=>t.finished));return Promise.all([...T,..._])}))}function lN(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function uN(t,e,n,r,i){var o;const{library:a}=i,[s]=dT("interaction",a),c=e.node().nameInteraction,l=_N(n).find((([e])=>e===t)),u=c.get(t);if(!u)return;if(null===(o=u.destroy)||void 0===o||o.call(u),!l[1])return;const f=hN(r,t,l[1],s),d={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},h=f(d,[],i.emitter);c.set(t,{destroy:h})}function fN(t,e){return _e(this,void 0,void 0,(function*(){const{library:n}=e,r=yield function(t,e){return _e(this,void 0,void 0,(function*(){const{library:n}=e,[r,i]=dT("mark",n),o=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Or)),{marks:a}=t,s=[],c=[],l=[...a],{width:u,height:f}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:o=r,paddingTop:a=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:d=c,inset:h=0,insetLeft:p=h,insetRight:g=h,insetTop:m=h,insetBottom:y=h}=t,v=t=>"auto"===t?20:t;return{width:n-v(i)-v(o)-l-u-p-g,height:e-v(a)-v(s)-f-d-m-y}}(t),d={options:t,width:u,height:f};for(;l.length;){const[t]=l.splice(0,1),n=yield TN(t,e),{type:a=wr("G2Mark type is required."),key:u}=n;if(o.has(a))c.push(n);else{const{props:t={}}=i(a),{composite:e=!0}=t;if(e){const{data:t}=n,e=Object.assign(Object.assign({},n),{data:t?Array.isArray(t)?t:t.value:t}),i=yield r(e,d),o=Array.isArray(i)?i:[i];l.unshift(...o.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else s.push(n)}}return Object.assign(Object.assign({},t),{marks:s,components:c})}))}(t,e),i=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=Se(t,["coordinate","interaction","style","marks"]),a=i.map((t=>t.coordinate||{})),s=i.map((t=>t.interaction||{})),c=i.map((t=>t.viewStyle||{})),l=[...a,e].reduceRight(((t,e)=>K(t,e)),{}),u=[n,...s].reduce(((t,e)=>K(t,e)),{}),f=[...c,r].reduce(((t,e)=>K(t,e)),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:l,interaction:u,style:f})}(r);t.interaction=i.interaction,t.coordinate=i.coordinate,t.marks=[...i.marks,...i.components];const o=pT(i,n);return pN(yield dN(o,e),o,n)}))}function dN(t,e){return _e(this,void 0,void 0,(function*(){const{library:n}=e,[r]=dT("theme",n),[,i]=dT("mark",n),{theme:o,marks:a,coordinates:s=[]}=t,c=r(AN(o)),l=new Map;for(const t of a){const{type:n}=t,{props:r={}}=i(n),o=yield aN(t,r,e);if(o){const[t,e]=o;l.set(t,e)}}const u=Vn(Array.from(l.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of u.values()){const e=t.reduce(((t,{scale:e})=>K(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],o=Array.from(new Set(i.map((t=>t.field)).filter(Or))),a=K({guide:{title:0===o.length?void 0:o},field:o[0]},e),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},tC(l,u,a,s,c,n)),{key:r});t.forEach((t=>t.scale=f))}return l}))}function hN(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(K(o,Object.assign({type:e},n)))}function pN(t,e,n){const[r]=dT("mark",n),[i]=dT("theme",n),[o]=dT("labelTransform",n),{key:a,frame:s=!1,theme:c,clip:l,style:u={},labelTransform:f=[]}=e,d=i(AN(c)),h=Array.from(t.values()),p=function(t,e){var n;const{components:r=[]}=e,i=["scale","encode","axis","legend","data","transform"],o=Array.from(new Set(t.flatMap((t=>t.channels.map((t=>t.scale)))))),a=new Map(o.map((t=>[t.name,t])));for(const t of r){const e=oC(t);for(const r of e){const e=a.get(r),s=(null===(n=t.scale)||void 0===n?void 0:n[r])||{},{independent:c=!1}=s;if(e&&!c){const{guide:n}=e,r="boolean"==typeof n?{}:n;e.guide=K({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:it(t,i)});o.push(e)}}}return o}(h,e),g=function(t){return t.map((t=>{const e=K(t,t.style);return delete e.style,e}))}(wC(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter((t=>"shape"!==t.name));if(1!==e.length||t.some((t=>"shape"===t.name)))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const o={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},a=(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,s={field:a,name:"shape",type:"constant",domain:[],range:[o[i]]};return[...t,s]}(Array.from(p),h,t),e,n)),m=HC(g,e,d,n),y=function(t,e,n){const[r]=dT("coordinate",n),{innerHeight:i,innerWidth:o,insetLeft:a,insetTop:s,insetRight:c,insetBottom:l}=t,{coordinates:u=[]}=e,f=(d=u).find((t=>"cartesian"===t.type||"cartesian3D"===t.type))?d:[...d,{type:"cartesian"}];var d;const h="cartesian3D"===f[0].type,p=Object.assign(Object.assign({},t),{x:a,y:s,width:o-a-c,height:i-l-s,transformations:f.flatMap(r)});return h?new A_(p):new O_(p)}(m,e,n),v=s?K({mainLineWidth:1,mainStroke:"#000"},u):u;!function(t,e,n){const r=Vn(t,(t=>`${t.plane||"xy"}-${t.position}`)),{paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:d,innerWidth:h,insetBottom:p,insetLeft:g,insetRight:m,insetTop:y,height:v,width:b,depth:x}=n,w={xy:YC({width:b,height:v,paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:d,innerWidth:h,insetBottom:p,insetLeft:g,insetRight:m,insetTop:y}),yz:YC({width:x,height:v,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:v,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:YC({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),o=w[r][i],[a,s]=Ir(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));a.length&&UC(a,e,o,i),s.length&&qC(n,0,o)}}(OC(g),y,m),function(t){const e=t.find((({type:t})=>"axisX"===t)),n=t.find((({type:t})=>"axisY"===t)),r=t.find((({type:t})=>"axisZ"===t));e&&n&&r&&(e.plane="xy",n.plane="xy",r.plane="yz",r.origin=[e.bbox.x,e.bbox.y,0],r.eulerAngles=[0,-90,0],r.bbox.x=e.bbox.x,r.bbox.y=e.bbox.y,t.push(Object.assign(Object.assign({},e),{plane:"xz",showLabel:!1,showTitle:!1,origin:[e.bbox.x,e.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},n),{plane:"yz",showLabel:!1,showTitle:!1,origin:[n.bbox.x+n.bbox.width,n.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},r),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]})))}(g);const b={};for(const t of g){const{scales:e=[]}=t,r=[];for(const t of e){const{name:e}=t,i=rC(t,n);r.push(i),"y"===e&&i.update(Object.assign(Object.assign({},i.getOptions()),{xScale:b.x})),nC(b,{[e]:i})}t.scaleInstances=r}const x=[];for(const[e,i]of t.entries()){const{children:t,dataDomain:o,modifier:s,key:c}=e,{index:l,channels:u,tooltip:f}=i,d=Object.fromEntries(u.map((({name:t,scale:e})=>[t,e]))),h=Nr(d,(t=>rC(t,n)));nC(b,h);const p=eC(u,h),g=r(e),[v,w,M]=mN(g(l,h,p,y)),O=o||v.length,E=s?s(w,O,m):[],k=t=>{var e,n;return null===(n=null===(e=f.title)||void 0===e?void 0:e[t])||void 0===n?void 0:n.value},S=t=>f.items.map((e=>e[t])),A=v.map(((t,e)=>{const n=Object.assign({points:w[e],transform:E[e],index:t,markKey:c,viewKey:a},f&&{title:k(t),items:S(t)});for(const[r,i]of Object.entries(p))n[r]=i[t],M&&(n[`series${W(r)}`]=M[e].map((t=>i[t])));return M&&(n.seriesIndex=M[e]),M&&f&&(n.seriesItems=M[e].map((t=>S(t))),n.seriesTitle=M[e].map((t=>k(t)))),n}));i.data=A,i.index=v;const _=null==t?void 0:t(A,h,m);x.push(..._||[])}return[{layout:m,theme:d,coordinate:y,markState:t,key:a,clip:l,scale:b,style:v,components:g,labelTransform:br(f.map(o))},x]}function gN(t,e,n,r){return _e(this,void 0,void 0,(function*(){const{library:i}=r,{components:o,theme:a,layout:s,markState:c,coordinate:l,key:u,style:f,clip:d,scale:h}=t,{x:p,y:g,width:m,height:y}=s,v=Se(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),w=b.map((t=>Sr(Object.assign({},a.view,f),t))),M=["a","margin","padding","inset"].map((t=>kr(v,t))),O=t=>t.style("x",(t=>_[t].x)).style("y",(t=>_[t].y)).style("width",(t=>_[t].width)).style("height",(t=>_[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(Sm(n),w[t])}));let E=0,k=0,S=m,A=y;const _=x.map((t=>{const e=M[t],{left:n=0,top:r=0,bottom:i=0,right:o=0}=e;return E+=n,k+=r,S-=n+o,A-=r+i,{x:E,y:k,width:S,height:A}}));e.selectAll(LN(fS)).data(x.filter((t=>Or(w[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",fS).style("zIndex",-2).call(O)),(t=>t.call(O)),(t=>t.remove()));const T=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:o}=i,{enter:a={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:d,duration:h=300,delay:p=0}=a,{type:g,duration:m=300,delay:y=0}=c;for(const t of o){const{updateType:r=l,updateDuration:i=u,updateDelay:o=f,enterType:a=d,enterDuration:s=h,enterDelay:c=p,exitDuration:v=m,exitDelay:b=y,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+o),n=Math.min(n,o)),(void 0===x||x)&&(e=Math.max(e,v+b),n=Math.min(n,b)),(void 0===a||a)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(c),P=!!T&&{duration:T[1]};for(const[,t]of Yn(o,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const C=e.selectAll(LN(lS)).data(o,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",lS).append((t=>MC(K({animate:P,scale:h},t),l,a,i,c)))),(t=>t.transition((function(t,e,n){const{preserve:r=!1}=t;if(r)return;const o=MC(K({animate:P,scale:h},t),l,a,i,c),{attributes:s}=o,[u]=n.childNodes;return u.update(s,!1)})))).transitions();n.push(...C.flat().filter(Or));const N=e.selectAll(LN(cS)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",cS).call(PN).call(NN,Array.from(c.keys())).call(jN,d)),(t=>t.call(NN,Array.from(c.keys())).call((t=>T?function(t,e){const[n,r]=e;t.transition((function(t,e,i){const{transform:o,width:a,height:s}=i.style,{paddingLeft:c,paddingTop:l,innerWidth:u,innerHeight:f,marginLeft:d,marginTop:h}=t,p=[{transform:o,width:a,height:s},{transform:`translate(${c+d}, ${l+h})`,width:u,height:f}];return i.animate(p,{delay:n,duration:r,fill:"both"})}))}(t,T):PN(t))).call(jN,d))).transitions();n.push(...N.flat());for(const[o,a]of c.entries()){const{data:s}=a,{key:c,class:l,type:u}=o,f=e.select(`#${c}`),d=xN(o,a,t,r),h=ON(o,a,t,i),p=kN(o,a,t,i),g=SN(o,a,t,i),m=vN(e,f,l,"element"),y=f.selectAll(LN(aS)).selectFacetAll(m).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(d).attr("className",aS).attr("markType",u).transition((function(t,e,n){return h(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=Er((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){bN(i,e,n);const o=d(t,r),a=p(t,[i],[o]);return null!==a||(i.nodeName===o.nodeName&&"g"!==o.nodeName?Mr(i,o):(i.parentNode.replaceChild(o,i),o.className=aS,o.markType=u,o.__data__=i.__data__)),a})).attr("markType",u).attr("className",aS)}))),(t=>t.each((function(t,e,n){n.__removed__=!0})).transition((function(t,e,n){return g(t,[n])})).remove()),(t=>t.append(d).attr("className",aS).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new Am(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new Am([],n.__toData__,n.parentNode).append(d).attr("className",aS).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...y.flat())}!function(t,e,n,r,i){const[o]=dT("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(LN(oS)).node(),l=new Map,u=new Map,f=Array.from(a.entries()).flatMap((([n,o])=>{const{labels:a=[],key:s}=n,c=function(t,e,n,r,i){const[o]=dT("shape",r),{data:a,encode:s}=t,{data:c,defaultLabelShape:l}=e,u=c.map((t=>t.points)),f=Nr(s,(t=>t.value)),{theme:d,coordinate:h}=n,p=Object.assign(Object.assign({},i),{document:hT(i),theme:d,coordinate:h});return t=>{const{index:e,points:n}=t,r=a[e],{formatter:i=t=>`${t}`,transform:s,style:c,render:h}=t,g=Se(t,["formatter","transform","style","render"]),m=Nr(Object.assign(Object.assign({},g),c),(t=>yN(t,r,e,a,{channel:f}))),{shape:y=l,text:v}=m,b=Se(m,["shape","text"]),x="string"==typeof i?LE(i):i,w=Object.assign(Object.assign({},b),{text:x(v,r,e,a),datum:r}),M=Object.assign({type:`label.${y}`,render:h},b);return o(M,p)(n,w,wN(d,"label",y,"label"),u)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(LN(aS)).nodes().filter((t=>!t.__removed__));return a.flatMap(((t,e)=>{const n=Se(t,["transform"]);return f.flatMap((r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:o,key:a,index:s}=n.__data__,c=function(t){const e=t.cloneNode(),n=t.getAnimations();e.style.visibility="hidden",n.forEach((t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])})),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:o}=r;return[i,o]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${a}-${e}`,bounds:c,index:s,points:o,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map(((r,a)=>Object.assign(Object.assign({},t),{key:`${i[a]}-${e}`,bounds:[o[a]],index:r,points:o,dependentElement:n})));return l?l(u):u}(n,e,r);return i.forEach((e=>{l.set(e,c),u.set(e,t)})),i}))}))})),d=Sm(c).selectAll(LN(uS)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",uS)),(t=>t.each((function(t,e,n){Mr(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),h=Vn(d,(t=>u.get(t.__data__))),{coordinate:p}=t,g={canvas:i.canvas,coordinate:p};for(const[t,e]of h){const{transform:n=[]}=t;br(n.map(o))(e,g)}s&&s(d,g)}(t,e,0,i,r)}))}function mN([t,e,n]){if(n)return[t,e,n];const r=[],i=[];for(let n=0;n<t.length;n++){const o=t[n],a=e[n];a.every((([t,e])=>Or(t)&&Or(e)))&&(r.push(o),i.push(a))}return[r,i]}function yN(t,e,n,r,i){return"function"==typeof t?t(e,n,r,i):"string"!=typeof t?t:Tr(e)&&void 0!==e[t]?e[t]:t}function vN(t,e,n,r){return t.node().parentElement.findAll((t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node())).flatMap((t=>t.getElementsByClassName(r)))}function bN(t,e,n){if(!t.__facet__)return;const r=t.parentNode.parentNode,i=e.parentNode,[o,a]=n(r),[s,c]=n(i);!function(t,e){const{transform:n}=t.style,r=(t=>"none"===t||void 0===t)(n)?"":n;t.style.transform=`${r} ${e}`.trimStart()}(t,`translate(${o-s}, ${a-c})`),e.append(t)}function xN(t,e,n,r){const{library:i}=r,[o]=dT("shape",i),{data:a,encode:s}=t,{defaultShape:c,data:l,shape:u}=e,f=Nr(s,(t=>t.value)),d=l.map((t=>t.points)),{theme:h,coordinate:p}=n,{type:g,style:m={}}=t,y=Object.assign(Object.assign({},r),{document:hT(r),coordinate:p,theme:h});return e=>{const{shape:n=c}=m,{shape:r=n,points:i,seriesIndex:s,index:l}=e,p=Se(e,["shape","points","seriesIndex","index"]),v=Object.assign(Object.assign({},p),{index:l}),b=s?s.map((t=>a[t])):a[l],x=s||l,w=Nr(m,(t=>yN(t,b,x,a,{channel:f})));return(u[r]?u[r](w,y):o(Object.assign(Object.assign({},w),{type:CN(t,r)}),y))(i,v,wN(h,g,r,c),d)}}function wN(t,e,n,r){if("string"!=typeof e)return;const{color:i}=t,o=t[e]||{},a=o[n]||o[r];return Object.assign({color:i},a)}function MN(t,e,n,r,i){var o,a;const[,s]=dT("shape",i),[c]=dT("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:d}=r,h=`default${W(t)}Animation`,{[h]:p}=(null===(o=u[l])||void 0===o?void 0:o.props)||s(CN(e,l)).props,{[t]:g={}}=f,m=(null===(a=e.animate)||void 0===a?void 0:a[t])||{},y={coordinate:d};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:o,[`${t}Duration`]:a,[`${t}Easing`]:s}=e,l=Object.assign({type:i||p},m);if(!l.type)return null;const u=c(l,y)(n,r,K(g,{delay:o,duration:a,easing:s}));return Array.isArray(u)?u:[u]}}function ON(t,e,n,r){return MN("enter",t,e,n,r)}function EN(t){return t.finished.then((()=>{t.cancel()})),t}function kN(t,e,n,r){return MN("update",t,e,n,r)}function SN(t,e,n,r){return MN("exit",t,e,n,r)}function AN(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=Se(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function _N(t){const{interaction:e={}}=t;return Object.entries(K({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function TN(t,e){return _e(this,void 0,void 0,(function*(){const{data:n}=t,r=Se(t,["data"]);if(null==n)return t;const[,{data:i}]=yield ZC(0,{data:n},e);return Object.assign({data:i},r)}))}function PN(t){t.style("transform",(t=>`translate(${t.paddingLeft+t.marginLeft}, ${t.paddingTop+t.marginTop})`)).style("width",(t=>t.innerWidth)).style("height",(t=>t.innerHeight))}function CN(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function NN(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(LN(iS)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",iS).attr("id",(t=>t.key)).style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.style("facet",n).style("fill","transparent").style("zIndex",(t=>{var e;return null!==(e=t.zIndex)&&void 0!==e?e:0}))),(t=>t.remove()));t.select(LN(oS)).node()||t.append("g").attr("className",oS).style("zIndex",0)}function LN(...t){return t.map((t=>`.${t}`)).join("")}function jN(t,e){t.node()&&t.style("clipPath",(t=>{if(!e)return null;const{paddingTop:n,paddingLeft:r,marginLeft:i,marginTop:o,innerWidth:a,innerHeight:s}=t;return new ig({style:{x:r+i,y:n+o,width:a,height:s}})}))}function RN(t){const e=K({},t),n=new Map([[e,null]]),r=new Map([[null,-1]]),i=[e];for(;i.length;){const t=i.shift();if(void 0===t.key){const e=n.get(t),i=r.get(t),o=null===e?"0":`${e.key}-${i}`;t.key=o}const{children:e=[]}=t;if(Array.isArray(e))for(let o=0;o<e.length;o++){const a=K({},e[o]);e[o]=a,n.set(a,t),r.set(a,o),i.push(a)}}return e}function IN(t,e){const n=new lA;return n.registerPlugin(new fA),new bg({width:t,height:e,container:document.createElement("div"),renderer:n})}function BN(t,e={},n=()=>{},r=t=>{throw t}){const{width:i=640,height:o=480,depth:a=0}=t,s=RN(t),{canvas:c=IN(i,o),emitter:l=new hA,library:u}=e;e.canvas=c,e.emitter=l;const{width:f,height:d}=c.getConfig();f===i&&d===o||c.resize(i,o),l.emit(pA.BEFORE_RENDER);const h=Sm(c.document.documentElement);return c.ready.then((()=>cN(Object.assign(Object.assign({},s),{width:i,height:o,depth:a}),h,e))).then((()=>{if(a){const[t,e]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(t,e,-a/2)}c.requestAnimationFrame((()=>{l.emit(pA.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=c.getConfig().container)?document.getElementById(p):p;var p}function DN(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(!function(t){const e=t.getRoot().querySelectorAll(`.${sS}`);null==e||e.forEach((t=>{const{nameInteraction:e=new Map}=t;(null==e?void 0:e.size)>0&&Array.from(null==e?void 0:e.values()).forEach((t=>{null==t||t.destroy()}))}))}(r),n?r.destroy():r.destroyChildren()),i.off()}const FN={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function zN(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:FN[e]}function GN(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>GN(t,e,n,r)))}function WN(t){GN(t,"visibility","hidden",!0)}function $N(t){GN(t,"visibility","visible",!0)}function HN(t){return Sm(t).selectAll(`.${aS}`).nodes().filter((t=>!t.__removed__))}function VN(t,e){return YN(t,e).flatMap((({container:t})=>HN(t)))}function YN(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function UN(t){return Sm(t).select(`.${cS}`).node()}function qN(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new Cu;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function XN(t,e){const{offsetX:n,offsetY:r}=e,i=qN(t),{min:[o,a],max:[s,c]}=i;return n<o||n>s||(r<a||r>c)?null:[n-o,r-a]}function ZN(t,e){const{offsetX:n,offsetY:r}=e,[i,o,a,s]=function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return[n,r,i,o]}(t);return[Math.min(a,Math.max(i,n))-i,Math.min(s,Math.max(o,r))-o]}function KN(t){return t=>t.__data__.color}function QN(t){return t=>t.__data__.x}function JN(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[eL(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(eL(i,r))[e]}}function tL(t,e=(t,e)=>t,n=(t,e,n)=>t.setAttribute(e,n)){const r="__states__",i="__ordinal__",o=o=>{const{[r]:a=[],[i]:s={}}=o,c=a.reduce(((e,n)=>Object.assign(Object.assign({},e),t[n])),s);if(0!==Object.keys(c).length){for(const[t,r]of Object.entries(c)){const i=zN(o,t),a=e(r,o);n(o,t,a),t in s||(s[t]=i)}o[i]=s}},a=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{a(t),t[r]=[...e],o(t)},removeState:(t,...e)=>{a(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}o(t)},hasState:(t,e)=>(a(t),-1!==t[r].indexOf(e))}}function eL(t,e){return`${t},${e}`}function nL(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[eL(t.key,e.key),e.state])))),r={};for(const t of e){const[e,i]=Array.isArray(t)?t:[t,{}];r[e]=n.reduce(((t,n)=>{const[r,o={}]=n,a=void 0===(s=o[e])||"object"==typeof s&&0===Object.keys(s).length?i:o[e];var s;for(const[e,n]of Object.entries(a)){const i=t[e],o=(t,e,o,a)=>{const s=eL(a.__data__.viewKey,a.__data__.markKey);return r!==s?null==i?void 0:i(t,e,o,a):"function"!=typeof n?n:n(t,e,o,a)};t[e]=o}return t}),{})}return r}function rL(t,e){const n=new Map(t.map(((t,e)=>[t,e]))),r=e?t.map(e):t;return(t,i)=>{if("function"!=typeof t)return t;const o=n.get(i);return t(e?e(i):i,o,r,i)}}function iL(t){var{link:e=!1,valueof:n=(t,e)=>t,coordinate:r}=t,i=Se(t,["link","valueof","coordinate"]);if(!e)return[()=>{},()=>{}];const o=t=>t.__data__.points,a=(t,e)=>{const[,n,r]=t,[i,,,o]=e;return[n,i,o,r]};return[t=>{var e;if(t.length<=1)return;const r=Zn(t,((t,e)=>{const{x:n}=t.__data__,{x:r}=e.__data__;return n-r}));for(let t=1;t<r.length;t++){const s=qs(),c=r[t-1],l=r[t],[u,f,d,h]=a(o(c),o(l));s.moveTo(...u),s.lineTo(...f),s.lineTo(...d),s.lineTo(...h),s.closePath();const p=Nr(i,(t=>n(t,c))),{fill:g=c.getAttribute("fill")}=p,m=Se(p,["fill"]),y=new eg({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},m)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(y),c.link=y}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function oL(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(Dc(n)){const{points:i}=t.__data__,[o,a]=Bc(n)?Lm(i):i,s=n.getCenter(),c=ds(o,s),l=ds(a,s),u=gs(c)+ys(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return Bc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function aL(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=Se(t,["document","background","scale","coordinate","valueof"]);const s="element-background";if(!n)return[()=>{},()=>{}];const c=(t,e,n)=>{const r=t.invert(e),i=e+t.getBandWidth(r)/2,o=t.getStep(r)/2,a=o*n;return[i-o+a,i+o-a]},l=(t,n)=>{const{padding:o}=n,[a,s]=((t,e)=>{const{x:n}=r;if(!wk(n))return[0,1];const{__data__:i}=t,{x:o}=i,[a,s]=c(n,o,e);return[a,s]})(t,o),[l,u]=((t,e)=>{const{y:n}=r;if(!wk(n))return[0,1];const{__data__:i}=t,{y:o}=i,[a,s]=c(n,o,e);return[a,s]})(t,o),f=[[a,l],[s,l],[s,u],[a,u]].map((t=>i.map(t))),{__data__:d}=t,{y:h,y1:p}=d;return Dm(e,f,{y:h,y1:p},i,n)},u=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,o=Se(e,["transform","transformOrigin","stroke"]),a=Object.assign({transform:n,transformOrigin:r,stroke:i},o),s=t.cloneNode(!0);for(const[t,e]of Object.entries(a))s.style[t]=e;return s};return[t=>{t.background&&t.background.remove();const e=Nr(a,(e=>o(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,lineWidth:d=0}=e,h=Se(e,["fill","fillOpacity","zIndex","padding","lineWidth"]),p=Object.assign(Object.assign({},h),{fill:n,fillOpacity:i,zIndex:c,padding:f,lineWidth:d}),g=(()=>{const{x:t,y:e}=r;return[t,e].some(wk)})()?l:u,m=g(t,p);m.className=s,t.parentNode.parentNode.appendChild(m),t.background=m},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function sL(t,e){const n=t.getRootNode().defaultView.getContextService().getDomElement();(null==n?void 0:n.style)&&(t.cursor=n.style.cursor,n.style.cursor=e)}function cL(t){sL(t,t.cursor)}function lL(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function uL(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function fL(t,e=!1){const n=m(t,(t=>!!t)).map(((t,e)=>[0===e?"M":"L",...t]));return e&&n.push(["Z"]),n}function dL(t){return t.querySelectorAll(".element")}function hL(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function pL(t,{elements:e,datum:n,groupKey:r=t=>t,link:i=!1,background:o=!1,delay:a=60,scale:s,coordinate:c,emitter:l,state:u={}}){var f;const d=e(t),h=new Set(d),p=Vn(d,r),g=rL(d,n),[m,y]=iL(Object.assign({elements:d,valueof:g,link:i,coordinate:c},kr(u.active,"link"))),[v,b,x]=aL(Object.assign({document:t.ownerDocument,scale:s,coordinate:c,background:o,valueof:g},kr(u.active,"background"))),w=K(u,{active:Object.assign({},(null===(f=u.active)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.active.offset(...t),[,n]=t;return oL(d[n],e,c)}})}),{setState:M,removeState:O,hasState:E}=tL(w,g);let k;const S=t=>{const{target:e,nativeEvent:i=!0}=t;if(!h.has(e))return;k&&clearTimeout(k);const o=r(e),a=p.get(o),s=new Set(a);for(const t of d)s.has(t)?E(t,"active")||M(t,"active"):(M(t,"inactive"),y(t)),t!==e&&b(t);v(e),m(a),i&&l.emit("element:highlight",{nativeEvent:i,data:{data:n(e),group:a.map(n)}})},A=(t=!0)=>{for(const t of d)O(t,"active","inactive"),b(t),y(t);t&&l.emit("element:unhighlight",{nativeEvent:t})},_=t=>{const{target:e}=t;o&&!x(e)||(o||h.has(e))&&(a>0?(k&&clearTimeout(k),k=setTimeout((()=>{A(),k=null}),a)):A())},T=()=>{A()};t.addEventListener("pointerover",S),t.addEventListener("pointerout",_),t.addEventListener("pointerleave",T);const P=t=>{const{nativeEvent:e}=t;e||A(!1)},C=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=lL(d,r,n);i&&S({target:i,nativeEvent:!1})};return l.on("element:highlight",C),l.on("element:unhighlight",P),()=>{t.removeEventListener("pointerover",S),t.removeEventListener("pointerout",_),t.removeEventListener("pointerleave",T),l.off("element:highlight",C),l.off("element:unhighlight",P);for(const t of d)b(t),y(t)}}function gL(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,o=Se(t,["delay","createGroup","background","link"]);return(t,a,s)=>{const{container:c,view:l,options:u}=t,{scale:f,coordinate:d}=l;return pL(UN(c),Object.assign({elements:HN,datum:JN(l),groupKey:n?n(l):void 0,coordinate:d,scale:f,state:nL(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:s},o))}}function mL(t){return gL(Object.assign(Object.assign({},t),{createGroup:QN}))}function yL(t){return gL(Object.assign(Object.assign({},t),{createGroup:KN}))}function vL(t,{elements:e,datum:n,groupKey:r=t=>t,link:i=!1,single:o=!1,coordinate:a,background:s=!1,scale:c,emitter:l,state:u={}}){var f;const d=e(t),h=new Set(d),p=Vn(d,r),g=rL(d,n),[m,y]=iL(Object.assign({link:i,elements:d,valueof:g,coordinate:a},kr(u.selected,"link"))),[v,b]=aL(Object.assign({document:t.ownerDocument,background:s,coordinate:a,scale:c,valueof:g},kr(u.selected,"background"))),x=K(u,{selected:Object.assign({},(null===(f=u.selected)||void 0===f?void 0:f.offset)&&{transform:(...t)=>{const e=u.selected.offset(...t),[,n]=t;return oL(d[n],e,a)}})}),{setState:w,removeState:M,hasState:O}=tL(x,g),E=(t=!0)=>{for(const t of d)M(t,"selected","unselected"),y(t),b(t);t&&l.emit("element:unselect",{nativeEvent:!0})},k=t=>{const{target:e,nativeEvent:a=!0}=t;return h.has(e)?o?((t,e,i=!0)=>{if(O(e,"selected"))E();else{const o=r(e),a=p.get(o),s=new Set(a);for(const t of d)s.has(t)?w(t,"selected"):(w(t,"unselected"),y(t)),t!==e&&b(t);if(m(a),v(e),!i)return;l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...a.map(n)]}}))}})(t,e,a):((t,e,o=!0)=>{const a=r(e),s=p.get(a),c=new Set(s);if(O(e,"selected")){if(!d.some((t=>!c.has(t)&&O(t,"selected"))))return E();for(const t of s)w(t,"unselected"),y(t),b(t)}else{const t=s.some((t=>O(t,"selected")));for(const t of d)c.has(t)?w(t,"selected"):O(t,"selected")||w(t,"unselected");!t&&i&&m(s),v(e)}o&&l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:o,data:{data:d.filter((t=>O(t,"selected"))).map(n)}}))})(t,e,a):E()};t.addEventListener("click",k);const S=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=o?r.data.slice(0,1):r.data;for(const t of i){const e=lL(d,t,n);k({target:e,nativeEvent:!1})}},A=()=>{E(!1)};return l.on("element:select",S),l.on("element:unselect",A),()=>{for(const t of d)y(t);t.removeEventListener("click",k),l.off("element:select",S),l.off("element:unselect",A)}}function bL(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=Se(t,["createGroup","background","link"]);return(t,o,a)=>{const{container:s,view:c,options:l}=t,{coordinate:u,scale:f}=c;return vL(UN(s),Object.assign({elements:HN,datum:JN(c),groupKey:e?e(c):void 0,coordinate:u,scale:f,state:nL(l,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:a},i))}}function xL(t){return bL(Object.assign(Object.assign({},t),{createGroup:QN}))}function wL(t){return bL(Object.assign(Object.assign({},t),{createGroup:KN}))}function ML(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=t=>`${t}`}=t,o=Se(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:a,container:s,update:c,setState:l}=t,{markState:u,scale:f,coordinate:d}=a,h=function(t,e,n){const[r]=Array.from(t.entries()).filter((([t])=>t.type===e)).map((([t])=>{const{encode:e}=t;return Object.fromEntries(n.map((t=>{const n=e[t];return[t,n?n.value:void 0]})))}));return r}(u,"line",["x","y","series"]);if(!h)return;const{y:p,x:g,series:m=[]}=h,y=p.map(((t,e)=>e)),v=Zn(y.map((t=>g[t]))),b=UN(s),x=s.getElementsByClassName(aS),w=Vn(s.getElementsByClassName(uS),(t=>t.__data__.key.split("-")[0])),M=new tg({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},kr(o,"rule"))}),O=new og({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},kr(o,"label"))});M.append(O),b.appendChild(M);const E=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return v[In(v,i)]},k=(t,e)=>{M.setAttribute("x1",t[0]),M.setAttribute("x2",t[0]),O.setAttribute("text",i(e))};let S;const A=ot((t=>{const e=XN(b,t);e&&(t=>{const{scale:e,coordinate:n}=S,{x:r,y:i}=e,o=E(n,r,t);k(t,o);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,a=e[Pn((t=>g[+t])).center(e,o)],s=[0,i.map(1)],c=[0,i.map(p[a]/p[e[0]])],[,l]=n.map(s),[,u]=n.map(c),f=l-u;t.setAttribute("transform",`translate(0, ${f})`);const d=w.get(r)||[];for(const t of d)t.setAttribute("dy",f)}})(e)}),e,{leading:n,trailing:r});return(t=>{_e(this,void 0,void 0,(function*(){const{x:e}=f,n=E(d,e,t);k(t,n),l("chartIndex",(t=>{const e=K({},t),r=e.marks.find((t=>"line"===t.type)),i=cr(Un(y,(t=>cr(t,(t=>+p[t]))/ur(t,(t=>+p[t]))),(t=>m[t])).values());K(r,{scale:{y:{domain:[1/i,i]}}});const o=function(t){const{transform:e=[]}=t,n=e.find((t=>"normalizeY"===t.type));if(n)return n;const r={type:"normalizeY"};return e.push(r),t.transform=e,r}(r);o.groupBy="color",o.basis=(t,e)=>e[t[Pn((t=>g[+t])).center(t,n)]];for(const t of e.marks)t.animate=!1;return e}));const r=yield c("chartIndex");S=r.view}))})([0,0]),b.addEventListener("pointerenter",A),b.addEventListener("pointermove",A),b.addEventListener("pointerleave",A),()=>{M.remove(),b.removeEventListener("pointerenter",A),b.removeEventListener("pointermove",A),b.removeEventListener("pointerleave",A)}}}function OL({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=UN(s),l=ot((t=>{const e=XN(c,t);if(!e)return a("fisheye"),void o();a("fisheye",(t=>{const n=K({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,o=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find((t=>"fisheye"===t.type));if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return o.focusX=r,o.focusY=i,o.visual=!0,n})),o()}),t,{leading:e,trailing:n});return c.addEventListener("pointerenter",l),c.addEventListener("pointermove",l),c.addEventListener("pointerleave",l),()=>{c.removeEventListener("pointerenter",l),c.removeEventListener("pointermove",l),c.removeEventListener("pointerleave",l)}}}function EL(t,e){if(e)return"string"==typeof e?document.querySelector(e):e;return t.ownerDocument.defaultView.getContextService().getDomElement().parentElement}function kL(t,e,n,r,i,o,a,s={},c=[10,10]){const l=new pw({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:c,template:{prefixCls:"g2-"},style:K({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(l.HTMLTooltipElement),l}function SL({root:t,data:e,x:n,y:r,render:i,event:o,single:a,position:s="right-bottom",enterable:c=!1,css:l,mount:u,bounding:f,offset:d}){const h=EL(t,u),p=EL(t),g=a?p:t,m=f||function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return{x:n,y:r,width:i-n,height:o-r}}(t),y=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(p,h),{tooltipElement:v=kL(h,n,r,s,c,m,y,l,d)}=g,{items:b,title:x=""}=e;v.update(Object.assign({x:n,y:r,data:b,title:x,position:s,enterable:c},void 0!==i&&{content:i(o,{items:b,title:x})})),g.tooltipElement=v}function AL({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const o=EL(t),a=e?o:t,{tooltipElement:s}=a;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY),RL(t),IL(t),BL(t)}function _L({root:t,single:e}){const n=EL(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0),RL(t),IL(t),BL(t)}function TL(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function PL(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function CL(t,e=t=>t){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function NL(t,e,n,r=t.map((t=>t.__data__)),i={}){const o=t=>t instanceof Date?+t:t,a=CL(r.map((t=>t.title)),o).filter(Or),s=r.flatMap(((r,o)=>{const a=t[o],{items:s=[],title:c}=r,l=s.filter(Or),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=PL(a)||i.color,name:o}=t,s=Se(t,["color","name"]);const l=function(t,e){const{color:n,series:r,facet:i=!1}=t,{color:o,series:a}=e,s=t=>t&&t.invert&&!(t instanceof zo)&&!(t instanceof Wo);if(s(r))return r.clone().invert(a);if(a&&r instanceof zo&&r.invert(a)!==o&&!i)return r.invert(a);if(s(n)){const t=n.invert(o);return Array.isArray(t)?null:t}return null}(e,r),f=u?l||o:o||l;return Object.assign(Object.assign({},s),{color:n,name:f||c})}))})).map(TL);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:CL(s,(t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`))})}function LL(t,e,n,r){var{plotWidth:i,plotHeight:o,mainWidth:a,mainHeight:s,startX:c,startY:l,transposed:u,polar:f,insetLeft:d,insetTop:h}=r,p=Se(r,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const g=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},p),m=((t,e)=>{if(1===e.length)return e[0];const n=e.map((e=>ps(e,t))),r=fr(n,(t=>t));return e[r]})(n,e);if(f){const[e,n,r]=(()=>{const t=c+d+a/2,e=l+h+s/2;return[t,e,ps([t,e],m)]})(),i=t.ruleX||((e,n,r)=>{const i=new qp({style:Object.assign({cx:e,cy:n,r:r},g)});return t.appendChild(i),i})(e,n,r);i.style.cx=e,i.style.cy=n,i.style.r=r,t.ruleX=i}else{const[e,n,r,a]=u?[c+m[0],c+m[0],l,l+o]:[c,c+i,m[1]+l,m[1]+l],s=t.ruleX||((e,n,r,i)=>{const o=new tg({style:Object.assign({x1:e,x2:n,y1:r,y2:i},g)});return t.appendChild(o),o})(e,n,r,a);s.style.x1=e,s.style.x2=n,s.style.y1=r,s.style.y2=a,t.ruleX=s}}function jL(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:o,mainHeight:a,startX:s,startY:c,transposed:l,polar:u,insetLeft:f,insetTop:d}=n,h=Se(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},h),g=e.map((t=>t[1])),m=e.map((t=>t[0])),y=gr(g),v=gr(m),[b,x,w,M]=(()=>{if(u){const t=Math.min(o,a)/2,e=s+f+o/2,n=c+d+a/2,r=gs(ds([v,y],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,y+c,y+c]:[v+s,v+s,c,c+i]})();if(m.length>0){const e=t.ruleY||(()=>{const e=new tg({style:Object.assign({x1:b,x2:x,y1:w,y2:M},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=w,e.style.y2=M,t.ruleY=e}}function RL(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function IL(t){t.ruleX&&(t.ruleX.remove(),t.ruleX=void 0)}function BL(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function DL(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function FL(t,e){return void 0===t?e:t}function zL(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function GL(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,crosshairsX:c,crosshairsY:l,render:u,groupName:f,emitter:d,wait:h=50,leading:p=!0,trailing:g=!1,startX:m=0,startY:y=0,body:v=!0,single:b=!0,position:x,enterable:w,mount:M,bounding:O,theme:E,offset:k,disableNative:S=!1,marker:A=!0,preserve:_=!1,style:T={},css:P={}}=e,C=Se(e,["elements","sort","filter","scale","coordinate","crosshairs","crosshairsX","crosshairsY","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","offset","disableNative","marker","preserve","style","css"]);const N=n(t),L=Bc(a),j=Dc(a),R=K(T,C),{innerWidth:I,innerHeight:B,width:D,height:F,insetLeft:z,insetTop:W}=a.getOptions(),$=[],H=[];for(const t of N){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?$.push(t):(r||i)&&H.push(t)}const V=H.length&&H.every((t=>"interval"===t.markType))&&!Dc(a),Y=t=>t.__data__.x,U=!!o.x.getBandWidth&&H.length>0;$.sort(((t,e)=>{const n=L?0:1,r=t=>t.getBounds().min[n];return L?r(e)-r(t):r(t)-r(e)}));const q=t=>{const e=L?1:0,{min:n,max:r}=t.getLocalBounds();return Zn([n[e],r[e]])};V?N.sort(((t,e)=>Y(t)-Y(e))):H.sort(((t,e)=>{const[n,r]=q(t),[i,o]=q(e),a=(n+r)/2,s=(i+o)/2;return L?s-a:a-s}));const X=new Map($.map((t=>{const{__data__:e}=t,{seriesX:n}=e;return[t,[Zn(n.map(((t,e)=>e)),(t=>n[+t])),n]]}))),{x:Z}=o,Q=(null==Z?void 0:Z.getBandWidth)?Z.getBandWidth()/2:0,J=t=>{const[e]=a.invert(t);return e-Q},tt=(t,e,n,r)=>{const{_x:i}=t,o=void 0!==i?Z.map(i):J(e),a=r.filter(Or),[s,c]=Zn([a[0],a[a.length-1]]);if(!U&&(o<s||o>c)&&!(s===c))return null;const l=Pn((t=>r[+t])).center;return n[l(n,o)]},et=V?(t,e)=>{const n=e[(0,Pn(Y).center)(e,J(t))];return Vn(e,Y).get(Y(n))}:(t,e)=>{const n=t[L?1:0],r=e.filter((t=>{const[e,r]=q(t);return n>=e&&n<=r}));if(!U||r.length>0)return r;const i=Pn((t=>{const[e,n]=q(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(Or)},nt=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter((([t])=>t.startsWith("series")&&"series"!==t)).map((([t,n])=>{const r=n[e];return[G(t.replace("series","")),r]})))},rt=ot((e=>{var n;const h=XN(t,e);if(!h)return;const p=qN(t),g=p.min[0],S=p.min[1],_=[h[0]-m,h[1]-y];if(!_)return;const T=et(_,H),C=[],N=[];for(const t of $){const[n,r]=X.get(t),i=tt(e,_,n,r);if(null!==i){C.push(t);const e=nt(t,i),{x:n,y:r}=e,o=a.map([(n||0)+Q,r||0]);N.push([Object.assign(Object.assign({},e),{element:t}),o])}}const G=Array.from(new Set(N.map((t=>t[0].x)))),V=G[fr(G,(t=>Math.abs(t-J(_))))],Y=N.filter((t=>t[0].x===V)),U=[...Y.map((t=>t[0])),...T.map((t=>t.__data__))],q=[...C,...T],Z=NL(q,o,f,U,E);if(r&&Z.items.sort(((t,e)=>r(t)-r(e))),i&&(Z.items=Z.items.filter(i)),0===q.length||zL(Z))return void it(e);if(v&&SL({root:t,data:Z,x:h[0]+g,y:h[1]+S,render:u,event:e,single:b,position:x,enterable:w,mount:M,bounding:O,css:P,offset:k}),s||c||l){const e=kr(R,"crosshairs"),n=Object.assign(Object.assign({},e),kr(R,"crosshairsX")),r=Object.assign(Object.assign({},e),kr(R,"crosshairsY")),i=Y.map((t=>t[1]));c&&LL(t,i,h,Object.assign(Object.assign({},n),{plotWidth:I,plotHeight:B,mainWidth:D,mainHeight:F,insetLeft:z,insetTop:W,startX:m,startY:y,transposed:L,polar:j})),l&&jL(t,i,Object.assign(Object.assign({},r),{plotWidth:I,plotHeight:B,mainWidth:D,mainHeight:F,insetLeft:z,insetTop:W,startX:m,startY:y,transposed:L,polar:j}))}if(A){const e=kr(R,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const{type:i=""}=n,o=e.filter((t=>{const[{x:e,y:n}]=t;return Or(e)&&Or(n)})).map((t=>{const[{color:e,element:o},a]=t,s=e||o.style.fill||o.style.stroke||r.color,c="hollow"===i?"transparent":s,l="hollow"===i?s:"#fff";return new qp({style:Object.assign({cx:a[0],cy:a[1],fill:c,r:4,stroke:l,lineWidth:2},n)})}));for(const e of o)t.appendChild(e);t.markers=o}(t,{data:Y,style:e,theme:E})}const K=null===(n=Y[0])||void 0===n?void 0:n[0].x,rt=null!=K?K:J(_);d.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:{x:Mk(o.x,rt,!0)}}}))}),h,{leading:p,trailing:g}),it=e=>{AL({root:t,single:b,emitter:d,event:e})},at=()=>{_L({root:t,single:b})},st=e=>{var n,{nativeEvent:r,data:i,offsetX:s,offsetY:c}=e,l=Se(e,["nativeEvent","data","offsetX","offsetY"]);if(r)return;const u=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.x,f=o.x.map(u),[d,h]=a.map([f,.5]),p=t.getRenderBounds(),g=p.min[0],m=p.min[1];rt(Object.assign(Object.assign({},l),{offsetX:void 0!==s?s:g+d,offsetY:void 0!==c?c:m+h,_x:u}))},ct=()=>{AL({root:t,single:b,emitter:d,nativeEvent:!1})},lt=()=>{dt(),at()},ut=()=>{ft()},ft=()=>{S||(t.addEventListener("pointerenter",rt),t.addEventListener("pointermove",rt),t.addEventListener("pointerleave",(e=>{XN(t,e)||it(e)})))},dt=()=>{S||(t.removeEventListener("pointerenter",rt),t.removeEventListener("pointermove",rt),t.removeEventListener("pointerleave",it))};return ft(),d.on("tooltip:show",st),d.on("tooltip:hide",ct),d.on("tooltip:disable",lt),d.on("tooltip:enable",ut),()=>{dt(),d.off("tooltip:show",st),d.off("tooltip:hide",ct),d.off("tooltip:disable",lt),d.off("tooltip:enable",ut),_?AL({root:t,single:b,emitter:d,nativeEvent:!1}):at()}}function WL(t,{elements:e,coordinate:n,scale:r,render:i,groupName:o,sort:a,filter:s,emitter:c,wait:l=50,leading:u=!0,trailing:f=!1,groupKey:d=t=>t,single:h=!0,position:p,enterable:g,datum:m,view:y,mount:v,bounding:b,theme:x,offset:w,shared:M=!1,body:O=!0,disableNative:E=!1,preserve:k=!1,css:S={}}){var A,_;const T=e(t),P=Vn(T,d),C=T.every((t=>"interval"===t.markType))&&!Dc(n),N=r.x,L=r.series,j=null!==(_=null===(A=null==N?void 0:N.getBandWidth)||void 0===A?void 0:A.call(N))&&void 0!==_?_:0,R=L?t=>t.__data__.x+t.__data__.series*j:t=>t.__data__.x+j/2;C&&T.sort(((t,e)=>R(t)-R(e)));const I=t=>{const{target:e}=t;return hL(e,(t=>!!t.classList&&t.classList.includes("element")))},B=C?e=>{const r=XN(t,e);if(!r)return;const[i]=n.invert(r),o=i,a=(0,Pn(R).center)(T,o),s=T[a];if(!M){const t=T.find((t=>t!==s&&R(t)===R(s)));if(t)return I(e)}return s}:I,D=ot((e=>{const n=B(e);if(!n)return void AL({root:t,single:h,emitter:c,event:e});const l=d(n),u=P.get(l);if(!u)return;const f=1!==u.length||M?NL(u,r,o,void 0,x):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(Or).map((e=>{var{color:n=PL(t)}=e,r=Se(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(TL);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(u[0]);if(a&&f.items.sort(((t,e)=>a(t)-a(e))),s&&(f.items=f.items.filter(s)),zL(f))return void AL({root:t,single:h,emitter:c,event:e});const{offsetX:m,offsetY:E}=e;O&&SL({root:t,data:f,x:m,y:E,render:i,event:e,single:h,position:p,enterable:g,mount:v,bounding:b,css:S,offset:w}),c.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:lT(n,y)}}))}),l,{leading:u,trailing:f}),F=e=>{AL({root:t,single:h,emitter:c,event:e})},z=()=>{E||(t.addEventListener("pointermove",D),t.addEventListener("pointerleave",F))},G=()=>{E||(t.removeEventListener("pointermove",D),t.removeEventListener("pointerleave",F))},W=({nativeEvent:e,offsetX:n,offsetY:r,data:i})=>{if(e)return;const{data:o}=i,a=lL(T,o,m);if(!a)return;const s=a.getBBox(),{x:c,y:l,width:u,height:f}=s,d=t.getBBox();D({target:a,offsetX:void 0!==n?n+d.x:c+u/2,offsetY:void 0!==r?r+d.y:l+f/2})},$=({nativeEvent:e}={})=>{e||AL({root:t,single:h,emitter:c,nativeEvent:!1})};return c.on("tooltip:show",W),c.on("tooltip:hide",$),c.on("tooltip:enable",(()=>{z()})),c.on("tooltip:disable",(()=>{G(),_L({root:t,single:h})})),z(),()=>{G(),c.off("tooltip:show",W),c.off("tooltip:hide",$),k?AL({root:t,single:h,emitter:c,nativeEvent:!1}):_L({root:t,single:h})}}function $L(t){const{shared:e,crosshairs:n,crosshairsX:r,crosshairsY:i,series:o,name:a,item:s=()=>({}),facet:c=!1}=t,l=Se(t,["shared","crosshairs","crosshairsX","crosshairsY","series","name","item","facet"]);return(t,a,u)=>{const{container:f,view:d}=t,{scale:h,markState:p,coordinate:g,theme:m}=d,y=DL(p,"seriesTooltip"),v=DL(p,"crosshairs"),b=UN(f),x=FL(o,y),w=FL(n,v);if(x&&function(t){return Array.from(t.values()).some((t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip}))}(p)&&!c)return GL(b,Object.assign(Object.assign({},l),{theme:m,elements:HN,scale:h,coordinate:g,crosshairs:w,crosshairsX:FL(FL(r,n),!1),crosshairsY:FL(i,w),item:s,emitter:u}));if(x&&c){const e=a.filter((e=>e!==t&&e.options.parentKey===t.options.key)),o=VN(t,a),c=e[0].view.scale,f=b.getBounds(),d=f.min[0],h=f.min[1];return Object.assign(c,{facet:!0}),GL(b.parentNode.parentNode,Object.assign(Object.assign({},l),{theme:m,elements:()=>o,scale:c,coordinate:g,crosshairs:FL(n,v),crosshairsX:FL(FL(r,n),!1),crosshairsY:FL(i,w),item:s,startX:d,startY:h,emitter:u}))}return WL(b,Object.assign(Object.assign({},l),{datum:JN(d),elements:HN,scale:h,coordinate:g,groupKey:e?t=>t.__data__.x:void 0,item:s,emitter:u,view:d,theme:m,shared:e}))}}gL.props={reapplyWhenUpdate:!0},mL.props={reapplyWhenUpdate:!0},yL.props={reapplyWhenUpdate:!0},bL.props={reapplyWhenUpdate:!0},xL.props={reapplyWhenUpdate:!0},wL.props={reapplyWhenUpdate:!0},ML.props={reapplyWhenUpdate:!0},$L.props={reapplyWhenUpdate:!0};const HL="legend-category",VL="legend-continuous",YL="items-item",UL="legend-category-item-marker",qL="legend-category-item-label";function XL(t){return t.getElementsByClassName(UL)[0]}function ZL(t){return t.getElementsByClassName(qL)[0]}function KL(t){return t.getElementsByClassName(YL)}function QL(t){return t.getElementsByClassName(HL)}function JL(t){return t.getElementsByClassName(VL)}function tj(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function ej(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){return _e(this,void 0,void 0,(function*(){const{view:c,update:l,setState:u}=t;u(e,(t=>{const{marks:e}=t,l=e.map((t=>{if("legends"===t.type)return t;const{transform:e=[]}=t,l=e.findIndex((({type:t})=>t.startsWith("group")||t.startsWith("bin"))),u=[...e];u.splice(l+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const f=Object.fromEntries(o.map((t=>[t,{domain:c.scale[t].getOptions().domain}])));return K({},t,Object.assign(Object.assign({transform:u,scale:f},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(a.map((t=>[t,{preserve:!0}])))}))}));return Object.assign(Object.assign({},t),{marks:l})})),yield l()}))}function nj(t,e){for(const n of t)ej(n,Object.assign(Object.assign({},e),{facet:!0}))}function rj(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),o=i.length>0,a=t=>tj(t).scales.map((t=>t.name)),s=[...QL(r),...JL(r)],c=s.flatMap(a),l=ot(o?nj:ej,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=tj(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===HL?function(t,{legends:e,marker:n,label:r,datum:i,filter:o,emitter:a,channel:s,state:c={}}){const l=new Map,u=new Map,f=new Map,{unselected:d={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=c,h={unselected:kr(d,"marker")},p={unselected:kr(d,"label")},{setState:g,removeState:m}=tL(h,void 0),{setState:y,removeState:v}=tL(p,void 0),b=Array.from(e(t));let x=b.map(i);const w=()=>{for(const t of b){const e=i(t),o=n(t),a=r(t);x.includes(e)?(m(o,"unselected"),v(a,"unselected")):(g(o,"unselected"),y(a,"unselected"))}};for(const e of b){const n=()=>{sL(t,"pointer")},r=()=>{cL(t)},c=t=>_e(this,void 0,void 0,(function*(){const n=i(e),r=x.indexOf(n);-1===r?x.push(n):x.splice(r,1),0===x.length&&x.push(...b.map(i)),yield o(x),w();const{nativeEvent:c=!0}=t;c&&(x.length===b.length?a.emit("legend:reset",{nativeEvent:c}):a.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:s,values:x}})))}));e.addEventListener("click",c),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),l.set(e,c),u.set(e,n),f.set(e,r)}const M=t=>_e(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===s&&(x=i,yield o(x),w())})),O=t=>_e(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;e||(x=b.map(i),yield o(x),w())}));return a.on("legend:filter",M),a.on("legend:reset",O),()=>{for(const t of b)t.removeEventListener("click",l.get(t)),t.removeEventListener("pointerenter",u.get(t)),t.removeEventListener("pointerout",f.get(t)),a.off("legend:filter",M),a.off("legend:reset",O)}}(r,{legends:KL,marker:XL,label:ZL,datum:t=>{const{__data__:e}=t,{index:n}=e;return u[n]},filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});l(o?i:t,n)},state:e.attributes.state,channel:s,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const o=({detail:{value:t}})=>{n(t),r.emit({nativeEvent:!0,data:{channel:i,values:t}})};return e.addEventListener("valuechange",o),()=>{e.removeEventListener("valuechange",o)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!1});l(o?i:t,n)},emitter:n,channel:s})}));return()=>{u.forEach((t=>t()))}}}function ij(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=QL(r),s=HN(r),c=t=>tj(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=nL(o,["active","inactive"]),f=rL(s,JN(i)),d=[];for(const t of a){const e=e=>{const{data:n}=t.attributes,{__data__:r}=e,{index:i}=r;return n[i].label},r=c(t),i=KL(t),o=l(r),a=Vn(s,(t=>o.invert(t.__data__[r]))),{state:h={}}=t.attributes,{inactive:p={}}=h,{setState:g,removeState:m}=tL(u,f),y={inactive:kr(p,"marker")},v={inactive:kr(p,"label")},{setState:b,removeState:x}=tL(y),{setState:w,removeState:M}=tL(v),O=t=>{for(const e of i){const n=XL(e),r=ZL(e);e===t||null===t?(x(n,"inactive"),M(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},E=(t,i)=>{const o=e(i),c=new Set(a.get(o));for(const t of s)c.has(t)?g(t,"active"):g(t,"inactive");O(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:o}}))},k=new Map;for(const t of i){const e=e=>{E(e,t)};t.addEventListener("pointerover",e),k.set(t,e)}const S=t=>{for(const t of s)m(t,"inactive","active");O(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},A=t=>{const{nativeEvent:n,data:o}=t;if(n)return;const{channel:a,value:s}=o;if(a!==r)return;const c=i.find((t=>e(t)===s));c&&E({nativeEvent:!1},c)},_=t=>{const{nativeEvent:e}=t;e||S({nativeEvent:!1})};t.addEventListener("pointerleave",S),n.on("legend:highlight",A),n.on("legend:unhighlight",_);const T=()=>{t.removeEventListener(S),n.off("legend:highlight",A),n.off("legend:unhighlight",_);for(const[t,e]of k)t.removeEventListener(e)};d.push(T)}return()=>d.forEach((t=>t()))}}function oj(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function aj(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function sj(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const cj=Ym((t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:c=10,document:l}=e,u=Se(e,["x","y","width","height","class","renders","handleSize","document"]);if(!l||void 0===i||void 0===o||void 0===n||void 0===r)return;const f=c/2,d=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},h=kr(Ar(u,"handleNW","handleNE"),"handleN"),{render:p=d}=h,g=Se(h,["render"]),m=kr(u,"handleE"),{render:y=d}=m,v=Se(m,["render"]),b=kr(Ar(u,"handleSE","handleSW"),"handleS"),{render:x=d}=b,w=Se(b,["render"]),M=kr(u,"handleW"),{render:O=d}=M,E=Se(M,["render"]),k=kr(u,"handleNW"),{render:S=d}=k,A=Se(k,["render"]),_=kr(u,"handleNE"),{render:T=d}=_,P=Se(_,["render"]),C=kr(u,"handleSE"),{render:N=d}=C,L=Se(C,["render"]),j=kr(u,"handleSW"),{render:R=d}=j,I=Se(j,["render"]),B=t=>()=>{const e=Ym((e=>((t,e)=>{const{id:n}=t,r=e(t,t.attributes,l);r.id=n,r.style.draggable=!0})(e,t)));return new e({})},D=Sm(t).attr("className",a).style("transform",`translate(${n}, ${r})`).style("draggable",!0);D.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(sj,Object.assign(Object.assign({width:i,height:o},Ar(u,"handle")),{transform:void 0})),D.maybeAppend("handle-n",B(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(sj,g),D.maybeAppend("handle-e",B(y)).style("x",i-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(sj,v),D.maybeAppend("handle-s",B(x)).style("x",f).style("y",o-f).style("width",i-c).style("height",c).style("fill","transparent").call(sj,w),D.maybeAppend("handle-w",B(O)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(sj,E),D.maybeAppend("handle-nw",B(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(sj,A),D.maybeAppend("handle-ne",B(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(sj,P),D.maybeAppend("handle-se",B(N)).style("x",i-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(sj,L),D.maybeAppend("handle-sw",B(R)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(sj,I)}));function lj(t,e){var{brushed:n=()=>{},brushended:r=()=>{},brushcreated:i=()=>{},brushstarted:o=()=>{},brushupdated:a=()=>{},extent:s=aj(t),brushRegion:c=(t,e,n,r,i)=>[t,e,n,r],reverse:l=!1,fill:u="#777",fillOpacity:f="0.3",stroke:d="#fff",selectedHandles:h=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=Se(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,m=null,y=null,v=null,b=null,x=!1;const[w,M,O,E]=s;sL(t,"crosshair"),t.style.draggable=!0;const k=(t,e,n)=>{if(o(n),v&&v.remove(),b&&b.remove(),g=[t,e],l)return S();A()},S=()=>{b=new eg({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:d,pointerEvents:"none"})}),v=new cj({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(v)},A=()=>{v=new cj({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:d,draggable:!0}),className:"mask"}),t.appendChild(v)},_=(t=!0)=>{v&&v.remove(),b&&b.remove(),g=null,m=null,y=null,x=!1,v=null,b=null,r(t)},T=(t,e,r=!0)=>{const[i,o,a,u]=function(t,e,n,r,i){const[o,a,s,c]=i;return[Math.max(o,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,d,h,p]=c(i,o,a,u,s);return l?C(f,d,h,p):P(f,d,h,p),n(f,d,h,p,r),[f,d,h,p]},P=(t,e,n,r)=>{v.style.x=t,v.style.y=e,v.style.width=n-t,v.style.height=r-e},C=(t,e,n,r)=>{b.style.d=`\n M${w},${M}L${O},${M}L${O},${E}L${w},${E}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,v.style.x=t,v.style.y=e,v.style.width=n-t,v.style.height=r-e},N={"handle-n":{vector:[0,1,0,0],cursor:"ns-resize"},"handle-e":{vector:[0,0,1,0],cursor:"ew-resize"},"handle-s":{vector:[0,0,0,1],cursor:"ns-resize"},"handle-w":{vector:[1,0,0,0],cursor:"ew-resize"},"handle-nw":{vector:[1,1,0,0],cursor:"nwse-resize"},"handle-ne":{vector:[0,1,1,0],cursor:"nesw-resize"},"handle-se":{vector:[0,0,1,1],cursor:"nwse-resize"},"handle-sw":{vector:[1,0,0,1],cursor:"nesw-resize"}},L=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==h.indexOf(e)&&new Set(Object.keys(N)).has(e)},R=t=>t===v.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=ZN(t,e);if(!v||!L(n))return k(r,i,e),void(x=!0);L(n)&&(y=[r,i])},B=e=>{const{target:n}=e,r=ZN(t,e);if(!g)return;if(!y)return T(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-y[0],r=t[1]-y[1],i=e(n,g[0],m[0],w,O),o=e(r,g[1],m[1],M,E),a=[g[0]+i,g[1]+o],s=[m[0]+i,m[1]+o];T(a,s)})(r);const[i,o]=[r[0]-y[0],r[1]-y[1]],{id:a}=n;if(N[a]){const[t,e,n,r]=N[a].vector;return T([g[0]+i*t,g[1]+o*e],[m[0]+i*n,m[1]+o*r])}},D=e=>{if(y){y=null;const{x:t,y:n,width:r,height:i}=v.style;return g=[t,n],m=[t+r,n+i],void a(t,n,t+r,n+i,e)}m=ZN(t,e);const[n,r,o,s]=T(g,m);x=!1,i(n,r,o,s,e)},F=t=>{const{target:e}=t;v&&!L(e)&&_()},z=e=>{const{target:n}=e;v&&L(n)&&!x?R(n)?sL(t,"move"):j(n)&&sL(t,N[n.id].cursor):sL(t,"crosshair")},G=()=>{sL(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",B),t.addEventListener("dragend",D),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",G),{mask:v,move(t,e,n,r,i=!0){v||k(t,e,{}),g=[t,e],m=[n,r],T([t,e],[n,r],i)},remove(t=!0){v&&_(t)},destroy(){v&&_(!1),sL(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",B),t.removeEventListener("dragend",D),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",G)}}}function uj(t,e,n){return e.filter((e=>{if(e===t)return!1;const{interaction:r={}}=e.options;return Object.values(r).find((t=>t.brushKey===n))}))}function fj(t,e,n){return uj(t,e,n).map((t=>t.options))}function dj(t,e){var{elements:n,selectedHandles:r,siblings:i=t=>[],datum:o,brushRegion:a,extent:s,reverse:c,scale:l,coordinate:u,series:f=!1,key:d=t=>t,bboxOf:h=t=>{const{x:e,y:n,width:r,height:i}=t.style;return{x:e,y:n,width:r,height:i}},state:p={},emitter:g}=e,m=Se(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),v=i(t),b=v.flatMap(n),x=rL(y,o),w=kr(m,"mask"),{setState:M,removeState:O}=tL(p,x),E=new Map,{width:k,height:S,x:A=0,y:_=0}=h(t),T=s||[0,0,k,S],P=()=>{for(const t of[...y,...b])O(t,"active","inactive")},C=(t,e,n,r)=>{var i;for(const t of v)null===(i=t.brush)||void 0===i||i.remove();const o=new Set;for(const i of y){const{min:a,max:s}=i.getLocalBounds(),[c,l]=a,[u,f]=s;oj([c,l,u,f],[t,e,n,r])?(M(i,"active"),o.add(d(i))):M(i,"inactive")}for(const t of b)o.has(d(t))?M(t,"active"):M(t,"inactive")},N=()=>{for(const t of y)O(t,"inactive");for(const t of E.values())t.remove();E.clear()},L=(e,n,r,i)=>{const o=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),E.set(t,e),e},a=new ig({style:{x:e+A,y:n+_,width:r-e,height:i-n}});t.appendChild(a);for(const t of y){const e=E.get(t)||o(t);e.style.clipPath=a,M(t,"inactive"),M(e,"active")}},j=lj(t,Object.assign(Object.assign({},w),{extent:T,brushRegion:a,reverse:c,selectedHandles:r,brushended:t=>{const e=f?N:P;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const o=Ek(t,e,n,r,l,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:o}});(f?L:C)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const o=Ek(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:o}}))},brushupdated:(t,e,n,r,i)=>{const o=Ek(t,e,n,r,l,u);g.emit("brush:end",Object.assign(Object.assign({},i),{nativeEvent:!0,data:{selection:o}}))},brushstarted:t=>{g.emit("brush:start",t)}})),R=({nativeEvent:t,data:e})=>{if(t)return;const{selection:n}=e,[r,i,o,a]=function(t,e,n){const{x:r,y:i}=e,[o,a]=t,s=kk(o,r),c=kk(a,i),l=[s[0],c[0]],u=[s[1],c[1]],[f,d]=n.map(l),[h,p]=n.map(u);return[f,d,h,p]}(n,l,u);j.move(r,i,o,a,!1)};g.on("brush:highlight",R);const I=({nativeEvent:t}={})=>{t||j.remove(!1)};g.on("brush:remove",I);const B=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),B()},j}function hj(t){var{facet:e,brushKey:n}=t,r=Se(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:c}=t,l=UN(a),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:d,coordinate:h}=s;if(e){const e=l.getBounds(),n=e.min[0],a=e.min[1],s=e.max[0],c=e.max[1];return dj(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>VN(t,i),datum:JN(YN(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:nL(YN(t,i).map((t=>t.options)),f),emitter:o,scale:d,coordinate:h,selectedHandles:void 0},u),r))}const p=dj(l,Object.assign(Object.assign({elements:HN,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return uj(t,e,n).map((t=>UN(t.container)))}(t,i,n),datum:JN([s,...uj(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:nL([c,...fj(t,i,n)],f),emitter:o,scale:d,coordinate:h,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function pj(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function gj(t){return hj(Object.assign(Object.assign({},t),{brushRegion:pj,selectedHandles:["handle-e","handle-w"]}))}function mj(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function yj(t){return hj(Object.assign(Object.assign({},t),{brushRegion:mj,selectedHandles:["handle-n","handle-s"]}))}const vj="axis",bj="axis-line",xj="axis-main-group",wj="axis-hot-area";function Mj(t){return t.getElementsByClassName(vj)}function Oj(t){return t.getElementsByClassName(bj)[0]}function Ej(t){return function(t){return t.getElementsByClassName(xj)[0]}(t).getLocalBounds()}function kj(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=Se(e,["cross","offsetX","offsetY"]);const a=Ej(t),s=Oj(t),[c]=s.getLocalBounds().min,[l,u]=a.min,[f,d]=a.max,h=2*(f-l);return{brushRegion:mj,hotZone:new ig({className:wj,style:Object.assign({width:n?h/2:h,transform:`translate(${(n?l:c-h/2).toFixed(2)}, ${u})`,height:d-u},o)}),extent:n?(t,e,n,r)=>[-1/0,e,1/0,r]:(t,e,n,i)=>[Math.floor(l-r),e,Math.ceil(f-r),i]}}function Sj(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=Se(e,["offsetY","offsetX","cross"]);const a=Ej(t),s=Oj(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,d]=a.max,h=d-u;return{brushRegion:pj,hotZone:new ig({className:wj,style:Object.assign({width:f-l,height:i?h:2*h,transform:`translate(${l}, ${i?u:c-h})`},o)}),extent:i?(t,e,n,r)=>[t,-1/0,n,1/0]:(t,e,r,i)=>[t,Math.floor(u-n),r,Math.ceil(d-n)]}}function Aj(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=UN(i),{x:c,y:l}=s.getBBox(),{coordinate:u}=o;return function(t,e){var{axes:n,elements:r,points:i,horizontal:o,datum:a,offsetY:s,offsetX:c,reverse:l=!1,state:u={},emitter:f,coordinate:d}=e,h=Se(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),m=rL(p,a),{setState:y,removeState:v}=tL(u,m),b=new Map,x=kr(h,"mask"),w=t=>Array.from(b.values()).every((([e,n,r,i])=>t.some((([t,o])=>t>=e&&t<=r&&o>=n&&o<=i)))),M=g.map((t=>t.attributes.scale)),O=t=>t.length>2?[t[0],t[t.length-1]]:t,E=new Map,k=()=>{E.clear();for(let t=0;t<g.length;t++){const e=M[t],{domain:n}=e.getOptions();E.set(t,O(n))}};k();const S=(t,e)=>{const n=[];for(const t of p){const e=i(t);w(e)?(y(t,"active"),n.push(t)):y(t,"inactive")}E.set(t,_(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)return Array.from(E.values());const t=[];for(const[e,n]of E){const r=M[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},A=t=>{for(const t of p)v(t,"active","inactive");k(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},_=(t,e)=>{const n=M[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return O(Ok(n,i))},T=g.some(o)&&g.some((t=>!o(t))),P=[];for(let t=0;t<g.length;t++){const e=g[t],n=o(e)?Sj:kj,{hotZone:r,brushRegion:i,extent:a}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=lj(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?A(n):S(t,n)},brushed(n,r,i,o,s){b.set(e,a(n,r,i,o)),S(t,s)}}));P.push(u)}const C=(t={})=>{const{nativeEvent:e}=t;e||P.forEach((t=>t.remove(!1)))},N=(t,e,n)=>{const[r,i]=t,a=L(r,e,n),s=L(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return o(n)?[a,-1/0,s,1/0]:[-1/0,a,1/0,s]},L=(t,e,n)=>{const{height:r,width:i}=d.getOptions(),a=e.clone();return o(n)?a.update({range:[0,i]}):a.update({range:[r,0]}),a.map(t)},j=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<P.length;t++){const e=n[t],r=P[t],i=g[t];if(e){const n=M[t];r.move(...N(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",C),f.on("brushAxis:highlight",j),()=>{P.forEach((t=>t.destroy())),f.off("brushAxis:remove",C),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:HN,axes:Mj,offsetY:l,offsetX:c,points:t=>t.__data__.points,horizontal:t=>{const{startPos:[e,n],endPos:[r,i]}=t.attributes;return e!==r&&n===i},datum:JN(o),state:nL(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function _j(t){var{hideX:e=!0,hideY:n=!0}=t,r=Se(t,["hideX","hideY"]);return(t,i,o)=>{const{container:a,view:s,options:c,update:l,setState:u}=t,f=UN(a);let d=!1,h=!1,p=s;const{scale:g,coordinate:m}=s;return function(t,e){var{filter:n,reset:r,brushRegion:i,extent:o,reverse:a,emitter:s,scale:c,coordinate:l,selection:u,series:f=!1}=e;const d=kr(Se(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:h,height:p}=t.getBBox(),g=o||[0,0,h,p],m=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),y=lj(t,Object.assign(Object.assign({},d),{extent:g,brushRegion:i,reverse:a,brushcreated:function(t,e,r,i,o){o.nativeEvent=!0,n(u(t,e,r,i),o),y.remove()}}));function v(t){m(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",v);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{y.destroy(),s.off("brush:filter",b),t.removeEventListener("click",v)}}(f,Object.assign(Object.assign({brushRegion:(t,e,n,r)=>[t,e,n,r],selection:(t,e,n,r)=>{const{scale:i,coordinate:o}=p;return Ek(t,e,n,r,i,o)},filter:(t,r)=>_e(this,void 0,void 0,(function*(){if(h)return;h=!0;const[i,a]=t;u("brushFilter",(t=>{const{marks:r}=t,o=r.map((t=>K({axis:Object.assign(Object.assign({},e&&{x:{transform:[{type:"hide"}]}}),n&&{y:{transform:[{type:"hide"}]}})},t,{scale:{x:{domain:i,nice:!1},y:{domain:a,nice:!1}}})));return Object.assign(Object.assign({},c),{marks:o,clip:!0})})),o.emit("brush:filter",Object.assign(Object.assign({},r),{data:{selection:[i,a]}}));const s=yield l();p=s.view,h=!1,d=!0})),reset:t=>{if(h||!d)return;const{scale:e}=s,{x:n,y:r}=e,i=n.getOptions().domain,a=r.getOptions().domain;o.emit("brush:filter",Object.assign(Object.assign({},t),{data:{selection:[i,a]}})),d=!1,p=s,u("brushFilter"),l()},extent:void 0,emitter:o,scale:g,coordinate:m},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function Tj(t){return _j(Object.assign(Object.assign({hideX:!0},t),{brushRegion:pj}))}function Pj(t){return _j(Object.assign(Object.assign({hideY:!0},t),{brushRegion:mj}))}const Cj="slider";function Nj(t,e,n,r=!1,i="x",o="y"){const{marks:a}=t,s=a.map((t=>{var a,s;return K({axis:{x:{transform:[{type:"hide"}]},y:{transform:[{type:"hide"}]}}},t,{scale:e,[n]:Object.assign(Object.assign({},(null===(a=t[n])||void 0===a?void 0:a[i])&&{[i]:Object.assign({preserve:!0},r&&{ratio:null})}),(null===(s=t[n])||void 0===s?void 0:s[o])&&{[o]:{preserve:!0}}),animate:!1})}));return Object.assign(Object.assign({},t),{marks:s,clip:!0,animate:!1})}function Lj(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return Ok(e,[Mk(e,o(r),!0),Mk(e,o(i),!1)])}function jj(t){return[t[0],t[t.length-1]]}function Rj({initDomain:t={},className:e=Cj,prefix:n="slider",setValue:r=(t,e)=>t.setValues(e),hasState:i=!1,wait:o=50,leading:a=!0,trailing:s=!1,getInitValues:c=t=>{var e;const n=null===(e=null==t?void 0:t.attributes)||void 0===e?void 0:e.values;if(0!==n[0]||1!==n[1])return n}}){return(l,u,f)=>{const{container:d,view:h,update:p,setState:g}=l,m=d.getElementsByClassName(e);if(!m.length)return()=>{};let y=!1;const{scale:v,coordinate:b,layout:x}=h,{paddingLeft:w,paddingTop:M,paddingBottom:O,paddingRight:E}=x,{x:k,y:S}=v,A=Bc(b),_=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return A?[n,e]:[e,n]},T=new Map,P=new Set,C={x:t.x||k.getOptions().domain,y:t.y||S.getOptions().domain};for(const t of m){const{orientation:e}=t.attributes,[l,u]=_(e),d=`${n}${W(l)}:filter`,h="x"===l,{ratio:m}=k.getOptions(),{ratio:b}=S.getOptions(),x=t=>{if(t.data){const{selection:e}=t.data,[n=jj(C.x),r=jj(C.y)]=e;return h?[Ok(k,n,m),Ok(S,r,b)]:[Ok(S,r,b),Ok(k,n,m)]}const{value:n}=t.detail;return[Lj(n,v[l],A&&"horizontal"===e),C[u]]},N=ot((e=>_e(this,void 0,void 0,(function*(){const{initValue:r=!1}=e;if(y&&!r)return;y=!0;const{nativeEvent:o=!0}=e,[a,s]=x(e);if(C[l]=a,C[u]=s,o){const t=h?a:s,n=h?s:a;f.emit(d,Object.assign(Object.assign({},e),{nativeEvent:o,data:{selection:[jj(t),jj(n)]}}))}g(t,(t=>Object.assign(Object.assign({},Nj(t,{[l]:{domain:a,nice:!1}},n,i,l,u)),{paddingLeft:w,paddingTop:M,paddingBottom:O,paddingRight:E}))),yield p(),y=!1}))),o,{leading:a,trailing:s}),L=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:o}=i,[a,s]=o;t.dispatchEvent(new up("valuechange",{data:i,nativeEvent:!1}));const c=h?kk(a,k):kk(s,S);r(t,c)};f.on(d,L),t.addEventListener("valuechange",N),T.set(t,N),P.add([d,L]);const j=c(t);j&&t.dispatchEvent(new up("valuechange",{detail:{value:j},nativeEvent:!1,initValue:!0}))}return p(),()=>{for(const[t,e]of T)t.removeEventListener("valuechange",e);for(const[t,e]of P)f.off(t,e)}}}const Ij="g2-scrollbar";function Bj(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(Ij).length)return()=>{};const{scale:a}=i,{x:s,y:c}=a,l={x:[...s.getOptions().domain],y:[...c.getOptions().domain]};s.update({domain:s.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain});return Rj(Object.assign(Object.assign({},t),{initDomain:l,className:Ij,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0]),getInitValues:t=>{const e=t.slider.attributes.values;if(0!==e[0])return e}}))(e,n,r)}}function Dj(t,e,n){return`<${t} style="${Object.entries(n).map((([t,e])=>{return`${n=t,n.replace(/([A-Z])/g,"-$1").toLowerCase()}:${e}`;var n})).join(";")}">${e}</${t}>`}const Fj={backgroundColor:"rgba(0,0,0,0.75)",color:"#fff",width:"max-content",padding:"1px 4px",fontSize:"12px",borderRadius:"2.5px",boxShadow:"0 3px 6px -4px rgba(0,0,0,0.12), 0 6px 16px 0 rgba(0,0,0,0.08), 0 9px 28px 8px rgba(0,0,0,0.05)"};function zj(t){return"text"===t.nodeName&&!!t.isOverflowing()}function Gj(t){var{offsetX:e=8,offsetY:n=8}=t,r=Se(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=kr(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!zj(r))return void t.stopPropagation();const{offsetX:l,offsetY:u}=t,f=l+e-o,d=u+n-a;if(r.tip)return r.tip.style.x=f,void(r.tip.style.y=d);const{text:h}=r.style,p=new Qp({className:"poptip",style:{innerHTML:Dj("div",h,Object.assign(Object.assign({},Fj),s)),x:f,y:d}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;zj(e)?e.tip&&(e.tip.remove(),e.tip=null,c.delete(e.tip)):t.stopPropagation()};return i.addEventListener("pointerover",l),i.addEventListener("pointerout",u),()=>{i.removeEventListener("pointerover",l),i.removeEventListener("pointerout",u),c.forEach((t=>t.remove()))}}}Gj.props={reapplyWhenUpdate:!0};const Wj={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function $j(t={}){const{originData:e=[],layout:n}=t,r=Se(t,["originData","layout"]),i=K({},Wj,r),o=kr(i,"breadCrumb"),a=kr(i,"active");return t=>{const{update:r,setState:i,container:s,options:c}=t,l=function(t){return Sm(t).select(`.${cS}`).node()}(s),u=c.marks[0],{state:f}=u,d=new Kp;l.appendChild(d);const h=(t,c)=>_e(this,void 0,void 0,(function*(){if(d.removeChildren(),c){let e="",n=o.y,r=0;const i=[],s=l.getBBox().width,c=t.map(((a,c)=>{e=`${e}${a}/`,i.push(a);const l=new og({name:e.replace(/\/$/,""),style:Object.assign(Object.assign({text:a,x:r,path:[...i],depth:c},o),{y:n})});d.appendChild(l),r+=l.getBBox().width;const u=new og({style:Object.assign(Object.assign({x:r,text:" / "},o),{y:n})});return d.appendChild(u),r+=u.getBBox().width,r>s&&(n=d.getBBox().height+o.y,r=0,l.attr({x:r,y:n}),r+=l.getBBox().width,u.attr({x:r,y:n}),r+=u.getBBox().width),c===ct(t)-1&&u.remove(),l}));c.forEach(((t,e)=>{if(e===ct(c)-1)return;const n=Object.assign({},t.attributes);t.attr("cursor","pointer"),t.addEventListener("mouseenter",(()=>{t.attr(a)})),t.addEventListener("mouseleave",(()=>{t.attr(n)})),t.addEventListener("click",(()=>{h(et(t,["style","path"]),et(t,["style","depth"]))}))}))}!function(t,e){[...QL(t),...JL(t)].forEach((t=>{e(t,(t=>t))}))}(s,i),i("treemapDrillDown",(r=>{const{marks:i}=r,o=t.join("/"),a=i.map((t=>{if("rect"!==t.type)return t;let r=e;if(c){const t=e.filter((t=>{const e=et(t,["id"]);return e&&(e.match(`${o}/`)||o.match(e))})).map((t=>({value:0===t.height?et(t,["value"]):void 0,name:et(t,["id"])}))),{paddingLeft:i,paddingBottom:a,paddingRight:s}=n,l=Object.assign(Object.assign({},n),{paddingTop:(n.paddingTop||d.getBBox().height+10)/(c+1),paddingLeft:i/(c+1),paddingBottom:a/(c+1),paddingRight:s/(c+1),path:t=>t.name,layer:t=>t.depth===c+1});r=YO(t,l,{value:"value"})[0]}else r=e.filter((t=>1===t.depth));const i=[];return r.forEach((({path:t})=>{i.push(N(t))})),K({},t,{data:r,scale:{color:{domain:i}}})}));return Object.assign(Object.assign({},r),{marks:a})})),yield r(void 0,["legendFilter"])})),p=t=>{const n=t.target;if("rect"!==et(n,["markType"]))return;const r=et(n,["__data__","key"]),i=A(e,(t=>t.id===r));et(i,"height")&&h(et(i,"path"),et(i,"depth"))};l.addEventListener("click",p);const g=E(Object.assign(Object.assign({},f.active),f.inactive)),m=()=>{dL(l).forEach((t=>{const n=et(t,["style","cursor"]),r=A(e,(e=>e.id===et(t,["__data__","key"])));if("pointer"!==n&&(null==r?void 0:r.height)){t.style.cursor="pointer";const e=rt(t.attributes,g);t.addEventListener("mouseenter",(()=>{t.attr(f.active)})),t.addEventListener("mouseleave",(()=>{t.attr(K(e,f.inactive))}))}}))};return m(),l.addEventListener("mousemove",m),()=>{d.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",m)}}}const Hj={pointR:6,pointStrokeWidth:1,pointStroke:"#888",pointActiveStroke:"#f5f5f5",pathStroke:"#888",pathLineDash:[3,4],labelFontSize:12,labelFill:"#888",labelStroke:"#fff",labelLineWidth:1,labelY:-6,labelX:2},Vj="movePoint",Yj=t=>{const e=t.target,{markType:n}=e;"line"===n&&(e.attr("_lineWidth",e.attr("lineWidth")||1),e.attr("lineWidth",e.attr("_lineWidth")+3)),"interval"===n&&(e.attr("_opacity",e.attr("opacity")||1),e.attr("opacity",.7*e.attr("_opacity")))},Uj=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},qj=(t,e,n)=>e.map((e=>{const r=["x","color"].reduce(((r,i)=>{const o=n[i];return o?e[o]===t[o]&&r:r}),!0);return r?Object.assign(Object.assign({},e),t):e})),Xj=t=>{const e=et(t,["__data__","y"]),n=et(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:o},childNodes:a}=t.parentNode,s=A(o,(({type:t})=>"normalizeY"===t)),c=et(i,["y","field"]),l=r[a.indexOf(t)][c];return(t,e=!1)=>s||e?t/(1-t)/(n/(1-n))*l:t},Zj=(t,e)=>{const n=et(t,["__data__","seriesItems",e,"0","value"]),r=et(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:o,transform:a}}=t.parentNode,s=A(a,(({type:t})=>"normalizeY"===t)),c=et(o,["y","field"]),l=i[r][c];return t=>s?1===n?t:t/(1-t)/(n/(1-n))*l:t},Kj=(t,e,n)=>{t.forEach(((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)}))},Qj=(t,e,n,r)=>{const i=new eg({style:n}),o=new og({style:r});return e.appendChild(o),t.appendChild(i),[i,o]},Jj=(t,e)=>{if(!et(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},tR=(t,e,n)=>{const r=uL(t,e),i=uL(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function eR(t={}){const{selection:e=[],precision:n=2}=t,r=Se(t,["selection","precision"]),i=Object.assign(Object.assign({},Hj),r||{}),o=kr(i,"path"),a=kr(i,"label"),s=kr(i,"point");return(t,r,i)=>{const{update:c,setState:l,container:u,view:f,options:{marks:d,coordinate:h}}=t,p=UN(u);let g,m=dL(p),y=e;const{transform:v=[],type:b}=h,x=!!A(v,(({type:t})=>"transpose"===t)),w="polar"===b,M="theta"===b,O=!!A(m,(({markType:t})=>"area"===t));O&&(m=m.filter((({markType:t})=>"area"===t)));const E=new Kp({style:{zIndex:2}});p.appendChild(E);const k=()=>{i.emit("element-point:select",{nativeEvent:!0,data:{selection:y}})},S=t=>{const e=t.target;y=[e.parentNode.childNodes.indexOf(e)],k(),T(e)},_=t=>{const{data:{selection:e},nativeEvent:n}=t;if(n)return;y=e;const r=et(m,[null==y?void 0:y[0]]);r&&T(r)},T=t=>{const{attributes:e,markType:r,__data__:h}=t,{stroke:p}=e,{points:m,seriesTitle:v,color:b,title:S,seriesX:A,y1:_}=h;if(x&&"interval"!==r)return;const{scale:P,coordinate:C}=(null==g?void 0:g.view)||f,{color:N,y:L,x:j}=P,R=C.getCenter();let I;E.removeChildren();const B=(t,e,n,r)=>_e(this,void 0,void 0,(function*(){return l("elementPointMove",(o=>{var a;const s=((null===(a=null==g?void 0:g.options)||void 0===a?void 0:a.marks)||d).map((o=>{if(!r.includes(o.type))return o;const{data:a,encode:s}=o,c=Object.keys(s).reduce(((r,i)=>{const o=s[i];return"x"===i&&(r[o]=t),"y"===i&&(r[o]=e),"color"===i&&(r[o]=n),r}),{}),l=qj(c,a,s);return((t,e)=>{i.emit("element-point:moved",{nativeEvent:!0,data:{changeData:t,data:e}})})(c,l),K({},o,{data:l,animate:!1})}));return Object.assign(Object.assign({},o),{marks:s})})),yield c("elementPointMove")}));if(["line","area"].includes(r))m.forEach(((e,r)=>{const i=j.invert(A[r]);if(!i)return;const c=new qp({name:Vj,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),l=Zj(t,r);c.addEventListener("mousedown",(f=>{const d=C.output([A[r],0]),h=null==v?void 0:v.length;u.attr("cursor","move"),y[1]!==r&&(y[1]=r,k()),Kj(E.childNodes,y,s);const[p,x]=Qj(E,c,o,a),M=t=>{const i=e[1]+t.clientY-I[1];if(O)if(w){const o=e[0]+t.clientX-I[0],[a,s]=tR(R,d,[o,i]),[,u]=C.output([1,L.output(0)]),[,f]=C.invert([a,u-(m[r+h][1]-s)]),g=(r+1)%h,y=fL([m[(r-1+h)%h],[a,s],v[g]&&m[g]]);x.attr("text",l(L.invert(f)).toFixed(n)),p.attr("d",y),c.attr("cx",a),c.attr("cy",s)}else{const[,t]=C.output([1,L.output(0)]),[,o]=C.invert([e[0],t-(m[r+h][1]-i)]),a=fL([m[r-1],[e[0],i],v[r+1]&&m[r+1]]);x.attr("text",l(L.invert(o)).toFixed(n)),p.attr("d",a),c.attr("cy",i)}else{const[,t]=C.invert([e[0],i]),o=fL([m[r-1],[e[0],i],m[r+1]]);x.attr("text",L.invert(t).toFixed(n)),p.attr("d",o),c.attr("cy",i)}};I=[f.clientX,f.clientY],window.addEventListener("mousemove",M);const S=()=>_e(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",M),u.removeEventListener("mouseup",S),V(x.attr("text")))return;const e=Number(x.attr("text")),n=Jj(N,b);g=yield B(i,e,n,["line","area"]),x.remove(),p.remove(),T(t)}));u.addEventListener("mouseup",S)})),E.appendChild(c)})),Kj(E.childNodes,y,s);else if("interval"===r){let e=[(m[0][0]+m[1][0])/2,m[0][1]];x?e=[m[0][0],(m[0][1]+m[1][1])/2]:M&&(e=m[0]);const i=Xj(t),c=new qp({name:Vj,style:Object.assign(Object.assign({cx:e[0],cy:e[1],fill:p},s),{stroke:s.activeStroke})});c.addEventListener("mousedown",(s=>{u.attr("cursor","move");const l=Jj(N,b),[f,d]=Qj(E,c,o,a),h=t=>{if(x){const r=e[0]+t.clientX-I[0],[o]=C.output([L.output(0),L.output(0)]),[,a]=C.invert([o+(r-m[2][0]),e[1]]),s=fL([[r,m[0][1]],[r,m[1][1]],m[2],m[3]],!0);d.attr("text",i(L.invert(a)).toFixed(n)),f.attr("d",s),c.attr("cx",r)}else if(M){const r=e[1]+t.clientY-I[1],o=e[0]+t.clientX-I[0],[a,s]=tR(R,[o,r],e),[l,u]=tR(R,[o,r],m[1]),h=C.invert([a,s])[1],p=_-h;if(p<0)return;const g=function(t,e,n=0){const r=[["M",...e[1]]],i=uL(t,e[1]),o=uL(t,e[0]);return 0===i?r.push(["L",...e[3]],["A",o,o,0,n,1,...e[0]],["Z"]):r.push(["A",i,i,0,n,0,...e[2]],["L",...e[3]],["A",o,o,0,n,1,...e[0]],["Z"]),r}(R,[[a,s],[l,u],m[2],m[3]],p>.5?1:0);d.attr("text",i(p,!0).toFixed(n)),f.attr("d",g),c.attr("cx",a),c.attr("cy",s)}else{const r=e[1]+t.clientY-I[1],[,o]=C.output([1,L.output(0)]),[,a]=C.invert([e[0],o-(m[2][1]-r)]),s=fL([[m[0][0],r],[m[1][0],r],m[2],m[3]],!0);d.attr("text",i(L.invert(a)).toFixed(n)),f.attr("d",s),c.attr("cy",r)}};I=[s.clientX,s.clientY],window.addEventListener("mousemove",h);const p=()=>_e(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",h),V(d.attr("text")))return;const e=Number(d.attr("text"));g=yield B(S,e,l,[r]),d.remove(),f.remove(),T(t)}));u.addEventListener("mouseup",p)})),E.appendChild(c)}};m.forEach(((t,e)=>{y[0]===e&&T(t),t.addEventListener("click",S),t.addEventListener("mouseenter",Yj),t.addEventListener("mouseleave",Uj)}));const P=t=>{const e=null==t?void 0:t.target;e&&(e.name===Vj||m.includes(e))||(y=[],k(),E.removeChildren())};return i.on("element-point:select",_),i.on("element-point:unselect",P),u.addEventListener("mousedown",P),()=>{E.remove(),i.off("element-point:select",_),i.off("element-point:unselect",P),u.removeEventListener("mousedown",P),m.forEach((t=>{t.removeEventListener("click",S),t.removeEventListener("mouseenter",Yj),t.removeEventListener("mouseleave",Uj)}))}}}var nR={},rR={};function iR(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function oR(t){var e=Object.create(null),n=[];return t.forEach((function(t){for(var r in t)r in e||n.push(e[r]=r)})),n}function aR(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function sR(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+aR(-t,6):t>9999?"+"+aR(t,6):aR(t,4)}(t.getUTCFullYear())+"-"+aR(t.getUTCMonth()+1,2)+"-"+aR(t.getUTCDate(),2)+(i?"T"+aR(e,2)+":"+aR(n,2)+":"+aR(r,2)+"."+aR(i,3)+"Z":r?"T"+aR(e,2)+":"+aR(n,2)+":"+aR(r,2)+"Z":n||e?"T"+aR(e,2)+":"+aR(n,2)+"Z":"")}function cR(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,s=0,c=o<=0,l=!1;function u(){if(c)return rR;if(l)return l=!1,nR;var e,r,i=a;if(34===t.charCodeAt(i)){for(;a++<o&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(e=a)>=o?c=!0:10===(r=t.charCodeAt(a++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a<o;){if(10===(r=t.charCodeAt(e=a++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(a)&&++a;else if(r!==n)continue;return t.slice(i,e)}return c=!0,t.slice(i,o)}for(10===t.charCodeAt(o-1)&&--o,13===t.charCodeAt(o-1)&&--o;(r=u())!==rR;){for(var f=[];r!==nR&&r!==rR;)f.push(r),r=u();e&&null==(f=e(f,s++))||i.push(f)}return i}function i(e,n){return e.map((function(e){return n.map((function(t){return a(e[t])})).join(t)}))}function o(e){return e.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?sR(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=iR(t);return function(r,i){return e(n(r),i,t)}}(t,e):iR(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=oR(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=oR(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function lR(t){for(var e in t){var n,r,i=t[e].trim();if(i)if("true"===i)i=!0;else if("false"===i)i=!1;else if("NaN"===i)i=NaN;else if(isNaN(n=+i)){if(!(r=i.match(/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/)))continue;uR&&r[4]&&!r[7]&&(i=i.replace(/-/g,"/").replace(/T/," ")),i=new Date(i)}else i=n;else i=null;t[e]=i}return t}const uR=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),fR=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>_e(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return cR(r).parse(e,i?lR:vr)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};fR.props={};const dR=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap((t=>e.map((e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))))):t;var i}};function hR(t){return null!=t&&!Number.isNaN(t)}dR.props={};const pR=t=>{const{callback:e=hR}=t;return t=>t.filter(e)};pR.props={};const gR=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};gR.props={};const mR=t=>{const{fields:e}=t;return t=>t.map((t=>function(t,e=[]){return e.reduce(((e,n)=>(n in t&&(e[n]=t[n]),e)),{})}(t,e)))};mR.props={};const yR=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map((e=>Object.entries(e).reduce(((e,[n,r])=>(e[t[n]||n]=r,e)),{})))};yR.props={};const vR=t=>{const{fields:e=[]}=t,n=(r=!0,e.map((t=>{if(Array.isArray(t)){const[e,n=r]=t;return[e,n]}return[t,r]})));var r;return t=>[...t].sort(((t,e)=>n.reduce(((n,[r,i=!0])=>0!==n?n:i?t[r]<e[r]?-1:+(t[r]!==e[r]):t[r]>e[r]?-1:+(t[r]!==e[r])),0)))};vR.props={};const bR=t=>{const{value:e}=t;return()=>e};bR.props={};const xR=t=>{const{callback:e=vr}=t;return t=>e(t)};xR.props={};const wR=t=>{const{callback:e=vr}=t;return t=>Array.isArray(t)?t.map(e):t};wR.props={};const MR=Math.PI/180,OR=64,ER=2048;function kR(t){return t.text}function SR(){return"serif"}function AR(){return"normal"}function _R(t){return t.value}function TR(){return 90*~~(2*Math.random())}function PR(){return 1}function CR(){}function NR(t,e,n,r){if(e.sprite)return;const i=t.context,o=t.ratio;i.clearRect(0,0,(OR<<5)/o,ER/o);let a=0,s=0,c=0;const l=n.length;for(--r;++r<l;){e=n[r],i.save(),i.font=e.style+" "+e.weight+" "+~~((e.size+1)/o)+"px "+e.font;let t=i.measureText(e.text+"m").width*o,l=e.size<<1;if(e.rotate){const n=Math.sin(e.rotate*MR),r=Math.cos(e.rotate*MR),i=t*r,o=t*n,a=l*r,s=l*n;t=Math.max(Math.abs(i+s),Math.abs(i-s))+31>>5<<5,l=~~Math.max(Math.abs(o+a),Math.abs(o-a))}else t=t+31>>5<<5;if(l>c&&(c=l),a+t>=OR<<5&&(a=0,s+=c,c=0),s+l>=ER)break;i.translate((a+(t>>1))/o,(s+(l>>1))/o),e.rotate&&i.rotate(e.rotate*MR),i.fillText(e.text,0,0),e.padding&&(i.lineWidth=2*e.padding,i.strokeText(e.text,0,0)),i.restore(),e.width=t,e.height=l,e.xoff=a,e.yoff=s,e.x1=t>>1,e.y1=l>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,a+=t}const u=i.getImageData(0,0,(OR<<5)/o,ER/o).data,f=[];for(;--r>=0;){if(!(e=n[r]).hasText)continue;const t=e.width,i=t>>5;let o=e.y1-e.y0;for(let t=0;t<o*i;t++)f[t]=0;if(a=e.xoff,null==a)return;s=e.yoff;let c=0,l=-1;for(let n=0;n<o;n++){for(let e=0;e<t;e++){const t=i*n+(e>>5),r=u[(s+n)*(OR<<5)+(a+e)<<2]?1<<31-e%32:0;f[t]|=r,c|=r}c?l=n:(e.y0++,o--,n--,s++)}e.y1=e.y0+l,e.sprite=f.slice(0,(e.y1-e.y0)*i)}}function LR(t,e,n){n>>=5;const r=t.sprite,i=t.width>>5,o=t.x-(i<<4),a=127&o,s=32-a,c=t.y1-t.y0;let l,u=(t.y+t.y0)*n+(o>>5);for(let t=0;t<c;t++){l=0;for(let n=0;n<=i;n++)if((l<<s|(n<i?(l=r[t*i+n])>>>a:0))&e[u+n])return!0;u+=n}return!1}function jR(t,e){const n=t[0],r=t[1];e.x+e.x0<n.x&&(n.x=e.x+e.x0),e.y+e.y0<n.y&&(n.y=e.y+e.y0),e.x+e.x1>r.x&&(r.x=e.x+e.x1),e.y+e.y1>r.y&&(r.y=e.y+e.y1)}function RR(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function IR(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function BR(){return document.createElement("canvas")}function DR(t){return"function"==typeof t?t:function(){return t}}const FR={archimedean:RR,rectangular:function(t){const e=4*t[0]/t[1];let n=0,r=0;return function(t){const i=t<0?-1:1;switch(Math.sqrt(1+4*i*t)-i&3){case 0:n+=e;break;case 1:r+=4;break;case 2:n-=e;break;default:r-=4}return[n,r]}}};function zR(){let t=[256,256],e=kR,n=SR,r=_R,i=AR,o=TR,a=PR,s=RR,c=Math.random,l=CR,u=[],f=null,d=1/0,h=BR;const p=AR,g={};function m(e,n,r){const i=n.x,o=n.y,a=Math.sqrt(t[0]*t[0]+t[1]*t[1]),l=s(t),u=c()<.5?1:-1;let f,d,h,p=-u;for(;(f=l(p+=u))&&(d=~~f[0],h=~~f[1],!(Math.min(Math.abs(d),Math.abs(h))>=a));)if(n.x=i+d,n.y=o+h,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1]||r&&LR(n,e,t[0])||r&&(m=r,!((g=n).x+g.x1>m[0].x&&g.x+g.x0<m[1].x&&g.y+g.y1>m[0].y&&g.y+g.y0<m[1].y)))){const r=n.sprite,i=n.width>>5,o=t[0]>>5,a=n.x-(i<<4),s=127&a,c=32-s,l=n.y1-n.y0;let u,f=(n.y+n.y0)*o+(a>>5);for(let t=0;t<l;t++){u=0;for(let n=0;n<=i;n++)e[f+n]|=u<<c|(n<i?(u=r[t*i+n])>>>s:0);f+=o}return delete n.sprite,!0}var g,m;return!1}return g.start=function(){const[s,y]=t,v=function(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=(OR<<5)/e,t.height=ER/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",n.textBaseline="middle",{context:n,ratio:e}}(h()),b=g.board?g.board:IR((t[0]>>5)*t[1]),x=u.length,w=[],M=u.map((function(t,s,c){return t.text=e.call(this,t,s,c),t.font=n.call(this,t,s,c),t.style=p.call(this,t,s,c),t.weight=i.call(this,t,s,c),t.rotate=o.call(this,t,s,c),t.size=~~r.call(this,t,s,c),t.padding=a.call(this,t,s,c),t})).sort((function(t,e){return e.size-t.size}));let O=-1,E=g.board?[{x:0,y:0},{x:s,y:y}]:void 0;function k(){const e=Date.now();for(;Date.now()-e<d&&++O<x;){const e=M[O];e.x=s*(c()+.5)>>1,e.y=y*(c()+.5)>>1,NR(v,e,M,O),e.hasText&&m(b,e,E)&&(l.call(null,"word",{cloud:g,word:e}),w.push(e),E?g.hasImage||jR(E,e):E=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=t[0]>>1,e.y-=t[1]>>1)}g._tags=w,g._bounds=E,O>=x&&(g.stop(),l.call(null,"end",{cloud:g,words:w,bounds:E}))}return f&&clearInterval(f),f=setInterval(k,0),k(),g},g.stop=function(){return f&&(clearInterval(f),f=null),g},g.createMask=e=>{const n=document.createElement("canvas"),[r,i]=t;if(!r||!i)return;const o=r>>5,a=IR((r>>5)*i);n.width=r,n.height=i;const s=n.getContext("2d");s.drawImage(e,0,0,e.width,e.height,0,0,r,i);const c=s.getImageData(0,0,r,i).data;for(let t=0;t<i;t++)for(let e=0;e<r;e++){const n=o*t+(e>>5),i=t*r+e<<2,s=c[i]>=250&&c[i+1]>=250&&c[i+2]>=250?1<<31-e%32:0;a[n]|=s}g.board=a,g.hasImage=!0},g.timeInterval=function(t){d=null==t?1/0:t},g.words=function(t){u=t},g.size=function(e=[]){t=[+e[0],+e[1]]},g.text=function(t){e=DR(t)},g.font=function(t){n=DR(t)},g.fontWeight=function(t){i=DR(t)},g.rotate=function(t){o=DR(t)},g.canvas=function(t){h=DR(t)},g.spiral=function(t){s=FR[t]||t},g.fontSize=function(t){r=DR(t)},g.padding=function(t){a=DR(t)},g.random=function(t){c=DR(t)},g.on=function(t){l=DR(t)},g}const GR={fontSize:[20,60],font:"Impact",padding:2,rotate:function(){return 30*(~~(6*Math.random())-3)}};function WR(t){return new Promise(((e,n)=>{if(t instanceof HTMLImageElement)e(t);else{if("string"==typeof t){const r=new Image;return r.crossOrigin="anonymous",r.src=t,r.onload=()=>e(r),void(r.onerror=()=>{console.error(`'image ${t} load failed !!!'`),n()})}n()}}))}const $R=(t,e)=>n=>_e(void 0,void 0,void 0,(function*(){const r=Object.assign({},GR,t,{canvas:e.createCanvas}),i=zR();var o,a;yield(o=i,a=r,{set(t,e,n){if(void 0===a[t])return this;const r=e?e.call(null,a[t]):a[t];return n?n.call(null,r):"function"==typeof o[t]?o[t](r):o[t]=r,this},setAsync(t,e,n){return _e(this,void 0,void 0,(function*(){if(void 0===a[t])return this;const r=e?yield e.call(null,a[t]):a[t];return n?n.call(null,r):"function"==typeof o[t]?o[t](r):o[t]=r,this}))}}).set("fontSize",(t=>{const e=n.map((t=>t.value));return function(t,e){if("function"==typeof t)return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,o]=e;return o===i?()=>(r+n)/2:({value:t})=>(r-n)/(o-i)*(t-i)+n}return()=>t}(t,[ur(e),cr(e)])})).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").set("canvas").setAsync("imageMask",WR,i.createMask),i.words([...n]);const s=i.start(),[c,l]=r.size,u=[{x:0,y:0},{x:c,y:l}],{_bounds:f=u,_tags:d,hasImage:h}=s,p=d.map((t=>{var{x:e,y:n,font:r}=t,i=Se(t,["x","y","font"]);return Object.assign(Object.assign({},i),{x:e+c/2,y:n+l/2,fontFamily:r})})),[{x:g,y:m},{x:y,y:v}]=f,b={text:"",value:0,opacity:0,fontSize:0};return p.push(Object.assign(Object.assign({},b),{x:h?0:g,y:h?0:m}),Object.assign(Object.assign({},b),{x:h?c:y,y:h?l:v})),p}));function HR(t){return"string"==typeof t?e=>e[t]:t}$R.props={};const VR=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=HR(s),l=HR(a),u=Un(e,(([t])=>t),(t=>c(t)));return t=>t.map((t=>{const e=u.get(l(t));return Object.assign(Object.assign({},t),r.reduce(((t,n,r)=>(t[i[r]]=e?e[n]:o,t)),{}))}))};VR.props={};const YR=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};YR.props={};var UR={exports:{}},qR={exports:{}};!function(t){var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}}(qR),function(t){var e=Math.log(2),n=t.exports,r=qR.exports;function i(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return n.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,o=r.isNumber(e.width)?e.width:2,a=r.isNumber(e.size)?e.size:50,s=r.isNumber(e.min)?e.min:(n=!0,r.findMinMulti(t)),c=r.isNumber(e.max)?e.max:(i=!0,r.findMaxMulti(t)),l=(c-s)/(a-1);return n&&(s-=2*o*l),i&&(c+=2*o*l),{min:s,max:c}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var o=r.isNumber(e.size)?e.size:50,a=r.isNumber(e.width)?e.width:2,s=n.getUnifiedMinMax(t,{size:o,width:a,min:e.min,max:e.max}),c=s.min,l=s.max-c,u=l/(o-1);if(0===l)return[{x:c,y:1}];for(var f=[],d=0;d<o;d++)f.push({x:c+d*u,y:0});var h=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(i,a),p=h[a],g=h[a-1]-h[a-2],m=0;t.forEach((function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+a<0||e-a>=f.length)){var n=Math.max(e-a,0),i=e,o=Math.min(e+a,f.length-1),s=n-(e-a),l=e+a-o,d=h[-a-1+s]||0,y=h[-a-1+l]||0,v=p/(p-d-y);s>0&&(m+=v*(s-1)*g);var b=Math.max(0,e-a+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*v*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*v*g),r.inside(0,f.length-1,o+1)&&(f[o+1].y+=1*v*g)}}));var y=m,v=0,b=0;return f.forEach((function(t){v+=t.y,y+=v,t.y=y,b+=y})),b>0&&f.forEach((function(t){t.y/=b})),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach((function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)})),n=-n/e,Math.pow(2,n)}}}(UR);var XR=UR.exports;const ZR=t=>{const{field:e,groupBy:n,as:r=["y","size"],min:i,max:o,size:a=10,width:s}=t,[c,l]=r;return t=>{const r=Array.from(Vn(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=XR.create(t.map((t=>t[e])),{min:i,max:o,size:a,width:s}),r=n.map((t=>t.x)),u=n.map((t=>t.y));return Object.assign(Object.assign({},t[0]),{[c]:r,[l]:u})}))}};ZR.props={};const KR=()=>t=>(console.log("G2 data section:",t),t);function QR(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function JR(t,e){const[n,r]=t,[i,o]=e;return n>=i[0]&&n<=o[0]&&r>=i[1]&&r<=o[1]}KR.props={};const tI=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{$N(t);const e=t.getLocalBounds(),r=n.some((t=>function(t,e){const[n,r]=t,[i,o]=e;return n[0]<o[0]&&r[0]>i[0]&&n[1]<o[1]&&r[1]>i[1]}(QR(e),QR(t.getLocalBounds()))));r?WN(t):n.push(t)})),t}};function eI([t,e],[n,r]){return r>t&&e>n}function nI(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function rI(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const iI=t=>{const{maxIterations:e=10,maxError:n=.1,padding:r=1}=t;return t=>{const i=t.length;if(i<=1)return t;const[o,a]=nI(),[s,c]=nI(),[l,u]=nI(),[f,d]=nI();for(const e of t){const{min:t,max:n}=rI(e),[r,i]=t,[o,s]=n;a(e,i),c(e,i),u(e,s-i),d(e,[r,o])}for(let o=0;o<e;o++){t.sort(((t,e)=>_n(s(t),s(e))));let e=0;for(let n=0;n<i-1;n++){const i=t[n];let o,a=n+1;for(;(o=t[a])&&!eI(f(i),f(o));)a+=1;if(o){const t=s(i),n=l(i),a=s(o),u=a-(t+n);if(u<r){const n=(r-u)/2;e=Math.max(e,n),c(i,t-n),c(o,a+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-o(e);return t}};function oI(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function aI(t,e,n){return.2126*oI(t)+.7152*oI(e)+.0722*oI(n)}function sI(t,e){const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=aI(n,r,i),l=aI(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function cI(t,e){const n=lr(e,(e=>sI(t,function(t){return"object"==typeof t?t:$f(t)}(e))));return e[n]}const lI=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;sI(t.parsedStyle.fill,r)<e&&t.attr("fill",cI(r,n))})),t)},uI=()=>t=>(t.forEach((t=>{$N(t);const e=t.attr("bounds"),n=function(t,e){const[n,r]=t;return!(JR(n,e)&&JR(r,e))}(QR(t.getLocalBounds()),e);n&&WN(t)})),t),fI=()=>(t,{canvas:e})=>{const{width:n,height:r}=e.getConfig();return t.forEach((t=>{$N(t);const{max:e,min:i}=t.getRenderBounds(),[o,a]=e,[s,c]=i,l=((t,e)=>{const[[n,r],[i,o]]=e,[[a,s],[c,l]]=t;let u=0,f=0;return a<n?u=n-a:c>i&&(u=i-c),s<r?f=r-s:l>o&&(f=o-l),[u,f]})([[s,c],[o,a]],[[0,0],[n,r]]);t.style.x+=l[0],t.style.y+=l[1]})),t};function dI(){return{"data.fetch":fR,"data.inline":bR,"data.sortBy":vR,"data.sort":gR,"data.filter":pR,"data.pick":mR,"data.rename":yR,"data.fold":dR,"data.slice":YR,"data.custom":xR,"data.map":wR,"data.join":VR,"data.kde":ZR,"data.log":KR,"data.wordCloud":$R,"transform.stackY":Ur,"transform.binX":ks,"transform.bin":Es,"transform.dodgeX":yi,"transform.jitter":ja,"transform.jitterX":Ra,"transform.jitterY":Ia,"transform.symmetryY":Ba,"transform.diffY":Da,"transform.stackEnter":vi,"transform.normalizeY":bi,"transform.select":$a,"transform.selectX":Ha,"transform.selectY":Va,"transform.groupX":rs,"transform.groupY":is,"transform.groupColor":os,"transform.group":ns,"transform.sortX":cs,"transform.sortY":us,"transform.sortColor":ls,"transform.flexX":fs,"transform.pack":ws,"transform.sample":As,"transform.filter":_s,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":i,"coordinate.theta":o,"coordinate.parallel":c,"coordinate.fisheye":l,"coordinate.radial":s,"coordinate.radar":u,"encode.constant":f,"encode.field":h,"encode.transform":d,"encode.column":p,"mark.interval":TM,"mark.rect":CM,"mark.line":RM,"mark.point":BM,"mark.text":FM,"mark.cell":GM,"mark.area":$M,"mark.link":VM,"mark.image":UM,"mark.polygon":XM,"mark.box":KM,"mark.vector":JM,"mark.lineX":rO,"mark.lineY":eO,"mark.connector":oO,"mark.range":lO,"mark.rangeX":fO,"mark.rangeY":hO,"mark.path":gO,"mark.shape":UO,"mark.density":ZO,"mark.heatmap":QO,"mark.wordCloud":qO,"palette.category10":JO,"palette.category20":tE,"scale.linear":nE,"scale.ordinal":rE,"scale.band":eE,"scale.identity":iE,"scale.point":oE,"scale.time":aE,"scale.log":sE,"scale.pow":cE,"scale.sqrt":dE,"scale.threshold":lE,"scale.quantile":uE,"scale.quantize":fE,"scale.sequential":hE,"scale.constant":pE,"theme.classic":vE,"theme.classicDark":wE,"theme.academy":OE,"theme.light":yE,"theme.dark":xE,"component.axisX":ek,"component.axisY":nk,"component.legendCategory":ck,"component.legendContinuous":hk,"component.legends":Lk,"component.title":xk,"component.sliderX":_k,"component.sliderY":Tk,"component.scrollbarX":Ck,"component.scrollbarY":Nk,"animation.scaleInX":jk,"animation.scaleOutX":Rk,"animation.scaleInY":Ik,"animation.scaleOutY":Bk,"animation.waveIn":Qk,"animation.fadeIn":Dk,"animation.fadeOut":Fk,"animation.zoomIn":Jk,"animation.zoomOut":tS,"animation.pathIn":eS,"animation.morphing":Kk,"animation.growInX":nS,"animation.growInY":rS,"interaction.elementHighlight":gL,"interaction.elementHighlightByX":mL,"interaction.elementHighlightByColor":yL,"interaction.elementSelect":bL,"interaction.elementSelectByX":xL,"interaction.elementSelectByColor":wL,"interaction.fisheye":OL,"interaction.chartIndex":ML,"interaction.tooltip":$L,"interaction.legendFilter":rj,"interaction.legendHighlight":ij,"interaction.brushHighlight":hj,"interaction.brushXHighlight":gj,"interaction.brushYHighlight":yj,"interaction.brushAxisHighlight":Aj,"interaction.brushFilter":_j,"interaction.brushXFilter":Tj,"interaction.brushYFilter":Pj,"interaction.sliderFilter":Rj,"interaction.scrollbarFilter":Bj,"interaction.poptip":Gj,"interaction.treemapDrillDown":$j,"interaction.elementPointMove":eR,"composition.spaceLayer":C_,"composition.spaceFlex":N_,"composition.facetRect":q_,"composition.repeatMatrix":tT,"composition.facetCircle":aT,"composition.timingKeyframe":cT,"labelTransform.overlapHide":tI,"labelTransform.overlapDodgeY":iI,"labelTransform.overflowHide":uI,"labelTransform.contrastReverse":lI,"labelTransform.exceedAdjust":fI}}function hI(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const pI={};const gI=t=>t?parseInt(t):0;function mI(t,e){const n=[t];for(;n.length;){const t=n.shift();e&&e(t);const r=t.children||[];for(const t of r)n.push(t)}}class yI{constructor(t={},e){this.parentNode=null,this.children=[],this.index=0,this.type=e,this.value=t}map(t=t=>t){const e=t(this.value);return this.value=e,this}attr(t,e){return 1===arguments.length?this.value[t]:this.map((n=>(n[t]=e,n)))}append(t){const e=new t({});return e.children=[],this.push(e),e}push(t){return t.parentNode=this,t.index=this.children.length,this.children.push(t),this}remove(){const t=this.parentNode;if(t){const{children:e}=t,n=e.findIndex((t=>t===this));e.splice(n,1)}return this}getNodeByKey(t){let e=null;return mI(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return mI(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return mI(this,(n=>{e||t===n.type&&(e=n)})),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}const vI=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"],bI="__remove__",xI="__callback__";function wI(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function MI(t,e){const{width:n,height:r,autoFit:i,depth:o=0}=t;let a=640,s=480;if(i){const{width:t,height:n}=function(t){const e=getComputedStyle(t),n=t.clientWidth||gI(e.width),r=t.clientHeight||gI(e.height);return{width:n-(gI(e.paddingLeft)+gI(e.paddingRight)),height:r-(gI(e.paddingTop)+gI(e.paddingBottom))}}(e);a=t||a,s=n||s}return a=n||a,s=r||s,{width:Math.max(j(a)?a:1,1),height:Math.max(j(s)?s:1,1),depth:o}}function OI(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of vI)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,wI(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===xI)e.children=t.value;else{const i=wI(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}function EI(t,e,n,r,i){const{type:o}=t,{type:a=n||o}=e;if(function(t,e){return"function"!=typeof t&&new Set(Object.keys(e)).has(t)}(a,i)){for(const n of vI)void 0!==t.attr(n)&&void 0===e[n]&&(e[n]=t.attr(n));return e}if(function(t,e){return"function"==typeof t||new Set(Object.keys(e)).has(t)}(a,r)){const t={type:"view"},n=Object.assign({},e);for(const e of vI)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function kI(t,e,n){if("function"==typeof t){const e=new yI;return e.value=t,e.type=xI,e}const{type:r,children:i}=t,o=Se(t,["type","children"]),a=function(t,e,n){if("function"==typeof t)return e.mark;const r=Object.assign(Object.assign({},e),n)[t];if(!r)throw new Error(`Unknown mark: ${t}.`);return r}(r,e,n),s=new a;return s.value=o,s.type=r,s}function SI(t,e){const{type:n,children:r}=e,i=Se(e,["type","children"]);t.type===n||void 0===n?Cr(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function AI(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=kI(e,n,r);Array.isArray(t.children)&&t.push(o);const{children:a}=e;if(Array.isArray(a))for(const t of a)i.push([o,t]);else"function"==typeof a&&i.push([o,a])}}function _I(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function TI(t,e,{key:n=e}){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(n);if(Array.isArray(t))return this.attr(n,t);const e=[...this.attr(n)||[],t];return this.attr(n,e)}}function PI(t,e,{key:n=e}){t.prototype[e]=function(t,e){if(0===arguments.length)return this.attr(n);if(1===arguments.length&&"string"!=typeof t)return this.attr(n,t);const r=this.attr(n)||{};return r[t]=1===arguments.length||e,this.attr(n,r)}}function CI(t,e,n){t.prototype[e]=function(t){if(0===arguments.length)return this.attr(e);if(Array.isArray(t))return this.attr(e,{items:t});if(Tr(t)&&(void 0!==t.title||void 0!==t.items))return this.attr(e,t);if(null===t||!1===t)return this.attr(e,t);const n=this.attr(e)||{},{items:r=[]}=n;return r.push(t),n.items=r,this.attr(e,n)}}function NI(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function LI(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function jI(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?_I(e,n,r):"array"===t?TI(e,n,r):"object"===t?PI(e,n,r):"node"===t?NI(e,n,r):"container"===t?LI(e,n,r):"mix"===t&&CI(e,n)}return e}}function RI(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const II={encode:{type:"object"},scale:{type:"object"},data:{type:"value"},transform:{type:"array"},style:{type:"object"},animate:{type:"object"},coordinate:{type:"object"},interaction:{type:"object"},label:{type:"array",key:"labels"},axis:{type:"object"},legend:{type:"object"},slider:{type:"object"},scrollbar:{type:"object"},state:{type:"object"},layout:{type:"object"},theme:{type:"object"},title:{type:"value"}},BI=Object.assign(Object.assign({},II),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),DI=Object.assign(Object.assign({},II),{labelTransform:{type:"array"}});let FI=class extends yI{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach((e=>{e.attr("data",t)})),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find((t=>t.key===this._key))}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&$N(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&WN(t)}};FI=Ae([jI(DI)],FI);let zI=class extends yI{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find((t=>t.key===this.attr("key")));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};zI=Ae([jI(BI)],zI);const GI="G2_CHART_KEY";class WI extends FI{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:o,createCanvas:a}=t;super(Se(t,["container","canvas","renderer","plugins","lib","createCanvas"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=q((()=>{this.forceFit()}),300),this._renderer=r||new lA,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[bI]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new hA,this._context={library:Object.assign(Object.assign({},o),pI),emitter:this._emitter,canvas:n,createCanvas:a},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._context.canvas.getConfig().supportsCSSTransform=!0,this._bindAutoFit(),this._rendering=!0;const t=new Promise(((t,e)=>BN(this._computedOptions(),this._context,this._createResolve(t),this._createReject(e)))),[e,n,r]=function(){let t,e;return[new Promise(((n,r)=>{e=n,t=r})),e,t]}();return t.then(n).catch(r).then((()=>this._renderTrailing())),e}options(t){if(0===arguments.length)return OI(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,EI(t,e,n,r,i)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){SI(e,n);const{children:t}=n,{children:r}=e;if(Array.isArray(t)&&Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++){const n=t[i],a=r[i];o.push([e,a,n])}}else"function"==typeof t&&o.push([e,null,t])}else e.remove();else AI(t,n,r,i)}}(this,t,this._previousDefinedType,this._marks,this._compositions),this}getContainer(){return this._container}getContext(){return this._context}on(t,e,n){return this._emitter.on(t,e,n),this}once(t,e){return this._emitter.once(t,e),this}emit(t,...e){return this._emitter.emit(t,...e),this}off(t,e){return this._emitter.off(t,e),this}clear(){this.options();this.emit(pA.BEFORE_CLEAR),this._reset(),DN(0,this._context,!1),this.emit(pA.AFTER_CLEAR)}destroy(){this.options();this.emit(pA.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),DN(0,this._context,!0),this._container[bI]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(pA.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=MI(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(pA.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(pA.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(pA.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(pA.AFTER_CHANGE_SIZE)})),n}_create(){const{library:t}=this._context,e=["mark.mark",...Object.keys(t).filter((t=>t.startsWith("mark.")||"component.axisX"===t||"component.axisY"===t||"component.legends"===t))];this._marks={};for(const t of e){const e=t.split(".").pop();class n extends zI{constructor(){super({},e)}}this._marks[e]=n,this[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}const n=["composition.view",...Object.keys(t).filter((t=>t.startsWith("composition.")&&"composition.mark"!==t))];this._compositions=Object.fromEntries(n.map((t=>{const e=t.split(".").pop();let n=class extends FI{constructor(){super({},e)}};return n=Ae([jI(RI(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))jI(RI(this._compositions))(t);for(const t of n){const e=t.split(".").pop();this[e]=function(){const t=this._compositions[e];return this.type=null,this.append(t)}}}_reset(){const t=["theme","type","width","height","autoFit"];this.type="view",this.value=Object.fromEntries(Object.entries(this.value).filter((([e])=>e.startsWith("margin")||e.startsWith("padding")||e.startsWith("inset")||t.includes(e)))),this.children=[]}_renderTrailing(){this._trailing&&(this._trailing=!1,this.render().then((()=>{const t=this._trailingResolve.bind(this);this._trailingResolve=null,t(this)})).catch((t=>{const e=this._trailingReject.bind(this);this._trailingReject=null,e(t)})))}_createResolve(t){return()=>{this._rendering=!1,t(this)}}_createReject(t){return e=>{this._rendering=!1,t(e)}}_computedOptions(){const t=this.options(),{key:e=GI}=t,{width:n,height:r,depth:i}=MI(t,this._container);return this._width=n,this._height=r,this._key=e,Object.assign(Object.assign({key:this._key},t),{width:n,height:r,depth:i})}_createCanvas(){const{width:t,height:e}=MI(this.options(),this._container);this._plugins.push(new fA),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new bg({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise(((t,e)=>{this._trailingResolve=t,this._trailingReject=e}))}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}const $I=hI(WI,Object.assign({},dI()));t.AREA_CLASS_NAME=fS,t.Academy=OE,t.Bin=Es,t.BinX=ks,t.COMPONENT_CLASS_NAME=lS,t.Chart=$I,t.ChartEvent=pA,t.Classic=vE,t.ClassicDark=wE,t.Dark=xE,t.DiffY=Da,t.DodgeX=yi,t.ELEMENT_CLASS_NAME=aS,t.Filter=_s,t.FlexX=fs,t.Group=ns,t.GroupColor=os,t.GroupX=rs,t.GroupY=is,t.Jitter=ja,t.JitterX=Ra,t.JitterY=Ia,t.LABEL_CLASS_NAME=uS,t.LABEL_LAYER_CLASS_NAME=oS,t.Light=yE,t.LinearAxis=JE,t.MAIN_LAYER_CLASS_NAME=iS,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=li,t.MaybeDefaultY=ui,t.MaybeFunctionAttribute=pi,t.MaybeGradient=mi,t.MaybeIdentityX=ci,t.MaybeIdentityY=si,t.MaybeKey=ri,t.MaybeSeries=ii,t.MaybeSize=ni,t.MaybeStackY=Xr,t.MaybeTitle=Qr,t.MaybeTooltip=fi,t.MaybeTuple=gi,t.MaybeTupleX=ai,t.MaybeTupleY=oi,t.MaybeVisualPosition=hi,t.MaybeZeroPadding=di,t.MaybeZeroX=Jr,t.MaybeZeroY=ti,t.MaybeZeroY1=An,t.MaybeZeroZ=ei,t.NormalizeY=bi,t.PLOT_CLASS_NAME=cS,t.Pack=ws,t.Runtime=WI,t.Sample=As,t.Select=$a,t.SelectX=Ha,t.SelectY=Va,t.Selection=Am,t.SortColor=ls,t.SortX=cs,t.SortY=us,t.StackEnter=vi,t.StackY=Ur,t.SymmetryY=Ba,t.VIEW_CLASS_NAME=sS,t.corelib=dI,t.extend=hI,t.register=function(t,e){Object.assign(pI,{[t]:e})},t.render=BN,t.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var i;const{width:o=640,height:a=480}=t,s=RN(t),{group:c=new Kp,emitter:l=new hA,library:u}=e;(null==c?void 0:c.parentElement)||wr("renderToMountedElement can't render chart to unmounted group.");const f=Sm(c);return e.group=c,e.emitter=l,e.canvas=e.canvas||(null===(i=null==c?void 0:c.ownerDocument)||void 0===i?void 0:i.defaultView),l.emit(pA.BEFORE_RENDER),cN(Object.assign(Object.assign({},s),{width:o,height:a}),f,e).then((()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame((()=>{l.emit(pA.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),c},t.select=Sm,Object.defineProperty(t,"__esModule",{value:!0})}));
|