@antv/g2 5.1.18 → 5.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/g2.lite.min.js +1 -1
- package/dist/g2.min.js +1 -1
- package/esm/animation/morphing.js +14 -12
- package/esm/animation/morphing.js.map +1 -1
- package/esm/data/utils/d3-cloud/index.js +1 -0
- package/esm/data/utils/d3-cloud/index.js.map +1 -1
- package/esm/data/wordCloud.d.ts +100 -2
- package/esm/data/wordCloud.js +20 -5
- package/esm/data/wordCloud.js.map +1 -1
- package/esm/index.d.ts +6 -2
- package/esm/interaction/brushHighlight.js +11 -8
- package/esm/interaction/brushHighlight.js.map +1 -1
- package/esm/label-transform/exceedAdjust.d.ts +7 -0
- package/esm/label-transform/exceedAdjust.js +45 -0
- package/esm/label-transform/exceedAdjust.js.map +1 -0
- package/esm/label-transform/index.d.ts +2 -0
- package/esm/label-transform/index.js +1 -0
- package/esm/label-transform/index.js.map +1 -1
- package/esm/lib/core.d.ts +3 -0
- package/esm/lib/core.js +6 -3
- package/esm/lib/core.js.map +1 -1
- package/esm/lib/std.d.ts +3 -1
- package/esm/mark/text.js +4 -3
- package/esm/mark/text.js.map +1 -1
- package/esm/mark/wordCloud.js +11 -12
- package/esm/mark/wordCloud.js.map +1 -1
- package/esm/runtime/plot.js +8 -4
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/types/component.d.ts +5 -2
- package/esm/shape/index.d.ts +2 -0
- package/esm/shape/index.js +1 -0
- package/esm/shape/index.js.map +1 -1
- package/esm/shape/text/tag.d.ts +7 -0
- package/esm/shape/text/tag.js +40 -0
- package/esm/shape/text/tag.js.map +1 -0
- package/esm/spec/labelTransform.d.ts +3 -0
- package/lib/animation/morphing.js +14 -12
- package/lib/animation/morphing.js.map +1 -1
- package/lib/data/utils/d3-cloud/index.js +1 -0
- package/lib/data/utils/d3-cloud/index.js.map +1 -1
- package/lib/data/wordCloud.d.ts +100 -2
- package/lib/data/wordCloud.js +20 -5
- package/lib/data/wordCloud.js.map +1 -1
- package/lib/index.d.ts +6 -2
- package/lib/interaction/brushHighlight.js +11 -8
- package/lib/interaction/brushHighlight.js.map +1 -1
- package/lib/label-transform/exceedAdjust.d.ts +7 -0
- package/lib/label-transform/exceedAdjust.js +49 -0
- package/lib/label-transform/exceedAdjust.js.map +1 -0
- package/lib/label-transform/index.d.ts +2 -0
- package/lib/label-transform/index.js +3 -1
- package/lib/label-transform/index.js.map +1 -1
- package/lib/lib/core.d.ts +3 -0
- package/lib/lib/core.js +3 -0
- package/lib/lib/core.js.map +1 -1
- package/lib/lib/std.d.ts +3 -1
- package/lib/mark/text.js +3 -2
- package/lib/mark/text.js.map +1 -1
- package/lib/mark/wordCloud.js +11 -12
- package/lib/mark/wordCloud.js.map +1 -1
- package/lib/runtime/plot.js +7 -3
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/types/component.d.ts +5 -2
- package/lib/shape/index.d.ts +2 -0
- package/lib/shape/index.js +4 -2
- package/lib/shape/index.js.map +1 -1
- package/lib/shape/text/tag.d.ts +7 -0
- package/lib/shape/text/tag.js +44 -0
- package/lib/shape/text/tag.js.map +1 -0
- package/lib/spec/labelTransform.d.ts +3 -0
- package/package.json +3 -2
- package/src/animation/morphing.ts +15 -12
- package/src/data/utils/d3-cloud/index.ts +1 -0
- package/src/data/wordCloud.ts +112 -7
- package/src/interaction/brushHighlight.ts +13 -8
- package/src/label-transform/exceedAdjust.ts +61 -0
- package/src/label-transform/index.ts +2 -0
- package/src/lib/core.ts +6 -0
- package/src/mark/text.ts +4 -3
- package/src/mark/wordCloud.ts +16 -18
- package/src/runtime/plot.ts +9 -3
- package/src/runtime/types/component.ts +10 -2
- package/src/shape/index.ts +2 -0
- package/src/shape/text/tag.ts +44 -0
- package/src/spec/labelTransform.ts +4 -0
package/dist/g2.lite.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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 void 0===t},V=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]=V(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=V(t[i]):e[i]=t[i];return e},Y=V;function U(t,e,n){var r;return function(){var i=this,o=arguments,a=n&&!r;clearTimeout(r),r=setTimeout((function(){r=null,n||t.apply(i,o)}),e),a&&t.apply(i,o)}}function q(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 X(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(q(e,i)){var o=e[i];null!==o&&S(o)?(S(t[i])||(t[i]={}),n<r?X(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 Z=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)X(t,e[r]);return t},K=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=K(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=K(t[i[r]],e[i[r]]));r++);return n}return!1},Q=K,J=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},tt=Object.prototype.hasOwnProperty,et=function(t,e){if(null===t||!S(t))return{};var n={};return O(e,(function(e){tt.call(t,e)&&(n[e]=t[e])})),n},nt=function(t,e){return P(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},rt=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},it=function(){};function ot(t){return v(t)?0:g(t)?t.length:Object.keys(t).length}var at=1e-6,st="undefined"!=typeof Float32Array?Float32Array:Array;function ct(){var t=new st(9);return st!=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 lt=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 ut(){var t=new st(16);return st!=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 ft(t){var e=new st(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 dt(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 ht(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 pt(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 gt(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 mt(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 yt(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 vt(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 bt(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 xt(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 wt(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 Mt(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 Ot(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 Et(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 kt(t,e,n){var r,i,o,a=n[0],s=n[1],c=n[2],l=Math.hypot(a,s,c);return l<at?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 St(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 At(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 _t(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 Tt(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 Pt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Ct(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 Nt(t,e){var n=new st(3);Ct(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 Lt(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 jt(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 Rt(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 It=Rt;function Bt(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 Dt=Bt;function Ft(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 zt(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)<at&&Math.abs(g-w)<at&&Math.abs(m-M)<at?pt(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 Gt(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 Wt=vt,$t=Gt,Ht=Object.freeze({__proto__:null,create:ut,clone:ft,copy:dt,fromValues:function(t,e,n,r,i,o,a,s,c,l,u,f,d,h,p,g){var m=new st(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:ht,identity:pt,transpose:gt,invert:mt,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:yt,multiply:vt,translate:bt,scale:xt,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<at?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:wt,rotateY:Mt,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:Ot,fromScaling:Et,fromRotation:kt,fromXRotation:St,fromYRotation:At,fromZRotation:_t,fromRotationTranslation:Tt,fromQuat2:function(t,e){var n=new st(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)),Tt(t,e,n),t},getTranslation:Pt,getScaling:Ct,getRotation:Nt,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:Lt,fromQuat:jt,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:Rt,perspective:It,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:Bt,ortho:Dt,orthoZO:Ft,lookAt:zt,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:Gt,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)<=at*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-b)<=at*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=at*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=at*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-M)<=at*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-O)<=at*Math.max(1,Math.abs(s),Math.abs(O))&&Math.abs(c-E)<=at*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(l-k)<=at*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(u-S)<=at*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-A)<=at*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(d-_)<=at*Math.max(1,Math.abs(d),Math.abs(_))&&Math.abs(h-T)<=at*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(p-P)<=at*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-C)<=at*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(m-N)<=at*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(y-L)<=at*Math.max(1,Math.abs(y),Math.abs(L))},mul:Wt,sub:$t});function Vt(){var t=new st(3);return st!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Yt(t){var e=new st(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Ut(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function qt(t,e,n){var r=new st(3);return r[0]=t,r[1]=e,r[2]=n,r}function Xt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Zt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Kt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Qt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Jt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function te(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 ee(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ne(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 re(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 ie(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 oe(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 ae(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)<=at*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=at*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=at*Math.max(1,Math.abs(i),Math.abs(s))}var se=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)},ce=Ut;function le(){var t=new st(4);return st!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function ue(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 fe(){var t=new st(4);return st!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function de(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 he(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 pe(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 ge(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}Vt(),function(){var t=le()}();var me=function(t,e,n,r){var i=new st(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ye=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ve=he,be=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};Vt(),qt(1,0,0),qt(0,1,0),fe(),fe(),ct(),function(){var t,e=(t=new st(2),st!=Float32Array&&(t[0]=0,t[1]=0),t)}();var xe=function(t,e){return xe=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])},xe(t,e)};function we(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}xe(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Me=function(){return Me=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},Me.apply(this,arguments)};function Oe(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 Ee(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 ke(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 Se(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 Ae(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 _e(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 Te(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 Pe(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 Ce={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Ne(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 Le={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function je(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Le[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Re(t){return je(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Ie(t){return Re(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function Be(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Le[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,Le[n]))),Le[n]););}function De(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 Fe(t){return t>=48&&t<=57||43===t||45===t||46===t}function ze(t){return t>=48&&t<=57}function Ge(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)),ze(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&ze(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;o<n&&ze(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;ze(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&&ze(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;o<n&&ze(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 We(t){for(var e,n=t.pathValue,r=t.max;t.index<r&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function $e(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Le[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,We(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Ge(t):De(t),t.err.length)return;t.data.push(t.param),We(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,We(t))}if(t.index>=t.max)break;if(!Fe(n.charCodeAt(t.index)))break}Be(t)}else Be(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var He=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 Ve(t){if(Re(t))return[].concat(t);var e=function(t){if(je(t))return[].concat(t);var e=new He(t);for(We(e);e.index<e.max&&!e.err.length;)$e(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 Ye(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 Ue(t){if(Ie(t))return[].concat(t);for(var e=Ve(t),n=Me({},Ce),r=0;r<e.length;r+=1){e[r]=Ye(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 Xe(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=Xe(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 Ze(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var Ke=function(t,e,n,r){return Te(Te([],Ze([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function Qe(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(Xe(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(Ke(g,m,h,p));case"Z":return g===y&&m===v?["C",g,m,y,v,y,v]:["C"].concat(Ke(g,m,y,v))}return t}function Je(t,e){if(void 0===e&&(e=!1),function(t){return Ie(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=Ue(t),a=Me({},Ce),s=[],c="",l=o.length,u=[],f=0;f<l;f+=1){o[f]&&(c=o[f][0]),s[f]=c;var d=Qe(o[f],a);o[f]=d,Ne(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 tn(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function en(t,e,n,r,i){var o=tn([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=Ze([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 nn(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 rn(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 en(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=nn({x:1,y:0},_),P=nn(_,{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 on(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=rn(t,e,n,r,i,o,a,s,c,S/y)).x,x=f.y,h&&k.push({x:b,y:x}),g&&(w+=tn(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 an(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 sn(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=an(t,e,n,r,i,o,a,s,k/m)).x,b=u.y,d&&E.push({x:v,y:b}),p&&(x+=tn(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 cn(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 ln(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=cn(t,e,n,r,i,o,O/p)).x,y=c.y,u&&M.push({x:m,y:y}),d&&(v+=tn(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 un(t,e,n){for(var r,i,o,a,s,c,l,u,f,d=Ue(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=en(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=on(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=sn(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=ln(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=en((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 fn(t){return function(t){var e=0,n=0,r=0;return Je(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 dn(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?sn(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=Ze(n,r,e),s=Ze(r,i,e),c=Ze(i,o,e),l=Ze(a,s,e),u=Ze(s,c,e),f=Ze(l,u,e);return[["C"].concat(a,l,f),["C"].concat(u,c,o)]}(r):[t,t]:[t],l:i}}))}function hn(t,e,n){var r=dn(t),i=dn(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:hn(g[0],g[1],f)}function pn(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function gn(t,e){if(null!==t)return{type:"column",value:t,field:e}}function mn(t,e){const n=gn(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function yn(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function vn(t,e){const n=gn(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function bn(t,e){const n=[];for(const r of t)n[r]=e;return n}function xn(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function wn(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=xn(t,n);if(null!==e)return[e,r]}}return[null,null]}function Mn(t){return!(t instanceof Date)&&"object"==typeof t}const On=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{y1:mn(bn(t,0))}})]};function En(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function kn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Sn(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=En,n=(e,n)=>En(t(e),n),r=(e,n)=>t(e)-n):(e=t===En||t===kn?t:An,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 An(){return 0}function _n(t){return null===t?NaN:+t}On.props={};const Tn=Sn(En),Pn=Tn.right,Cn=Tn.left,Nn=Sn(_n).center;var Ln=Pn;function jn(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 Rn(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 In(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 Bn extends Map{constructor(t,e=Fn){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(Dn(this,t))}has(t){return super.has(Dn(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 Dn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Fn(t){return null!==t&&"object"==typeof t?t.valueOf():t}function zn(t){return t}function Gn(t,...e){return Vn(t,zn,zn,e)}function Wn(t,...e){return Vn(t,Array.from,zn,e)}function $n(t,e,...n){return Vn(t,zn,e,n)}function Hn(t,e,...n){return Vn(t,Array.from,e,n)}function Vn(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new Bn,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 Yn(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(Un(n))}function Un(t=En){if(t===En)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 Xn=Array.prototype.slice;function Zn(t){return()=>t}const Kn=Math.sqrt(50),Qn=Math.sqrt(10),Jn=Math.sqrt(2);function tr(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>=Kn?10:o>=Qn?5:o>=Jn?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?tr(t,e,2*n):[s,c,l]}function er(t,e,n){return tr(t=+t,e=+e,n=+n)[2]}function nr(t){return Math.max(1,Math.ceil(Math.log(jn(t))/Math.LN2)+1)}function rr(){var t=zn,e=In,n=nr;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===In&&([u,f]=function(t,e,n){let r;for(;;){const i=er(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?tr(e,t,n):tr(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=er(u,f,n)),d[d.length-1]>=f)if(t>=f&&e===In){const t=er(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[Ln(d,o,0,h)].push(r[i]);return y}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:Zn(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:Zn([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Zn(Array.isArray(t)?Xn.call(t):t),r):n},r}function ir(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 or(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 ar(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 sr(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 cr(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:Un(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);cr(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(lr(t,n,e),i(t[r],o)>0&&lr(t,n,r);a<s;){for(lr(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?lr(t,n,s):(++s,lr(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function lr(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function ur(t,e,n=_n){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>_n(n(t[r],r,t)))),e<=0)return sr(r);if(e>=1)return or(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return cr(i,a,0,o,((t,e)=>qn(r[t],r[e]))),a=function(t,e=En){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?En(t,i)>0:0===En(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 fr(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 dr(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 ar(t);if(e>=1)return ir(t);var r,i=(r-1)*e,o=Math.floor(i),a=ir(cr(t,o).subarray(0,o+1));return a+(ar(t.subarray(o+1))-a)*(i-o)}}(t,.5,e)}function hr(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 pr(t){return t}function gr(t){return t.reduce(((t,e)=>(n,...r)=>e(t(n,...r),...r)),pr)}function mr(t){return t.replace(/( |^)[a-z]/g,(t=>t.toUpperCase()))}function yr(t=""){throw new Error(t)}function vr(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 br(t){return null!=t&&!Number.isNaN(t)}function xr(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 wr(t,e){return Mr(t,e)||{}}function Mr(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 Or(t,...e){return Object.fromEntries(Object.entries(t).filter((([t])=>e.every((e=>!t.startsWith(e))))))}function Er(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 kr(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function Sr(t){return null===t||!1===t}function Ar(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])?Ar(t[i],o,n,r+1):t[i]=o}return t}}function _r(t,e){return Object.entries(t).reduce(((n,[r,i])=>(n[r]=e(i,r,t),n)),{})}function Tr(t){return t.map(((t,e)=>e))}function Pr(t){return t[0]}function Cr(t){return t[t.length-1]}function Nr(t,e){const n=[[],[]];return t.forEach((t=>{n[e(t)?0:1].push(t)})),n}function Lr(t,e=t.length){if(1===e)return t.map((t=>[t]));const n=[];for(let r=0;r<t.length;r++){Lr(t.slice(r+1),e-1).forEach((e=>{n.push([t[r],...e])}))}return n}function jr(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=xn(r,t))||void 0===e?void 0:e[0]]})).filter((([,t])=>br(t)));return Array.from(Gn(e,(t=>i.map((([,e])=>e[t])).join("-"))).values())}function Rr(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce(((t,i)=>0!==t?t:En(e[n][i],e[r][i])),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>Wr((n=>t(e[n])))}(t):"series"===t?Dr:"value"===t?Fr:"sum"===t?zr:"maxIndex"===t?Gr:()=>null}function Ir(t,e){for(const n of t)n.sort(e)}function Br(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function Dr(t,e,n){return Wr((t=>n[t]))}function Fr(t,e,n){return Wr((t=>e[t]))}function zr(t,e,n){const r=Tr(t),i=Array.from(Gn(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,n.reduce(((t,n)=>t+ +e[n]))])));return Wr((t=>o.get(n[t])))}function Gr(t,e,n){const r=Tr(t),i=Array.from(Gn(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,or(n,(t=>e[t]))])));return Wr((t=>o.get(n[t])))}function Wr(t){return(e,n)=>En(t(e),t(n))}const $r=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=t;return(t,s)=>{const{data:c,encode:l,style:u={}}=s,[f,d]=xn(l,"y"),[h,p]=xn(l,"y1"),[g]=a?wn(l,"series","color"):xn(l,"color"),m=jr(e,t,s),y=Rr(n)(c,f,g);y&&Ir(m,y);const v=new Array(t.length),b=new Array(t.length),x=new Array(t.length),w=[],M=[];for(const t of m){r&&t.reverse();const e=h?+h[t[0]]:0,n=[],i=[];for(const r of t){const t=x[r]=+f[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===f[o[s]];)s--;for(;c<a.length-1&&0===f[a[c]];)c++;w.push(o[s]),M.push(a[c]);let l=e;for(const t of i.reverse()){const e=x[t];l=v[t]=(b[t]=l)+e}let u=e;for(const t of n){const e=x[t];e>0?u=v[t]=(b[t]=u)+e:v[t]=b[t]=u}}const O=new Set(w),E=new Set(M),k="y"===i?v:b,S="y"===o?v:b;return[t,Z({},s,{encode:{y0:mn(f,d),y:gn(k,d),y1:gn(S,p)},style:Object.assign({first:(t,e)=>O.has(e),last:(t,e)=>E.has(e)},u)})]}};function Hr(t){const{type:e}=t;return"string"==typeof e&&["stackY","dodgeX","groupX"].includes(e)}$r.props={};const Vr=t=>(e,n,r)=>{const{encode:i,transform:o=[]}=n;if(o.some(Hr))return[e,n];const{x:a,y:s}=i;if(void 0===a||void 0===s)return[e,n];const{series:c}=t;return $r({groupBy:c?["x","series"]:"x"})(e,n,r)};function Yr(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function Ur(t){const e=`${t.getFullYear()}-${Yr(t.getMonth()+1)}-${Yr(t.getDate())}`,n=t.getHours(),r=t.getMinutes(),i=t.getSeconds();return n||r||i?`${e} ${Yr(n)}:${Yr(r)}:${Yr(i)}`:e}Vr.props={};const qr=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(Sr(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=>xn(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?Ur(t[e]):t[e])).join(", ")};return[t,Z({},n,{tooltip:{title:s}})]}};qr.props={};const Xr=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{x:mn(bn(t,0))},scale:{x:{guide:null}}})]};Xr.props={};const Zr=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{y:mn(bn(t,0))},scale:{y:{guide:null}}})]};Zr.props={};const Kr=()=>(t,e)=>{const{encode:n}=e,{z:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{z:mn(bn(t,0))},scale:{z:{guide:null}}})]};Kr.props={};const Qr=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{size:yn(bn(t,3))}})]};Qr.props={};const Jr=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=Oe(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,Z({},e,{encode:{key:gn(a)}})]};Jr.props={};const ti=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[o,a]=xn(n,"color");return[t,Z({},e,{encode:{series:gn(o,a)}})]};ti.props={};const ei=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(Mn)?[t,e]:[t,Z({},e,{encode:{y:gn(n)}})]};ei.props={};const ni=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(Mn)?[t,e]:[t,Z({},e,{encode:{x:gn(n)}})]};ni.props={};const ri=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=xn(n,"y");return[t,Z({},e,{encode:{y1:gn([...i])}})]};ri.props={};const ii=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=xn(n,"x");return[t,Z({},e,{encode:{x1:gn([...i])}})]};ii.props={};const oi=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(Mn))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,Z({},e,{encode:{x:gn(r(n,0)),x1:gn(r(n,1))}})]}return[t,e]};oi.props={};const ai=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(Mn))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,Z({},e,{encode:{y:gn(r(n,0)),y1:gn(r(n,1))}})]}return[t,e]};ai.props={};const si=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(Sr(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,Z({},n,{tooltip:{items:a}})]}};si.props={};const ci=()=>(t,e)=>[t,Z({scale:{x:{padding:0},y:{padding:0}}},e)];ci.props={};const li=()=>(t,e)=>{const{data:n,style:r={}}=e,i=Oe(e,["data","style"]),{x:o,y:a}=r,s=Oe(r,["x","y"]);if(null==o||null==a)return[t,e];const c=a||0;return[[0],Z({},i,{data:[0],cartesian:!0,encode:{x:gn([o||0]),y:gn([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};li.props={};const ui=()=>(t,e)=>{const{style:n={}}=e;return[t,Z({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter((([,t])=>"function"==typeof t)).map((([t,e])=>[t,()=>e]))))})]};ui.props={};const fi=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(Mn))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,Z({},e,{encode:{x:gn(i),y:gn(o)}})]};fi.props={};const di=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:o}=n;return!o||i?[t,e]:[t,Z({},e,{encode:{series:yn(bn(t,void 0))}})]};di.props={};const hi=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return Oe(t,["groupBy","reverse","orderBy","padding"]),(t,o)=>{const{data:a,encode:s,scale:c}=o,{series:l}=c,[u]=xn(s,"y"),[f]=wn(s,"series","color"),d=Br(f,l),h=jr(e,t,o),p=Rr(r)(a,u,f);p&&Ir(h,p);const g=new Array(t.length);for(const t of h){n&&t.reverse();for(let e=0;e<t.length;e++)g[t[e]]=d[e]}return[t,Z({},o,{scale:{series:{domain:d,paddingInner:i}},encode:{series:gn(g)}})]}};hi.props={};const pi=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,xn(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(Gn(n,(e=>t[e])).values());e.push(...r)}l=e}if(r){const[t]=xn(s,r);t&&l.sort(((e,r)=>n(e,t)-n(r,t))),i&&l.reverse()}const u=(o||3e3)/l.length,[f]=o?[bn(t,u)]:wn(s,"enterDuration",bn(t,u)),[d]=wn(s,"enterDelay",bn(t,0)),h=new Array(t.length);for(let t=0,e=0;t<l.length;t++){const n=l[t],r=ir(n,(t=>+f[t]));for(const t of n)h[t]=+d[t]+e;e+=r}return[t,Z({},a,{encode:{enterDuration:yn(f),enterDelay:yn(h)}})]}};pi.props={};const gi=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:o}=r,a=Oe(i,["x"]),s=Object.entries(a).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,xn(i,t)[0]])),[,c]=s.find((([t])=>"y"===t)),l=s.map((([e])=>[e,new Array(t.length)])),u=jr(e,t,r),f=function(t){return"function"==typeof t?t:{min:(t,e)=>ar(t,(t=>e[+t])),max:(t,e)=>ir(t,(t=>e[+t])),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>fr(t,(t=>e[+t])),median:(t,e)=>dr(t,(t=>e[+t])),sum:(t,e)=>hr(t,(t=>e[+t])),deviation:(t,e)=>Rn(t,(t=>e[+t]))}[t]||ir}(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=Sr(o)||(null==o?void 0:o.items)&&0!==(null==o?void 0:o.items.length);return[t,Z({},r,Object.assign({encode:Object.fromEntries(l.map((([t,e])=>[t,gn(e,xn(i,t)[1])])))},!d&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function mi(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function yi(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function vi(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}gi.props={};const bi=Math.sqrt(50),xi=Math.sqrt(10),wi=Math.sqrt(2);function Mi(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>=bi?10:o>=xi?5:o>=wi?2:1)*10**i:-(10**-i)/(o>=bi?10:o>=xi?5:o>=wi?2:1)}function Oi(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>=bi?i*=10:o>=xi?i*=5:o>=wi&&(i*=2),e<t?-i:i}const Ei=(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=Mi(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=Mi(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=Mi(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},ki=1e3,Si=6e4,Ai=36e5,_i=864e5,Ti=6048e5,Pi=2592e6,Ci=31536e6;function Ni(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 Li=Ni(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),ji=Ni(ki,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+ki*e)}),(t=>t.getSeconds())),Ri=Ni(Si,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+Si*e)}),(t=>t.getMinutes())),Ii=Ni(Ai,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+Ai*e)}),(t=>t.getHours())),Bi=Ni(_i,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+_i*e)}),(t=>t.getDate()-1)),Di=Ni(Pi,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),Fi=Ni(Ti,(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=Di.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Ti)})),zi=Ni(Ci,(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())),Gi={millisecond:Li,second:ji,minute:Ri,hour:Ii,day:Bi,week:Fi,month:Di,year:zi},Wi=Ni(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),$i=Ni(ki,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+ki*e)}),(t=>t.getUTCSeconds())),Hi=Ni(Si,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+Si*e)}),(t=>t.getUTCMinutes())),Vi=Ni(Ai,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+Ai*e)}),(t=>t.getUTCHours())),Yi=Ni(_i,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+_i*e)}),(t=>t.getUTCDate()-1)),Ui=Ni(Pi,(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=Ni(Ti,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Ti*e)}),(t=>{const e=Ui.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Ti)})),Xi=Ni(Ci,(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())),Zi={millisecond:Wi,second:$i,minute:Hi,hour:Vi,day:Yi,week:qi,month:Ui,year:Xi};function Ki(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?Zi:Gi,{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=vi(s,d,0,h,u);let g;if(p===h){g=[c,Oi(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(Oi(o,a,f),1)]}return g}const Qi=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Ki(a,s,n,r,i),u=[c.floor(a,l),c.ceil(s,l)];return o?u.reverse():u};var Ji=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},to={}.toString,eo=function(t,e){return to.call(t)==="[object "+e+"]"},no=function(t){return null==t},ro=function(t){return Array.isArray?Array.isArray(t):eo(t,"Array")},io=function(t){return"object"==typeof t&&null!==t},oo=function(t){if(!io(t)||!eo(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},ao=function(t){return eo(t,"Number")},so=function(t){return null===t},co=function(t){return void 0===t};function lo(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&&oo(o)?(oo(t[i])||(t[i]={}),n<r?lo(t[i],o,n+1,r):t[i]=e[i]):ro(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var uo=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)lo(t,e[r]);return t},fo=function(t,e){if(!Ji(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},ho=function(t){return t};function po(t){return no(t)?0:Ji(t)?t.length:Object.keys(t).length}function go(t){return!co(t)&&!so(t)&&!Number.isNaN(t)}const mo=t=>e=>-t(-e),yo=(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?mo(r):r},vo=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?mo(n):n},bo=(t,e,n,r)=>{const i=t<0,o=yo(r,i),a=vo(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 xo={exports:{}},wo={exports:{}},Mo=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))},Oo=Array.prototype.concat,Eo=Array.prototype.slice,ko=wo.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];Mo(i)?e=Oo.call(e,Eo.call(i)):e.push(i)}return e};ko.wrap=function(t){return function(){return t(ko(arguments))}};var So={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]},Ao=wo.exports,_o=Object.hasOwnProperty,To=Object.create(null);for(var Po in So)_o.call(So,Po)&&(To[So[Po]]=Po);var Co=xo.exports={to:{},get:{}};function No(t,e,n){return Math.min(Math.max(e,t),n)}function Lo(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}Co.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=Co.get.hsl(t),n="hsl";break;case"hwb":e=Co.get.hwb(t),n="hwb";break;default:e=Co.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},Co.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]:_o.call(So,e[1])?((i=So[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]=No(i[n],0,255);return i[3]=No(i[3],0,1),i},Co.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,No(parseFloat(e[2]),0,100),No(parseFloat(e[3]),0,100),No(isNaN(n)?1:n,0,1)]}return null},Co.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,No(parseFloat(e[2]),0,100),No(parseFloat(e[3]),0,100),No(isNaN(n)?1:n,0,1)]}return null},Co.to.hex=function(){var t=Ao(arguments);return"#"+Lo(t[0])+Lo(t[1])+Lo(t[2])+(t[3]<1?Lo(Math.round(255*t[3])):"")},Co.to.rgb=function(){var t=Ao(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]+")"},Co.to.rgb.percent=function(){var t=Ao(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]+")"},Co.to.hsl=function(){var t=Ao(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},Co.to.hwb=function(){var t=Ao(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},Co.to.keyword=function(t){return To[t.slice(0,3)]};var jo=xo.exports;function Ro(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 Io(t){const e=jo.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*Ro(a,o,e+1/3),255*Ro(a,o,e),255*Ro(a,o,e-1/3),i]}(r):null}const Bo=(t,e)=>n=>t*(1-n)+e*n,Do=(t,e)=>"number"==typeof t&&"number"==typeof e?Bo(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=Io(t),r=Io(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,Fo=(t,e)=>{const n=Bo(t,e);return t=>Math.round(n(t))};function zo({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Go(t){return"object"==typeof t?t.valueOf():t}class Wo extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Go,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(zo({map:this.map,initKey:this.initKey},t))}has(t){return super.has(zo({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 $o{constructor(t){this.options=uo({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=uo({},this.options,t),this.rescale(t)}rescale(t){}}const Ho=Symbol("defaultUnknown");function Vo(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function Yo(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==Ho)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function Uo(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class qo extends $o{getDefaultOptions(){return{domain:[],range:[],unknown:Ho}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Vo(this.domainIndexMap,this.getDomain(),this.domainKey),Yo({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Vo(this.rangeIndexMap,this.getRange(),this.rangeKey),Yo({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=Uo(e),this.rangeKey=Uo(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 qo(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 Xo(t){return Math.round(1e12*t)/1e12}function Zo(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 Wo(e.map(((t,e)=>{const n=m[e]*v;return[t,a?Math.floor(n):n]}))),x=new Wo(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]=Xo(O);const n=e[t];O+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:E}}class Ko extends qo{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Ho,flex:[]}}constructor(t){super(t)}clone(){return new Ko(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 Zo(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 Qo=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=Mi(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 Jo extends $o{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:Qo}}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 ao(r)&&ao(i)?t(r,i,n):[]}clone(){return new Jo(this.options)}}function ta(t){return Math.abs(t)<1e-14?t:parseFloat(t.toFixed(14))}const ea=[1,5,2,2.5,4,3],na=100*Number.EPSILON;function ra(t,e,n,r,i,o){const a=po(e),s=fo(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,o);return(l<na||o-l<na)&&r<=0&&i>=0&&(c=1),1-s/(a-1)-n+c}function ia(t,e,n){const r=po(e);return 1-fo(e,t)/(r-1)-n+1}function oa(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 aa(t,e){return t>=e?2-(t-1)/(e-1):1}function sa(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function ca(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}const la=(t,e,n=5,r=!0,i=ea,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=ia(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=aa(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=ca(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=ra(l,i,c,n,h,p),y=sa(t,e,n,h),v=oa(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=ta(s.lmax),u=ta(s.lmin),f=ta(s.lstep),d=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,h=new Array(d);h[0]=ta(u);for(let t=1;t<d;t+=1)h[t]=ta(h[t-1]+f);return h};class ua extends $o{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:la}}map(t){return go(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new ua(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return ao(r)&&ao(i)?n(r,i,e):[]}}const fa=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=yi(r,i),c=n(o,a)):(s=yi(i,r),c=n(a,o)),mi(c,s)},da=(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]=yi(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=vi(t,e,1,r)-1,a=i[n];return mi(o[n],a)(e)}},ha=(t,e,n,r)=>(Math.min(t.length,e.length)>2?da:fa)(t,e,r?Fo:n);class pa extends $o{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Bo,tickCount:5}}map(t){return go(t)?this.output(t):this.options.unknown}invert(t){return go(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 Ei}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]):ho}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=ha(n.map(t),r,o,i);this.output=mi(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=ha(i,r.map(t),Bo);this.input=mi(e,n,o)}}class ga extends pa{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Do,tickMethod:Qo,tickCount:5}}chooseTransforms(){return[ho,ho]}clone(){return new ga(this.options)}}class ma extends Ko{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Ho,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new ma(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const ya=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class va extends pa{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Do,tickMethod:Qo,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[ho,ho];const e=.5===t?ya:(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 va(this.options)}}class ba extends va{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Do,tickMethod:Qo,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new ba(this.options)}}class xa extends $o{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!go(t))return this.options.unknown;const e=vi(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 xa(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const wa=(t,e,n,r=10)=>{const i=t<0,o=vo(r,i),a=yo(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=Qo(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);d=Qo(u,f,t).map(o)}return s?d.reverse():d};class Ma extends pa{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:Do,tickMethod:wa,tickCount:5}}chooseNice(){return bo}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[yo(t,n),vo(t,n)]}clone(){return new Ma(this.options)}}class Oa extends xa{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:la}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=Ei(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 Oa(this.options)}}function Ea(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 ka extends xa{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:la}}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(Ea(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 ka(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var Sa=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Aa=/\[([^]*?)\]/gm;function _a(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function Ta(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 Pa=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ca=["January","February","March","April","May","June","July","August","September","October","November","December"],Na=_a(Ca,3),La=Ta({},{dayNamesShort:_a(Pa,3),dayNames:Pa,monthNamesShort:Na,monthNames:Ca,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),ja=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},Ra={D:function(t){return String(t.getDate())},DD:function(t){return ja(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return ja(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 ja(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 ja(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return ja(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return ja(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return ja(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return ja(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return ja(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return ja(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return ja(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?"-":"+")+ja(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+ja(Math.floor(Math.abs(e)/60),2)+":"+ja(Math.abs(e)%60,2)}},Ia={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 Ba=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Ki(a,s,n,r,i),u=c.range(a,new Date(+s+1),l,!0);return o?u.reverse():u};function Da(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class Fa extends pa{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:Ba,interpolate:Bo,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return Qi}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?Zi:Gi,r=e?Da:ho;return e=>function(t,e,n){if(void 0===e&&(e=Ia.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=Ia[e]||e).replace(Aa,(function(t,e){return r.push(e),"@@@"}));var i=Ta(Ta({},La),n);return(e=e.replace(Sa,(function(e){return Ra[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 Fa(this.options)}}var za,Ga=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 Wa=za=class extends ga{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:ho,tickMethod:Qo,tickCount:5}}constructor(t){super(t)}clone(){return new za(this.options)}};function $a(t,e,n){if(null===t)return[-.5,.5];const r=Br(t,e),i=new Ko({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function Ha(t,e,n){return e*(1-t)+n*t}Wa=za=Ga([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 ao(n)?Math.round(n):n})(i):i;this.output=mi(s,a,n,t)},n.prototype.invert=void 0}}((function(t){return[t(0),t(1)]}),(t=>{const[e,n]=t;return mi(Bo(0,1),yi(e,n))}))],Wa);const Va=(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]=xn(o,"x"),[u]=xn(o,"y"),f=$a(l,s,n),d=$a(u,c,r),h=t.map((()=>Ha(i(),...d))),p=t.map((()=>Ha(i(),...f)));return[t,Z({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:gn(h),dx:gn(p)}})]}};Va.props={};const Ya=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{x:a}=o,[s]=xn(i,"x"),c=$a(s,a,e),l=t.map((()=>Ha(n(),...c)));return[t,Z({scale:{x:{padding:.5}}},r,{encode:{dx:gn(l)}})]}};Ya.props={};const Ua=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{y:a}=o,[s]=xn(i,"y"),c=$a(s,a,e),l=t.map((()=>Ha(n(),...c)));return[t,Z({scale:{y:{padding:.5}}},r,{encode:{dy:gn(l)}})]}};Ua.props={};const qa=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,i=Oe(r,["x"]),o=Object.entries(i).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,xn(r,t)[0]])),a=o.map((([e])=>[e,new Array(t.length)])),s=jr(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]=In(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,Z({},n,{encode:Object.fromEntries(a.map((([t,e])=>[t,gn(e,xn(r,t)[1])])))})]}};qa.props={};const Xa=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(t,r)=>{const{encode:i}=r,[o]=xn(i,"y"),[a,s]=xn(i,"y1");n?wn(i,"series","color"):xn(i,"color");const c=jr(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,Z({},r,{encode:{y1:gn(l,s)}})]}};function Za(t,e){return[t[0]]}function Ka(t,e){return[t[t.length-1]]}function Qa(t,e){return[t[or(t,(t=>e[t]))]]}function Ja(t,e){return[t[sr(t,(t=>e[t]))]]}Xa.props={};const ts=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:o}=i,a=jr(e,t,i),[s]=xn(o,n),c=function(t){return"function"==typeof t?t:{first:Za,last:Ka,max:Qa,min:Ja}[t]||Za}(r);return[a.flatMap((t=>c(t,s))),i]}};ts.props={};const es=(t={})=>{const{selector:e}=t,n=Oe(t,["selector"]);return ts(Object.assign({channel:"x",selector:e},n))};es.props={};const ns=(t={})=>{const{selector:e}=t,n=Oe(t,["selector"]);return ts(Object.assign({channel:"y",selector:e},n))};function rs(t){return e=>null===e?t:`${t} of ${e}`}function is(){return[(t,e)=>fr(t,(t=>+e[t])),rs("mean")]}function os(){return[(t,e)=>dr(t,(t=>+e[t])),rs("median")]}function as(){return[(t,e)=>ir(t,(t=>+e[t])),rs("max")]}function ss(){return[(t,e)=>ar(t,(t=>+e[t])),rs("min")]}function cs(){return[(t,e)=>t.length,rs("count")]}function ls(){return[(t,e)=>hr(t,(t=>+e[t])),rs("sum")]}function us(){return[(t,e)=>e[t[0]],rs("first")]}function fs(){return[(t,e)=>e[t[t.length-1]],rs("last")]}ns.props={};const ds=(t={})=>{const{groupBy:e}=t,n=Oe(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:is,max:as,count:cs,first:us,last:fs,sum:ls,min:ss,median:os}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,c]=xn(o,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=xn(o,n);return r})(c,e),u=a.map((t=>n(t,null!=s?s:i)));return[t,Object.assign(Object.assign({},vn(u,(null==r?void 0:r(l))||l)),{aggregate:!0})]})),c=Object.keys(o).map((t=>{const[e,n]=xn(o,t),r=a.map((t=>e[t[0]]));return[t,gn(r,n)]})),l=a.map((t=>i[t[0]]));return[Tr(a),Z({},r,{data:l,encode:Object.fromEntries([...c,...s])})]}};ds.props={};const hs=(t={})=>{const{channels:e=["x","y"]}=t,n=Oe(t,["channels"]);return ds(Object.assign(Object.assign({},n),{groupBy:(t,n)=>jr(e,t,n)}))};hs.props={};const ps=(t={})=>hs(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));ps.props={};const gs=(t={})=>hs(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));gs.props={};const ms=(t={})=>hs(Object.assign(Object.assign({},t),{channels:["color"]}));function ys(t,e,n){var r;const{reverse:i,slice:o,channel:a}=n,s=Oe(n,["reverse","slice","channel"]),{encode:c,scale:l={}}=e,u=null===(r=l[a])||void 0===r?void 0:r.domain,[f]=xn(c,a),d=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[o]=xn(n,r);if("function"==typeof i)return t=>i(t,o);if("max"===i)return t=>ir(t,(t=>+o[t]));if("min"===i)return t=>ar(t,(t=>+o[t]));if("sum"===i)return t=>hr(t,(t=>+o[t]));if("median"===i)return t=>dr(t,(t=>+o[t]));if("mean"===i)return t=>fr(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?Yn($n(t,e,n),(([t,e],[n,r])=>En(e,r)||En(t,n))):Yn(Gn(t,n),(([t,n],[r,i])=>e(n,i)||En(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,Z(e,{scale:{[a]:{domain:m}}})]}ms.props={};const vs=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,o=Oe(t,["reverse","slice","channel","ordinal"]);return(t,a)=>i?ys(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]=xn(o,i),s=Yn(t,(t=>a[t]));return r&&s.reverse(),[s,e]}(t,a,Object.assign({reverse:e,slice:n,channel:r},o))};vs.props={};const bs=(t={})=>vs(Object.assign(Object.assign({},t),{channel:"x"}));bs.props={};const xs=(t={})=>vs(Object.assign(Object.assign({},t),{channel:"color"}));xs.props={};const ws=(t={})=>vs(Object.assign(Object.assign({},t),{channel:"y"}));ws.props={};const Ms=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:o,encode:a}=i,[s]=xn(a,"x"),c=e?function(t,e){return"string"==typeof e?t.map((t=>t[e])):t.map(e)}(o,e):xn(a,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>hr(t,(t=>+e[t]));throw new Error(`Unknown reducer: ${t}`)}(r,c),u=Hn(t,l,(t=>s[t])).map((t=>t[1]));return[t,Z({},i,{scale:{x:{flex:u}}})]}};function Os([t,e],[n,r]){return[t-n,e-r]}function Es([t,e],[n,r]){return[t+n,e+r]}function ks([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function Ss([t,e]){return Math.atan2(e,t)}function As([t,e]){return Ss([t,e])+Math.PI/2}function _s(t,e){const n=Ss(t),r=Ss(e);return n<r?r-n:2*Math.PI-(n-r)}function Ts(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 Ps([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function Cs(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]=Ts(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})`}))}}Ms.props={};const Ns=t=>(e,n)=>[e,Z({},n,{modifier:Cs(t),axis:!1})];Ns.props={};const Ls="thresholds";function js(t){const[e,n]=In(t);return Math.min(200,function(t,e,n){const r=jn(t),i=Rn(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}const Rs=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=Oe(t,["groupChannels","binChannels"]),i={};return ds(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter((([t])=>!t.startsWith(Ls))))),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]=xn(a,t);return e})),c=wr(r,Ls),l=t.filter((t=>s.every((e=>br(e[t]))))),u=[...e.map((t=>{const[e]=xn(a,t);return e})).filter(br).map((t=>e=>t[e])),...n.map(((t,e)=>{const n=s[e],r=c[t]||js(n),o=rr().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(Gn(l,(t=>u.map((e=>e(t))).join("-"))).values())}}))};Rs.props={};const Is=(t={})=>{const{thresholds:e}=t;return Rs(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function Bs(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]))}Is.props={};const Ds=(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 Bs;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[sr(t,(t=>n[t]))]],max:(t,e,n)=>[t[or(t,(t=>n[t]))]],median:(t,e,n)=>{return[t[(r=t,i=t=>n[t],ur(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=jr(r,t,e),[s]=xn(o,"x"),[c]=xn(o,"y");return[a.flatMap((t=>i(t,s,c,n))),e]}};Ds.props={};const Fs=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map((([t,e])=>{const[n]=xn(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(br);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,Z({},n,{encode:Object.fromEntries(c),data:a.map((t=>i[t]))})]};function zs(t){return function(){return t}}Fs.props={};const Gs=Math.abs,Ws=Math.atan2,$s=Math.cos,Hs=Math.max,Vs=Math.min,Ys=Math.sin,Us=Math.sqrt,qs=1e-12,Xs=Math.PI,Zs=Xs/2,Ks=2*Xs;function Qs(t){return t>=1?Zs:t<=-1?-Zs:Math.asin(t)}const Js=Math.PI,tc=2*Js,ec=1e-6,nc=tc-ec;function rc(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class ic{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?rc:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return rc;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>ec)if(Math.abs(u*s-c*l)>ec&&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((Js-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>ec&&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)>ec||Math.abs(this._y1-l)>ec)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%tc+tc),f>nc?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>ec&&this._append`A${n},${n},0,${+(f>=Js)},${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 oc(){return new ic}function ac(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 ic(e)}function sc(t){return t.innerRadius}function cc(t){return t.outerRadius}function lc(t){return t.startAngle}function uc(t){return t.endAngle}function fc(t){return t&&t.padAngle}function dc(t,e,n,r,i,o,a){var s=t-n,c=e-r,l=(a?o:-o)/Us(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)*Us(Hs(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 hc(){var t=sc,e=cc,n=zs(0),r=null,i=lc,o=uc,a=fc,s=null,c=ac(l);function l(){var l,u,f=+t.apply(this,arguments),d=+e.apply(this,arguments),h=i.apply(this,arguments)-Zs,p=o.apply(this,arguments)-Zs,g=Gs(p-h),m=p>h;if(s||(s=l=c()),d<f&&(u=d,d=f,f=u),d>qs)if(g>Ks-qs)s.moveTo(d*$s(h),d*Ys(h)),s.arc(0,0,d,h,p,!m),f>qs&&(s.moveTo(f*$s(p),f*Ys(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>qs&&(r?+r.apply(this,arguments):Us(f*f+d*d)),A=Vs(Gs(d-f)/2,+n.apply(this,arguments)),_=A,T=A;if(S>qs){var P=Qs(S/f*Ys(k)),C=Qs(S/d*Ys(k));(O-=2*P)>qs?(w+=P*=m?1:-1,M-=P):(O=0,w=M=(h+p)/2),(E-=2*C)>qs?(b+=C*=m?1:-1,x-=C):(E=0,b=x=(h+p)/2)}var N=d*$s(b),L=d*Ys(b),j=f*$s(M),R=f*Ys(M);if(A>qs){var I,B=d*$s(x),D=d*Ys(x),F=f*$s(w),z=f*Ys(w);if(g<Xs)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<qs))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/Ys(function(t){return t>1?0:t<-1?Xs:Math.acos(t)}((G*$+W*H)/(Us(G*G+W*W)*Us($*$+H*H)))/2),Y=Us(I[0]*I[0]+I[1]*I[1]);_=Vs(A,(f-Y)/(V-1)),T=Vs(A,(d-Y)/(V+1))}else _=T=0}E>qs?T>qs?(y=dc(F,z,N,L,d,T,m),v=dc(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,Ws(y.y01,y.x01),Ws(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,T,Ws(y.y01,y.x01),Ws(y.y11,y.x11),!m),s.arc(0,0,d,Ws(y.cy+y.y11,y.cx+y.x11),Ws(v.cy+v.y11,v.cx+v.x11),!m),s.arc(v.cx,v.cy,T,Ws(v.y11,v.x11),Ws(v.y01,v.x01),!m))):(s.moveTo(N,L),s.arc(0,0,d,b,x,!m)):s.moveTo(N,L),f>qs&&O>qs?_>qs?(y=dc(j,R,B,D,f,-_,m),v=dc(N,L,F,z,f,-_,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),_<A?s.arc(y.cx,y.cy,_,Ws(y.y01,y.x01),Ws(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,_,Ws(y.y01,y.x01),Ws(y.y11,y.x11),!m),s.arc(0,0,f,Ws(y.cy+y.y11,y.cx+y.x11),Ws(v.cy+v.y11,v.cx+v.x11),m),s.arc(v.cx,v.cy,_,Ws(v.y11,v.x11),Ws(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-Xs/2;return[$s(r)*n,Ys(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:zs(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:zs(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:zs(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:zs(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:zs(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:zs(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:zs(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function pc(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function gc(t){this._context=t}function mc(t){return new gc(t)}function yc(t){return t[0]}function vc(t){return t[1]}function bc(t,e){var n=zs(!0),r=null,i=mc,o=null,a=ac(s);function s(s){var c,l,u,f=(s=pc(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?yc:zs(t),e="function"==typeof e?e:void 0===e?vc:zs(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:zs(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:zs(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:zs(!!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 xc(t,e,n){var r=null,i=zs(!0),o=null,a=mc,s=null,c=ac(l);function l(l){var u,f,d,h,p,g=(l=pc(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 bc().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?yc:zs(+t),e="function"==typeof e?e:zs(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?vc:zs(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:zs(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:zs(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:zs(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:zs(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:zs(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:zs(+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:zs(!!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}oc.prototype=ic.prototype,gc.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 wc=Oc(mc);function Mc(t){this._curve=t}function Oc(t){function e(e){return new Mc(t(e))}return e._curve=t,e}function Ec(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(Oc(t)):e()._curve},t}function kc(){}function Sc(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 Ac(t,e){this._context=t,this._k=(1-e)/6}function _c(t,e){this._context=t,this._k=(1-e)/6}function Tc(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>qs){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>qs){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 Pc(t,e){this._context=t,this._alpha=e}function Cc(t,e){this._context=t,this._alpha=e}Mc.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))}},Ac.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:Sc(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:Sc(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 Ac(t,e)}return n.tension=function(e){return t(+e)},n}(0),_c.prototype={areaStart:kc,areaEnd:kc,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:Sc(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 _c(t,e)}return n.tension=function(e){return t(+e)},n}(0),Pc.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:Tc(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 Pc(t,e):new Ac(t,0)}return n.alpha=function(e){return t(+e)},n}(.5),Cc.prototype={areaStart:kc,areaEnd:kc,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:Tc(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 Nc=function t(e){function n(t){return e?new Cc(t,e):new _c(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Lc(t){this._context=t}function jc(t){return new Lc(t)}function Rc(t){return t<0?-1:1}function Ic(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(Rc(o)+Rc(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Bc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Dc(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 Fc(t){this._context=t}function zc(t){this._context=new Gc(t)}function Gc(t){this._context=t}function Wc(t){return new Fc(t)}function $c(t){return new zc(t)}function Hc(t,e){this._context=t,this._t=e}function Vc(t){return new Hc(t,.5)}function Yc(t){return new Hc(t,0)}function Uc(t){return new Hc(t,1)}function qc(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function Xc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function Zc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function Kc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function Qc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function Jc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function tl(t){return Kc(t)||Xc(t)}function el(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find((t=>"polar"===t[0]));return[+n,+r]}function nl(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]}Lc.prototype={areaStart:kc,areaEnd:kc,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))}},Fc.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:Dc(this,this._t0,Bc(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,Dc(this,Bc(this,n=Ic(this,t,e)),n);break;default:Dc(this,this._t0,n=Ic(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(zc.prototype=Object.create(Fc.prototype)).point=function(t,e){Fc.prototype.point.call(this,e,t)},Gc.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)}},Hc.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 rl="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},il={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}(il);var ol=il.exports;function al(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function sl(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function cl(){}var ll=.7,ul=1/ll,fl="\\s*([+-]?\\d+)\\s*",dl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",hl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",pl=/^#([0-9a-f]{3,8})$/,gl=new RegExp("^rgb\\("+[fl,fl,fl]+"\\)$"),ml=new RegExp("^rgb\\("+[hl,hl,hl]+"\\)$"),yl=new RegExp("^rgba\\("+[fl,fl,fl,dl]+"\\)$"),vl=new RegExp("^rgba\\("+[hl,hl,hl,dl]+"\\)$"),bl=new RegExp("^hsl\\("+[dl,hl,hl]+"\\)$"),xl=new RegExp("^hsla\\("+[dl,hl,hl,dl]+"\\)$"),wl={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 Ml(){return this.rgb().formatHex()}function Ol(){return this.rgb().formatRgb()}function El(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=pl.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?kl(e):3===n?new Al(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Sl(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Sl(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=gl.exec(t))?new Al(e[1],e[2],e[3],1):(e=ml.exec(t))?new Al(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=yl.exec(t))?Sl(e[1],e[2],e[3],e[4]):(e=vl.exec(t))?Sl(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=bl.exec(t))?Cl(e[1],e[2]/100,e[3]/100,1):(e=xl.exec(t))?Cl(e[1],e[2]/100,e[3]/100,e[4]):wl.hasOwnProperty(t)?kl(wl[t]):"transparent"===t?new Al(NaN,NaN,NaN,0):null}function kl(t){return new Al(t>>16&255,t>>8&255,255&t,1)}function Sl(t,e,n,r){return r<=0&&(t=e=n=NaN),new Al(t,e,n,r)}function Al(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function _l(){return"#"+Pl(this.r)+Pl(this.g)+Pl(this.b)}function Tl(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Pl(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Cl(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Ll(t,e,n,r)}function Nl(t){if(t instanceof Ll)return new Ll(t.h,t.s,t.l,t.opacity);if(t instanceof cl||(t=El(t)),!t)return new Ll;if(t instanceof Ll)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 Ll(a,s,c,t.opacity)}function Ll(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function jl(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Rl(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Il(t,e){var n=Math.min.apply(Math,Te([],_e(t),!1)),r=Math.min.apply(Math,Te([],_e(e),!1));return{x:n,y:r,width:Math.max.apply(Math,Te([],_e(t),!1))-n,height:Math.max.apply(Math,Te([],_e(e),!1))-r}}function Bl(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Dl(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function Fl(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=Bl(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=Dl(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}}al(cl,El,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Ml,formatHex:Ml,formatHsl:function(){return Nl(this).formatHsl()},formatRgb:Ol,toString:Ol}),al(Al,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof cl||(i=El(i)),i?new Al((i=i.rgb()).r,i.g,i.b,i.opacity):new Al):new Al(t,e,n,null==r?1:r);var i}),sl(cl,{brighter:function(t){return t=null==t?ul:Math.pow(ul,t),new Al(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?ll:Math.pow(ll,t),new Al(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){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:_l,formatHex:_l,formatRgb:Tl,toString:Tl})),al(Ll,(function(t,e,n,r){return 1===arguments.length?Nl(t):new Ll(t,e,n,null==r?1:r)}),sl(cl,{brighter:function(t){return t=null==t?ul:Math.pow(ul,t),new Ll(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?ll:Math.pow(ll,t),new Ll(this.h,this.s,this.l*t,this.opacity)},rgb:function(){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 Al(jl(t>=240?t-240:t+120,i,r),jl(t,i,r),jl(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var zl=1e-4;function Gl(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,Te([],_e(t.concat([h])),!1)),i.apply(void 0,Te([],_e(e.concat([h])),!1))];(v=Rl(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<zl);d++){var m=a-f,y=a+f,v=(p=[i.apply(void 0,Te([],_e(t.concat([m])),!1)),i.apply(void 0,Te([],_e(e.concat([m])),!1))],Rl(c[0],c[1],p[0],p[1]));if(m>=0&&v<s)a=m,s=v;else{var b=[i.apply(void 0,Te([],_e(t.concat([y])),!1)),i.apply(void 0,Te([],_e(e.concat([y])),!1))],x=Rl(c[0],c[1],b[0],b[1]);y<=1&&x<s?(a=y,s=x):f*=.5}}return{x:i.apply(void 0,Te([],_e(t.concat([a])),!1)),y:i.apply(void 0,Te([],_e(e.concat([a])),!1))}}function Wl(t,e,n,r){return Rl(t,e,n,r)}function $l(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Hl(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 Vl(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 Yl(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 Ul(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],u=Yl(t,n,i,a),f=Yl(e,r,o,s),d=0;d<u.length;d++)c.push(Vl(t,n,i,a,u[d]));for(d=0;d<f.length;d++)l.push(Vl(e,r,o,s,f[d]));return Il(c,l)}function ql(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 Gl([t,n,i,a],[e,r,o,s],c,l,Vl,u)}(t,e,n,r,i,o,a,s,c,l,u);return Rl(f.x,f.y,c,l)}function Xl(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+=Rl(r[0],r[1],i[0],i[1])}return e}(t)}function Zl(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Kl(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 Ql(t,e,n,r,i,o){var a=Kl(t,n,i)[0],s=Kl(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(Zl(t,n,i,a)),void 0!==s&&l.push(Zl(e,r,o,s)),Il(c,l)}function Jl(t,e,n,r,i,o,a,s){var c=function(t,e,n,r,i,o,a,s){return Gl([t,n,i],[e,r,o],a,s,Zl)}(t,e,n,r,i,o,a,s);return Rl(c.x,c.y,a,s)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==rl||"undefined"!=typeof self&&self;var tu={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}()}(tu);var eu,nu,ru=tu.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"}(eu||(eu={})),function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"}(nu||(nu={}));var iu=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}(),ou=function(){function t(t){this.clipSpaceNearZ=nu.NEGATIVE_ONE,this.plugins=[],this.config=Me({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 au(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function su(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function cu(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function lu(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function uu(t){return void 0===t?0:t>360||t<-360?t%360:t}function fu(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Yt(t):j(t)?qt(t,e,n):qt(t[0],t[1]||e,t[2]||n)}function du(t){return t*(Math.PI/180)}function hu(t){return t*(180/Math.PI)}function pu(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=_e(Ct(Vt(),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 gu(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 st(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 mu(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=hu(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var yu=ut(),vu=ut(),bu=le(),xu=[Vt(),Vt(),Vt()],wu=Vt();function Mu(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 Ou,Eu=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){au(this.center,t),au(this.halfExtents,e),su(this.min,this.center,this.halfExtents),cu(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){cu(this.center,e,t),lu(this.center,this.center,.5),su(this.halfExtents,e,t),lu(this.halfExtents,this.halfExtents,.5),au(this.min,t),au(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],su(this.min,n,r),cu(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?au([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?au([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}(),ku=function(){function t(t,e){this.distance=t||0,this.normal=e||qt(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 ee(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/ce(this.normal);Jt(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&&re(n,t,e,i),o},t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(Ou||(Ou={}));var Su,Au,_u,Tu=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new ku)}return t.prototype.extractFromVPMatrix=function(t){var e=_e(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];Zt(this.planes[0].normal,o-n,l-a,h-u),this.planes[0].distance=y-p,Zt(this.planes[1].normal,o+n,l+a,h+u),this.planes[1].distance=y+p,Zt(this.planes[2].normal,o+r,l+s,h+f),this.planes[2].distance=y+g,Zt(this.planes[3].normal,o-r,l-s,h-f),this.planes[3].distance=y-g,Zt(this.planes[4].normal,o-i,l-c,h-d),this.planes[4].distance=y-m,Zt(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}(),Pu=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}(),Cu=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}(),Nu="Method not implemented.",Lu="Use document.documentElement instead.";!function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"}(Su||(Su={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"}(Au||(Au={})),function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"}(_u||(_u={}));var ju,Ru,Iu,Bu,Du,Fu="updated",zu=2e-4,Gu=function(){function t(){this.clipSpaceNearZ=nu.NEGATIVE_ONE,this.eventEmitter=new ol,this.matrix=ut(),this.right=qt(1,0,0),this.up=qt(0,1,0),this.forward=qt(0,0,1),this.position=qt(0,0,1),this.focalPoint=qt(0,0,0),this.distanceVector=qt(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=ut(),this.projectionMatrixInverse=ut(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Su.EXPLORING,this.trackingMode=Au.DEFAULT,this.projectionMode=_u.PERSPECTIVE,this.frustum=new Tu,this.orthoMatrix=ut()}return t.prototype.isOrtho=function(){return this.projectionMode===_u.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===Su.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Su.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!==Su.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 mt(ut(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(t,e){var n=Ot(ut(),[t,e,0]);this.jitteredProjectionMatrix=vt(ut(),n,this.projectionMatrix)},t.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},t.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},t.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},t.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},t.prototype.setNear=function(t){return this.projectionMode===_u.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===_u.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===_u.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===_u.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===_u.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===_u.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=qt(a.x-r,a.y-i,0),c=ee(s,this.right)/Ut(this.right),l=ee(s,this.up)/Ut(this.up);return this.pan(-c,-l),this},t.prototype.setPerspective=function(t,e,n,r){var i;this.projectionMode=_u.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(du(.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,o-a,t,this.far,this.clipSpaceNearZ===nu.ZERO),xt(this.projectionMatrix,this.projectionMatrix,qt(1,-1,1)),mt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(t,e,n,r,i,o){var a;this.projectionMode=_u.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===nu.NEGATIVE_ONE?Dt(this.projectionMatrix,f,d,p,h,i,o):Ft(this.projectionMatrix,f,d,p,h,i,o),xt(this.projectionMatrix,this.projectionMatrix,qt(1,-1,1)),mt(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=fu(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=qt(0,1,0);if(this.focalPoint=fu(t,e,n),this.trackingMode===Au.CINEMATIC){var i=Qt(Vt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=Ut(i),a=hu(Math.asin(e/o)),s=90+hu(Math.atan2(n,t)),c=ut();Mt(c,c,du(s)),wt(c,c,du(a)),r=ie(Vt(),[0,1,0],c)}return mt(this.matrix,zt(ut(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},t.prototype.getDistance=function(){return this.distance},t.prototype.getDistanceVector=function(){return this.distanceVector},t.prototype.setDistance=function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<zu&&(this.distance=zu),this.dollyingStep=this.distance/100;var e=Vt();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=uu(t),this.computeMatrix(),this._getAxes(),this.type===Su.ORBITING||this.type===Su.EXPLORING?this._getPosition():this.type===Su.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(t){return this.elevation=uu(t),this.computeMatrix(),this._getAxes(),this.type===Su.ORBITING||this.type===Su.EXPLORING?this._getPosition():this.type===Su.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(t){return this.roll=uu(t),this.computeMatrix(),this._getAxes(),this.type===Su.ORBITING||this.type===Su.EXPLORING?this._getPosition():this.type===Su.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=de(fe(),[0,0,1],du(this.roll));pt(this.matrix);var e=de(fe(),[1,0,0],du((this.rotateWorld&&this.type!==Su.TRACKING||this.type===Su.TRACKING?1:-1)*this.elevation)),n=de(fe(),[0,1,0],du((this.rotateWorld&&this.type!==Su.TRACKING||this.type===Su.TRACKING?1:-1)*this.azimuth)),r=he(fe(),n,e);r=he(fe(),r,t);var i=jt(ut(),r);this.type===Su.ORBITING||this.type===Su.EXPLORING?(bt(this.matrix,this.matrix,this.focalPoint),vt(this.matrix,this.matrix,i),bt(this.matrix,this.matrix,[0,0,this.distance])):this.type===Su.TRACKING&&(bt(this.matrix,this.matrix,this.position),vt(this.matrix,this.matrix,i))},t.prototype._setPosition=function(t,e,n){this.position=fu(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(){Xt(this.right,fu(ue(le(),[1,0,0,0],this.matrix))),Xt(this.up,fu(ue(le(),[0,1,0,0],this.matrix))),Xt(this.forward,fu(ue(le(),[0,0,1,0],this.matrix))),te(this.right,this.right),te(this.up,this.up),te(this.forward,this.forward)},t.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Ut(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===Su.TRACKING||this.rotateWorld?(this.elevation=hu(Math.asin(e/r)),this.azimuth=hu(Math.atan2(-t,-n))):(this.elevation=-hu(Math.asin(e/r)),this.azimuth=-hu(Math.atan2(-t,-n)))},t.prototype._getPosition=function(){Xt(this.position,fu(ue(le(),[0,0,0,1],this.matrix))),this._getDistance()},t.prototype._getFocalPoint=function(){var t,e;oe(this.distanceVector,[0,0,-this.distance],(t=ct(),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)),Kt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},t.prototype._getDistance=function(){this.distanceVector=Qt(Vt(),this.focalPoint,this.position),this.distance=Ut(this.distanceVector),this.dollyingStep=this.distance/100},t.prototype._getOrthoMatrix=function(){if(this.projectionMode===_u.ORTHOGRAPHIC){var t=this.position,e=de(fe(),[0,0,1],-this.roll*Math.PI/180);Lt(this.orthoMatrix,e,qt((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),qt(this.zoom,this.zoom,1),t)}},t.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=vt(ut(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Fu)}},t.prototype.rotate=function(t,e,n){throw new Error(Nu)},t.prototype.pan=function(t,e){throw new Error(Nu)},t.prototype.dolly=function(t){throw new Error(Nu)},t.prototype.createLandmark=function(t,e){throw new Error(Nu)},t.prototype.gotoLandmark=function(t,e){throw new Error(Nu)},t.prototype.cancelLandmarkAnimation=function(){throw new Error(Nu)},t}();function Wu(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(Wu.Cache||Map),n}Wu.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"}(ju||(ju={})),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"}(Ru||(Ru={})),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"}(Iu||(Iu={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Bu||(Bu={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Du||(Du={}));var $u,Hu=[{name:"em",unit_type:ju.kEms},{name:"px",unit_type:ju.kPixels},{name:"deg",unit_type:ju.kDegrees},{name:"rad",unit_type:ju.kRadians},{name:"grad",unit_type:ju.kGradians},{name:"ms",unit_type:ju.kMilliseconds},{name:"s",unit_type:ju.kSeconds},{name:"rem",unit_type:ju.kRems},{name:"turn",unit_type:ju.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"}($u||($u={}));var Vu,Yu=function(t){return t?"number"===t?ju.kNumber:"percent"===t||"%"===t?ju.kPercentage:function(t){return Hu.find((function(e){return e.name===t})).unit_type}(t):ju.kUnknown},Uu=function(t){var e=1;switch(t){case ju.kPixels:case ju.kDegrees:case ju.kSeconds:break;case ju.kMilliseconds:e=.001;break;case ju.kRadians:e=180/Math.PI;break;case ju.kGradians:e=.9;break;case ju.kTurns:e=360}return e},qu=function(t){switch(t){case ju.kNumber:case ju.kInteger:return"";case ju.kPercentage:return"%";case ju.kEms:return"em";case ju.kRems:return"rem";case ju.kPixels:return"px";case ju.kDegrees:return"deg";case ju.kRadians:return"rad";case ju.kGradians:return"grad";case ju.kMilliseconds:return"ms";case ju.kSeconds:return"s";case ju.kTurns:return"turn"}return""},Xu=function(){function t(){}return t.isAngle=function(t){return t===ju.kDegrees||t===ju.kRadians||t===ju.kGradians||t===ju.kTurns},t.isLength=function(t){return t>=ju.kEms&&t<ju.kDegrees},t.isRelativeUnit=function(t){return t===ju.kPercentage||t===ju.kEms||t===ju.kRems},t.isTime=function(t){return t===ju.kSeconds||t===ju.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(Bu.kNo,Du.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=$u.kUnitType&&this.getType()<=$u.kClampType},t}(),Zu=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return we(e,t),e.prototype.getType=function(){return $u.kColorType},e.prototype.to=function(t){return this},e}(Xu);!function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"}(Vu||(Vu={}));var Ku=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return we(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 $u.kColorType},e}(Xu),Qu=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return we(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return $u.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(Xu),Ju=Wu((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),tf=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function ef(t){return"function"==typeof t}var nf={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},rf=Wu((function(t){var e=Ju(t),n=nf[e];return e=(null==n?void 0:n.alias)||e})),of=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},af=function(t){return function(t){switch(t){case Ru.kUNumber:return ju.kNumber;case Ru.kULength:return ju.kPixels;case Ru.kUPercent:return ju.kPercentage;case Ru.kUTime:return ju.kSeconds;case Ru.kUAngle:return ju.kDegrees;default:return ju.kUnknown}}(function(t){switch(t){case ju.kNumber:case ju.kInteger:return Ru.kUNumber;case ju.kPercentage:return Ru.kUPercent;case ju.kPixels:return Ru.kULength;case ju.kMilliseconds:case ju.kSeconds:return Ru.kUTime;case ju.kDegrees:case ju.kRadians:case ju.kGradians:case ju.kTurns:return Ru.kUAngle;default:return Ru.kUOther}}(t))},sf=function(t){function e(e,n){void 0===n&&(n=ju.kNumber);var r,i=t.call(this)||this;return r="string"==typeof n?Yu(n):n,i.unit=r,i.value=e,i}return we(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 $u.kUnitType},e.prototype.convertTo=function(t){if(this.unit===t)return new e(this.value,this.unit);var n=af(this.unit);if(n!==af(t)||n===ju.kUnknown)return null;var r=Uu(this.unit)/Uu(t);return new e(this.value*r,t)},e.prototype.buildCSSText=function(t,e,n){var r;switch(this.unit){case ju.kUnknown:break;case ju.kInteger:r=Number(this.value).toFixed(0);break;case ju.kNumber:case ju.kPercentage:case ju.kEms:case ju.kRems:case ju.kPixels:case ju.kDegrees:case ju.kRadians:case ju.kGradians:case ju.kMilliseconds:case ju.kSeconds:case ju.kTurns:var i=this.value,o=qu(this.unit);if(i<-999999||i>999999){var a=qu(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?of(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r},e}(Xu),cf=new sf(0,"px");new sf(1,"px");var lf,uf,ff=new sf(0,"deg"),df=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 we(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}(Zu),hf=new Qu("unset"),pf=new Qu("initial"),gf=new Qu("inherit"),mf={"":hf,unset:hf,initial:pf,inherit:gf},yf=function(t){return mf[t]||(mf[t]=new Qu(t)),mf[t]},vf=new df(0,0,0,0,!0),bf=new df(0,0,0,0),xf=Wu((function(t,e,n,r){return new df(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),wf=function(t,e){return void 0===e&&(e=ju.kNumber),new sf(t,e)};new sf(50,"%"),function(t){t[t.Standard=0]="Standard"}(lf||(lf={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"}(uf||(uf={}));var Mf,Of={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Cu(0,0,0,0)};function Ef(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>"}(Mf||(Mf={}));var kf=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 Sf=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Af=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,_f=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Tf=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Pf={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},Cf=Wu((function(t){var e;return e="angular"===t.type?Number(t.value):Pf[t.value]||0,wf(e,"deg")})),Nf=Wu((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:wf(e,r),cy:wf(n,i)}})),Lf=Wu((function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return kf(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:wf(Number(t.length.value),"%"),color:Ef(t)}}));if("linear-gradient"===e)return new Ku(Vu.LinearGradient,{angle:n?Cf(n):ff,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o=Nf(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?yf(f):wf(f,u)}return new Ku(Vu.RadialGradient,{cx:a,cy:s,size:c,steps:i})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=Sf.exec(t);if(r){var i=(null===(e=r[2].match(Tf))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return[new Ku(Vu.LinearGradient,{angle:wf(parseFloat(r[1]),"deg"),steps:i.map((function(t){var e=_e(t,2),n=e[0],r=e[1];return{offset:wf(100*Number(n),"%"),color:r}}))})]}}else if("r"===n){var o=function(t){var e,n=Af.exec(t);if(n){var r=(null===(e=n[4].match(Tf))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:wf(50,"%"),cy:wf(50,"%"),steps:r.map((function(t){var e=_e(t,2),n=e[0],r=e[1];return{offset:wf(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!C(o))return[new Ku(Vu.RadialGradient,o)];t=o}}else if("p"===n)return function(t){var e=_f.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 jf(t){return t&&!!t.image}function Rf(t){return t&&!v(t.r)&&!v(t.g)&&!v(t.b)}var If=Wu((function(t){if(jf(t))return Me({repetition:"repeat"},t);if(v(t)&&(t=""),"transparent"===t)return bf;if("currentColor"===t)t="black";else if("none"===t)return vf;var e=Lf(t);if(e)return e;var n=El(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),xf.apply(void 0,Te([],_e(r),!1))}));function Bf(t,e){if(Rf(t)&&Rf(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 Df(t,e){if(v(e))return wf(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return wf(Number(e),"px");if("deg".search(t)>=0)return wf(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 wf(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var Ff=function(t){return Df(new RegExp("px","g"),t)},zf=Wu(Ff);Wu((function(t){return Df(new RegExp("%","g"),t)}));var Gf=function(t){return j(t)||isFinite(Number(t))?wf(Number(t)||0,"px"):Df(new RegExp("px|%|em|rem","g"),t)},Wf=Wu(Gf),$f=function(t){return Df(new RegExp("deg|rad|grad|turn","g"),t)},Hf=Wu($f);function Vf(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,c=af(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(a=l.value,s=u.value,o=qu(t.unit)):(sf.isLength(t.unit)||sf.isLength(e.unit))&&(a=Xf(t,i,n),s=Xf(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Yf(t){var e=0;return t.unit===ju.kDegrees?e=t.value:t.unit===ju.kRadians?e=hu(Number(t.value)):t.unit===ju.kTurns&&(e=360*Number(t.value)),e}function Uf(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 qf(t){return C(t)?t.split(" ").map((function(t){return Wf(t)})):t.map((function(t){return Wf(t.toString())}))}function Xf(t,e,n,r){if(void 0===r&&(r=!1),t.unit===ju.kPixels)return Number(t.value);if(t.unit===ju.kPercentage&&n){var i=n.nodeName===eu.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var Zf=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Kf(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,Zf.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Df(/deg|rad|grad|turn|px|%/g,t)||If(t)}))}),n.lastIndex===t.length)return r}return[]}function Qf(t){return t.toString()}var Jf=function(t){return"number"==typeof t?wf(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?wf(Number(t)):wf(0)},td=Wu(Jf);function ed(t,e){return[t,e,Qf]}function nd(t,e){return function(n,r){return[n,r,function(n){return Qf(L(n,t,e))}]}}function rd(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function id(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=un(t.parsedStyle.d.absolutePath,void 0,Me(Me({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function od(t,e){return t[0]===e[0]&&t[1]===e[1]}function ad(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 sd(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Wu((function(t){return C(t)?t.split(" ").map(td):t.map(td)}));var cd=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)},ld=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var c=du(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=cd({x:1,y:0},v),x=cd(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 ud(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=ld({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),d=ld({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 fd(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function dd(t,e){return fd(t)*fd(e)?(t[0]*e[0]+t[1]*e[1])/(fd(t)*fd(e)):1}function hd(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(dd(t,e))}function pd(t,e){var n=e[1],r=e[2],i=F(du(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=hd([1,0],x),O=hd(x,w);return dd(x,w)<=-1&&(O=Math.PI),dd(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:od(t,[l,u])?0:n,ry:od(t,[l,u])?0:r,startAngle:M,endAngle:M+O,xRotation:i,arcFlag:o,sweepFlag:a}}function gd(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 md(t,e){void 0===e&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case eu.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 eu.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=gd(h,h,g,void 0===m?0:m);break;case eu.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=gd(b,w,g,void 0===O?0:O);break;case eu.POLYLINE:case eu.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===eu.POLYGON);break;case eu.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=_e(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 eu.PATH:n=Te([],_e(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=qt(e[1],e[2],0);n&&ie(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=qt(e[1],e[2],0),a=qt(e[3],e[4],0),s=qt(e[5],e[6],0);n&&(ie(o,o,n),ie(a,a,n),ie(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=qt(e[6],e[7],0);n&&ie(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=qt(e[1],e[2],0),a=qt(e[3],e[4],0),n&&(ie(o,o,n),ie(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 yd=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=Ue(t)}catch(n){e=Ue(""),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&&od(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=pd(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]&&od(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=sd((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=sd((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=ud(u,0),x=b.x,w=b.y,M=ud(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=Ql(c[0],c[1],s[1],s[2],s[3],s[4]);break;case"C":l=Ul(c[0],c[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var u=g.arcParams;l=Fl(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-=ad(g,e).xExtra:a[0]===h&&(h+=ad(g,e).xExtra),a[1]===d?d-=ad(g,e).yExtra:a[1]===p&&(p+=ad(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}}},vd=Wu(yd);function bd(t){return C(t)?vd(t):yd(t)}function xd(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Je(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Je(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=hn(r,i));var a,s,c,l,u,f,d,h,p=fn(o[0])!==fn(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+=tn(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 wd(t,e){var n;return n=C(t)?t.split(" ").map((function(t){var e=_e(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]})):t,{points:n,totalLength:0,segments:[]}}function Md(t,e){return[t.points,e.points,function(t){return t}]}var Od=null;function Ed(t){return function(e){var n=0;return t.map((function(t){return t===Od?e[n++]:t}))}}function kd(t){return t}var Sd={matrix:["NNNNNN",[Od,Od,0,0,Od,Od,0,0,0,0,1,0,Od,Od,0,1],kd],matrix3d:["NNNNNNNNNNNNNNNN",kd],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Ed([Od,Od,new sf(1)]),kd],scalex:["N",Ed([Od,new sf(1),new sf(1)]),Ed([Od,new sf(1)])],scaley:["N",Ed([new sf(1),Od,new sf(1)]),Ed([new sf(1),Od])],scalez:["N",Ed([new sf(1),new sf(1),Od])],scale3d:["NNN",kd],skew:["Aa",null,kd],skewx:["A",null,Ed([Od,ff])],skewy:["A",null,Ed([ff,Od])],translate:["Tt",Ed([Od,Od,cf]),kd],translatex:["T",Ed([Od,cf,cf]),Ed([Od,cf])],translatey:["T",Ed([cf,Od,cf]),Ed([cf,Od])],translatez:["L",Ed([cf,cf,Od])],translate3d:["TTL",kd]};function Ad(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=Sd[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()?ff:Hf(t)},N:td,T:Wf,L:zf}[d.toUpperCase()](f):{a:ff,n:l[0],t:cf}[d]))return[];l.push(h)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function _d(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=Sd[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()?ff:$f(t)},N:Jf,T:Gf,L:Ff}[d.toUpperCase()](f):{a:ff,n:l[0],t:cf}[d]))return[];l.push(h)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function Td(t){var e,n,r,i;switch(t.t){case"rotatex":return i=du(Yf(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=du(Yf(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=du(Yf(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=du(Yf(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=du(Yf(t.d[0])),f=du(Yf(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=du(Yf(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=du(Yf(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=Xf(t.d[0],0,null)||0,n=Xf(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Xf(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=Xf(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=Xf(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Xf(t.d[0],0,null)||0,n=Xf(t.d[1],0,null)||0,r=Xf(t.d[2],0,null)||0,1];case"perspective":var d=Xf(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 Pd(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 Cd(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}(yu,t))return!1;if(dt(vu,yu),vu[3]=0,vu[7]=0,vu[11]=0,vu[15]=1,Math.abs(yt(vu))<1e-8)return!1;var a,s,c=yu[3],l=yu[7],u=yu[11],f=yu[12],d=yu[13],h=yu[14],p=yu[15];if(0!==c||0!==l||0!==u){if(bu[0]=c,bu[1]=l,bu[2]=u,bu[3]=p,!mt(vu,vu))return!1;gt(vu,vu),ue(i,bu,vu)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=d,e[2]=h,s=yu,(a=xu)[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]=Ut(xu[0]),te(xu[0],xu[0]),r[0]=ee(xu[0],xu[1]),Mu(xu[1],xu[1],xu[0],1,-r[0]),n[1]=Ut(xu[1]),te(xu[1],xu[1]),r[0]/=n[1],r[1]=ee(xu[0],xu[2]),Mu(xu[2],xu[2],xu[0],1,-r[1]),r[2]=ee(xu[1],xu[2]),Mu(xu[2],xu[2],xu[1],1,-r[2]),n[2]=Ut(xu[2]),te(xu[2],xu[2]),r[1]/=n[2],r[2]/=n[2],ne(wu,xu[1],xu[2]),ee(xu[0],wu)<0)for(var g=0;g<3;g++)n[g]*=-1,xu[g][0]*=-1,xu[g][1]*=-1,xu[g][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+xu[0][0]-xu[1][1]-xu[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-xu[0][0]+xu[1][1]-xu[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-xu[0][0]-xu[1][1]+xu[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+xu[0][0]+xu[1][1]+xu[2][2],0)),xu[2][1]>xu[1][2]&&(o[0]=-o[0]),xu[0][2]>xu[2][0]&&(o[1]=-o[1]),xu[1][0]>xu[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(Td).reduce(Pd)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var Nd=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 Ld(t){return t.toFixed(6).replace(".000000","")}function jd(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Cd(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Cd(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 Nd(t[0],t[1],t[2],e,t[4]).map(Ld).join(",")}])}function Rd(t){return t.replace(/[xy]/,"")}function Id(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Bd(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?wf(a):wf(a,t.unit)}))})},o=0;o<t.length;o++)i(o)}var a,s,c=[],l=[],u=[];if(t.length!==e.length)c=[(v=jd(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=Sd[f],m=Sd[d],y=void 0;if(s=d,"perspective"===(a=f)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var v=jd([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]&&Rd(f)===Rd(d))y=Rd(f),h=g[2](h),p=m[2](p);else{if(!g[1]||!m[1]||Id(f)!==Id(d)){c=[(v=jd(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];break}y=Id(f),h=g[1](h),p=m[1](p)}for(var b=[],x=[],w=[],M=0;M<h.length;M++){v=Vf(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 Dd=Wu((function(t){if(C(t)){if("text-anchor"===t)return[wf(0,"px"),wf(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:[Wf(zd(e[0])),Wf(zd(e[1]))]}return[wf(t[0]||0,"px"),wf(t[1]||0,"px")]})),Fd=function(t){if(C(t)){if("text-anchor"===t)return[wf(0,"px"),wf(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:[Gf(zd(e[0])),Gf(zd(e[1]))]}return[wf(t[0]||0,"px"),wf(t[1]||0,"px")]};function zd(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var Gd=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Mf.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Mf.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Mf.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Mf.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Mf.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Mf.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Mf.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Mf.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Mf.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Mf.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Mf.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:Mf.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Mf.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Mf.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Mf.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Mf.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Mf.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Mf.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:Mf.FILTER},{n:"clipPath",syntax:Mf.DEFINED_PATH},{n:"textPath",syntax:Mf.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Mf.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Mf.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:Mf.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:Mf.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:Mf.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:Mf.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Mf.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Mf.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Mf.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:Mf.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:Mf.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:Mf.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Mf.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Mf.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Mf.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Mf.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Mf.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Mf.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Mf.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Mf.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Mf.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:Mf.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Mf.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Mf.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Mf.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Mf.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:Mf.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Mf.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Mf.NUMBER,d:function(t){return t===eu.PATH||t===eu.POLYGON||t===eu.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:Mf.MARKER},{n:"markerEnd",syntax:Mf.MARKER},{n:"markerMid",syntax:Mf.MARKER},{n:"markerStartOffset",syntax:Mf.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Mf.LENGTH,l:!0,int:!0,d:"0"}],Wd=Gd.filter((function(t){return!!t.l})).map((function(t){return t.n})),$d={},Hd=new WeakMap,Vd=function(){function t(t){var e=this;this.runtime=t,Gd.forEach((function(t){e.registerMetadata(t)}))}return t.prototype.registerMetadata=function(t){Te([t.n],_e(t.a||[]),!1).forEach((function(e){$d[e]=t}))},t.prototype.unregisterMetadata=function(t){delete $d[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=$d[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<Wd.length;g++)if(Wd[g]in e){p=!0;break}e.fill&&(t.parsedStyle.fill=If(e.fill)),e.stroke&&(t.parsedStyle.stroke=If(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=If(e.shadowColor)),e.filter&&(t.parsedStyle.filter=Kf(e.filter)),v(e.radius)||(t.parsedStyle.radius=Uf(e.radius,4)),v(e.lineDash)||(t.parsedStyle.lineDash=Uf(e.lineDash,2)),e.points&&(t.parsedStyle.points=wd(e.points)),""===e.d&&(t.parsedStyle.d=Me({},Of)),e.d&&(t.parsedStyle.d=bd(e.d)),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},t,null),H(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=Ad(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=Dd(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=$d[t],o=e;if((""===e||v(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)o=yf(e);else if(i){var a=i.k,s=i.syntax,c=s&&this.getPropertySyntax(s);a&&a.indexOf(e)>-1?o=yf(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=$d[t],o="g-root"===n.id,a=e;if(i){var s=i.syntax,c=i.inh,l=i.d;if(e instanceof Qu){var u=e.value;if("unset"===u&&(u=c&&!o?"inherit":"initial"),"initial"===u)v(l)||(e=this.parseProperty(t,ef(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 Qu?e.value:e}return a},t.prototype.postProcessProperty=function(t,e,n){var r=$d[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=Hd.get(t);n||(Hd.set(t,[]),n=Hd.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=Hd.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=Hd.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Hd.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 Eu),r.renderBounds||(r.renderBounds=new Eu);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===eu.POLYLINE||e===eu.POLYGON||e===eu.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,cu(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?Xf(P[0],0,t,!0):0),U=(V?-1:1)*(P?Xf(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===eu.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===eu.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))},t.prototype.isPropertyInheritable=function(t){var e=$d[t];return!!e&&e.inh},t}(),Yd=function(){function t(){this.parser=Hf,this.parserUnmemoize=$f,this.parserWithCSSDisabled=null,this.mixer=ed}return t.prototype.calculator=function(t,e,n,r){return Yf(n)},t}(),Ud=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof Qu&&(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}(),qd=function(){function t(){this.parser=If,this.parserWithCSSDisabled=If,this.mixer=Bf}return t.prototype.calculator=function(t,e,n,r){return n instanceof Qu?"none"===n.value?vf:bf:n},t}(),Xd=function(){function t(){this.parser=Kf}return t.prototype.calculator=function(t,e,n){return n instanceof Qu?[]:n},t}();function Zd(t){var e=t.parsedStyle.fontSize;return v(e)?null:e}var Kd=function(){function t(){this.parser=Wf,this.parserUnmemoize=Gf,this.parserWithCSSDisabled=null,this.mixer=ed}return t.prototype.calculator=function(t,e,n,r,i){var o;if(j(n))return n;if(!sf.isRelativeUnit(n.unit))return n.value;var a=i.styleValueRegistry;if(n.unit===ju.kPercentage)return 0;if(n.unit===ju.kEms){if(r.parentNode){if(s=Zd(r.parentNode))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}if(n.unit===ju.kRems){if(null===(o=null==r?void 0:r.ownerDocument)||void 0===o?void 0:o.documentElement){var s;if(s=Zd(r.ownerDocument.documentElement))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}},t}(),Qd=function(){function t(){this.mixer=rd}return t.prototype.parser=function(t){var e=qf(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}(),Jd=function(){function t(){this.mixer=rd}return t.prototype.parser=function(t){var e=qf(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}(),th=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof Qu&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),eh=function(){function t(){this.mixer=ed,this.parser=td,this.parserUnmemoize=Jf,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),nh=function(){function t(){this.parser=td,this.parserUnmemoize=Jf,this.parserWithCSSDisabled=null,this.mixer=nd(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===eu.LINE||i===eu.PATH||i===eu.POLYLINE){var o=n.getPoint(r);o&&t.setLocalPosition(o.x,o.y)}}},t}(),rh=function(){function t(){this.parser=td,this.parserUnmemoize=Jf,this.parserWithCSSDisabled=null,this.mixer=nd(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),ih=function(){function t(){this.parser=bd,this.parserWithCSSDisabled=bd,this.mixer=xd}return t.prototype.calculator=function(t,e,n){return n instanceof Qu&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Cu(0,0,0,0)}:n},t}(),oh=function(){this.parser=wd,this.mixer=Md},ah=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.mixer=nd(0,1/0),e}return we(e,t),e}(Kd),sh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Qu?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),ch=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}(),lh={},uh=0;var fh="undefined"!=typeof window&&void 0!==window.document;function dh(t){return!!t.getAttribute}function hh(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 ph(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 gh(t,e){if(fh)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var mh={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},yh="object"==typeof performance&&performance.now?performance:Date;function vh(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 bh=1,xh="object"==typeof self&&self.self==self?self:"object"==typeof rl&&rl.global==rl?rl:{},wh=Date.now(),Mh={},Oh=Date.now(),Eh=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Oh,r=n>16?0:16-n,i=bh++;return Mh[i]=t,Object.keys(Mh).length>1||setTimeout((function(){Oh=e;var t=Mh;Mh={},Object.keys(t).forEach((function(e){return t[e](xh.performance&&"function"==typeof xh.performance.now?xh.performance.now():Date.now()-wh)}))}),r),i},kh=function(t){delete Mh[t]},Sh=function(t){return"string"!=typeof t?Eh:""===t?xh.requestAnimationFrame:xh[t+"RequestAnimationFrame"]},Ah=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!!Sh(t)})),_h=Sh(Ah),Th=function(t){return"string"!=typeof t?kh:""===t?xh.cancelAnimationFrame:xh[t+"CancelAnimationFrame"]||xh[t+"CancelRequestAnimationFrame"]}(Ah);xh.requestAnimationFrame=_h,xh.cancelAnimationFrame=Th;var Ph=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,Te([],_e(t),!1))})))},t}(),Ch=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 ke(this,void 0,void 0,(function(){var e,n,r;return Se(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,Te([],_e(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}(),Nh=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}(),Lh=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}(),jh=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Rh=/([\"\'])[^\'\"]+\1/;function Ih(t,e,n){return pt(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var Bh=1e-5,Dh=ut(),Fh=ut();function zh(t,e){if(t.length){var n=pt(Dh);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,Bh)})))||[1,1];Et(Fh,[i[0],i[1],1])}else if("scalex"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Bh)})))||[1];Et(Fh,[i[0],1,1])}else if("scaley"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Bh)})))||[1];Et(Fh,[1,i[0],1])}else if("scalez"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Bh)})))||[1];Et(Fh,[1,1,i[0]])}else if("scale3d"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Bh)})))||[1,1,1];Et(Fh,[i[0],i[1],i[2]])}else if("translate"===e){Ot(Fh,[(o=r||[cf,cf])[0].value,o[1].value,0])}else if("translatex"===e){Ot(Fh,[(o=r||[cf])[0].value,0,0])}else if("translatey"===e){Ot(Fh,[0,(o=r||[cf])[0].value,0])}else if("translatez"===e){Ot(Fh,[0,0,(o=r||[cf])[0].value])}else if("translate3d"===e){var o;Ot(Fh,[(o=r||[cf,cf,cf])[0].value,o[1].value,o[2].value])}else if("rotate"===e){_t(Fh,du(Yf((a=r||[ff])[0])))}else if("rotatex"===e){St(Fh,du(Yf((a=r||[ff])[0])))}else if("rotatey"===e){At(Fh,du(Yf((a=r||[ff])[0])))}else if("rotatez"===e){_t(Fh,du(Yf((a=r||[ff])[0])))}else if("rotate3d"===e){var a;kt(Fh,du(Yf((a=r||[cf,cf,cf,ff])[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];Ih(Fh,du(s[0]),du(s[1]))}else if("skewx"===e){s=(null==r?void 0:r.map((function(t){return t.value})))||[0];Ih(Fh,du(s[0]),0)}else if("skewy"===e){s=(null==r?void 0:r.map((function(t){return t.value})))||[0];Ih(Fh,0,du(s[0]))}else if("matrix"===e){var c=_e(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];ht(Fh,l,u,0,0,f,d,0,0,0,0,1,0,h,p,0,1)}else"matrix3d"===e&&ht.apply(Ht,Te([Fh],_e(r.map((function(t){return t.value}))),!1));Wt(n,n,Fh)})),e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var Gh=function(){function t(){this.parser=Ad,this.parserUnmemoize=_d,this.parserWithCSSDisabled=_d,this.mixer=Bd}return t.prototype.calculator=function(t,e,n,r){return n instanceof Qu?[]:n},t.prototype.postProcessor=function(t){zh(t.parsedStyle.transform,t)},t}(),Wh=function(){function t(){this.parser=Dd,this.parserUnmemoize=Fd}return t.prototype.postProcessor=function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===ju.kPixels&&e[1].unit===ju.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()},t}(),$h=function(){function t(){this.parser=td,this.parserUnmemoize=Jf}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=uf.Z_INDEX_CHANGED)}},t}(),Hh=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}(),Vh=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}(),Yh=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}(),Uh=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}(),qh=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,Te([],_e(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,Te([],_e(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,Te([],_e(e.map((function(t){return t[1]}))),!1)),o=Math.max.apply(Math,Te([],_e(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}(),Xh=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}(),Zh=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 Ep.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}(),Kh=function(){function t(){}return t.prototype.update=function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}},t}();var Qh,Jh=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 Pu,this.page=new Pu,this.canvas=new Pu,this.viewport=new Pu,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(Nu)},t}(),tp=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.client=new Pu,e.movement=new Pu,e.offset=new Pu,e.global=new Pu,e.screen=new Pu,e}return we(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(Nu)},e}(Jh),ep=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return we(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}(tp),np=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return we(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(tp),rp=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 we(e,t),e}(Jh),ip=function(){function t(){this.emitter=new ol}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=ef(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var c=_e(t.split(":"),2),l=c[0];t=c[1],s=l,a=!0}if(t=r?"".concat(t,"capture"):t,e=ef(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,Te([],_e(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=ef(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=ef(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new rp(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}(),op=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 we(e,t),e.isNode=function(t){return!!t.childNodes},Object.defineProperty(e.prototype,"textContent",{get:function(){var t,e,n="";this.nodeName===eu.TEXT&&(n+=this.style.text);try{for(var r=Ae(this.childNodes),i=r.next();!i.done;i=r.next()){var o=i.value;o.nodeName===eu.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===eu.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(Nu)},e.prototype.lookupNamespaceURI=function(t){throw new Error(Nu)},e.prototype.lookupPrefix=function(t){throw new Error(Nu)},e.prototype.normalize=function(){throw new Error(Nu)},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}(ip),ap=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new ol,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=ut(),this.tmpVec3=Vt(),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=yh.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")}op.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"),op.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&&op.isNode(o)&&o.parentNode;f&&f!==(op.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(op.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!==(op.isNode(n.rootTarget)&&n.rootTarget.parentNode);)d.currentTarget=d.target,n.notifyTarget(d),r&&n.notifyTarget(d,"mouseenter"),op.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!==(op.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),op.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!==(op.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),op.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"),op.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}n.freeEvent(i)},this.onWheel=function(t){var e=n.createWheelEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.onClick=function(t){if(n.context.config.useNativeClickEvent){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)}},this.onPointerCancel=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(e),n.freeEvent(e)}}return t.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},t.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},t.prototype.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new Pu(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},t.prototype.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new Pu(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},t.prototype.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),c=r.getWorldTransform(),l=vt(this.tmpMatrix,c,s),u=Zt(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return ie(u,u,l),new Pu(u[0],u[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=vt(this.tmpMatrix,n,r),o=Zt(this.tmpVec3,t.x,t.y,0);ie(this.tmpVec3,this.tmpVec3,i);var a=this.context.config,s=a.width,c=a.height;return new Pu((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++)op.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=Ae(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(ep);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(np);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(np);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(ep);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=yh.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||op.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=dh(e)&&e.getAttribute("cursor");if(n)return n;e=op.isNode(e)&&e.parentNode}},t}(),sp=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||Ep.offscreenCanvas)this.canvas=t||Ep.offscreenCanvas,this.context=this.canvas.getContext("2d",Me({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",Me({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",Me({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"}(Qh||(Qh={}));var cp,lp=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 Nh,initAsync:new Ph,dirtycheck:new Lh,cull:new Lh,beginFrame:new Nh,beforeRender:new Nh,render:new Nh,afterRender:new Nh,endFrame:new Nh,destroy:new Nh,pick:new Ch,pickSync:new Lh,pointerDown:new Nh,pointerUp:new Nh,pointerMove:new Nh,pointerOut:new Nh,pointerOver:new Nh,pointerWheel:new Nh,pointerCancel:new Nh,click:new Nh}}return t.prototype.init=function(t){var e=this,n=Me(Me({},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(Qh.CAMERA_CHANGED)},t.prototype.render=function(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited){r.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var i=1===r.renderReasons.size&&r.renderReasons.has(Qh.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&i);o&&this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),o&&r.renderListCurrentFrame.forEach((function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e()}},t.prototype.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=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!==uf.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;hh(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(hh)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(Qh.DISPLAY_OBJECT_CHANGED)},t}(),up=/\[\s*(.*)=(.*)\s*\]/,fp=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(up),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}(),dp=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 we(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(Jh);function hp(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"}(cp||(cp={}));var pp,gp,mp,yp=new dp(cp.REPARENT,null,"","","",0,"",""),vp=function(){function t(t){var e,n,r,i,o,a,s,c,l=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new rp(cp.BOUNDS_CHANGED),this.rotate=(e=fe(),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=qt(n,r,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var s=fe();ge(s,n[0],n[1],n[2]);var c=l.getRotation(t),u=l.getRotation(t.parentNode);ye(e,u),pe(e,e),he(s,e,s),he(a.localRotation,s,c),be(a.localRotation,a.localRotation),o&&l.dirtifyLocal(t,a)}else l.rotateLocal(t,n)}),this.rotateLocal=(n=fe(),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=qt(e,r,i));var a=t.transformable;ge(n,e[0],e[1],e[2]),ve(a.localRotation,a.localRotation,n),o&&l.dirtifyLocal(t,a)}),this.setEulerAngles=(r=fe(),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=qt(e,n,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){ge(a.localRotation,e[0],e[1],e[2]);var s=l.getRotation(t.parentNode);ye(r,pe(fe(),s)),ve(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=qt(e,n,r));var o=t.transformable;ae(e,Vt())||(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),Kt(o.localPosition,o.localPosition,e),i&&l.dirtifyLocal(t,o))},this.setPosition=(i=ut(),o=Vt(),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,!ae(l.getPosition(t),o)){if(Xt(r.position,o),null!==t.parentNode&&t.parentNode.transformable){var a=t.parentNode.transformable;dt(i,a.worldTransform),mt(i,i),ie(r.localPosition,o,i)}else Xt(r.localPosition,o);n&&l.dirtifyLocal(t,r)}}),this.setLocalPosition=function(){var t=Vt();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,ae(i.localPosition,t)||(Xt(i.localPosition,t),r&&l.dirtifyLocal(e,i))}}(),this.translate=(a=Vt(),s=Vt(),c=Vt(),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=Zt(s,e,n,r)),ae(e,a)||(Kt(c,l.getPosition(t),e),l.setPosition(t,c,i))}),this.setRotation=function(){var t=fe();return function(e,n,r,i,o,a){void 0===a&&(a=!0);var s=e.transformable;if("number"==typeof n&&(n=me(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var c=l.getRotation(e.parentNode);ye(t,c),pe(t,t),he(s.localRotation,t,n),be(s.localRotation,s.localRotation),a&&l.dirtifyLocal(e,s)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=ut(),e=Vt(),n=me(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(Lt(r.localTransform,r.localRotation,r.localPosition,qt(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=pt(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),vt(r.localTransform,r.localTransform,i)}var o=Lt(t,n,e,r.localScale,r.origin);vt(r.localTransform,r.localTransform,o)}else Lt(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=uf.ADDED);var a=t.transformable;a&&this.dirtifyWorld(t,a),a.frozen&&this.unfreezeParentToRoot(t),i&&t.dispatchEvent(yp)},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=uf.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=qt(e,n,r));var o=t.transformable;ge(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=qt(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=qt(e[0],e[1],e[2]||r.localScale[2]);ae(i,r.localScale)||(Xt(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=me(e,n,r,i));var a=t.transformable;ye(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 st(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=_e(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;)hp(n),n=n.parentNode;e&&t.forEach((function(t){hp(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 dp(cp.ATTR_MODIFIED,n,e,e,t,dp.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))},t.prototype.getPosition=function(t){var e=t.transformable;return Pt(e.position,this.getWorldTransform(t,e))},t.prototype.getRotation=function(t){var e=t.transformable;return Nt(e.rotation,this.getWorldTransform(t,e))},t.prototype.getScale=function(t){var e=t.transformable;return Ct(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=Pt(Vt(),e),r=Nt(fe(),e),i=Ct(Vt(),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(Eu.isEmpty(r))return null;var i=n||new Eu;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&&Ep.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new Eu},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 Eu).update(r.center,r.halfExtents))})),o||(o=new Eu),e){var a=ph(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o.update(s.center,s.halfExtents)}}return e?(r.renderBounds=o,r.renderBoundsDirty=!1):(r.bounds=o,r.boundsDirty=!1),o},t.prototype.getLocalBounds=function(t){if(t.parentNode){var e=ut();t.parentNode.transformable&&(e=mt(ut(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Eu.isEmpty(n)){var r=new Eu;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);Eu.isEmpty(i)||(r=new Eu).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=_e(r.getMin(),2),s=a[0],c=a[1],l=_e(r.getMax(),2),u=l[0],f=l[1];return new Cu(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),u-s,f-c)}return new Cu((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?vt(e.worldTransform,r.worldTransform,e.localTransform):dt(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}(),bp={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]},xp=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,wp=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Mp=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Op=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!Mp.exec(n)&&!wp.exec(t))},this.trimByKinsokuShorui=function(t){var e=Te([],_e(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=bp.MetricsString+bp.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(bp.BaselineSymbol).width),c=bp.HeightMultiplier*s;s=s*bp.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();!Rh.test(p)&&jh.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 Cu(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&&bp.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&bp.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=Te([],_e(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||!xp.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(!xp.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}(),Ep={},kp=(gp=new Xh,mp=new qh,(pp={})[eu.CIRCLE]=new Hh,pp[eu.ELLIPSE]=new Vh,pp[eu.RECT]=gp,pp[eu.IMAGE]=gp,pp[eu.GROUP]=new Kh,pp[eu.LINE]=new Yh,pp[eu.TEXT]=new Zh(Ep),pp[eu.POLYLINE]=mp,pp[eu.POLYGON]=mp,pp[eu.PATH]=new Uh,pp[eu.HTML]=null,pp[eu.MESH]=null,pp),Sp=function(){var t,e=new qd,n=new Kd;return(t={})[Mf.PERCENTAGE]=null,t[Mf.NUMBER]=new eh,t[Mf.ANGLE]=new Yd,t[Mf.DEFINED_PATH]=new Ud,t[Mf.PAINT]=e,t[Mf.COLOR]=e,t[Mf.FILTER]=new Xd,t[Mf.LENGTH]=n,t[Mf.LENGTH_PERCENTAGE]=n,t[Mf.LENGTH_PERCENTAGE_12]=new Qd,t[Mf.LENGTH_PERCENTAGE_14]=new Jd,t[Mf.COORDINATE]=new Kd,t[Mf.OFFSET_DISTANCE]=new nh,t[Mf.OPACITY_VALUE]=new rh,t[Mf.PATH]=new ih,t[Mf.LIST_OF_POINTS]=new oh,t[Mf.SHADOW_BLUR]=new ah,t[Mf.TEXT]=new sh,t[Mf.TEXT_TRANSFORM]=new ch,t[Mf.TRANSFORM]=new Gh,t[Mf.TRANSFORM_ORIGIN]=new Wh,t[Mf.Z_INDEX]=new $h,t[Mf.MARKER]=new th,t}();Ep.CameraContribution=Gu,Ep.AnimationTimeline=null,Ep.EasingFunction=null,Ep.offscreenCanvasCreator=new sp,Ep.sceneGraphSelector=new fp,Ep.sceneGraphService=new vp(Ep),Ep.textService=new Op(Ep),Ep.geometryUpdaterFactory=kp,Ep.CSSPropertySyntaxFactory=Sp,Ep.styleValueRegistry=new Vd(Ep),Ep.layoutRegistry=null,Ep.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==rl?rl:{},Ep.enableCSSParsing=!1,Ep.enableDataset=!1,Ep.enableStyleSyntax=!0,Ep.enableAttributeDashCased=!1,Ep.enableSizeAttenuation=!1;var Ap=0,_p=new dp(cp.INSERTED,null,"","","",0,"",""),Tp=new dp(cp.REMOVED,null,"","","",0,"",""),Pp=new rp(cp.DESTROY),Cp=function(t){function e(){var e=t.call(this)||this;return e.entity=Ap++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.cullable={strategy:lf.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=Ep.enableCSSParsing?{opacity:hf,fillOpacity:hf,strokeOpacity:hf,fill:hf,stroke:hf,transform:hf,transformOrigin:hf,visibility:hf,pointerEvents:hf,lineWidth:hf,lineCap:hf,lineJoin:hf,increasedLineWidthForHitTesting:hf,fontSize:hf,fontFamily:hf,fontStyle:hf,fontWeight:hf,fontVariant:hf,textAlign:hf,textBaseline:hf,textTransform:hf,zIndex:hf,filter:hf,shadowType:hf}:null,e.parsedStyle={},e.attributes={},e}return we(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(Nu)},e.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return Ep.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),this.isMutationObserved&&(_p.relatedNode=this,t.dispatchEvent(_p)),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 Tp.relatedNode=this,t.dispatchEvent(Tp),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),Ep.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 Ep.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return Ep.sceneGraphService.querySelector("#".concat(t),this)},e.prototype.getElementsByName=function(t){return Ep.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},e.prototype.getElementsByClassName=function(t){return Ep.sceneGraphService.querySelectorAll(".".concat(t),this)},e.prototype.getElementsByTagName=function(t){return Ep.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return Ep.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return Ep.sceneGraphService.querySelectorAll(t,this)},e.prototype.closest=function(t){var e=this;do{if(Ep.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=_e(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,Te([],_e(a),!1))}},e.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,Te([],_e(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,Te([],_e(t),!1))},e.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.prototype.destroy=function(){this.dispatchEvent(Pp),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return Ep.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return Ep.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return Ep.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return Ep.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return Ep.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 Ep.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){if(Ep.enableAttributeDashCased){var n=rf(t);e=this.attributes[n]}return Ep.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(Nu)},e.prototype.getAttributeNode=function(t){throw new Error(Nu)},e.prototype.getAttributeNodeNS=function(t,e){throw new Error(Nu)},e.prototype.hasAttributeNS=function(t,e){throw new Error(Nu)},e.prototype.removeAttributeNS=function(t,e){throw new Error(Nu)},e.prototype.removeAttributeNode=function(t){throw new Error(Nu)},e.prototype.setAttributeNS=function(t,e,n){throw new Error(Nu)},e.prototype.setAttributeNode=function(t){throw new Error(Nu)},e.prototype.setAttributeNodeNS=function(t){throw new Error(Nu)},e.prototype.toggleAttribute=function(t,e){throw new Error(Nu)},e}(op);function Np(t){return!!(null==t?void 0:t.nodeName)}var Lp,jp=Ep.globalThis.Proxy?Ep.globalThis.Proxy:function(){},Rp=new dp(cp.ATTR_MODIFIED,null,null,null,null,dp.MODIFICATION,null,null),Ip={opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Bp={fill:vf,stroke:vf,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Dp=Te(Te([],_e(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),Fp="data-",zp=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||eu.GROUP,Ep.enableCSSParsing?(Object.assign(n.attributes,Ip),Object.assign(n.parsedStyle,Bp,n.config.initialParsedStyle)):n.config.initialParsedStyle&&Object.assign(n.parsedStyle,n.config.initialParsedStyle),n.initAttributes(n.config.style),Ep.enableDataset&&(n.dataset=new jp({},{get:function(t,e){var r="".concat(Fp).concat(tf(e));return void 0!==t[r]?t[r]:n.getAttribute(r)},set:function(t,e,r){return n.setAttribute("".concat(Fp).concat(tf(e)),r),!0}})),Ep.enableStyleSyntax&&(n.style=new jp({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 we(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=Me({},this.attributes);for(var r in n){var i=n[r];Np(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};Ep.enableCSSParsing&&(n.usedAttributes=Dp);var r=t;if(Ep.enableAttributeDashCased)for(var i in r={},t){r[rf(i)]=t[i]}Ep.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),Ep.enableAttributeDashCased&&(e=rf(e)),H(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];Ep.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(Rp.relatedNode=this,Rp.prevValue=o,Rp.newValue=e,Rp.attrName=t,Rp.prevParsedValue=a,Rp.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(Rp):(Rp.target=this,this.ownerDocument.defaultView.dispatchEvent(Rp,!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=_e(t.getMin(),2),n=e[0],r=e[1],i=_e(t.getMax(),2),o=i[0],a=i[1];return new Cu(n,r,o-n,a-r)},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ep.sceneGraphService.setOrigin(this,fu(t,e,n)),this},e.prototype.getOrigin=function(){return Ep.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ep.sceneGraphService.setPosition(this,fu(t,e,n)),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ep.sceneGraphService.setLocalPosition(this,fu(t,e,n)),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ep.sceneGraphService.translate(this,fu(t,e,n)),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Ep.sceneGraphService.translateLocal(this,fu(t,e,n)),this},e.prototype.getPosition=function(){return Ep.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return Ep.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=fu(t,e=e||t,n=n||t)),Ep.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=fu(t,e=e||t,n=n||t)),Ep.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return Ep.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return Ep.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){return hu(_e(pu(Vt(),Ep.sceneGraphService.getWorldTransform(this)),3)[2])},e.prototype.getLocalEulerAngles=function(){return hu(_e(pu(Vt(),Ep.sceneGraphService.getLocalRotation(this)),3)[2])},e.prototype.setEulerAngles=function(t){return Ep.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return Ep.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return v(e)&&v(n)?Ep.sceneGraphService.rotateLocal(this,0,0,t):Ep.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return v(e)&&v(n)?Ep.sceneGraphService.rotate(this,0,0,t):Ep.sceneGraphService.rotate(this,t,e,n),this},e.prototype.setRotation=function(t,e,n,r){return Ep.sceneGraphService.setRotation(this,t,e,n,r),this},e.prototype.setLocalRotation=function(t,e,n,r){return Ep.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.prototype.setLocalSkew=function(t,e){return Ep.sceneGraphService.setLocalSkew(this,t,e),this},e.prototype.getRotation=function(){return Ep.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return Ep.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return Ep.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return Ep.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return Ep.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(t){return Ep.sceneGraphService.setLocalTransform(this,t),this},e.prototype.resetLocalTransform=function(){Ep.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 Ep.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,Te([],_e(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,Te([],_e(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=_e(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=_e(Pt(Vt(),e),2),r=n[0],i=n[1],o=_e(Ct(Vt(),e),2),a=o[0],s=o[1],c=Nt(fe(),e),l=_e(pu(Vt(),c),3),u=l[0],f=l[2];return gu(u||f,r,i,a,s)},e.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.prototype.setMatrix=function(t){var e=_e(mu(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=_e(mu(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(){Ep.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},e.prototype.hide=function(){Ep.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}(Cp),Gp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Me({type:eu.CIRCLE},e))||this}return we(e,t),e}(zp),Wp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Oe(e,["style"]);return(n=t.call(this,Me({style:(Ep.enableCSSParsing,Me({},r))},i))||this).isCustomElement=!0,n}return we(e,t),e}(zp),$p=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Me({type:eu.ELLIPSE},e))||this}return we(e,t),e}(zp),Hp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Me({type:eu.GROUP},e))||this}return we(e,t),e}(zp),Vp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Oe(e,["style"]);return(n=t.call(this,Me({type:eu.HTML,style:Ep.enableCSSParsing?Me({x:"",y:"",width:"auto",height:"auto",innerHTML:""},r):Me({},r)},i))||this).cullable.enable=!1,n}return we(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 Cu(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 Eu,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=mt(ut(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Eu.isEmpty(e)){var n=new Eu;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(zp),Yp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Me({type:eu.IMAGE},e))||this}return we(e,t),e}(zp),Up=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Oe(e,["style"]);(n=t.call(this,Me({type:eu.LINE,style:Me({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&&Np(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),s&&Np(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return we(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&&Np(r)&&(this.markerStartAngle=0,r.remove()),i&&Np(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Np(r)&&(this.markerEndAngle=0,r.remove()),i&&Np(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&&Np(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=$l(n.x1,n.y1,n.x2,n.y2,t),i=r.x,o=r.y,a=ie(Vt(),qt(i,o,0),e?this.getWorldTransform():this.getLocalTransform());return new Pu(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 Wl(t.x1,t.y1,t.x2,t.y2)},e}(zp),qp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Oe(e,["style"]);(n=t.call(this,Me({type:eu.PATH,style:Ep.enableCSSParsing?Me({d:"",miterLimit:""},r):Me({},r),initialParsedStyle:Ep.enableCSSParsing?null:{miterLimit:4,d:Me({},Of)}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&Np(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&Np(c)&&n.placeMarkerMid(c),s&&Np(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return we(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&&Np(r)&&(this.markerStartAngle=0,r.remove()),i&&Np(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Np(r)&&(this.markerEndAngle=0,r.remove()),i&&Np(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&&Np(a)){var s,c,l,u,f,d,h;if(t){var p=_e(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=_e(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&&Np(t))for(var n=1;n<e.length-1;n++){var r=_e(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 id(this)},e.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=function(t,e,n){return un(t,e,Me(Me({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,o=ie(Vt(),qt(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new Pu(o[0],o[1])},e.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*id(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}(zp),Xp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Oe(e,["style"]);(n=t.call(this,Me({type:eu.POLYGON,style:Ep.enableCSSParsing?Me({points:"",miterLimit:"",isClosed:!0},r):Me({},r),initialParsedStyle:Ep.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&&Np(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&Np(c)&&n.placeMarkerMid(c),s&&Np(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return we(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&&Np(r)&&(this.markerStartAngle=0,r.remove()),i&&Np(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Np(r)&&(this.markerEndAngle=0,r.remove()),i&&Np(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&&Np(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&&Np(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}(zp),Zp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Oe(e,["style"]);return t.call(this,Me({type:eu.POLYLINE,style:Ep.enableCSSParsing?Me({points:"",miterLimit:"",isClosed:!1},n):Me({},n),initialParsedStyle:Ep.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r))||this}return we(e,t),e.prototype.getTotalLength=function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=Xl(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=Wl(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=$l(n[l][0],n[l][1],n[l+1][0],n[l+1][1],c),f=u.x,d=u.y,h=ie(Vt(),qt(f,d,0),e?this.getWorldTransform():this.getLocalTransform());return new Pu(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}(Xp),Kp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Me({type:eu.RECT},e))||this}return we(e,t),e}(zp),Qp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Oe(e,["style"]);return t.call(this,Me({type:eu.TEXT,style:Ep.enableCSSParsing?Me({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):Me({fill:"black"},n)},r))||this}return we(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}(zp),Jp=function(){function t(){this.registry={},this.define(eu.CIRCLE,Gp),this.define(eu.ELLIPSE,$p),this.define(eu.RECT,Kp),this.define(eu.IMAGE,Yp),this.define(eu.LINE,Up),this.define(eu.GROUP,Hp),this.define(eu.PATH,qp),this.define(eu.POLYGON,Xp),this.define(eu.POLYLINE,Zp),this.define(eu.TEXT,Qp),this.define(eu.HTML,Vp)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),tg=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;Ep.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},eg=function(t){function e(){var e=t.call(this)||this;e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new Ep.AnimationTimeline(e)}catch(t){}var n={};return Gd.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=ef(i)?i(eu.GROUP):i)})),e.documentElement=new Hp({id:"g-root",style:n}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return we(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?Qp:Hp);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(Nu)},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 ke(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return Se(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 ke(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return Se(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(Lu)},e.prototype.insertBefore=function(t,e){throw new Error(Lu)},e.prototype.removeChild=function(t,e){throw new Error(Lu)},e.prototype.replaceChild=function(t,e,n){throw new Error(Lu)},e.prototype.append=function(){throw new Error(Lu)},e.prototype.prepend=function(){throw new Error(Lu)},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}(op),ng=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 rp(cp.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="Culling",t}(),rg=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new ep(null),this.rootWheelEvent=new np(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=Ae(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=Ae(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=Ae(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=Ae(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=Ae(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.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.context.config.supportsCSSTransform||v(r)||v(i)){var s=this.context.eventService.client2Viewport(new Pu(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},t.prototype.bootstrapEvent=function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.getViewportXY(e),o=i.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=mh[t.type]||t.type),t},t.prototype.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.getViewportXY(t),r=n.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=yh.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];H(i.button)&&(i.button=0),H(i.buttons)&&(i.buttons=1),H(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),H(i.width)&&(i.width=i.radiusX||1),H(i.height)&&(i.height=i.radiusY||1),H(i.tiltX)&&(i.tiltX=0),H(i.tiltY)&&(i.tiltY=0),H(i.pointerType)&&(i.pointerType="touch"),H(i.pointerId)&&(i.pointerId=i.identifier||0),H(i.pressure)&&(i.pressure=i.force||.5),H(i.twist)&&(i.twist=0),H(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;H(o.isPrimary)&&(o.isPrimary=!0),H(o.width)&&(o.width=1),H(o.height)&&(o.height=1),H(o.tiltX)&&(o.tiltX=0),H(o.tiltY)&&(o.tiltY=0),H(o.pointerType)&&(o.pointerType="mouse"),H(o.pointerId)&&(o.pointerId=1),H(o.pressure)&&(o.pressure=.5),H(o.twist)&&(o.twist=0),H(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),ig=[eu.CIRCLE,eu.ELLIPSE,eu.IMAGE,eu.RECT,eu.LINE,eu.POLYLINE,eu.POLYGON,eu.TEXT,eu.PATH,eu.HTML],og=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(Eu.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||Ou.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==Ou.OUTSIDE,i.visible},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Ou.OUTSIDE||n===Ou.INSIDE)return n;for(var i=Ou.INSIDE,o=ig.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(ee(u,e.getPositiveFarPoint(r[a]))+f<0)return Ou.OUTSIDE;ee(u,e.getNegativeFarPoint(r[a]))+f<0&&(i|=c)}}return i},t}(),ag=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;Ep.enableSizeAttenuation&&Ep.styleValueRegistry.updateSizeAttenuation(e,s.getCamera().getZoom()),Ep.enableCSSParsing&&Ep.styleValueRegistry.recalc(e),Ep.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),Ep.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(t.tag,(function(){s.addEventListener(cp.MOUNTED,u),s.addEventListener(cp.UNMOUNTED,f),s.addEventListener(cp.ATTR_MODIFIED,c),s.addEventListener(cp.BOUNDS_CHANGED,l)})),i.hooks.destroy.tap(t.tag,(function(){s.removeEventListener(cp.MOUNTED,u),s.removeEventListener(cp.UNMOUNTED,f),s.removeEventListener(cp.ATTR_MODIFIED,c),s.removeEventListener(cp.BOUNDS_CHANGED,l),r.toSync.clear()}));var d=null!==(n=Ep.globalThis.requestIdleCallback)&&void 0!==n?n:_h.bind(Ep.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 Eu),a.dirtyRenderBounds.update(o.center,o.halfExtents));var s=_e(o.getMin(),2),c=s[0],l=s[1],u=_e(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"}(Lp||(Lp={}));var sg=new rp(cp.MOUNTED),cg=new rp(cp.UNMOUNTED),lg=new rp(Lp.BEFORE_RENDER),ug=new rp(Lp.RERENDER),fg=new rp(Lp.AFTER_RENDER),dg=function(t){function e(e){var n=t.call(this)||this;n.Element=zp,n.inited=!1,n.context={},n.document=new eg,n.document.defaultView=n,n.customElements=new Jp;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||uh++;lh[n]&&lh[n].destroy(),lh[n]=e}}(r,n);var E=a,k=s,S=c;return i&&(S=(S=c||fh&&window.devicePixelRatio||1)>=1?Math.ceil(S):1,E=a||function(t){var e=gh(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/S,k=s||function(t){var e=gh(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/S),o&&(Ep.offscreenCanvas=o),n.devicePixelRatio=S,n.requestAnimationFrame=null!=h?h:_h.bind(Ep.globalThis),n.cancelAnimationFrame=null!=p?p:Th.bind(Ep.globalThis),n.supportsTouchEvents=null!=y?y:"ontouchstart"in Ep.globalThis,n.supportsPointerEvents=null!=m?m:!!Ep.globalThis.PointerEvent,n.isTouchEvent=null!=M?M:function(t){return n.supportsTouchEvents&&t instanceof Ep.globalThis.TouchEvent},n.isMouseEvent=null!=O?O:function(t){return!Ep.globalThis.MouseEvent||t instanceof Ep.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Ep.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 we(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 Ep.CameraContribution;i.clipSpaceNearZ=n,i.setType(Su.EXPLORING,Au.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(Fu,(function(){r.context.renderingContext.renderReasons.add(Qh.CAMERA_CHANGED),Ep.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){Ep.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 rp(Lp.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 rp(Lp.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===_u.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new rp(Lp.RESIZE,{width:t,height:e}))},e.prototype.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},e.prototype.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},e.prototype.removeChild=function(t){return this.document.documentElement.removeChild(t)},e.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},e.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},e.prototype.render=function(){var t=this;this.dispatchEvent(lg),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(ug)})),this.dispatchEvent(fg)},e.prototype.run=function(){var t=this,e=function(){t.render(),t.frameId=t.requestAnimationFrame(e)};e()},e.prototype.initRenderer=function(t,e){var n=this;if(void 0===e&&(e=!1),!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new ru,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new rg,new ag,new ng([new og])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(Me(Me({},Ep),this.context)),this.context.renderingService=new lp(Ep,this.context),this.context.eventService=new ap(Ep,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 rp(Lp.READY))})):r.dispatchEvent(new rp(Lp.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new rp(Lp.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(Ep)}))},e.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),Te([],_e(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy(Ep)})),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(cg):(cg.target=t,this.dispatchEvent(cg,!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(sg):(sg.target=t,this.dispatchEvent(sg,!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}(ip),hg=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.landmarks=[],e}return we(e,t),e.prototype.rotate=function(t,e,n){if(this.relElevation=uu(e),this.relAzimuth=uu(t),this.relRoll=uu(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Su.EXPLORING){var r=de(fe(),[1,0,0],du((this.rotateWorld?1:-1)*this.relElevation)),i=de(fe(),[0,1,0],du((this.rotateWorld?1:-1)*this.relAzimuth)),o=de(fe(),[0,0,1],du(this.relRoll)),a=he(fe(),i,r);a=he(fe(),a,o);var s=jt(ut(),a);bt(this.matrix,this.matrix,[0,0,-this.distance]),vt(this.matrix,this.matrix,s),bt(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===Su.ORBITING||this.type===Su.EXPLORING?this._getPosition():this.type===Su.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(t,e){var n=fu(t,e,0),r=Yt(this.position);return Kt(r,r,Jt(Vt(),this.right,n[0])),Kt(r,r,Jt(Vt(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},e.prototype.dolly=function(t){var e=this.forward,n=Yt(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===Su.ORBITING||this.type===Su.EXPLORING?this._getDistance():this.type===Su.TRACKING&&Kt(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 Ep.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:ft(d.getWorldTransform()),right:Yt(d.right),up:Yt(d.up),forward:Yt(d.forward),position:Yt(d.getPosition()),focalPoint:Yt(d.getFocalPoint()),distanceVector:Yt(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;if(0===c)return this.syncFromLandmark(r),void(d&&d());this.cancelLandmarkAnimation();var g,m=r.position,y=r.focalPoint,v=r.zoom,b=r.roll,x=u||Ep.EasingFunction(a),w=function(){n.setFocalPoint(y),n.setPosition(m),n.setRoll(b),n.setZoom(v),n.computeMatrix(),n.triggerUpdate(),d&&d()},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=Vt(),s=Vt();re(a,n.focalPoint,y,o),re(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),se(a,y)+se(s,m)<=.01&&null==v&&null==b?w():(n.computeMatrix(),n.triggerUpdate(),e<c&&(p&&p(o),n.landmarkAnimationID=n.canvas.requestAnimationFrame(M)))}};this.canvas.requestAnimationFrame(M)}},e.prototype.syncFromLandmark=function(t){this.matrix=dt(this.matrix,t.matrix),this.right=Xt(this.right,t.right),this.up=Xt(this.up,t.up),this.forward=Xt(this.forward,t.forward),this.position=Xt(this.position,t.position),this.focalPoint=Xt(this.focalPoint,t.focalPoint),this.distanceVector=Xt(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},e}(Gu);Ep.CameraContribution=hg;var pg=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 we(e,t),e}(Jh),gg=0,mg=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(gg++),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 pg(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(Nu)},t.prototype.addEventListener=function(t,e,n){throw new Error(Nu)},t.prototype.removeEventListener=function(t,e,n){throw new Error(Nu)},t.prototype.dispatchEvent=function(t){throw new Error(Nu)},t.prototype.commitStyles=function(){throw new Error(Nu)},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 pg(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 pg(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),yg=.1,vg="function"==typeof Float32Array,bg=function(t,e){return 1-3*e+3*t},xg=function(t,e){return 3*e-6*t},wg=function(t){return 3*t},Mg=function(t,e,n){return((bg(e,n)*t+xg(e,n))*t+wg(e))*t},Og=function(t,e,n){return 3*bg(e,n)*t*t+2*xg(e,n)*t+wg(e)},Eg=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=vg?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=Mg(o*yg,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=yg;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*yg,s=Og(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=Og(e,n,r);if(0===o)return e;e-=(Mg(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=Mg(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+yg,t,n)};return function(t){return 0===t||1===t?t:Mg(a(t),e,r)}},kg=function(t){return Math.pow(t,2)},Sg=function(t){return Math.pow(t,3)},Ag=function(t){return Math.pow(t,4)},_g=function(t){return Math.pow(t,5)},Tg=function(t){return Math.pow(t,6)},Pg=function(t){return 1-Math.cos(t*Math.PI/2)},Cg=function(t){return 1-Math.sqrt(1-t*t)},Ng=function(t){return t*t*(3*t-2)},Lg=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)},jg=function(t,e){void 0===e&&(e=[]);var n=_e(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)},Rg=function(t,e,n){void 0===e&&(e=[]);var r=_e(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},Ig=function(t,e){void 0===e&&(e=[]);var n=_e(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},Bg=function(t,e){void 0===e&&(e=[]);var n=_e(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return Eg(r,i,o,a)(t)},Dg=Eg(.42,0,1,1),Fg=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},zg=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}},Gg=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}},Wg={steps:Ig,"step-start":function(t){return Ig(t,[1,"start"])},"step-end":function(t){return Ig(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Bg,ease:function(t){return Bg(t,[.25,.1,.25,1])},in:Dg,out:Fg(Dg),"in-out":zg(Dg),"out-in":Gg(Dg),"in-quad":kg,"out-quad":Fg(kg),"in-out-quad":zg(kg),"out-in-quad":Gg(kg),"in-cubic":Sg,"out-cubic":Fg(Sg),"in-out-cubic":zg(Sg),"out-in-cubic":Gg(Sg),"in-quart":Ag,"out-quart":Fg(Ag),"in-out-quart":zg(Ag),"out-in-quart":Gg(Ag),"in-quint":_g,"out-quint":Fg(_g),"in-out-quint":zg(_g),"out-in-quint":Gg(_g),"in-expo":Tg,"out-expo":Fg(Tg),"in-out-expo":zg(Tg),"out-in-expo":Gg(Tg),"in-sine":Pg,"out-sine":Fg(Pg),"in-out-sine":zg(Pg),"out-in-sine":Gg(Pg),"in-circ":Cg,"out-circ":Fg(Cg),"in-out-circ":zg(Cg),"out-in-circ":Gg(Cg),"in-back":Ng,"out-back":Fg(Ng),"in-out-back":zg(Ng),"out-in-back":Gg(Ng),"in-bounce":Lg,"out-bounce":Fg(Lg),"in-out-bounce":zg(Lg),"out-in-bounce":Gg(Lg),"in-elastic":jg,"out-elastic":Fg(jg),"in-out-elastic":zg(jg),"out-in-elastic":Gg(jg),spring:Rg,"spring-in":Rg,"spring-out":Fg(Rg),"spring-in-out":zg(Rg),"spring-out-in":Gg(Rg)},$g=function(t){return Wg[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)]||Wg.linear},Hg=function(t){return t},Vg=1,Yg=.5,Ug=0;function qg(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Xg="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Zg=new RegExp("cubic-bezier\\("+Xg+","+Xg+","+Xg+","+Xg+"\\)"),Kg=/steps\(\s*(\d+)\s*\)/,Qg=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Jg(t){var e=Zg.exec(t);if(e)return Eg.apply(void 0,Te([],_e(e.slice(1).map(Number)),!1));var n=Kg.exec(t);if(n)return qg(Number(n[1]),Ug);var r=Qg.exec(t);return r?qg(Number(r[1]),{start:Vg,middle:Yg,end:Ug}[r[2]]):$g(t)}function tm(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 em=0,nm=1,rm=2,im=3;function om(t,e,n){var r=function(t,e,n){if(null===e)return em;var r=n.endTime;return e<Math.min(n.delay,r)?nm:e>=Math.min(n.delay+t+n.endDelay,r)?rm:im}(t,e,n),i=function(t,e,n,r,i){switch(r){case nm:return"backwards"===e||"both"===e?0:null;case im:return n-i;case rm:return"forwards"===e||"both"===e?t:null;case em: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!==nm&&(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!==rm||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===rm&&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 am(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(sm(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Jg(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:lm(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)sm(n)&&t.setAttribute(n,null)}}function sm(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var cm=function(t,e,n){return function(r){var i=um(t,e,r);return!Ep.enableCSSParsing&&j(i)?i:n(i)}};function lm(t,e,n,r){var i=$d[t];if(i&&i.syntax&&i.int){var o=Ep.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(Ep.enableCSSParsing){var c=Ep.styleValueRegistry.parseProperty(t,e,r,!1),l=Ep.styleValueRegistry.parseProperty(t,n,r,!1);a=Ep.styleValueRegistry.computeProperty(t,c,r,!1),s=Ep.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=cm.apply(void 0,Te([],_e(f),!1));return function(t){return 0===t?e:1===t?n:d(t)}}}}return cm(!1,!0,(function(t){return t?n:e}))}function um(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(um(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var fm=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Hg,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=Jg(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function dm(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 hm="backwards|forwards|both|none".split("|"),pm="reverse|alternate|alternate-reverse".split("|");function gm(t,e){return function(t,e){var n=new fm;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===hm.indexOf(t[e]))return;if("direction"===e&&-1===pm.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 mm=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=gm(n,!1),this.timing.effect=this,this.timing.activeDuration=tm(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=dm(e,this.timing),this.interpolations=am(this.normalizedKeyframes,this.timing,this.target);var i=Ep.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=om(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=dm(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 ym(t,e){return Number(t.id)-Number(e.id)}var vm=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(ym),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 mm(t,e,n),i=new mg(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(ym),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,Te([],_e(a),!1)),(i=this.pendingEffects).push.apply(i,Te([],_e(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,l]},t}();function bm(t){return new xm([t],null,t,t.ownerDocument)}Ep.EasingFunction=Jg,Ep.AnimationTimeline=vm;class xm{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 xm(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new xm(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 xm([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 xm(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 xm(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new xm([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 xm([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=Gn(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 xm([],r,this._parent,this._document),new xm(i,null,this._parent,this._document),new xm(o,null,this._parent,this._document),new xm([],a,this._parent,this._document),new xm(s,null,this._parent,this._document)];return new xm(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new xm(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=xm.registry[t];return e?new e:yr(`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 xm([],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 wm(t,e,n){return Math.max(e,Math.min(t,n))}function Mm(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function Om(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function Em(t,e,n,r,i){const o=Ss(Os(r,e))+Math.PI,a=Ss(Os(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function km(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=Tr(a),[l,u]=In(c,(t=>a[t])),f=new ga({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 Sm(t){const[e,n,r,i]=t;return[i,e,n,r]}function Am(t,e,n){const[r,i,,o]=qc(t)?Sm(e):e,[a,s]=n,c=t.getCenter(),l=As(Os(r,c)),u=As(Os(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:ks(o,c),outerRadius:ks(r,c)}}function _m(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function Tm(t,e){if(!Xc(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function Pm(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 Cm(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=Oe(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!Xc(r)&&!Kc(r)){const n=!!qc(r),[i,,o]=n?Sm(e):e,[a,b]=i,[x,w]=Os(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?wm(E,y,1/0):wm(E,g,m),A=n?wm(k,g,m):wm(k,y,1/0),_=n?M:M-(S-E)/2,T=n?O-(A-k)/2:O-(A-k);return bm(t.createElement("rect",{})).style("x",_).style("y",T).style("width",S).style("height",A).style("radius",[h,p,d,f]).call(Om,v).node()}const{y:b,y1:x}=n,w=r.getCenter(),M=Am(r,e,[b,x]),O=hc().cornerRadius(a).padAngle(o*Math.PI/180);return bm(t.createElement("path",{})).style("d",O(M)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",a).style("inset",o).call(Om,v).node()}xm.registry={g:Hp,rect:Kp,circle:Gp,path:qp,text:Qp,ellipse:$p,image:Yp,line:Up,polygon:Xp,polyline:Zp,html:Vp};const Nm=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=t,a=Oe(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,d=Oe(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=Oe(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"];qc(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 bm(Cm(c,e,r,s,F)).call(Om,d).style("fill","transparent").style(n,R).style(_m(t),I).style("lineWidth",k).style("stroke",void 0===p?R:p).call(Om,j).node()}};Nm.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Lm=(t,e)=>Nm(Object.assign({colorAttribute:"fill"},t),e);Lm.props=Object.assign(Object.assign({},Nm.props),{defaultMarker:"square"});const jm=(t,e)=>Nm(Object.assign({colorAttribute:"stroke"},t),e);function Rm(t,e,n){const[r,i,o,a]=t;if(qc(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]}jm.props=Object.assign(Object.assign({},Nm.props),{defaultMarker:"hollowSquare"});const Im=(t,e)=>{const{adjustPoints:n=Rm}=t,r=Oe(t,["adjustPoints"]),{coordinate:i,document:o}=e;return(t,e,a,s)=>{const{index:c}=e,{color:l}=a,u=Oe(a,["color"]),f=s[c+1],d=n(t,f,i),h=!!qc(i),[p,g,m,y]=h?Sm(d):d,{color:v=l,opacity:b}=e,x=bc().curve(jc)([p,g,m,y]);return bm(o.createElement("path",{})).call(Om,u).style("d",x).style("fill",v).style("fillOpacity",b).call(Om,r).node()}};function Bm(t,e,n){const[r,i,o,a]=t;if(qc(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]}Im.props={defaultMarker:"square"};const Dm=(t,e)=>Im(Object.assign({adjustPoints:Bm},t),e);function Fm(t){const e="function"==typeof t?t:t.render;return class extends Wp{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Dm.props={defaultMarker:"square"};const zm=Fm((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;bm(t).maybeAppend("line",(()=>o.createElement("path",{}))).style("d",e).call(Om,r),bm(t).maybeAppend("line1",(()=>o.createElement("path",{}))).style("d",n).call(Om,i)}));const Gm=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=(t=>!Number.isNaN(t)&&null!=t),connect:a=!1}=t,s=Oe(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:d}=u,h=Oe(u,["color","lineWidth"]),{color:p=f,size:g=d,seriesColor:m,seriesX:y,seriesY:v}=e,b=Tm(c,e),x=qc(c),w=r&&m?km(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(Xc(c)){const t=c.getCenter();O=e=>Ec(bc().curve(wc)).angle(((n,r)=>As(Os(e[r],t)))).radius(((n,r)=>ks(e[r],t))).defined((([t,e])=>o(t)&&o(e))).curve(n)(e)}else O=bc().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=wr(M,"connect"),A=!!k.length;if(!A||a&&!Object.keys(S).length)return bm(l.createElement("path",{})).style("d",O(E)||[]).call(Om,M).node();if(A&&!a)return bm(l.createElement("path",{})).style("d",O(t)).call(Om,M).node();return bm(new zm).style("style1",Object.assign(Object.assign({},M),S)).style("style2",M).style("d1",(_=k,_.map(O).join(","))).style("d2",O(t)).node();var _}};Gm.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Wm=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Xc(n)?jc:mc;return Gm(Object.assign({curve:i},t),e)(...r)}};Wm.props=Object.assign(Object.assign({},Gm.props),{defaultMarker:"line"});const $m=(t,e)=>{const n=Oe(t,[]),{coordinate:r}=e;return(...t)=>{const i=Xc(r)?Nc:qc(r)?$c:Wc;return Gm(Object.assign({curve:i},n),e)(...t)}};$m.props=Object.assign(Object.assign({},Gm.props),{defaultMarker:"smooth"});const Hm=(t,e)=>Gm(Object.assign({curve:Uc},t),e);Hm.props=Object.assign(Object.assign({},Gm.props),{defaultMarker:"hv"});const Vm=(t,e)=>Gm(Object.assign({curve:Yc},t),e);Vm.props=Object.assign(Object.assign({},Gm.props),{defaultMarker:"vh"});const Ym=(t,e)=>Gm(Object.assign({curve:Vc},t),e);function Um(t,e,n,r,i){const o=Ss(Os(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=Es(e,s),d=Es(n,c),h=Es(d,l),p=Es(n,l),g=Os(p,c),m=Os(n,c),y=Os(e,s),v=Os(y,u),b=Os(e,u),x=Os(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()}Ym.props=Object.assign(Object.assign({},Gm.props),{defaultMarker:"hvh"});const qm=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=Oe(i,["color"]),l=oc();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(br)&&Um(l,n,r,i,a)}return bm(n.createElement("path",{})).call(Om,c).style("fill",a||s).style("d",l.toString()).call(Om,t).node()}};qm.props=Object.assign(Object.assign({},Gm.props),{defaultMarker:"line"});const Xm=(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"]];Xm.style=["fill"];const Zm=Xm.bind(void 0);Zm.style=["stroke","lineWidth"];const Km=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];Km.style=["fill"];const Qm=Km.bind(void 0);Qm.style=["fill"];const Jm=Km.bind(void 0);Jm.style=["stroke","lineWidth"];const ty=(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"]]};ty.style=["fill"];const ey=ty.bind(void 0);ey.style=["stroke","lineWidth"];const ny=(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"]]};ny.style=["fill"];const ry=ny.bind(void 0);ry.style=["stroke","lineWidth"];const iy=(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"]]};iy.style=["fill"];const oy=iy.bind(void 0);oy.style=["stroke","lineWidth"];const ay=(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"]]};ay.style=["fill"];const sy=ay.bind(void 0);sy.style=["stroke","lineWidth"];const cy=(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"]]};cy.style=["fill"];const ly=cy.bind(void 0);ly.style=["stroke","lineWidth"];const uy=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];uy.style=["stroke","lineWidth"];const fy=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];fy.style=["stroke","lineWidth"];const dy=(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]];dy.style=["stroke","lineWidth"];const hy=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];hy.style=["stroke","lineWidth"];const py=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];py.style=["stroke","lineWidth"];const gy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];gy.style=["stroke","lineWidth"];const my=gy.bind(void 0);my.style=["stroke","lineWidth"];const yy=(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]];yy.style=["stroke","lineWidth"];const vy=(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]];vy.style=["stroke","lineWidth"];const by=(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]];by.style=["stroke","lineWidth"];const xy=(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]];xy.style=["stroke","lineWidth"];const wy=(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]];wy.style=["stroke","lineWidth"];const My=new Map([["bowtie",cy],["cross",fy],["dash",my],["diamond",ty],["dot",gy],["hexagon",ay],["hollowBowtie",ly],["hollowDiamond",ey],["hollowHexagon",sy],["hollowPoint",Zm],["hollowSquare",Jm],["hollowTriangle",ry],["hollowTriangleDown",oy],["hv",vy],["hvh",xy],["hyphen",py],["line",uy],["plus",hy],["point",Xm],["rect",Qm],["smooth",yy],["square",Km],["tick",dy],["triangleDown",iy],["triangle",ny],["vh",by],["vhv",wy]]);function Oy(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||Jc(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 Ey=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=Oe(t,["colorAttribute","symbol","mode"]),a=My.get(r)||My.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]=Pm(e),v=Oy(i,e,r,s)||o.r||l.r;return bm(c.createElement("path",{})).call(Om,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(_m(t),g).style(n,h).call(Om,o).node()}};Ey.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ky=(t,e)=>Ey(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);ky.props=Object.assign({defaultMarker:"hollowBowtie"},Ey.props);const Sy=(t,e)=>Ey(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);Sy.props=Object.assign({defaultMarker:"hollowDiamond"},Ey.props);const Ay=(t,e)=>Ey(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);Ay.props=Object.assign({defaultMarker:"hollowHexagon"},Ey.props);const _y=(t,e)=>Ey(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);_y.props=Object.assign({defaultMarker:"hollowPoint"},Ey.props);const Ty=(t,e)=>Ey(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);Ty.props=Object.assign({defaultMarker:"hollowSquare"},Ey.props);const Py=(t,e)=>Ey(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);Py.props=Object.assign({defaultMarker:"hollowTriangle"},Ey.props);const Cy=(t,e)=>Ey(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);Cy.props=Object.assign({defaultMarker:"hollowTriangleDown"},Ey.props);const Ny=(t,e)=>{const{colorAttribute:n,mode:r="auto"}=t,i=Oe(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]=Pm(e),y=Oy(r,e,s,o)||i.r||c.r;return bm(a.createElement("circle",{})).call(Om,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(_m(t),p).style(n,d).call(Om,i).node()}},Ly=(t,e)=>Ny(Object.assign({colorAttribute:"fill"},t),e);Ly.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const jy=(t,e)=>Ny(Object.assign({colorAttribute:"stroke"},t),e);jy.props=Object.assign({defaultMarker:"hollowPoint"},Ly.props);const Ry=(t,e)=>Ey(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);Ry.props=Object.assign({defaultMarker:"bowtie"},Ey.props);const Iy=(t,e)=>Ey(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);Iy.props=Object.assign({defaultMarker:"cross"},Ey.props);const By=(t,e)=>Ey(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);By.props=Object.assign({defaultMarker:"diamond"},Ey.props);const Dy=(t,e)=>Ey(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Dy.props=Object.assign({defaultMarker:"hexagon"},Ey.props);const Fy=(t,e)=>Ey(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);Fy.props=Object.assign({defaultMarker:"hyphen"},Ey.props);const zy=(t,e)=>Ey(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);zy.props=Object.assign({defaultMarker:"line"},Ey.props);const Gy=(t,e)=>Ey(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);Gy.props=Object.assign({defaultMarker:"plus"},Ey.props);const Wy=(t,e)=>Ey(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);Wy.props=Object.assign({defaultMarker:"point"},Ey.props);const $y=(t,e)=>Ey(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);$y.props=Object.assign({defaultMarker:"square"},Ey.props);const Hy=(t,e)=>Ey(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);Hy.props=Object.assign({defaultMarker:"tick"},Ey.props);const Vy=(t,e)=>Ey(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);Vy.props=Object.assign({defaultMarker:"triangle"},Ey.props);const Yy=(t,e)=>Ey(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);Yy.props=Object.assign({defaultMarker:"triangleDown"},Ey.props);const Uy=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=Oe(t,["arrow","arrowSize"]),{document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Oe(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,d]=t,h=oc();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*ks(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(...d),h.lineTo(...t),h.moveTo(...d),h.lineTo(...e)}return bm(o.createElement("path",{})).call(Om,c).style("d",h.toString()).style("stroke",l).style("transform",u).call(Om,i).node()}};function qy(t,e){e(t),t.children&&t.children.forEach((function(t){t&&qy(t,e)}))}function Xy(t){Ky(t,!0)}function Zy(t){Ky(t,!1)}function Ky(t,e){var n=e?"visible":"hidden";qy(t,(function(t){t.attr("visibility",n)}))}Uy.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Qy=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,Te([],_e(e),!1))||this;return r.isMutationObserved=!0,r.addEventListener(cp.INSERTED,(function(){Zy(r)})),r}return we(e,t),e}(Hp);function Jy(t){var e=t.appendChild(new Qy({class:"offscreen"}));return Zy(e),e}var tv=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Oe(e,["style"]);return t.call(this,Me({style:Me({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return we(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Jy(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(Qp);function ev(t){return t*Math.PI/180}function nv(t){return Number((180*t/Math.PI).toPrecision(5))}var rv=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 iv(t,e){return y(t)?t.apply(void 0,Te([],_e(e),!1)):t}var ov,av=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=_e(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},sv=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var o=_e(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?sv(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)}))},cv=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)sv(t,e[r]);return t},lv=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},uv=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 ov||(ov=Ep.offscreenCanvasCreator.getOrCreateContext(void 0)),ov.font=[o,a,i,"".concat(n,"px"),r].join(" "),ov.measureText(t).width}),(function(t,e){return[t,Object.values(e||fv(t)).join()].join("")}),4096),fv=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 dv(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function hv(t,e){var n=dv(t);n&&n.attr(e)}function pv(t,e,n){void 0===n&&(n="..."),hv(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function gv(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 mv(t){return"function"==typeof t?t():C(t)||j(t)?new tv({style:{text:String(t)}}):t}function yv(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 vv(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 bv=function(t,e){return function(n){return t*(1-n)+e*n}};function xv(t,e){return"number"==typeof t&&"number"==typeof e?bv(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]=xv(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=_e(e,2),o=i[0],a=i[1];o in t?n[o]=xv(t[o],a):r[o]=a})),function(t){return Object.entries(n).forEach((function(e){var n=_e(e,2),i=n[0],o=n[1];return r[i]=o(t)})),r}}(t,e):function(e){return t}}function wv(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=_e([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 rv(e,n,r-e,i-n)}var Mv=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=_e([0,0],2),g=p[0],m=p[1],y=e.map((function(t){var e,n=t.width,r=t.height,i=_e([g,m],2),o=i[0],a=i[1];return e=_e([g+n*h[0],m+r*h[1]],2),g=e[0],m=e[1],new rv(o,a,n,r)})),v=wv(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=rv.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r}));wv(x);var w=function(t){var e=_e(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=rv.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=rv.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},Ov=function(t,e,n){return[]};function Ev(t,e){return[t[0]*e,t[1]*e]}function kv(t,e){return[t[0]+e[0],t[1]+e[1]]}function Sv(t,e){return[t[0]-e[0],t[1]-e[1]]}function Av(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function _v(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Tv(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Pv(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 Cv(t,e){return+t.toPrecision(e)}function Nv(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 Lv(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=_e(r,2))[0],h=i[1];for(var p=0,g=t.length;p<g;p+=1)d=Av(d,y=t[p]),h=_v(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=Ev(v=Sv(a=t[n?(p+1)%m:p+1],o),e);var b=Tv(y,o),x=Tv(y,a),w=b+x;0!==w&&(b/=w,x/=w);var M=Ev(v,-b),O=Ev(v,x);c=kv(y,M),s=Av(s=kv(y,O),_v(a,y)),s=_v(s,Av(a,y)),c=Av(c=kv(y,M=Ev(M=Sv(s,y),-b/x)),_v(o,y)),s=kv(y,O=Ev(O=Sv(y,c=_v(c,Av(o,y))),x/b)),f&&(c=Av(c=_v(c,d),h),s=Av(s=_v(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=_e(i,1)[0],d.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),d}var jv=["$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 Rv(t){return jv.includes(t)}function Iv(t){var e={};for(var n in t)Rv(n)&&(e[n]=t[n]);return e}function Bv(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 Dv=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=_e(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=Pe(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=Pe(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=Pe(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,Ae(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=Te(Te([],_e(this._elements),!1),_e(t._elements),!1),r=Te(Te([],_e(this._transitions),!1),_e(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=_e(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,Te([this._parent,this],_e(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:Hp,rect:Kp,circle:Gp,path:qp,text:tv,ellipse:$p,image:Yp,line:Up,polygon:Xp,polyline:Zp,html:Vp},t}();function Fv(t){return new Dv([t],null,t,t.ownerDocument)}function zv(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 Gv(t){var e=t.getLocalBounds(),n=_e([e.min,e.max],2),r=_e(n[0],2),i=r[0],o=r[1],a=_e(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 Wv(t,e){var n=_e(t,2),r=n[0],i=n[1],o=_e(e,2),a=o[0],s=o[1];return r!==a&&i===s}function $v(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Hv(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 Vv=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function Yv(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i=_e(t,2),o=i[0],a=i[1];if("className"===o||"class"===o);else if(Vv(o,"show")&&Vv(Hv(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat($v(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp($v(e)),"")]=a;else if(!Vv(o,"show")&&Vv(o,e)!==n){var s=Hv(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}})),r}function Uv(t,e){return Object.entries(t).reduce((function(t,n){var r=_e(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($v(i))]=o,t}),{})}function qv(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=_e(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)})),[r,i]}function Xv(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=_e([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 Zv(){Ky(this,"hidden"!==this.attributes.visibility)}var Kv=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,cv({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return we(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Jy(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&&Zv.call(this)},e.prototype.update=function(t,e){var n;return this.attr(cv({},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}(Wp),Qv=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"]]},Jv=Qv,tb=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},eb=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},nb=eb;var rb=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function ib(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 ob=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return we(e,t),e.prototype.render=function(t,n){var r=t.symbol,i=t.size,o=void 0===i?16:i,a=t.x,s=void 0===a?0:a,c=t.y,l=void 0===c?0:c,u=Oe(t,["symbol","size","x","y","transform","transformOrigin"]),f=ib(r);yv(!!f,Fv(n),(function(t){t.maybeAppendByClassName("marker",f).attr("className","marker ".concat(f,"-marker")).call((function(t){if("image"===f){var n=2*o;t.styles({img:r,width:n,height:n,x:s-o,y:l-o})}else{n=o/2;var i=y(r)?r:e.getSymbol(r);t.styles(Me({d:null==i?void 0:i(s,l,n)},u))}}))}))},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}(Kv);ob.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]]})),ob.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),ob.registerSymbol("line",tb),ob.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),ob.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]]})),ob.registerSymbol("circle",Qv),ob.registerSymbol("point",Jv),ob.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"]]})),ob.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"]]})),ob.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"]]})),ob.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),ob.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"]]})),ob.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"]]})),ob.registerSymbol("line",tb),ob.registerSymbol("dot",eb),ob.registerSymbol("dash",nb),ob.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]]})),ob.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]]})),ob.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]]})),ob.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]]})),ob.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 ab=function(t){function e(e){var n=this,r=e.style,i=Oe(e,["style"]);return(n=t.call(this,Z({},{type:"column"},Me({style:r},i)))||this).columnsGroup=new Hp({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return we(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,")"),Fv(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(cv({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(zp),sb=function(t){function e(e){var n=this,r=e.style,i=Oe(e,["style"]);return(n=t.call(this,Z({},{type:"lines"},Me({style:r},i)))||this).linesGroup=n.appendChild(new Hp),n.areasGroup=n.appendChild(new Hp),n.render(),n}return we(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(cv({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){Fv(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){Fv(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}(zp);function cb(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return Te([e===n?"M":"L"],_e(t),!1)}));return e?r.reverse():r}function lb(t,e){if(void 0===e&&(e=!1),t.length<=2)return cb(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];Q(o,n.slice(-2))||n.push.apply(n,Te([],_e(o),!1))}var a=Lv(n,!1);return e?a.unshift(Te(["M"],_e(t[r-1]),!1)):a.unshift(Te(["M"],_e(t[0]),!1)),a}function ub(t,e,n){var r=Y(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function fb(t){return 0===t.length?[0,0]:[T(D(t,(function(t){return T(t)||0}))),_(B(t,(function(t){return _(t)||0})))]}function db(t){for(var e=Y(t),n=e[0].length,r=_e([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 hb=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 we(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=Y(t);return j(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?db(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=_e(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=Yv(this.attributes,"area"),a=Yv(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=_e(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=_e([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=lb(o),s=void 0;if(0===i)s=ub(a,e,n);else{var c=lb(t[i-1],!0),l=o[0];c[0][0]="L",s=Te(Te(Te([],_e(a),!1),_e(c),!1),[Te(["M"],_e(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=cb(t[i]),a=void 0;if(0===i)a=ub(o,e,n);else{var s=cb(t[i-1],!0);s[0][0]="L",a=Te(Te(Te([],_e(o),!1),_e(s),!1),[["Z"]],!1)}r.push(a)}return r}(u,s,d):function(t,e,n,r){return t.map((function(t){return ub(e?lb(t):cb(t),n,r)}))}(u,i,s,d)}return{lines:u.map((function(e,n){return Me({stroke:t.getColor(n),d:i?lb(e):cb(e)},a)})),areas:f.map((function(e,n){return Me({d:e,fill:t.getColor(n)},o)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=Yv(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=db(s));var c=this.createScales(s),l=c.x,u=c.y,f=_e(fb(s),2),d=f[0],h=f[1],p=new ga({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 Me(Me({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)?Fv(n).select(r):Fv(n).append(i)).attr("className","container").node();var o=t.type,a=t.x,s=t.y,c="spark".concat(o),l=Me({x:a,y:s},"line"===o?this.linesStyle:this.columnsStyle);Fv(e).selectAll(".spark").data([o]).join((function(t){return t.append((function(t){return"line"===t?new sb({className:c,style:l}):new ab({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=_e(fb(t),2),h=d[0],p=d[1],g=new ga({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 ga({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new Ko({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}(Kv);function pb(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=_e(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,Me(Me({},t[e]),n)]:[e,n]})))}function gb(t,e){t?t.finished.then(e):e()}function mb(t,e){"update"in t?t.update(e):t.attr(e)}function yb(t,e,n){return 0===e.length?null:n?t.animate(e,n):(mb(t,{style:e.slice(-1)[0]}),null)}function vb(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=_e(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?yb(t,[r,i],Me({fill:"both"},n)):(mb(t,i),null)}function bb(t,e){return t.style.opacity||(t.style.opacity=1),vb(t,{opacity:0},e)}var xb={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},wb={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Mb={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},Ob=av({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),Eb=av({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),kb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return we(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=Oe(t,["x","y","size","radius","orientation"]),u=o,f=2.4*u,d=Fv(e).maybeAppendByClassName(Eb.iconRect,"rect").styles(Me(Me({},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(Eb.iconLine,"-1"),"line").styles(Me({x1:h,x2:h,y1:g,y2:m},l)),d.maybeAppendByClassName("".concat(Eb.iconLine,"-2"),"line").styles(Me({x1:p,x2:p,y1:g,y2:m},l)),"vertical"===c&&(d.node().style.transform="rotate(90)")},e}(Kv),Sb=function(t){function e(e){return t.call(this,e,Mb)||this}return we(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,o=n.showLabel,a=Yv(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=_e(qv(Oe(a,["x","y","transform","transformOrigin"]),[]),2),p=h[0],g=h[1],m=Fv(t).maybeAppendByClassName(Eb.labelGroup,"g").styles(g),y=Me(Me({},wb),p),v=y.text,b=Oe(y,["text"]);yv(!!o,m,(function(t){e.label=t.maybeAppendByClassName(Eb.label,"text").styles(Me(Me({},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=Me(Me({x:n,y:r,orientation:i},xb),Yv(this.attributes,"icon")),s=this.attributes.iconShape,c=void 0===s?function(){return new kb({style:a})}:s;Fv(t).maybeAppendByClassName(Eb.iconGroup,"g").selectAll(Eb.icon.class).data([c]).join((function(t){return t.append("string"==typeof c?c:function(){return c(o)}).attr("className",Eb.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}(Kv),Ab=function(t){function e(e){var n=t.call(this,e,Me(Me(Me({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},Uv(Mb,"handle")),Uv(xb,"handleIcon")),Uv(wb,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(gv(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(gv(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 rp("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 we(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=Yv(this.attributes,"sparkline");return Me(Me({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=_e(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=_e(zv(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(Ob.selection.class).each((function(n,r){vb(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&vb(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&vb(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=Yv(this.attributes,"track");this.trackShape=Fv(t).maybeAppendByClassName(Ob.track,"rect").styles(Me(Me({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=Fv(t).maybeAppendByClassName(Ob.brushArea,"rect").styles(Me({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;yv("horizontal"===n.orientation,Fv(t).maybeAppendByClassName(Ob.sparklineGroup,"g"),(function(t){var n=Me(Me({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName(Ob.sparkline,(function(){return new hb({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(Ob.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 Sb({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(Ob.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=Fv(t).maybeAppendByClassName(Ob.foreground,"g");var a=Yv(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(Me(Me({},a),{transform:"translate(".concat(n,", ").concat(r,")")}))},c=this;this.foregroundGroup.selectAll(Ob.selection.class).data("value"===i?[]:this.calcSelectionArea().map((function(t,e){return{style:Me({},t),index:e,show:"select"===o?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",Ob.selection.name).call(s).each((function(t,e){var n=this;1===e?(c.selectionShape=Fv(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=_e(this.range,2),i=r[0],o=r[1],a=_e(this.getValues().map((function(t){return Cv(t,e)})),2),s=a[0],c=a[1],l=_e(((Array.isArray(t)?t:[s,null!=t?t:c])||[s,c]).map((function(t){return Cv(t,e)})),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,L(f,i,o)];u>f&&(u=(n=_e([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=_e(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=_e(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=Yv(this.attributes,"handle"),c=Yv(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),d=o("start"===t?f[0]:f[1]),h=new tv({style:Me(Me(Me({},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=Yv(this.attributes,"handleLabel");return Me(Me(Me({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=Yv(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return Me({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),Me(Me(Me({},Uv(this.getHandleIconStyle(),"icon")),Uv(Me(Me({},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=_e(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=_e(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 rp(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}(Kv),_b=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 rp("scroll",r)),n.dispatchEvent(new rp("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=_e(n.getLocalPosition(),2),r=e[0],i=e[1],o=_e(n.padding,4),a=o[0],s=o[3],c=n.getOrientVal([r+s,i+a]),l=(n.getOrientVal(gv(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new rp("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new rp("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new rp("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new rp("trackMouseleave",{detail:t.detail}))},n}return we(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return zv(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=_e(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=_e(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=_e(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=_e(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=Yv(this.attributes,"track"),l=Yv(this.attributes,"thumb"),u=Me(Me({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()},Uv(c,"track")),Uv(l,"selection"));this.slider=Fv(t).maybeAppendByClassName("scrollbar",(function(){return new Ab({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=_e(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}(Kv),Tb={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 qp({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:[]};Z({},Tb,{style:{type:"arc"}}),Z({},Tb,{style:{}});var Pb=av({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"),Cb=av({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Nb(t){return t.reduce((function(t,e,n){return t.push(Te([0===n?"M":"L"],_e(e),!1)),t}),[])}function Lb(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 Nb(t);if(!o)return[];var a=Tv(t[0],o),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push(Te(["M"],_e(e),!1)):t.push(Te(["A",a,a,0,0,s],_e(e),!1)),t}),[])}(t,e,n):Nb(t)}function jb(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=_e([Lb(t,n),Lb(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=_e([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([Te(["L"],_e(d),!1)],[Te(["L"],_e(f),!1)]);if(!o)throw new Error("Arc grid need to specified center");var p=_e([Tv(d,o),Tv(f,o)],2),g=p[0],m=p[1];return h([Te(["A",g,g,0,0,1],_e(d),!1),Te(["L"],_e(d),!1)],[Te(["A",m,m,0,0,0],_e(f),!1),Te(["L"],_e(f),!1)])}var Rb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return we(e,t),e.prototype.render=function(t,e){var n=Oe(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=_e(e,1)[0];return Me(Me({},t),{points:Te(Te([],_e(e),!1),[n],!1)})})):n}(t),i=Fv(e).maybeAppendByClassName(Cb.lineGroup,"g"),o=Fv(e).maybeAppendByClassName(Cb.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:Lb(t.points,n)}}));return t.selectAll(Cb.line.class).data(a,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=iv(Iv(Me({d:t.d},r)),[t,e,a]);this.attr(Me({class:Cb.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))}))}),(function(t){return t.transition((function(t,e){return vb(this,iv(Iv(Me({d:t.d},r)),[t,e,a]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=bb(this,i.exit);return gb(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=_e([e[l].points,e[l+1].points],2),f=jb(u[0],u[1],n);c.push({d:f,fill:s(l)})}return t.selectAll(Cb.region.class).data(c,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=iv(t,[t,e,c]);this.attr(n)})).attr("className",Cb.region.name)}),(function(t){return t.transition((function(t,e){return vb(this,iv(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=bb(this,r.exit);return gb(e,(function(){return t.remove()})),e}))})).transitions()}(o,r,t);return Te(Te([],_e(a),!1),_e(s),!1)},e}(Kv);function Ib(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=_e(t,2);return[n[0],iv(n[1],e)]})))}function Bb(t,e){return e&&y(e)?t.filter(e):t}function Db(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function Fb(t,e){if("linear"===e.type){var n=_e(e.startPos,2),r=n[0],i=n[1],o=_e(e.endPos,2),a=_e([o[0]-r,o[1]-i],2);return Pv([a[0],a[1]])}var s=ev(Db(t,e));return[-Math.sin(s),Math.cos(s)]}function zb(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(Fb(t,n),"positive"!==e)}function Gb(t,e){return zb(t,e.labelDirection,e)}function Wb(t,e){return"linear"===e.type?function(t,e){var n=_e(e.startPos,2),r=n[0],i=n[1],o=_e(e.endPos,2),a=_e([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=_e(e.center,2),i=r[0],o=r[1],a=ev(Db(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function $b(t){return 0===Fb(0,t)[1]}function Hb(t){return 0===Fb(0,t)[0]}function Vb(t,e){return e-t==360}function Yb(t,e,n,r,i){var o=e-t,a=_e([i,i],2),s=a[0],c=a[1],l=_e([ev(t),ev(e)],2),u=l[0],f=l[1],d=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},h=_e(d(u),2),p=h[0],g=h[1],m=_e(d(f),2),y=m[0],v=m[1];if(Vb(t,e)){var b=_e(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 Ub(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(Pb.line.class).data([{d:Yb.apply(void 0,Te(Te([i,o],_e(a),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",Pb.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=xv(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,Me({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return Te(Te([n,r],_e(i),!1),[o],!1)}(this),Te(Te([i,o],_e(a),!1),[s],!1),r.update);if(e){var n=function(){var e=J(t.attributes,"__keyframe_data__");t.style.d=Yb.apply(void 0,Te([],_e(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function qb(t){var e=_e(t,2),n=_e(e[0],2),r=n[0],i=n[1],o=_e(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function Xb(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,c=e.lineExtension,l=_e([o,a],2),u=_e(l[0],2),f=u[0],d=u[1],h=_e(l[1],2),p=h[0],g=h[1],m=_e(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=_e([t,e,n],3),i=_e(r[0],2),o=i[0],a=i[1],s=_e(r[1],2),c=s[0],l=s[1],u=_e(r[2],2),f=u[0],d=u[1],h=_e([c-o,l-a],2),p=h[0],g=h[1],m=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),y=_e([-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(Pb.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(Pb.line.name," ").concat(t.className)})).styles(n).transition((function(t){return vb(this,qb(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return vb(this,qb(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:Pb.line.name}]);var M=_e(s,2),O=M[0],E=M[1],k=p-f,S=g-d,A=_e([f+k*O,d+S*O],2),_=A[0],T=A[1],P=_e([f+k*E,d+S*E],2),C=P[0],N=P[1];return w([{line:[[f+y,d+v],[_,T]],className:Pb.lineFirst.name},{line:[[C,N],[p+b,g+x]],className:Pb.lineSecond.name}])}function Zb(t,e,n){var r,i=e.type,o=Yv(e,"line");return r="linear"===i?Xb(t,e,Nv(o,"arrow"),n):Ub(t,e,Nv(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(Pb.line.class):a?t.select(Pb.lineSecond.class):t.select(Pb.line.class),!o||!s||"arc"===n.type&&Vb(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=mv(s);f.attr(r),Bv(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function Kb(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Qb(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=_e(Wb(i,e),2),a=o[0],s=o[1],c=_e(Ev(function(t,e){return zb(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}}))}function Jb(t,e,n,r){var i=Yv(n,"grid"),o=i.type,a=i.areaFill,s=Kb(n),c=Bb(e,n.gridFilter),l="segment"===o?Qb(c,n):function(t,e){var n=e.gridControlAngles,r=Kb(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=_e(r,2),o=i[0],a=i[1];return t.map((function(t,r){var i=_e(Wb(t.value,e),2),s=i[0],c=i[1],l=_e([s-o,c-a],2),u=l[0],f=l[1],d=[];return n.forEach((function(t){var e=ev(t),n=_e([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=Me(Me({},i),{center:s,areaFill:y(a)?c.map((function(t,e){return iv(a,[t,e,c])})):a,animate:r,data:l});return t.selectAll(Pb.grid.class).data([1]).join((function(t){return t.append((function(){return new Rb({style:u})})).attr("className",Pb.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}var tx=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 ex(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getBounds(),i=_e(r.min,2),o=i[0],a=i[1],s=_e(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=dv(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=_e(zv(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 tx((h+=o)-(void 0===A?E:A),(p+=a)-M,h+f+E,p+d+S);return t.setEulerAngles(n),_.rotatedPoints(ev(n),g,m)}function nx(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 rx(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 ix(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=rx((r=d)[0],r[1],i[0]),a=rx(r[0],r[1],i[1]),s=rx(i[0],i[1],r[0]),c=rx(i[0],i[1],r[1]),o!==a&&s!==c||0===o&&nx(r,i[0])||0===a&&nx(r,i[1])||0===s&&nx(i,r[0])||0===c&&nx(i,r[1])){if(0===rx(d[0],e,d[1]))return nx(d,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(t,e)}))}function ox(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=_e(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=_e(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 ax(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=_e(o,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-a-u,d=a+u,h=_e(zv(e),4),p=h[0],g=h[1],m=h[2],y=h[3];return new tx(c+f-y,l+f-p,c+d+g,l+d+m)}var v=_e(t.startPos,2),b=v[0],x=v[1],w=_e(t.endPos,2),M=w[0],O=w[1],E=_e(Hb(t)?[-e,0,e,0]:[0,e,0,-e],4),k=E[0],S=E[1],A=E[2],_=E[3],T=Ev(Gb(0,t),i),P=new tx(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 ix([[r,o],[i,o],[i,a],[r,a]],ex(e,n))}(c,t)},u=function(t,e){return!t||!t.firstChild||!function(t,e,n){var r,i,o=ex(t,n).flat(1),a=ex(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=Ae(s),l=c.next();!l.done;l=c.next())if(ox(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,zv(n))};try{for(var f=Ae(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 sx(t,e){return void 0===e&&(e={}),v(t)?0:"number"==typeof t?t:Math.floor(uv(t,e))}var cx=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(Zy(t),!1)}))};var lx=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=cx,f=function(t){return t.forEach(r.show),t},d=2,h=t.slice(),p=t.slice(),g=Math.min.apply(Math,Te([1],_e(t.map((function(t){return t.getBBox().width}))),!1));if("linear"===n.type&&($b(n)||Hb(n))){var m=Gv(t[0]).left,y=Gv(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&&ax((l=c?Te(Te([c],_e(p),!1),[s],!1):Te([s],_e(p),!1),l.filter(lv)),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=Ae(s),p=h.next();!p.done;p=h.next()){if(d(p.value),ax(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=fv(r.getTextShape(t[0])),p=sx(u,h),g=a?sx(a,h):p,m=sx(c,h);(v(m)||m===1/0)&&(m=Math.max.apply(null,t.map((function(t){return t.getBBox().width}))));var y=t.slice();_e(d,4);for(var b=function(e){if(y.forEach((function(t){r.ellipsis(r.getTextShape(t),e,o)})),(y=ax(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,Te([],_e(d),!1)),p=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&$b(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),ax(t,n,f).length<1)return;l&&g(d)}}]]);function ux(){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 fx(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function dx(t,e){var n=_e(t,2),r=n[0],i=n[1],o=_e(e,2),a=o[0],s=o[1],c=_e([r*a+i*s,r*s-i*a],2),l=c[0],u=c[1];return Math.atan2(u,l)}function hx(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=Gb(t.value,n),a=Fb(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return vv(e,-90,90)||(e+=180),e}(nv("perpendicular"===i?dx([1,0],o):dx([a[0]<0?-1:1,0],a)))}function px(t,e,n){var r=n.type,i=n.labelAlign,o=Gb(t,n),a=fx(e),s=fx(nv(dx([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?(vv(a,0,90,!1,!0)||vv(a,0,90)||vv(a,270,360))&&(c="start"):90===s?vv(a,0,90,!1,!0)?c="start":(vv(a,90,180)||vv(a,270,360))&&(c="end"):270===s?vv(a,0,90,!1,!0)?c="end":(vv(a,90,180)||vv(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(vv(a,0,90)||vv(a,270,360))&&(c="end")):c="center":"parallel"===i?l=vv(s,0,180,!0)?"top":"bottom":"horizontal"===i?vv(s,90,270,!1)?c="end":(vv(s,270,360,!1)||vv(s,0,90))&&(c="start"):"perpendicular"===i&&(c=vv(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function gx(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=iv(s,[t,c,e]),u=_e([Gb(t.value,n),ux(a,o)],2),f=_e(kv(Ev(u[0],l+(1===u[1]?iv(r?i:0,[t,c,e]):0)),Wb(t.value,n)),2);return{x:f[0],y:f[1]}}function mx(t,e){"text"===t.nodeName&&t.attr(e)}function yx(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=lx.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:Zy,show:Xy,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=px(e.__data__.value,t,n),i=e.querySelector(Pb.labelItem.class);i&&mx(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&pv(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"),hv(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function vx(t,e,n,r,i){var o=n.indexOf(e),a=Fv(t).append(function(t,e,n,r){var i=r.labelFormatter;return y(i)?function(){return mv(iv(i,[t,e,n,Gb(t.value,r)]))}:function(){return mv(t.label||"")}}(e,o,n,i)).attr("className",Pb.labelItem.name).node(),s=_e(qv(Ib(r,[e,o,n])),2),c=s[0],l=s[1],u=l.transform,f=Oe(l,["transform"]);Xv(a,u);var d=hx(e,a,i);return a.getLocalEulerAngles()||a.setLocalEulerAngles(d),mx(a,Me(Me({},px(e.value,d,i)),c)),t.attr(f),a}function bx(t,e,n,r){var i=Bb(e,n.labelFilter),o=Yv(n,"label");return t.selectAll(Pb.label.class).data(i,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",Pb.label.name).transition((function(t){vx(this,t,e,o,n);var r=gx(t,e,n),i=r.x,a=r.y;return this.style.transform="translate(".concat(i,", ").concat(a,")"),null})).call((function(){yx.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&&Zy(t),e.isVisible()&&Xy(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=_e(t.getGeometryBounds().center,2),d=f[0],h=f[1],p=_e(e.getGeometryBounds().center,2),g=_e([(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)}],Me(Me({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)}],Me(Me({fill:"both"},n),{duration:l+u,delay:c+l-u}));return gb(k,i),[E,k]}(this.querySelector(Pb.labelItem.class),vx(this,t,e,o,n),r.update),a=gx(t,e,n),s=a.x,c=a.y,l=vb(this,{transform:"translate(".concat(s,", ").concat(c,")")},r.update);return Te(Te([],_e(i),!1),[l],!1)})).call((function(e){var r,i,o=J(e,"_transitions").flat().filter(lv);i=function(){yx.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=bb(this.childNodes[0],r.exit);return gb(e,(function(){return Fv(t).remove()})),e}))})).transitions()}function xx(t,e){return zb(t,e.tickDirection,e)}function wx(t,e,n,r,i){var o=_e(function(t,e){var n=_e(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,iv(i.tickLength,[t,e,n])),2),a=_e(o[0],2),s=a[0],c=a[1],l=_e(o[1],2);return{x1:s,x2:l[0],y1:c,y2:l[1]}}function Mx(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=xx(e.value,i),s="line";return y(o)&&(s=function(){return iv(o,[e,n,r,a])}),t.append(s).attr("className",Pb.tickItem.name)}(Fv(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=xx(t.value,o),c=wx(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,d=c.y2,h=_e(qv(Ib(a,[t,e,n,s])),2),p=h[0],g=h[1];"line"===r.node().nodeName&&r.styles(Me({x1:l,x2:u,y1:f,y2:d},p)),i.attr(g),r.styles(p)}(t,e,n,a,this,r,i);var s=_e(Wb(t.value,r),2),c=s[0],l=s[1];return vb(this,{transform:"translate(".concat(c,", ").concat(l,")")},o)}var Ox=av({text:"text"},"title");function Ex(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function kx(t,e){var n=Object.entries(e).reduce((function(e,n){var r=_e(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e}),{});t.styles(n)}var Sx=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 we(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(Ox.text.class);if(!a)return new rv(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=_e(zv(i),4),f=u[0],d=u[1],h=u[2],p=u[3],g=_e([0,0,+e,+n],4),m=g[0],y=g[1],v=g[2],b=g[3],x=Ex(r);if(x.includes("i"))return new rv(m,y,v,b);x.forEach((function(t,r){var i,o,a,s;"t"===t&&(i=_e(0===r?[l+h,+n-l-h]:[0,+n],2),y=i[0],b=i[1]),"r"===t&&(o=_e([+e-c-p],1),v=o[0]),"b"===t&&(a=_e([+n-l-f],1),b=a[0]),"l"===t&&(s=_e(0===r?[c+d,+e-c-d]:[0,+e],2),m=s[0],v=s[1])}));var w=_e(zv(o),4),M=w[0],O=w[1],E=w[2],k=w[3],S=_e([k+O,M+E],2),A=S[0],_=S[1];return new rv(m+k,y+M,v-A,b-_)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new rv(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=Oe(t,["width","height","position","spacing"]),i=_e(qv(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,c=o.position,l=_e([+a/2,+s/2],2),u=_e([+l[0],+l[1],"center","middle"],4),f=u[0],d=u[1],h=u[2],p=u[3],g=Ex(c);return g.includes("l")&&(f=(e=_e([0,"start"],2))[0],h=e[1]),g.includes("r")&&(f=(n=_e([+a,"end"],2))[0],h=n[1]),g.includes("t")&&(d=(r=_e([0,"top"],2))[0],p=r[1]),g.includes("b")&&(d=(i=_e([+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;yv(!!r.text,Fv(e),(function(t){n.title=t.maybeAppendByClassName(Ox.text,"text").styles(i).call(kx,{x:a,y:s,textAlign:c,textBaseline:l}).node()}))},e}(Kv);function Ax(t,e,n,r,i){var o=_e(qv(Yv(r,"title")),2),a=o[0],s=o[1],c=s.transform,l=s.transformOrigin,u=Oe(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(Me(Me({},a),{transformOrigin:l})),Xv(t.node(),f);var d=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=Ex(i),s=t.node().getLocalBounds(),c=_e(s.min,2),l=c[0],u=c[1],f=_e(s.halfExtents,2),d=f[0],h=f[1],p=_e(e.node().getLocalBounds().halfExtents,2),g=p[0],m=p[1],y=_e([l+d,u+h],2),v=y[0],b=y[1],x=_e(zv(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=_e("start"===i?[k,S]:[S,k],2),_=A[0],T=A[1],P=_e(Ev(Pv([-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}}(Fv(n._offscreen||n.querySelector(Pb.mainGroup.class)),e,r),h=d.x,p=d.y;return vb(e.node(),{transform:"translate(".concat(h,", ").concat(p,")")},i)}function _x(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=yv(i,e.maybeAppendByClassName(Pb.lineGroup,"g"),(function(e){return Zb(e,t,r)}))||[],c=yv(o,e.maybeAppendByClassName(Pb.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=Bb(e,n.tickFilter),o=Yv(n,"tick");return t.selectAll(Pb.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",Pb.tick.name).transition((function(t,e){return Mx.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),Mx.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=bb(this.childNodes[0],r.exit);return gb(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=yv(a,e.maybeAppendByClassName(Pb.labelGroup,"g"),(function(e){return bx(e,n,t,r)}))||[];return Te(Te(Te([],_e(s),!1),_e(c),!1),_e(l),!1).filter((function(t){return!!t}))}var Tx=function(t){function e(e){return t.call(this,e,Tb)||this}return we(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=pb(void 0===n?a:n),h=yv(c,Fv(e).maybeAppendByClassName(Pb.gridGroup,"g"),(function(e){return Jb(e,f,t,d)}))||[],p=Fv(e).maybeAppendByClassName(Pb.mainGroup,"g");i&&(!this.initialized&&d.enter||this.initialized&&d.update)&&_x(t,Fv(this.offscreenGroup),f,pb(!1));var g=_x(t,Fv(p.node()),f,d),m=yv(s,Fv(e).maybeAppendByClassName(Pb.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(Pb.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 mv(i)})).attr("className",Pb.title.name).transition((function(){return Ax(Fv(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return Ax(Fv(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,d)}))||[];return Te(Te(Te([],_e(h),!1),_e(g),!1),_e(m),!1).flat().filter((function(t){return!!t}))},e}(Kv),Px=av({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"),Cx=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:rb(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 Hp({class:Px.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new Hp({class:Px.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return we(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=_e(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,Te([],_e(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 rv(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=_e(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=yb(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return gb(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(Px.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)?Xy(e):Zy(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=_e("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=_e(v.offset,3),x=_e(b[0],2),w=x[0],M=x[1],O=_e(b[1],2),E=O[0],k=O[1],S=_e(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(Px.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=_e(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(Px.controller,"g");if(Ky(s.node(),a),a){var c=Yv(this.attributes,"button"),l=Yv(this.attributes,"pageNum"),u=_e(qv(c),2),f=u[0],d=u[1],h=f.size,p=Oe(f,["size"]),g=!s.select(Px.prevBtnGroup.class).node(),m=s.maybeAppendByClassName(Px.prevBtnGroup,"g").styles(d);this.prevBtnGroup=m.node();var y=m.maybeAppendByClassName(Px.prevBtn,"path"),v=s.maybeAppendByClassName(Px.nextBtnGroup,"g").styles(d);this.nextBtnGroup=v.node(),[y,v.maybeAppendByClassName(Px.nextBtn,"path")].forEach((function(t){t.styles(Me(Me({},p),{transformOrigin:"center"})),Bv(t.node(),h,!0)}));var b=s.maybeAppendByClassName(Px.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(Px.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=Fv(e);this.renderClipPath(a),this.renderController(a),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=U((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener(cp.INSERTED,e),this.playWindow.addEventListener(cp.REMOVED,e)},e}(Kv);function Nx(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}ob.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"]]})),ob.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]]})),ob.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 Lx=av({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 jx=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new Gp({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return we(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=_e(zv(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=_e(this.spacing,2),f=u[0],d=u[1];if(r){var h=r-n-f-d,p=_e(this.span,2);c=(t=_e([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=_e(zv(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=_e(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(Lx.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=Yv(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(Lx.markerGroup,"g").style("zIndex",0),yv(!!n,this.markerGroup,(function(){var t=e.markerGroup.node(),i=t.getElementsByClassName(Lx.marker.name)[0],o=n();i?o.nodeName===i.nodeName?(!function(t,e){var n,r,i=e.attributes;try{for(var o=Ae(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=_e(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}}}(i,o),Fv(i).styles(r)):(i.remove(),Fv(o).attr("className",Lx.marker.name).styles(r),t.appendChild(o)):(Fv(o).attr("className",Lx.marker.name).styles(r),t.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var a=Bv(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(a,")")}))},e.prototype.renderLabel=function(t){var e=Yv(this.attributes,"label"),n=e.text,r=Oe(e,["text"]);this.labelGroup=t.maybeAppendByClassName(Lx.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Lx.label,(function(){return mv(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=Yv(this.attributes,"value"),r=n.text,i=Oe(n,["text"]);this.valueGroup=t.maybeAppendByClassName(Lx.valueGroup,"g").style("zIndex",0),yv(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(Lx.value,(function(){return mv(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=Yv(this.attributes,"background");this.background=t.maybeAppendByClassName(Lx.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Lx.background,"rect").styles(Me({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=_e(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,")")}),pv(this.labelGroup.select(Lx.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(c,")")}),pv(this.valueGroup.select(Lx.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=Fv(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}(Kv),Rx=av({page:"item-page",navigator:"navigator",item:"item"},"items"),Ix=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Bx=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:it,mouseenter:it,mouseleave:it})||this;return n.navigatorShape=[0,0],n}return we(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=Yv(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:Me({layout:n,labelText:s,valueText:c},Object.fromEntries(Object.entries(r).map((function(n){var r=_e(n,2);return[r[0],iv(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=_e(this.navigatorShape,1)[0],s=_e(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=_e(y,2),b=v[0],x=v[1],w=(r-a-(l-1)*o)/l,M=e.getBBox().height,O=_e([0,0],2),E=O[0],k=O[1];return"horizontal"===n?(E=(d=_e([f,b*(M+i)],2))[0],k=d[1],f=x===l-1?0:f+w+o):(E=(h=_e([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=_e(this.navigatorShape,1)[0],a=_e(this.grid,2),s=a[0],c=a[1],l=_e([e-o,n],2),u=l[0],f=l[1],d=_e([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&&Ix(y,(function(t){return t<c}))?(n=_e([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=_e([v+1,0,0,x+M+r],4),v=o[0],y=o[1],b=o[2],(x=o[3])+M<=f&&Ix(v,(function(t){return t<s}))?(a=_e([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=_e([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 Nx(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(Rx.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(Rx.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);Fv(t).selectAll(Rx.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new jx({style:e})})).attr("className",Rx.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=_e(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=_e(t,2);return{page:e[0],layouts:e[1]}})),i=Te([],_e(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new Hp({className:Rx.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=Yv(this.attributes,"nav"),r=cv({orientation:e},n),i=this;return t.selectAll(Rx.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new Cx({style:r})})).attr("className",Rx.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(Fv(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new rp(t,{detail:e});this.dispatchEvent(n)},e}(Kv),Dx=av({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),Fx={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},zx=function(t){function e(e){return t.call(this,e,Fx)||this}return we(e,t),e.prototype.render=function(t,e){var n=Fv(e).maybeAppendByClassName(Dx.markerGroup,"g");this.renderMarker(n);var r=Fv(e).maybeAppendByClassName(Dx.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?Nx(r,"horizontalHandle","verticalHandle"):i;yv(!!o,t,(function(t){var n=Yv(e.attributes,"marker"),r=Me({symbol:o},n);e.marker=t.maybeAppendByClassName(Dx.marker,(function(){return new ob({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;yv(r,t,(function(t){var n,r=Yv(e.attributes,"label"),o=r.text,c=Oe(r,["text"]),l=(null===(n=t.select(Dx.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,d=l.height,h=_e(Nx(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(Dx.label,"text").styles(Me(Me({},c),{x:p,y:g,text:s(o).toString(),textAlign:m,textBaseline:y}))}))},e}(Kv),Gx={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},Wx=cv({},Gx,{}),$x=cv({},Gx,Uv(Fx,"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"}),Hx=av({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"),Vx=function(t){function e(e){return t.call(this,e,Wx)||this}return we(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=_e(qv(Yv(this.attributes,"title")),2),s=a[0],c=a[1];this.titleGroup=t.maybeAppendByClassName(Hx.titleGroup,"g").styles(c);var l=Me(Me({width:e,height:n},s),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(Hx.title,(function(){return new Sx({style:l})})).update(l)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,o=e.height,a=_e(qv(Yv(this.attributes,"title",!0)),2),s=a[0],c=a[1],l=Me(Me({},s),{width:i,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Hx.itemsGroup,"g").styles(Me(Me({},c),{transform:"translate(".concat(n,", ").concat(r,")")}));var u=this;this.itemsGroup.selectAll(Hx.items.class).data(["items"]).join((function(t){return t.append((function(){return new Bx({style:l})})).attr("className",Hx.items.name).each((function(){u.items=Fv(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 rv(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=Ex(r),u=_e(zv(a?i:0),4),f=u[0],d=u[1],h=u[2],p=u[3],g=_e(zv(o),4),m=g[0],y=g[1],v=g[2],b=g[3],x=_e([p+d,f+h],2),w=x[0],M=x[1],O=_e([b+y,m+v],2),E=O[0],k=O[1];if("l"===l[0])return new rv(s.x,s.y,c.width+s.width+w+E,Math.max(c.height+k,s.height));if("t"===l[0])return new rv(s.x,s.y,Math.max(c.width+E,s.width),c.height+s.height+M+k);var S=_e([e.attributes.width||c.width,e.attributes.height||c.height],2),A=S[0],_=S[1];return new rv(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=Fv(e);e.style.transform="translate(".concat(a,", ").concat(c,")"),this.renderTitle(l,r,i),this.renderItems(l,this.availableSpace),this.adjustLayout()},e}(Kv),Yx={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},Ux=av({background:"background",labelGroup:"label-group",label:"label"},"indicator"),qx=function(t){function e(e){var n=t.call(this,e,Yx)||this;return n.point=[0,0],n.group=n.appendChild(new Hp({})),n.isMutationObserved=!0,n}return we(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=_e(zv(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 rv(c[0]-a,c[1]-r,l[0]+i-c[0]+a,l[1]+o-c[1]+r),f=this.getPath(e,u),d=Yv(this.attributes,"background");this.background=Fv(this.group).maybeAppendByClassName(Ux.background,"path").styles(Me(Me({},d),{d:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=_e(qv(Yv(this.attributes,"label")),2),i=r[0],o=r[1],a=Oe(i,["text"]);(this.label=Fv(this.group).maybeAppendByClassName(Ux.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(Ux.label,(function(){return mv(e(n))})).style("text",e(n).toString()).selectAll("text").styles(a)},e.prototype.adjustLayout=function(){var t=_e(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,Te([c+1,1],_e(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=Wv.apply(void 0,Te([],_e(t),!1)),r=_e(t,2),i=_e(r[0],2),o=i[0],a=i[1],s=_e(r[1],2),c=s[0],l=s[1],u=_e(n?[c-o,[o,c]]:[l-a,[a,l]],2),f=u[0],d=_e(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=_e([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?Zy(this):Xy(this)},e.prototype.bindEvents=function(){this.label.on(cp.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(Kv);function Xx(t,e){var n=_e(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 Zx=av({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function Kx(t){var e=t.orientation,n=t.size,r=t.length;return Nx(e,[r,n],[n,r])}function Qx(t){var e=t.type,n=_e(Kx(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 Jx(t){return Qx(t)}function tw(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 If(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(Nx(n,"0","270"),")")):""}function ew(t){var e=t.orientation,n=t.range;if(!n)return[];var r=_e(Kx(t),2),i=r[0],o=r[1],a=_e(n,2),s=a[0],c=a[1],l=Nx(e,s*i,0),u=Nx(e,0,s*o),f=Nx(e,c*i,i),d=Nx(e,o,c*o);return[["M",l,u],["L",l,d],["L",f,d],["L",f,u],["Z"]]}var nw=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 we(e,t),e.prototype.render=function(t,e){!function(t,e){var n=Yv(e,"track");t.maybeAppendByClassName(Zx.track,"path").styles(Me({d:Qx(e)},n))}(Fv(e).maybeAppendByClassName(Zx.trackGroup,"g"),t),function(t,e){var n=Yv(e,"selection"),r=tw(e),i=t.maybeAppendByClassName(Zx.selection,"path").styles(Me({d:Jx(e),fill:r},n)),o=i.maybeAppendByClassName(Zx.clipPath,"path").styles({d:ew(e)}).node();i.style("clipPath",o)}(Fv(e).maybeAppendByClassName(Zx.selectionGroup,"g"),t)},e}(Kv);var rw=function(t){function e(e){var n=t.call(this,e,$x)||this;return n.eventToOffsetScale=new ga({}),n.innerRibbonScale=new ga({}),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=Xx(r.map((function(t){return t.value})),o).range;n.showIndicator((a[0]+a[1])/2,"".concat(a[0],"-").concat(a[1])),n.dispatchIndicated(o,a)}else{var s=n.getTickValue(o);n.showIndicator(s),n.dispatchIndicated(s)}},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=_e(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 we(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 rv(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(Fv(e));var i=this.availableSpace,o=i.x,a=i.y,s=Fv(e).maybeAppendByClassName(Hx.contentGroup,"g").styles({transform:"translate(".concat(o,", ").concat(a,")")});yv(!!r,s.maybeAppendByClassName(Hx.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(Hx.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(Hx.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,Te([],_e(t.map((function(t){return t.value}))),!1)),max:Math.max.apply(Math,Te([],_e(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=_e(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=_e(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Nx(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=Yv(this.attributes,"title"),s=Me(Me({},a),{width:i,height:o,text:r}),c=this;t.selectAll(Hx.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new Sx({style:s})})).attr("className",Hx.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 rv(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 rv(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(Pb.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new rv(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=_e(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=_e(this.ifHorizontal([b,m],[m,b]),2),w=x[0],M=x[1],O=["top","left"].includes(y)?s:0,E=_e(this.ifHorizontal([v/2,O],[O,v/2]),2),k=E[0],S=E[1];return new rv(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=Yv(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=cv({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(Hx.ribbon,(function(){return new nw({style:y})})).update(y)},e.prototype.getHandleClassName=function(t){return"".concat(Hx.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=Yv(this.attributes,"handle"),i=_e(this.selection,2),o=i[0],a=i[1],s=Me(Me({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?zx:Sb,u=this;this.handlesGroup.selectAll(Hx.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(Hx.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=_e(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 rv(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=_e([Math.max(e,i),Math.max(n,o)],2),s=a[0],c=a[1];return this.cacheHandleBBox=new rv(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=_e(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=_e(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=Yv(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Hx.indicator,(function(){return new qx({})})).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(Me(Me({},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=_e([n.value,c.value],2),u=l[0],f=l[1],d=(u+f)/2;e.push(Me(Me({},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=_e(["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=Yv(this.attributes,"tick"),s=Yv(this.attributes,"label"),c=s.align,l=cv(Me({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Uv(a,"tick"),Uv(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=Me(Me(Me({},l),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(Hx.label,(function(){return new Tx({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=_e([0,0,0],3),l=c[0],u=c[2],f=null!=i?i:o;return e?(u=f,"positive"===n?"right"===a?(l=f,u=f):"bottom"===a&&(l=u):"negative"===n&&("top"===a||"left"===a)&&(l=o)):"positive"===n&&("right"===a||"bottom"===a&&(l=o+s)),{offset:l,spacing:r,tickLength:u}},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=_e(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}),Xy(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){Zy(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=_e(this.selection,2),o=i[0],a=i[1],s=_e([t,e],2),c=s[0],l=s[1];n&&(c+=o,l+=a);var u=this.range;r=_e(function(t,e,n,r){var i,o=_e(t,2),a=o[0],s=o[1],c=_e(e,2),l=c[0],u=c[1],f=_e(n,2),d=f[0],h=f[1],p=_e([l,u],2),g=p[0],m=p[1],y=m-g;return g>m&&(g=(i=_e([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 H(e)?Cv(.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?Xx(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,e){var n=this.range,r=n.min,i=n.max,o=_e(this.ribbon.node().getPosition(),2),a=o[0],s=o[1],c=this.ifHorizontal(a,s),l=this.ifHorizontal.apply(this,Te([],_e(gv(t)),!1))-c;return L(this.getOffset(l,!0),r,i)},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.dispatchSelection=function(){var t=new rp("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},e.prototype.dispatchIndicated=function(t,e){var n=new rp("indicate",{detail:{value:t,range:e}});this.dispatchEvent(n)},e}(Kv);function iw(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 ow={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function aw(t){var e;void 0===t&&(t="");var n=iw(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)]=Me({flex:1},ow),e[".".concat(n.VALUE)]=Me({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},ow),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 sw=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=iw(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:aw(o)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return we(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=Oe(t,["name","color","index"]),l=Me({name:i,color:a,index:null!=s?s:e},c);return pn(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=pn(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=iw(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,Te([],_e(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=_e(e,2),r=n[0],i=n[1];Te([t],_e(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=_e(l,2),n=e[0],i=e[1],a=_e(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=_e(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=_e(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=_e([+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 rv(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}(Kv),cw=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[cp.BOUNDS_CHANGED,cp.INSERTED,cp.REMOVED],n.$margin=zv(0),n.$padding=zv(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 we(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=zv(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=zv(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=_e(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new rv(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=_e(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],c=_e(this.$margin,4),l=c[0],u=c[3];return new rv(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:Mv,grid:Ov},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}(Hp);function lw(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 bc()([[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=ks(t,e),i=ks(e,n),o=ks(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 bc()(u)}const uw=Fm((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=Oe(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=wr(b,"background"),{padding:w}=x,M=Oe(x,["padding"]),O=wr(b,"connector"),{points:E=[]}=O,k=Oe(O,["points"]),S=[[+u,+f],[+c,+l]];let A;A=v?bm(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",v).call(Om,Object.assign({transform:a,transformOrigin:s},b)).node():bm(t).maybeAppend("text","text").style("zIndex",0).style("text",d).call(Om,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const _=bm(t).maybeAppend("background","rect").style("zIndex",-1).call(Om,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(Om,h?M:{}).node(),T=lw(_,S,E,y),P=g&&new ob({id:"startMarker",style:Object.assign({x:0,y:0},wr(b,"startMarker"))}),C=m&&new ob({id:"endMarker",style:Object.assign({x:0,y:0},wr(b,"endMarker"))});bm(t).maybeAppend("connector","path").style("zIndex",0).style("d",T).style("markerStart",P).style("markerEnd",C).call(Om,p?k:{})})),fw=(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 bm(new uw).style("x",f).style("y",d).call(Om,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(Om,u).call(Om,t).node()}};fw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dw=Fm((t=>{const e=Oe(t.attributes,["class","x","y","transform"]),n=wr(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=bm(t).maybeAppend("marker",(()=>new ob({}))).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);bm(t).maybeAppend("text","text").style("x",a).style("y",s).call(Om,e)})),hw=(t,e)=>{const n=Oe(t,[]);return(t,e,r)=>{const{color:i}=r,o=Oe(r,["color"]),{color:a=i,text:s=""}=e,c={text:String(s),stroke:a,fill:a},[[l,u]]=t;return bm(new dw).call(Om,o).style("transform",`translate(${l},${u})`).call(Om,c).call(Om,n).node()}};hw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const pw=Fm((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;bm(t).maybeAppend("connect-path",(()=>o.createElement("path",{}))).style("d",n).call(Om,i),bm(t).maybeAppend("area-path",(()=>o.createElement("path",{}))).style("d",e).call(Om,r)})),gw=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=(t=>!Number.isNaN(t)&&null!=t),connect:o=!1}=t,a=Oe(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=qc(s),m=Tm(s,e),y=r&&d?km(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=wr(v,"connect"),M=!!x.length,O=t=>bm(c.createElement("path",{})).style("d",t||"").call(Om,v).node();if(Xc(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=xc().curve(wc),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 Ec(n())},delete t.lineX0,t.lineEndAngle=function(){return Ec(r())},delete t.lineX1,t.lineInnerRadius=function(){return Ec(i())},delete t.lineY0,t.lineOuterRadius=function(){return Ec(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Oc(t)):e()._curve},t}().angle(((t,n)=>As(Os(r[n],e)))).outerRadius(((t,n)=>ks(r[n],e))).innerRadius(((t,n)=>ks(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)):bm(new pw).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?xc().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):xc().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)):bm(new pw).style("areaStyle",v).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};gw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const mw=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Xc(n)?jc:mc;return gw(Object.assign({curve:i},t),e)(...r)}};mw.props=Object.assign(Object.assign({},gw.props),{defaultMarker:"square"});const yw=(t,e)=>{const n=Oe(t,[]),{coordinate:r}=e;return(...t)=>{const i=Xc(r)?Nc:qc(r)?$c:Wc;return gw(Object.assign({curve:i},n),e)(...t)}};yw.props=Object.assign(Object.assign({},gw.props),{defaultMarker:"smooth"});const vw=(t,e)=>(...n)=>gw(Object.assign({curve:Vc},t),e)(...n);vw.props=Object.assign(Object.assign({},gw.props),{defaultMarker:"hvh"});const bw=(t,e)=>(...n)=>gw(Object.assign({curve:Yc},t),e)(...n);bw.props=Object.assign(Object.assign({},gw.props),{defaultMarker:"vh"});const xw=(t,e)=>(...n)=>gw(Object.assign({curve:Uc},t),e)(...n);xw.props=Object.assign(Object.assign({},gw.props),{defaultMarker:"hv"});const ww=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>Uy(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};ww.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Mw=(t,e)=>{const n=Oe(t,[]),{document:r}=e;return(t,e,i)=>{const{color:o}=i,a=Oe(i,["color"]),{color:s=o,transform:c}=e,[l,u]=t,f=oc();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]),bm(r.createElement("path",{})).call(Om,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(Om,n).node()}};function Ow(t,e,n,r){const i=oc();if(Xc(n)){const o=n.getCenter(),a=ks(t,o),s=(ks(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),Em(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return qc(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)}Mw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ew=(t,e)=>{const{cornerRatio:n=1/3}=t,r=Oe(t,["cornerRatio"]),{coordinate:i,document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Oe(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,d]=t,h=Ow(f,d,i,n);return bm(o.createElement("path",{})).call(Om,c).style("d",h.toString()).style("stroke",l).style("transform",u).call(Om,r).node()}};Ew.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const kw=(t,e)=>{const n=Oe(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Oe(o,["color"]),{color:c=a,transform:l}=e,[u,f]=t,d=oc();if(d.moveTo(u[0],u[1]),Xc(r)){const t=r.getCenter();d.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{Em(d,u,f,Ps(u,f),ks(u,f)/2)}return bm(i.createElement("path",{})).call(Om,s).style("d",d.toString()).style("stroke",c).style("transform",l).call(Om,n).node()}};function Sw(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 Aw(t={}){return[...Sw(t),{name:"title",scale:"identity"}]}function _w(){return[{type:qr,channel:"color"},{type:si,channel:["x","y"]}]}function Tw(){return[{type:qr,channel:"x"},{type:si,channel:["y"]}]}function Pw(t={}){return Sw(t)}function Cw(){return[{type:Jr}]}function Nw(t,e){return t.getBandWidth(t.invert(e))}function Lw(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?Nw(a,r[e]):0,l=h?Nw(s,i[e]):0,g=p&&o?(Nw(c,o[e])/2+ +o[e])*n:0,[m,y]=t;return[m+u*n+g,y+f*l]}:t=>t}function jw(t){return parseFloat(t)/100}function Rw(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?jw(e)*a:+e,"string"==typeof n?jw(n)*s:+n]]}))]}kw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Iw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Oe(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?jw(d)*m:d,h="string"==typeof h?jw(h)*y:h;const v=p-Number(d)/2,b=g-Number(h)/2;return bm(r.createElement("image",{})).call(Om,s).style("x",v).style("y",b).style("src",l).style("stroke",c).style("transform",f).call(Om,t).style("width",d).style("height",h).node()}};function Bw(t,e){const n=oc();if(Xc(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>ks(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?Em(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)}Iw.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Dw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Oe(o,["color"]),{color:c=a,transform:l}=i,u=Bw(e,n);return bm(r.createElement("path",{})).call(Om,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(Om,t).node()}};function Fw(t,e){const[n,r,i,o]=t,a=oc();if(Xc(e)){const t=e.getCenter(),s=ks(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),Em(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),Em(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}Dw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const zw=(t,e)=>{const n=Oe(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Oe(o,["color"]),{color:c=a,transform:l}=e,u=Fw(t,r);return bm(i.createElement("path",{})).call(Om,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(Om,n).node()}};function Gw(t,e){const n=oc();if(Xc(e)){const r=e.getCenter(),[i,o]=r,a=Ss(Os(t[0],r)),s=Ss(Os(t[1],r)),c=ks(r,t[2]),l=ks(r,t[3]),u=ks(r,t[8]),f=ks(r,t[10]),d=ks(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}zw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ww=(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=Oe(o,["color","fill","stroke"]),d=Gw(e,n);return bm(r.createElement("path",{})).call(Om,f).style("d",d.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Om,t).node()}};function $w(t,e,n=4){const r=oc();if(!Xc(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=ks(i,t[3]),c=ks(i,t[8]),l=ks(i,t[10]),u=Ss(Os(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}Ww.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Hw=(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=Oe(o,["color","fill","stroke"]),d=$w(e,n,4);return bm(r.createElement("path",{})).call(Om,f).style("d",d.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Om,t).node()}};Hw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Vw=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=Oe(t,["arrow","arrowSize"]),{coordinate:o,document:a}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=Oe(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},wr(i,"arrow"))):null,p=function(t,e){if(!Xc(e))return bc().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return hc()({startAngle:0,endAngle:2*Math.PI,outerRadius:ks(t[0],n),innerRadius:ks(t[1],n)})}(t,o),g=function(t,e){if(!Xc(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,e.transform);return bm(a.createElement("path",{})).call(Om,u).style("d",p).style("stroke",f).style("lineWidth",d).style("transform",g).style("markerEnd",h).call(Om,i).node()}};function Yw(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}Vw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Uw=(t,e)=>{const{offset:n=0,offset1:r=n,offset2:i=n,connectLength1:o,endMarker:a=!0}=t,s=Oe(t,["offset","offset1","offset2","connectLength1","endMarker"]),{coordinate:c}=e;return(t,e,n)=>{const{color:l,connectLength1:u}=n,f=Oe(n,["color","connectLength1"]),{color:d,transform:h}=e,p=function(t,e,n,r,i=0){const[[o,a],[s,c]]=e;if(qc(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=wr(Object.assign(Object.assign({},s),n),"endMarker");return bm(new qp).call(Om,f).style("d",function(t){return bc().x((t=>t[0])).y((t=>t[1]))(t)}(p)).style("stroke",d||l).style("transform",h).style("markerEnd",a?new ob({className:"marker",style:Object.assign(Object.assign({},g),{symbol:Yw})}):null).call(Om,s).node()}};function qw(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function Xw(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=Er(n.x,l),s=Er(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 Zw(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=Am(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:d,endAngle:h}=l,p="inside"===t?(d+h)/2:h,g=Qw(p,a,s),m=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?Kw(c,p,i):Ps(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},m),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function Kw(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function Qw(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function Jw(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=Am(r,e,[i,o]),{startAngle:f,endAngle:d}=u,h=r.getCenter(),p=(f+d)/2,g={textAlign:"center",textBaseline:"middle",rotate:Qw(p,a,s)},{innerRadius:m,outerRadius:y}=u,v=m+(y-m)*c+l,[b,x]=Kw(h,p,v);return Object.assign({x:b,y:x},g)}function tM(t){return void 0===t?null:t}function eM(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:tM(o[0]),y:tM(o[1])}}function nM(t,e,n,r){const{bounds:i}=n;if(1===i.length)return eM(0,0,n);return(Zc(r)?Zw:tl(r)?Jw:Xw)(t,e,n,r)}function rM(t,e,n){const r=Am(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function iM(t,e,n){const r=Am(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function oM(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=iM(e,n,r),h=Math.sin(d)>0?1:-1,p=Qw(d,i,o),g={textAlign:h>0||Zc(r)?"start":"end",textBaseline:"middle",rotate:p},m=rM(e,n,r),y=m+(s?c:a),[[v,b],[x,w],[M,O]]=function(t,e,n,r,i){const[o,a]=Kw(t,e,n),[s,c]=Kw(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)}Uw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var aM=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=or(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=Ss(Os(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:nM,bottomLeft:nM,bottomRight:nM,inside:nM,left:nM,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?eM(0,0,n):(Zc(r)?Zw:tl(r)?oM:Xw)(t,e,n,r)},right:nM,spider:function(t,e,n,r){if(!tl(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=Oe(oM(0,e,n,r),[]),c=r.getCenter(),l=rM(e,n,r),u=iM(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(!tl(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=Oe(oM(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if(tl(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=As([c-u[0],l-u[1]]),p=Math.sin(h)>0?1:-1,[g,m]=Kw(u,h,d);return s.x=g+(o+a)*p,s.y=m,s},top:nM,topLeft:nM,topRight:nM});function sM(t,e,n,r,i){const{position:o}=e,{render:a}=i,s=function(t,e){return void 0!==t?t:tl(e)?"inside":qc(e)?"right":"top"}(o,n),c=r[a?"htmlLabel":"inside"===s?"innerLabel":"label"],l=Object.assign({},c,e),u=aM[qw(s)];if(!u)throw new Error(`Unknown position: ${s}`);return Object.assign(Object.assign({},c),u(s,t,l,n,i))}const cM=(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=Oe(o,["text","x","y","transform","transformOrigin","className"]),h=sM(e,o,n,r,t),{rotate:p=0,transform:g=""}=h,m=Oe(h,["rotate","transform"]);return bm(new uw).call(Om,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(Om,d).node()}};cM.props={defaultMarker:"point"};const lM=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=Oe(t,["arrow","colorAttribute"]),{coordinate:o,document:a}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=Oe(n,["color","stroke"]),{d:u,color:f=s}=e,[d,h]=o.getSize();return bm(a.createElement("path",{})).call(Om,l).style("d","function"==typeof u?u({width:d,height:h}):u).style(r,f).call(Om,i).node()}};lM.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const uM=(t,e)=>lM(Object.assign({colorAttribute:"fill"},t),e);uM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const fM=(t,e)=>lM(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);fM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dM=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:o}=r,{color:a}=i,s=Oe(i,["color"]),{color:c=a}=r,[l,...u]=e,f=oc();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),bm(n.createElement("path",{})).call(Om,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(Om,t).node()}};function hM(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 pM(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}dM.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},hM(3);const gM=function(t,e=((...t)=>`${t[0]}`),n=16){const r=hM(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=pM(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 mM(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=pM(a,t,e).getContext("2d"),l=function(t,e){const n=pM(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=gM(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=pM(a,t,e).getContext("2d");return f.putImageData(u,0,0),f}const yM=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:o,blur:a,useGradientOpacity:s}=t,c=Oe(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=ar(t,(t=>t[2])),v=ir(t,(t=>t[2])),b=p&&g?mM(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 bm(f.createElement("image",{})).call(Om,d).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas).style("transform",h).call(Om,c).node()}};yM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const vM=(t,e)=>{const{render:n}=t,r=Oe(t,["render"]);return t=>{const[[i,o]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:o}),e)}};function bM(t,e){return t.getBandWidth(t.invert(e))}vM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xM={rect:Lm,hollow:jm,funnel:Im,pyramid:Dm},wM=()=>(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=bM(l,i[t]),n=e*(u?bM(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]};wM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:xM,channels:[...Aw({shapes:Object.keys(xM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Cw(),{type:On},{type:Xr}],postInference:[...Tw()],interaction:{shareTooltip:!0}};const MM={rect:Lm,hollow:jm},OM=()=>(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]};OM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:MM,channels:[...Aw({shapes:Object.keys(MM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Cw(),{type:On}],postInference:[...Tw()],interaction:{shareTooltip:!0}};const EM={line:Wm,smooth:$m,hv:Hm,vh:Vm,hvh:Ym,trail:qm},kM=(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(Gn(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]},SM=(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}))]},AM=()=>(t,e,n,r)=>(Qc(r)?SM:kM)(t,e,n,r);AM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:EM,channels:[...Aw({shapes:Object.keys(EM)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Cw(),{type:di},{type:ti}],postInference:[...Tw(),{type:qr,channel:"color"},{type:si,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const _M={hollow:_y,hollowDiamond:Sy,hollowHexagon:Ay,hollowSquare:Ty,hollowTriangleDown:Cy,hollowTriangle:Py,hollowBowtie:ky,hollowCircle:jy,point:Wy,plus:Gy,diamond:By,square:$y,triangle:Vy,hexagon:Dy,cross:Iy,bowtie:Ry,hyphen:Fy,line:zy,tick:Hy,triangleDown:Yy,circle:Ly},TM=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=Lw(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))]))]};TM.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:_M,channels:[...Aw({shapes:Object.keys(_M)}),{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:[...Cw(),{type:Xr},{type:Zr}],postInference:[{type:Qr},..._w()]};const PM={text:fw,badge:hw},CM=t=>{const{cartesian:e=!1}=t;return e?Rw:(e,n,r,i)=>{const{x:o,y:a}=r,s=Lw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};CM.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:PM,channels:[...Aw({shapes:Object.keys(PM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize"},{name:"rotate"}],preInference:[...Cw(),{type:fi},{type:li}],postInference:[..._w()]};const NM={cell:Lm,hollow:jm},LM=()=>(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]};LM.props={defaultShape:"cell",defaultLabelShape:"label",shape:NM,composite:!1,channels:[...Aw({shapes:Object.keys(NM)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Cw(),{type:Xr},{type:Zr},{type:ci}],postInference:[..._w()]};const jM={area:mw,smooth:yw,hvh:vw,vh:bw,hv:xw},RM=()=>(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(Gn(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]};RM.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:jM,channels:[...Aw({shapes:Object.keys(jM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Cw(),{type:ti},{type:On},{type:ci}],postInference:[...Tw()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const IM={link:ww,arc:kw,smooth:Mw,vhv:Ew},BM=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=Lw(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]};BM.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:IM,channels:[...Aw({shapes:Object.keys(IM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Cw(),{type:ri},{type:ii}],postInference:[..._w()]};const DM={image:Iw},FM=t=>{const{cartesian:e}=t;return e?Rw:(e,n,r,i)=>{const{x:o,y:a}=r,s=Lw(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:"image",defaultLabelShape:"label",composite:!1,shape:DM,channels:[...Aw({shapes:Object.keys(DM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Cw(),{type:fi},{type:li}],postInference:[..._w()]};const zM={polygon:Dw,ribbon:zw},GM=()=>(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]};GM.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:zM,channels:[...Aw({shapes:Object.keys(zM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Cw()],postInference:[..._w()]};const WM={box:Ww,violin:Hw},$M=()=>(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]};$M.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:WM,channels:[...Aw({shapes:Object.keys(WM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Cw(),{type:Xr}],postInference:[...Tw()],interaction:{shareTooltip:!0}};const HM={vector:Uy},VM=()=>(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]};VM.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:HM,channels:[...Aw({shapes:Object.keys(HM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Cw()],postInference:[..._w()]};const YM={line:Vw},UM=t=>(e,n,r,i)=>{const{y:o}=r,a=Lw(n,r,Z({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]};UM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:YM,channels:[...Pw({shapes:Object.keys(YM)}),{name:"y",required:!0}],preInference:[...Cw(),{type:ei}],postInference:[]};const qM={line:Vw},XM=t=>(e,n,r,i)=>{const{x:o}=r,a=Lw(n,r,Z({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]};XM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:qM,channels:[...Pw({shapes:Object.keys(qM)}),{name:"x",required:!0}],preInference:[...Cw(),{type:ni}],postInference:[]};const ZM={connector:Uw},KM=(...t)=>BM(...t);function QM(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 JM(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=QM("x",e,i,r.x),s=QM("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]}}KM.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:ZM,channels:[...Pw({shapes:Object.keys(ZM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Cw()],postInference:[]};const tO={range:Lm},eO=()=>JM();eO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:tO,channels:[...Pw({shapes:Object.keys(tO)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Cw()],postInference:[]};const nO={range:Lm},rO=()=>JM({extendY:!0});rO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:nO,channels:[...Pw({shapes:Object.keys(nO)}),{name:"x",required:!0}],preInference:[...Cw(),{type:oi}],postInference:[]};const iO={range:Lm},oO=()=>JM({extendX:!0});oO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:iO,channels:[...Pw({shapes:Object.keys(iO)}),{name:"y",required:!0}],preInference:[...Cw(),{type:ai}],postInference:[]};const aO={path:uM,hollow:fM},sO=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];function cO(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 lO(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=fO)):void 0===e&&(e=uO);for(var n,r,i,o,a,s=new pO(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 pO(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(hO)}function uO(t){return t.children}function fO(t){return Array.isArray(t)?t[1]:null}function dO(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function hO(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function pO(t){this.data=t,this.depth=this.height=0,this.parent=null}function gO(t){return null==t?null:mO(t)}function mO(t){if("function"!=typeof t)throw new Error;return t}function yO(){return 0}function vO(t){return function(){return t}}function bO(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 xO(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}sO.props={defaultShape:"path",defaultLabelShape:"label",shape:aO,composite:!1,channels:[...Aw({shapes:Object.keys(aO)}),{name:"d",scale:"identity"}],preInference:[...Cw()],postInference:[]},pO.prototype=lO.prototype={constructor:pO,count:function(){return this.eachAfter(cO)},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 lO(this).eachBefore(dO)},[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 wO={depth:-1},MO={},OO={};function EO(t){return t.id}function kO(t){return t.parentId}function SO(){var t,e=EO,n=kO;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;_O(t,e-1)&&!_O(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(AO),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(AO(t)),d.push(OO));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 pO(o),null!=(u=h(o,a,r))&&(u+="")&&(f=l.id=u,g.set(f,g.has(f)?MO: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===MO)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===OO&&1===s.children.length;)s=s.children[0],--i;for(let t=d.length-1;t>=0&&(l=d[t]).data===OO;--t)l.data=null}if(s.parent=wO,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(hO),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=gO(t),r):e},r.parentId=function(t){return arguments.length?(n=gO(t),r):n},r.path=function(e){return arguments.length?(t=gO(e),r):t},r}function AO(t){let e=t.length;if(e<2)return"";for(;--e>1&&!_O(t,e););return t.slice(0,e)}function _O(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function TO(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 PO=(1+Math.sqrt(5))/2;function CO(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?xO(a,n,r,i,M?r+=l*u/M:o):TO(a,n,r,M?n+=c*u/M:i,o),M-=u,b=x}return y}var NO=function t(e){function n(t,n,r,i,o){CO(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(PO);function LO(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 jO(t,e,n,r,i){(1&t.depth?TO:xO)(t,e,n,r,i)}var RO=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?xO(s,n,r,i,h?r+=(o-r)*s.value/h:o):TO(s,n,r,h?n+=(i-n)*s.value/h:i,o),h-=s.value}else t._squarify=a=CO(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(PO);function IO(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],IO(n,n.path)}))}function BO(t){const e=J(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach((t=>{BO(t)}))}function DO(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:LO,treemapDice:xO,treemapSlice:TO,treemapSliceDice:jO,treemapSquarify:NO,treemapResquarify:RO},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?SO().path(e)(t):SO()(t):lO(t)}(t,e.path);w(t)?BO(o):IO(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=NO,e=!1,n=1,r=1,i=[0],o=yO,a=yO,s=yO,c=yO,l=yO;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(bO),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=mO(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:vO(+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:vO(+t),u):a},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:vO(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"==typeof t?t:vO(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:vO(+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 FO=t=>{const{cartesian:e}=t;return e?Rw:(e,n,r,i)=>{const{x:o,y:a}=r,s=Lw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};FO.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:vM},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Cw(),{type:fi},{type:li},{type:ui}]};var zO={},GO={};function WO(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function $O(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 HO(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function VO(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+HO(-t,6):t>9999?"+"+HO(t,6):HO(t,4)}(t.getUTCFullYear())+"-"+HO(t.getUTCMonth()+1,2)+"-"+HO(t.getUTCDate(),2)+(i?"T"+HO(e,2)+":"+HO(n,2)+":"+HO(r,2)+"."+HO(i,3)+"Z":r?"T"+HO(e,2)+":"+HO(n,2)+":"+HO(r,2)+"Z":n||e?"T"+HO(e,2)+":"+HO(n,2)+"Z":"")}function YO(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 GO;if(l)return l=!1,zO;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())!==GO;){for(var f=[];r!==zO&&r!==GO;)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?VO(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=WO(t);return function(r,i){return e(n(r),i,t)}}(t,e):WO(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=$O(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=$O(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function UO(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;qO&&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 qO=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),XO=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>ke(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return YO(r).parse(e,i?UO:pr)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};XO.props={};const ZO=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 KO(t){return null!=t&&!Number.isNaN(t)}ZO.props={};const QO=t=>{const{callback:e=KO}=t;return t=>t.filter(e)};QO.props={};const JO=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};JO.props={};const tE=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)))};tE.props={};const eE=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)),{})))};eE.props={};const nE=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)))};nE.props={};const rE=t=>{const{value:e}=t;return()=>e};rE.props={};const iE=t=>{const{callback:e=pr}=t;return t=>e(t)};iE.props={};const oE=t=>{const{callback:e=pr}=t;return t=>Array.isArray(t)?t.map(e):t};function aE(t){return"string"==typeof t?e=>e[t]:t}oE.props={};const sE=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=aE(s),l=aE(a),u=$n(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)),{}))}))};sE.props={};const cE=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};cE.props={};var lE={exports:{}},uE={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}}(uE),function(t){var e=Math.log(2),n=t.exports,r=uE.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)}}}(lE);var fE=lE.exports;const dE=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(Gn(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=fE.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})}))}};dE.props={};const hE=()=>t=>(console.log("G2 data section:",t),t);hE.props={};const pE={density:dM},gE=()=>(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]};gE.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:pE,channels:[...Aw({shapes:Object.keys(pE)}),{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:[...Cw(),{type:On},{type:Xr}],postInference:[...Tw()],interaction:{shareTooltip:!0}};const mE={heatmap:yM},yE=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]}))]]};yE.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:mE,channels:[...Aw({shapes:Object.keys(mE)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Cw(),{type:Xr},{type:Zr}],postInference:[..._w()]};const vE=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];vE.props={};const bE=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];bE.props={};const xE=t=>new Ko(t);xE.props={};const wE=t=>new ga(t);wE.props={};const ME=t=>new qo(t);ME.props={};const OE=t=>new ua(t);OE.props={};const EE=t=>new ma(t);EE.props={};const kE=t=>new Fa(t);kE.props={};const SE=t=>new Ma(t);SE.props={};const AE=t=>new va(t);AE.props={};const _E=t=>new xa(t);_E.props={};const TE=t=>new ka(t);TE.props={};const PE=t=>new Oa(t);PE.props={};const CE=t=>new ba(t);CE.props={};const NE=t=>new Wa(t);NE.props={};const LE=t=>new Jo(t);function jE({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"}}}LE.props={};const RE=jE({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}),IE=t=>Z({},RE,t);IE.props={};const BE=t=>Z({},IE(),{category10:"category10",category20:"category20"},t);BE.props={};const DE=jE({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"#141414",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}),FE=t=>Z({},DE,{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),zE=t=>Object.assign({},FE(),{category10:"category10",category20:"category20"},t);zE.props={};const GE=jE({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}),WE=t=>Z({},GE,{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 $E(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)]}WE.props={};var HE,VE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function YE(t){if(!(e=VE.exec(t)))throw new Error("invalid format: "+t);var e;return new UE({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 UE(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 qE(t,e){var n=$E(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")}YE.prototype=UE.prototype,UE.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 XE={"%":(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)=>qE(100*t,e),r:qE,s:function(t,e){var n=$E(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(HE=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")+$E(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function ZE(t){return t}var KE,QE,JE=Array.prototype.map,tk=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function ek(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?ZE:(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?ZE: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=YE(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"):XE[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=XE[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?tk[8+HE/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=YE(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=$E(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=tk[8+r/3];return function(t){return n(i*t)+o}}}}function nk(t,e,n){return t.querySelector(e)?bm(t).select(e):bm(t).append(n)}function rk(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function ik(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)}KE=ek({thousands:",",grouping:[3],currency:["$",""]}),QE=KE.format;class ok extends cw{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 ak extends ok{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function sk(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function ck(t){return"vertical"===t||t===-Math.PI/2}function lk(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 uk(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=Oe(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 fk(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function dk(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function hk(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]=In(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(Xc(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 ga({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(!Jc(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new ga({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new ga({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return Xc(s)||qc(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:Zc(s)&&"center"===a||qc(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||qc(s)&&g(a)?1-l:l,label:f(d(Mm(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(Mm(e),n,r)),id:String(n)}}))}function pk(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 gk(t,e,n){return!function(t){return Xc(t)&&qc(t)}(e)&&!Qc(e)&&(void 0===t?!!n.getTicks:t)}function mk(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${mr(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:ck(o)?10:0,tick:"center"!==r&&void 0}):a}const yk=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?QE(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)}},vk=yk((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=Oe(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=mk(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]=dk(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]=el(r),[f,d]=nl(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=Xc(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=hk(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:rk(u),labelOverlap:pk(p,k),grid:gk(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 Tx({className:"axis",style:uk(C)})}})),bk=yk((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=Oe(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=hk(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]=el(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]=nl(i),[h,p]=dk(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=uk(Z({},w,M,x,Object.assign(Object.assign({type:"arc",data:y,titleText:rk(d),grid:h},p),l)));return new Tx({style:nt(O,["transform"])})}}));vk.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},bk.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const xk=t=>(...e)=>{const n=vk(Object.assign({},{crossPadding:50},t))(...e);return fk(n,t),n};xk.props=Object.assign(Object.assign({},vk.props),{defaultPosition:"bottom"});const wk=t=>(...e)=>{const n=vk(Object.assign({},{crossPadding:10},t))(...e);return fk(n,t),n};function Mk(t,e,n,r){const{radar:i}=t,[o]=r,a=o.getOptions().name,[s,c]=nl(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))})}wk.props=Object.assign(Object.assign({},vk.props),{defaultPosition:"left"});const Ok=t=>{const{important:e={}}=t,n=Oe(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return vk(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({},Mk(t,i,o,a)),e)}))(r)}};function Ek(t,e){const{scales:n,library:r,markState:i}=e,[o,a]=function(t,e){const n=sk(t,"shape"),r=sk(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=Oe(e,["d","fill","lineWidth","path","stroke","color"]);const l=My.get(t)||My.get("point");return(...t)=>new qp({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 sk(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 kk(t){const e=sk(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=sk(t,"size");return n instanceof ua?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:Ek(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:kk(r)},s="string"==typeof n?QE(n):n,c=sk(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)})))})}Ok.props=Object.assign(Object.assign({},vk.props),{defaultPosition:"center"});const Ak=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,cols:c,itemMarker:l}=t,u=Oe(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}=lk(t,e,n);return{width:i,height:o}}(r,t,Ak),h=ik(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:rk(s)}),Sk(t,e)),{legendCategory:g={}}=i,m=uk(Object.assign({},g,p,u)),y=new ak({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},h),{subOptions:m})});return y.appendChild(new Vx({className:"legend-category",style:m})),y}};function _k(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 Tk(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],Cr(e)];return[n,r]}function Pk(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:[If(e).toString()]})),r}(s,c),[u,f]=Tk(l),[d,h]=Tk([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof Jo))));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 Ck(t,e,n,r,i,o){const a=sk(t,"color"),s=function(t,e,n){const{size:r}=e,i=lk(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 xa){const{range:t}=a.getOptions(),[e,n]=Tk(a);return a instanceof Oa||a instanceof ka?_k(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 Pk(s,a,sk(t,"size"),sk(t,"opacity"),e,o)}Ak.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const Nk=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,style:c,crossPadding:l,padding:u}=t,f=Oe(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=ik(o,n),{legendContinuous:y={}}=a,v=uk(Object.assign({},y,Object.assign(Object.assign({titleText:rk(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>QE(e)(t.label):e},Ck(r,l,i,t,Nk,a)),c),f)),b=new ok({style:Object.assign(Object.assign({x:d,y:h,width:p,height:g},m),{subOptions:v})});return b.appendChild(new rw({className:"legend-continuous",style:v})),b}};Nk.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const Lk=t=>(...e)=>Nk(Object.assign({},{block:!0},t))(...e);Lk.props=Object.assign(Object.assign({},Nk.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const jk=t=>e=>{const{scales:n}=e,r=sk(n,"size");return Nk(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};jk.props=Object.assign(Object.assign({},Nk.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const Rk=t=>jk(Object.assign({},{block:!0},t));function Ik(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"}}}Rk.props=Object.assign(Object.assign({},Nk.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const Bk=(Dk={render(t,e){const{width:n,title:r,subtitle:i,spacing:o=2,align:a="left",x:s,y:c}=t,l=Oe(t,["width","title","subtitle","spacing","align","x","y"]);e.style.transform=`translate(${s}, ${c})`;const u=wr(l,"title"),f=wr(l,"subtitle"),d=nk(e,".title","text").attr("className","title").call(Om,Object.assign(Object.assign(Object.assign({},Ik(0,0,n,a)),{fontSize:14,textBaseline:"top",text:r}),u)).node().getLocalBounds();nk(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({},Ik(0,d.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),f))}))}},class extends Wp{constructor(t){super(t),this.descriptor=Dk}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(Z({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var Dk;const Fk=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new Bk({style:Z({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};function zk(t){return!!t.getBandWidth}function Gk(t,e,n){if(!zk(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))}(Cn(s,e)+o,0,i.length-1);return i[c]}function Wk(t,e,n){if(!e)return t.getOptions().domain;if(!zk(t)){const r=Yn(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 $k(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[Gk(a,n,e),Gk(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[Wk(a,[l[0],u[0]]),Wk(s,[l[1],u[1]])]}function Hk(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}Fk.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const Vk=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:o}=t,a=Oe(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?QE(n):n,v="horizontal"===e,b=qc(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 Ab({className:"slider",style:Object.assign({},g,Object.assign(Object.assign({x:w,y:M,trackLength:v?h:p,orientation:e,formatter:t=>(y||m)(Gk(c,b?1-t:t,!0)),sparklineData:Yk(t,r)},i),a))})}};function Yk(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)).map((([t])=>{const{encode:n,slider:r}=t;if((null==r?void 0:r.x)&&0===Object.keys(r.x).length){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"])}Vk.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const Uk=t=>Vk(Object.assign(Object.assign({},t),{orientation:"horizontal"}));Uk.props=Object.assign(Object.assign({},Vk.props),{defaultPosition:"bottom"});const qk=t=>Vk(Object.assign(Object.assign({},t),{orientation:"vertical"}));qk.props=Object.assign(Object.assign({},Vk.props),{defaultPosition:"left"});const Xk=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=Oe(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 _b({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}))})}};Xk.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const Zk=t=>Xk(Object.assign(Object.assign({},t),{orientation:"horizontal"}));Zk.props=Object.assign(Object.assign({},Xk.props),{defaultPosition:"bottom"});const Kk=t=>Xk(Object.assign(Object.assign({},t),{orientation:"vertical"}));Kk.props=Object.assign(Object.assign({},Xk.props),{defaultPosition:"left"});const Qk=t=>()=>new Hp;Qk.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]=qc(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))}},tS=(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]=qc(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))}},eS=(t,e)=>{const n=1e-4,{coordinate:r}=e;return tg({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:Mf.NUMBER}),(e,i,o)=>{const[a]=e;return Xc(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=Am(r,d,[h,p]),{innerRadius:m,outerRadius:y}=g,v=hc().cornerRadius(s).padAngle(c*Math.PI/180),b=new qp({}),x=t=>(b.attr({d:v(t)}),md(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]=qc(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)}},nS=(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]=qc(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))}},rS=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))};rS.props={};const iS=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))};iS.props={};const oS={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},aS={[eu.CIRCLE]:["cx","cy","r"],[eu.ELLIPSE]:["cx","cy","rx","ry"],[eu.RECT]:["x","y","width","height"],[eu.IMAGE]:["x","y","width","height"],[eu.LINE]:["x1","y1","x2","y2"],[eu.POLYLINE]:["points"],[eu.POLYGON]:["points"]};function sS(t,e,n=!1){const r={};for(const i of e){const e=t.style[i];e?r[i]=e:n&&(r[i]=oS[i])}return r}const cS=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function lS(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function uS(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 fS(t,e){const[n,r,i,o]=lS(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(uS([t,o,e,l]))}f-=t,u+=1}return c}function dS(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function hS(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function pS(t){const e=md(t);if(e&&!function(t){return!hS(t,"m")||!hS(t,"M")}(e))return e}function gS(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=pS(e),s=pS(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;dS(e,t);let o=cS;if(t.nodeName===eu.GROUP){const[n,i,o,a]=lS(t),[s,c,l,u]=lS(e);r=`translate(${n-s}, ${i-c}) scale(${o/l}, ${a/u})`}else o=o.concat(aS[t.nodeName]||[]);const a=[Object.assign({transform:null!=r?r:"none"},sS(t,o,!0)),Object.assign({transform:null!=i?i:"none"},sS(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 qp({style:Object.assign(Object.assign({},sS(t,cS)),{d:e})});return dS(r,t),r}(t,a),l=[Object.assign({},sS(e,cS)),Object.assign({},sS(n,cS))];a!==s&&(l[0].d=a,l[1].d=s);const u=c.animate(l,r);return u.onfinish=()=>{const t=c.style.d;vr(c,n),c.style.d=t,c.style.transform="none"},c.style.transform="none",u}const mS=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:fS}(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 gS(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)=>gS(e,new qp({style:Object.assign({d:i[r]},sS(t,cS))}),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)=>gS(t,t,new qp({style:{d:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,o,i)}return null};mS.props={};const yS=(t,e)=>{const n=1e-4;tg({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:Mf.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!Xc(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=hc().cornerRadius(u).padAngle(f*Math.PI/180),b=Am(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}};yS.props={};const vS=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))},bS=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))},xS=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))};xS.props={};const wS=(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 qp({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)};wS.props={};const MS=(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 qp({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 eS(t,e)([f],r,i)};MS.props={};const OS="main-layer",ES="label-layer",kS="element",SS="view",AS="plot",_S="component",TS="label",PS="area";function CS(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 NS(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 LS(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&&Np(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&&Np(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 jS(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&&Np(i)&&a){var m=_e(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&&Np(o)&&s){var b=_e(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 RS(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&&Np(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&&Np(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 IS(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&&Np(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&&Np(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 BS(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=_e(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 DS=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.name="canvas-path-generator",e}return we(e,t),e.prototype.init=function(){var t,e=((t={})[eu.CIRCLE]=CS,t[eu.ELLIPSE]=NS,t[eu.RECT]=BS,t[eu.LINE]=LS,t[eu.POLYLINE]=IS,t[eu.POLYGON]=RS,t[eu.PATH]=jS,t[eu.TEXT]=void 0,t[eu.GROUP]=void 0,t[eu.IMAGE]=void 0,t[eu.HTML]=void 0,t[eu.MESH]=void 0,t);this.context.pathGeneratorFactory=e},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(iu),FS=Vt(),zS=Vt(),GS=Vt(),WS=ut(),$S=function(){function t(){var t=this;this.isHit=function(e,n,r,i){var o=t.context.pointInPathPickerFactory[e.nodeName];if(o){var a=mt(WS,r),s=ie(zS,Zt(GS,n[0],n[1],0),a);if(o(e,new Pu(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 ke(i,void 0,void 0,(function(){return Se(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=Zt(FS,a,s,0),l=t.elementsFromBBox(c[0],c[1],c[0],c[1]),u=[];try{for(var f=Ae(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=ph(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 HS(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=Rl(o,s,e.x,e.y),b=_e(vh(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 VS(t,e,n,r){return t/(n*n)+e/(r*r)}function YS(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=_e(vh(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?VS(E,k,c+O,l+O)<=1:w?VS(E,k,c,l)<=1:!!M&&(VS(E,k,c-O,l-O)>=1&&VS(E,k,c+O,l+O)<=1)}function US(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function qS(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 Rl(l.x,l.y,a,s)<=o/2}function XS(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&&Hl(t,e,n,r,o,a)<=i/2}function ZS(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(XS(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(XS(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}var KS=1e-6;function QS(t){return Math.abs(t)<KS?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 tA(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;QS(a[1]-n)>0!=QS(s[1]-n)>0&&QS(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function eA(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=tA(t[i],e,n))break}return r}function nA(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!(!_e(vh(void 0===d?"auto":d,r.fill,r.stroke),2)[1]&&!n||!l)&&XS(i,o,a,s,l+f,e.x,e.y)}function rA(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=_e(vh(g,(null==b?void 0:b.length)&&d,f),2),w=x[0],M=x[1],O=id(t),E=!1;return w||n?E=y?r(t,e):eA(b,e.x,e.y)||eA(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||US(d.x-a,d.y-a,d.width+e,d.height+e,n,r))switch(c.command){case"L":case"Z":if(o=XS(f[0],f[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(o=Jl(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=ql(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=Xe(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=ql(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 iA(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=_e(vh(void 0===f?"auto":f,o,i),2),h=d[0],p=!1;return(d[1]||n)&&(p=ZS(u.points,s+l,e.x,e.y,!0)),p||!h&&!n||(p=tA(u.points,e.x,e.y)),p}function oA(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!(!_e(vh(void 0===l?"auto":l,r.fill,r.stroke),2)[1]&&!n||!o)&&ZS(c.points,o+s,e.x,e.y,!1)}function aA(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=_e(vh(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=_e(i,4),l=c[0],u=c[1],f=c[2],d=c[3];return XS(t+l,e,t+n-u,e,o,a,s)||XS(t+n,e+u,t+n,e+r-f,o,a,s)||XS(t+n-f,e+r,t+d,e+r,o,a,s)||XS(t,e+r-d,t,e+l,o,a,s)||qS(t+n-u,e+u,u,Math.PI,Math.PI,o,a,s)||qS(t+n-f,e+r-f,f,0,Math.PI,o,a,s)||qS(t+d,e+r-d,d,Math.PI,Math.PI,o,a,s)||qS(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?US(p-k,m-k,y+k,v+k,e.x,e.y):w?US(p,m,y,v,e.x,e.y):!!M&&function(t,e,n,r,i,o,a){var s=i/2;return US(t-s,e-s,n,i,o,a)||US(t+n-s,e-s,i,r,o,a)||US(t+s,e+r-s,n,i,o,a)||US(t-s,e+s,i,r,o,a)}(p,m,y,v,O,e.x,e.y)}function sA(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[eu.IMAGE].render(y,Me(Me({},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 cA=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.name="canvas-picker",e}return we(e,t),e.prototype.init=function(){var t,e=((t={})[eu.CIRCLE]=HS,t[eu.ELLIPSE]=YS,t[eu.RECT]=aA,t[eu.LINE]=nA,t[eu.POLYLINE]=oA,t[eu.POLYGON]=iA,t[eu.PATH]=rA,t[eu.TEXT]=function(){return!0},t[eu.GROUP]=null,t[eu.IMAGE]=sA,t[eu.HTML]=null,t[eu.MESH]=null,t);this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new $S)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(iu),lA=function(){function t(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=ut(),this.dprMatrix=ut(),this.tmpMat4=ut(),this.vec3a=Vt(),this.vec3b=Vt(),this.vec3c=Vt(),this.vec3d=Vt()}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(cp.UNMOUNTED,d),f.addEventListener(cp.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(cp.UNMOUNTED,d),f.removeEventListener(cp.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(Et(r.dprMatrix,[e,e,1]),vt(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)p(s.root,t);else{var a=r.safeMergeAABB.apply(r,Te([r.mergeDirtyAABBs(r.renderQueue)],_e(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new Eu;return o.setMinMax([e,n,0],[r,i,0]),o}))),!1));if(r.removedRBushNodeAABBs=[],Eu.isEmpty(a))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(a),l=c.x,d=c.y,h=c.width,g=c.height,m=ie(r.vec3a,[l,d,0],r.vpMatrix),y=ie(r.vec3b,[l+h,d,0],r.vpMatrix),v=ie(r.vec3c,[l,d+g,0],r.vpMatrix),b=ie(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 rp(Lp.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)&op.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!==eu.LINE&&t.nodeName!==eu.PATH&&t.nodeName!==eu.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 Eu;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=_e(t.getMin(),2),n=e[0],r=e[1],i=_e(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 Eu);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?(dt(this.tmpMat4,e.getLocalTransform()),vt(this.tmpMat4,n,this.tmpMat4),vt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(dt(this.tmpMat4,e.getWorldTransform()),vt(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 Eu;return t.forEach((function(t){n.add(t)})),n},t.tag="CanvasRenderer",t}(),uA=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=!v(a)&&!a.isNone,S=!v(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===eu.PATH||P===eu.LINE||P===eu.POLYLINE||A||C);k&&(t.globalAlpha=l*f,N||fA(n,t,T),this.fill(t,n,a,s,r,i,o),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"),fA(n,t,!0),C&&(this.stroke(t,n,d,r,i,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,_,!0))),this.stroke(t,n,d,r,i,o))},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.prototype.fill=function(t,e,n,r,i,o,a){var s=this;Array.isArray(n)?n.forEach((function(n){t.fillStyle=s.getColor(n,e,t),r?t.fill(r):t.fill()})):(jf(n)&&(t.fillStyle=this.getPattern(n,e,t,i,o,a)),r?t.fill(r):t.fill())},t.prototype.stroke=function(t,e,n,r,i,o){var a=this;Array.isArray(n)?n.forEach((function(n){t.strokeStyle=a.getColor(n,e,t),t.stroke()})):(jf(n)&&(t.strokeStyle=this.getPattern(n,e,t,r,i,o)),t.stroke())},t.prototype.getPattern=function(t,e,n,r,i,o){var a,s;if("rect"===t.image.nodeName){var c=t.image.parsedStyle,l=c.width,u=c.height;s=r.contextService.getDPR();var f=r.config.offscreenCanvas;(a=o.offscreenCanvasCreator.getOrCreateCanvas(f)).width=l*s,a.height=u*s;var d=o.offscreenCanvasCreator.getOrCreateContext(f),h=[];t.image.forEach((function(t){i.renderDisplayObject(t,d,r,h,o)})),h.forEach((function(){d.restore()}))}return this.imagePool.getOrCreatePatternSync(t,n,a,s,e.getGeometryBounds().min,(function(){e.renderable.dirty=!0,r.renderingService.dirtify()}))},t.prototype.getColor=function(t,e,n){var r;if(t.type===Vu.LinearGradient||t.type===Vu.RadialGradient){var i=e.getGeometryBounds(),o=i&&2*i.halfExtents[0]||1,a=i&&2*i.halfExtents[1]||1,s=i&&i.min||[0,0];r=this.imagePool.getOrCreateGradient(Me(Me({type:t.type},t.value),{min:s,width:o,height:a}),n)}return r},t}();function fA(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)}var dA=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){fA(n,t,!v(f)&&d>0);try{t.drawImage(r,o,s,h,p)}catch(t){}}},t}(),hA=function(){function 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.fillOpacity,O=void 0===M?1:M,E=a.strokeOpacity,k=void 0===E?1:E,S=a.opacity,A=void 0===S?1:S,_=a.metrics,T=a.x,P=void 0===T?0:T,C=a.y,N=void 0===C?0:C,L=a.dx,j=a.dy,R=a.shadowColor,I=a.shadowBlur,B=_.font,D=_.lines,F=_.height,z=_.lineHeight,G=_.lineMetrics;t.font=B,t.lineWidth=c,t.textAlign="middle"===u?"center":u;var W=d;o.enableCSSParsing||"alphabetic"!==W||(W="bottom"),t.lineJoin=p,v(m)||(t.miterLimit=m);var $=N;"middle"===d?$+=-F/2-z/2:"bottom"===d||"alphabetic"===d||"ideographic"===d?$+=-F:"top"!==d&&"hanging"!==d||($+=-z);var H=P+(L||0);$+=j||0,1===D.length&&("bottom"===W?(W="middle",$-=.5*F):"top"===W&&(W="middle",$+=.5*F)),t.textBaseline=W,fA(n,t,!v(R)&&I>0);for(var V=0;V<D.length;V++){var Y=c/2+H;$+=z,v(x)||x.isNone||!c||this.drawLetterSpacing(t,D[V],G[V],u,Y,$,b,O,k,A,!0),v(w)||this.drawLetterSpacing(t,D[V],G[V],u,Y,$,b,O,k,A)}},t.prototype.drawLetterSpacing=function(t,e,n,r,i,o,a,s,c,l,u){if(void 0===u&&(u=!1),0!==a){var f=t.textAlign;t.textAlign="left";var d=i;"center"===r||"middle"===r?d=i-n.width/2:"right"!==r&&"end"!==r||(d=i-n.width);for(var h=Array.from(e),p=t.measureText(e).width,g=0,m=0;m<h.length;++m){var y=h[m];u?this.strokeText(t,y,d,o,c):this.fillText(t,y,d,o,s,l),d+=p-(g=t.measureText(e.substring(m+1)).width)+a,p=g}t.textAlign=f}else u?this.strokeText(t,e,i,o,c):this.fillText(t,e,i,o,s,l)},t.prototype.fillText=function(t,e,n,r,i,o){var a,s=!v(i)&&1!==i;s&&(a=t.globalAlpha,t.globalAlpha=i*o),t.fillText(e,n,r),s&&(t.globalAlpha=a)},t.prototype.strokeText=function(t,e,n,r,i){var o,a=!v(i)&&1!==i;a&&(o=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),a&&(t.globalAlpha=o)},t}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}we(e,t)}(uA),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}we(e,t)}(uA),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}we(e,t)}(uA),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}we(e,t)}(uA),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}we(e,t)}(uA),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}we(e,t)}(uA),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}we(e,t)}(uA);var pA=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 we(e,t),e.prototype.init=function(){var t,e=Me({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new uA(n),i=((t={})[eu.CIRCLE]=r,t[eu.ELLIPSE]=r,t[eu.RECT]=r,t[eu.IMAGE]=new dA(n),t[eu.TEXT]=new hA,t[eu.LINE]=r,t[eu.POLYLINE]=r,t[eu.POLYGON]=r,t[eu.PATH]=r,t[eu.GROUP]=void 0,t[eu.HTML]=void 0,t[eu.MESH]=void 0,t);this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new lA(e))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(iu),gA=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}(),mA=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.name="dom-interaction",e}return we(e,t),e.prototype.init=function(){this.addRenderingPlugin(new gA)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(iu),yA=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===eu.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===eu.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),c.delete(n))}},d=function(t){var e=t.target;if(e.nodeName===eu.HTML){var n=t.attrName;r.updateAttribute(n,e)}},h=function(t){var e=t.target;if(e.nodeName===eu.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(Lp.RESIZE,p),s.addEventListener(cp.MOUNTED,u),s.addEventListener(cp.UNMOUNTED,f),s.addEventListener(cp.ATTR_MODIFIED,d),s.addEventListener(cp.BOUNDS_CHANGED,h)})),a.hooks.endFrame.tap(t.tag,(function(){r.$camera&&o.renderReasons.has(Qh.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),a.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(Lp.RESIZE,p),s.removeEventListener(cp.MOUNTED,u),s.removeEventListener(cp.UNMOUNTED,f),s.removeEventListener(cp.ATTR_MODIFIED,d),s.removeEventListener(cp.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="";Rf(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="";Rf(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}(),vA=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.name="html-renderer",e}return we(e,t),e.prototype.init=function(){this.addRenderingPlugin(new yA)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(iu),bA=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):fh&&(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?zh(Ad(u),new zp({})):pt(ut()),f&&xt(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===Vu.LinearGradient){var h=function(t,e,n,r){var i=du(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===Vu.RadialGradient){var v=function(t,e,n,r,i,o){var a=r.value,s=i.value;r.unit===ju.kPercentage&&(a=r.value/100*e),i.unit===ju.kPercentage&&(s=i.value/100*n);var c=Math.max(tn([0,0],[a,s]),tn([0,n],[a,s]),tn([e,n],[a,s]),tn([e,0],[a,s]));return o&&(o instanceof sf?c=o.value:o instanceof Qu&&("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(tn([0,0],[a,s]),tn([0,n],[a,s]),tn([e,n],[a,s]),tn([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===ju.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}(),xA=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===eu.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===eu.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(cp.MOUNTED,s),o.addEventListener(cp.ATTR_MODIFIED,c)})),n.hooks.destroy.tap(t.tag,(function(){o.removeEventListener(cp.MOUNTED,s),o.removeEventListener(cp.ATTR_MODIFIED,c)}))},t.tag="LoadImage",t}(),wA=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.name="image-loader",e}return we(e,t),e.prototype.init=function(){this.context.imagePool=new bA(this.context.config),this.addRenderingPlugin(new xA)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(iu),MA=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||fh&&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){fh&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(Qh.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={}),ke(this,void 0,void 0,(function(){var e,n;return Se(this,(function(r){return e=t.type,n=t.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]}))}))},t}(),OA=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.name="canvas-context-register",e}return we(e,t),e.prototype.init=function(){this.context.ContextService=MA},e.prototype.destroy=function(){delete this.context.ContextService},e}(iu),EA=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new OA),n.registerPlugin(new wA),n.registerPlugin(new DS),n.registerPlugin(new pA),n.registerPlugin(new mA),n.registerPlugin(new cA),n.registerPlugin(new vA),n}return we(e,t),e}(ou),kA=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 ke(n,void 0,void 0,(function(){var n,o,d,h,p,g;return Se(this,(function(m){switch(m.label){case 0:if(!s){if(n=t.timeStamp-c,o=tn([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}(),SA=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="dragndrop",n}return we(e,t),e.prototype.init=function(){this.addRenderingPlugin(new kA(Me({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}(iu),AA=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}(),_A=AA;const TA={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"},PA=[["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"]]]]];function CA(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):ho}function NA(t){return t instanceof Float32Array||t instanceof Array}var 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=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 RA(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var IA=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},BA=function(t,e,n,r,i){var o,a,s=IA(t,2),c=s[0],l=s[1],u=ct();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},DA=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},FA=function(t,e,n,r,i){var o=new ga({range:[e,e+r]}),a=new ga({range:[n,n+i]});return{transform:function(t){var e=DA(t,2),n=e[0],r=e[1];return[o.map(n),a.map(r)]},untransform:function(t){var e=DA(t,2),n=e[0],r=e[1];return[o.invert(n),a.invert(r)]}}},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},GA=function(t,e,n,r,i){return(0,zA(t,1)[0])(e,n,r,i)},WA=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},$A=function(t,e,n,r,i){return WA(t,1)[0]},HA=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},VA=function(t,e,n,r,i){var o=HA(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new ga({range:[c,l]}),f=new ga({range:[a,s]}),d=i/r,h=d>1?1:d,p=d>1?1/d:1;return{transform:function(t){var e=HA(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=HA(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=RA(Math.atan2(o,i),a,s);return[f.invert(l),u.invert(c)]}}},YA=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},UA=function(t,e,n,r,i){return{transform:function(t){var e=YA(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=YA(t,2),n=e[0];return[e[1],n]}}},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,a,s=qA(t,2),c=s[0],l=s[1],u=ct();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},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=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))},QA=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return XA.apply(void 0,KA([[-1,-1]],ZA(e),!1))},JA=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return XA.apply(void 0,KA([[-1,1]],ZA(e),!1))},t_=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return XA.apply(void 0,KA([[1,-1]],ZA(e),!1))},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},n_=function(t,e,n,r,i){var o=e_(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}(ct(),o)},r_=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},i_=function(t,e,n,r,i){var o=r_(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 ga({range:[c,c+.99*l]}),d=new ga({range:[a,s]}),h=i/r,p=h>1?1:h,g=h>1?1/h:1;return{transform:function(t){var e=r_(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=r_(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=RA(Math.atan2(o,i)+Math.floor(c/l)*Math.PI*2,a,s),m=c-u*h;return[d.invert(h),f.invert(m)]}}},o_=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},a_=function(t,e,n,r,i){var o=o_(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new ga({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new ma({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}}},s_=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 c_(t){return 1/Math.tan(t)}var l_=function(t,e,n,r,i){var o=c_(s_(t,1)[0]);return{transform:function(t){var e=s_(t,2),n=e[0],r=e[1];return[n+r*o,r]},untransform:function(t){var e=s_(t,2),n=e[0],r=e[1];return[n-r*o,r]}}},u_=function(t,e,n,r,i){var o=c_(s_(t,1)[0]);return{transform:function(t){var e=s_(t,2),n=e[0];return[n,e[1]+n*o]},untransform:function(t){var e=s_(t,2),n=e[0];return[n,e[1]-n*o]}}},f_=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 d_(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 h_(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 p_(t,e,n){return n?new ga({range:[0,1],domain:[0,e]}).map(t):t}var g_=function(t,e,n,r,i){var o=f_(t,3),a=o[0],s=o[1],c=o[2],l=p_(a,r,void 0!==c&&c);return{transform:function(t){var e=f_(t,2),n=e[0],r=e[1];return[d_(n,l,s,0,1),r]},untransform:function(t){var e=f_(t,2),n=e[0],r=e[1];return[h_(n,l,s,0,1),r]}}},m_=function(t,e,n,r,i){var o=f_(t,3),a=o[0],s=o[1],c=o[2],l=p_(a,i,void 0!==c&&c);return{transform:function(t){var e=f_(t,2);return[e[0],d_(e[1],l,s,0,1)]},untransform:function(t){var e=f_(t,2);return[e[0],h_(e[1],l,s,0,1)]}}},y_=function(t,e,n,r,i){var o=f_(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,d=p_(a,r,f),h=p_(s,i,f);return{transform:function(t){var e=f_(t,2),n=e[0],r=e[1];return[d_(n,d,c,0,1),d_(r,h,l,0,1)]},untransform:function(t){var e=f_(t,2),n=e[0],r=e[1];return[h_(n,d,c,0,1),h_(r,h,l,0,1)]}}},v_=function(t,e,n,r,i){var o=f_(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,d=new ga({range:[0,r]}),h=new ga({range:[0,i]}),p=f?a:d.map(a),g=f?s:h.map(s);return{transform:function(t){var e=f_(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=d_(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=f_(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=h_(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)]}}},b_=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},x_=function(t,e,n,r,i,o,a){var s=new ga({range:[e,e+i]}),c=new ga({range:[n,n+o]}),l=new ga({range:[r,r+a]});return{transform:function(t){var e=b_(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=b_(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},w_=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},M_=function(t,e,n,r,i,o,a){var s=w_(t,3),c=s[0],l=s[1],u=s[2];return Ot(ut(),[c,l,u])},O_=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},E_=function(t,e,n,r,i,o,a){return{transform:function(t){var e=O_(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=O_(t,3),n=e[0];return[e[1],n,e[2]]}}},k_=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},S_=function(t,e,n,r,i,o,a){var s=k_(t,3),c=s[0],l=s[1],u=s[2];return Et(ut(),[c,l,u])},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},__=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))},T_=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.")},P_=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:FA,translate:BA,custom:GA,matrix:$A,polar:VA,transpose:UA,scale:XA,"shear.x":l_,"shear.y":u_,reflect:QA,"reflect.x":JA,"reflect.y":t_,rotate:n_,helix:i_,parallel:a_,fisheye:y_,"fisheye.x":g_,"fisheye.y":m_,"fisheye.circular":v_},this.update(t)}return t.prototype.update=function(t){this.options=uo({},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:__(__([],A_(n),!1),[__([],A_(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?__([],A_(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,jA([],LA(o),!1))}return n}}(t):t)};try{for(var c=T_(r),l=c.next();!l.done;l=c.next()){var u=A_(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(__([],A_(d),!1),g,m,y,v);if(NA(b))o.push(b);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(b)||ho,"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 CA.apply(void 0,__([],A_(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n,r,i=ct();return e&&t.reverse(),t.forEach((function(t){return lt(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 st(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 oe(e,e,i),[e[0],e[1]]}},t}(),C_=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},N_=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))},L_=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.")},j_=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:x_,translate3D:M_,scale3D:S_,transpose3D:E_},this.update(t)}return t.prototype.update=function(t){this.options=uo({},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:N_(N_([],C_(n),!1),[N_([],C_(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?N_([],C_(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,jA([],LA(o),!1))}return n}}(t):t)};try{for(var c=L_(r),l=c.next();!l.done;l=c.next()){var u=C_(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(N_([],C_(d),!1),g,m,y,v,b,x);if(NA(w))o.push(w);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(w)||ho,!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 CA.apply(void 0,N_([],C_(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=ut();return e&&t.reverse(),t.forEach((function(t){return Wt(n,n,t)})),e&&mt(n,ft(n)),function(t){var e=[t[0],t[1],t[2],1];return ue(e,e,n),[e[0],e[1],e[2]]}},t}();function R_(t){return(e,...n)=>Z({},t(e,...n),e)}function I_(t){return(e,...n)=>Z({},e,t(e,...n))}function B_(t,e){if(!t)return e;if(Array.isArray(t))return t;const{value:n=e}=t,r=Oe(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}const D_=()=>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=Oe(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:B_(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})}))};D_.props={};const F_=()=>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=Oe(r,["data"]),g=B_(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};F_.props={};const z_=()=>t=>{const{children:e}=t,n=Oe(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:c=[]}=n,l=Oe(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=Oe(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:B_(e,r),scale:Z({},i,n),encode:Z({},s,f),transform:[...c,...d],axis:!(!l||!o)&&Z({},o,l),legend:!(!u||!a)&&Z({},a,u)},h)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};z_.props={};const G_=({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=Oe(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})]})]};G_.props={};class W_{constructor(t){this.$value=t}static of(t){return new W_(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const $_=R_((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=Gn(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"))}}})),H_=R_((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))?[In(a)]:[Array.from(new Set(a)),"ordinal"]})();return{encode:{color:i},scale:{color:Z({},o,{domain:c,type:l})},legend:{color:Z({title:s},a)}}})),V_=R_((()=>({animate:{enterType:"fadeIn"}}))),Y_=I_((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),U_=I_((()=>({type:"cell"}))),q_=I_((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]}}})),X_=I_(((t,e=Z_,n=Q_,r=J_,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=Tr(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?ir(_,(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=Oe(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:tT(N,n)(c,j),y:tT(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:Z(L,E,R),axis:Z({},A,I),legend:!1},P),i)}))}))}}}));function Z_(t){const{points:e}=t;return Ts(e)}function K_(t,e){return e.length?Z({title:!1,tick:null,label:null},t):Z({title:!1,tick:null,label:null,grid:null},t)}function Q_(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return K_(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return Z({title:s,grid:c},t)}}function J_(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return K_(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return Z({title:o,grid:a},t)}}function tT(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const eT=()=>t=>[W_.of(t).call(U_).call(H_).call(V_).call($_).call(Y_).call(q_).call(X_).value()];eT.props={};const nT=R_((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),rT=I_((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=Tr(t),y=t.map((({points:t})=>Ts(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=Oe(m,["scale","key","encode","axis","interaction"]),k=null===(y=null==b?void 0:b.y)||void 0===y?void 0:y.guide,S={x:oT(null===(v=null==b?void 0:b.x)||void 0===v?void 0:v.guide)(g,e),y:aT(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:Z({x:{facet:!1},y:{facet:!1}},b),axis:Z({x:{tickCount:5},y:{tickCount:5}},M,S),legend:!1,encode:Z({},w,{x:l,y:p}),interaction:Z({},O,{legendFilter:!1})},E)}))}))}}})),iT=I_((t=>{const{encode:e}=t,n=Oe(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=Oe(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 oT(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return K_(t,n)}}function aT(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return K_(t,n)}}const sT=()=>t=>[W_.of(t).call(U_).call(H_).call(rT).call(iT).call(V_).call(Y_).call(nT).value()],cT=R_((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),lT=R_((t=>({coordinate:{type:"polar"}}))),uT=t=>{const{encode:e}=t,n=Oe(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function fT(t){return t=>null}function dT(t){const{points:e}=t,[n,r,i,o]=e,a=ks(n,o),s=Os(n,o),c=_s(s,Os(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[d,h]=i,p=As(s)+c/2,g=u*l;return[d+g*Math.sin(p)-f/2,h-g*Math.cos(p)-f/2,f,f]}const hT=()=>t=>[W_.of(t).call(U_).call(uT).call(H_).call(lT).call(q_).call(X_,dT,fT,fT,{frame:!1}).call(V_).call(Y_).call(cT).value()];function pT(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 gT=()=>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=Z({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]=pT(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 mT(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 yT(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=hj(o,(t=>"element"===t.className));const c=function(t){return hj(t,(t=>"component"===t.className))}(o),l=function(t){return hj(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:mT(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 vT(){return(t,e,n)=>{const{container:r,view:i}=t,o=yT(TA.CLICK,i,n,(t=>1===t.detail)),a=yT(TA.DBLCLICK,i,n,(t=>2===t.detail)),s=yT(TA.POINTER_TAP,i,n),c=yT(TA.POINTER_DOWN,i,n),l=yT(TA.POINTER_UP,i,n),u=yT(TA.POINTER_OVER,i,n),f=yT(TA.POINTER_OUT,i,n),d=yT(TA.POINTER_MOVE,i,n),h=yT(TA.POINTER_ENTER,i,n),p=yT(TA.POINTER_LEAVE,i,n),g=yT(TA.POINTER_UPOUTSIDE,i,n),m=yT(TA.DRAG_START,i,n),y=yT(TA.DRAG,i,n),v=yT(TA.DRAG_END,i,n),b=yT(TA.DRAG_ENTER,i,n),x=yT(TA.DRAG_LEAVE,i,n),w=yT(TA.DRAG_OVER,i,n),M=yT(TA.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 bT(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":Ok,"component.axisLinear":vk,"component.axisArc":bk,"component.legendContinuousBlock":Lk,"component.legendContinuousBlockSize":Rk,"component.legendContinuousSize":jk,"interaction.event":vT,"composition.mark":G_,"composition.view":z_,"shape.label.label":cM}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||yr(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=Oe(t,["type"]);n||yr("Plot type is required!");const o=r(n);return null==o?void 0:o(i,e)},r]}function xT(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||yr("Cannot find library document")}function wT(t,e){const{coordinate:n={}}=t,r=Oe(t,["coordinate"]),{type:i,transform:o=[]}=n,a=Oe(n,["type","transform"]);if(!i)return Object.assign(Object.assign({},r),{coordinates:o});const[,s]=bT("coordinate",e),{transform:c=!1}=s(i).props||{};if(c)throw new Error(`Unknown coordinate: ${i}.`);return Object.assign(Object.assign({},r),{coordinates:[Object.assign({type:i},a),...o]})}function MT(t,e){return t.filter((t=>t.type===e))}function OT(t){return MT(t,"polar").length>0}function ET(t){return MT(t,"transpose").length%2==1}function kT(t){return MT(t,"theta").length>0}function ST(t){return MT(t,"radial").length>0}function AT(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}gT.props={},vT.props={reapplyWhenUpdate:!0};var _T=AT("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),TT=AT("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),PT=AT("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),CT=AT("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),NT=AT("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),LT=AT("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),jT=AT("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),RT=AT("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),IT=AT("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),BT=AT("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),DT=AT("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function FT(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function zT(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function GT(){}var WT=.7,$T=1/WT,HT="\\s*([+-]?\\d+)\\s*",VT="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",YT="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",UT=/^#([0-9a-f]{3,8})$/,qT=new RegExp(`^rgb\\(${HT},${HT},${HT}\\)$`),XT=new RegExp(`^rgb\\(${YT},${YT},${YT}\\)$`),ZT=new RegExp(`^rgba\\(${HT},${HT},${HT},${VT}\\)$`),KT=new RegExp(`^rgba\\(${YT},${YT},${YT},${VT}\\)$`),QT=new RegExp(`^hsl\\(${VT},${YT},${YT}\\)$`),JT=new RegExp(`^hsla\\(${VT},${YT},${YT},${VT}\\)$`),tP={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 eP(){return this.rgb().formatHex()}function nP(){return this.rgb().formatRgb()}function rP(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=UT.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?iP(e):3===n?new cP(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?oP(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?oP(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=qT.exec(t))?new cP(e[1],e[2],e[3],1):(e=XT.exec(t))?new cP(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ZT.exec(t))?oP(e[1],e[2],e[3],e[4]):(e=KT.exec(t))?oP(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=QT.exec(t))?pP(e[1],e[2]/100,e[3]/100,1):(e=JT.exec(t))?pP(e[1],e[2]/100,e[3]/100,e[4]):tP.hasOwnProperty(t)?iP(tP[t]):"transparent"===t?new cP(NaN,NaN,NaN,0):null}function iP(t){return new cP(t>>16&255,t>>8&255,255&t,1)}function oP(t,e,n,r){return r<=0&&(t=e=n=NaN),new cP(t,e,n,r)}function aP(t){return t instanceof GT||(t=rP(t)),t?new cP((t=t.rgb()).r,t.g,t.b,t.opacity):new cP}function sP(t,e,n,r){return 1===arguments.length?aP(t):new cP(t,e,n,null==r?1:r)}function cP(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function lP(){return`#${hP(this.r)}${hP(this.g)}${hP(this.b)}`}function uP(){const t=fP(this.opacity);return`${1===t?"rgb(":"rgba("}${dP(this.r)}, ${dP(this.g)}, ${dP(this.b)}${1===t?")":`, ${t})`}`}function fP(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function dP(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function hP(t){return((t=dP(t))<16?"0":"")+t.toString(16)}function pP(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new mP(t,e,n,r)}function gP(t){if(t instanceof mP)return new mP(t.h,t.s,t.l,t.opacity);if(t instanceof GT||(t=rP(t)),!t)return new mP;if(t instanceof mP)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 mP(a,s,c,t.opacity)}function mP(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function yP(t){return(t=(t||0)%360)<0?t+360:t}function vP(t){return Math.max(0,Math.min(1,t||0))}function bP(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}FT(GT,rP,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:eP,formatHex:eP,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return gP(this).formatHsl()},formatRgb:nP,toString:nP}),FT(cP,sP,zT(GT,{brighter(t){return t=null==t?$T:Math.pow($T,t),new cP(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?WT:Math.pow(WT,t),new cP(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new cP(dP(this.r),dP(this.g),dP(this.b),fP(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:lP,formatHex:lP,formatHex8:function(){return`#${hP(this.r)}${hP(this.g)}${hP(this.b)}${hP(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:uP,toString:uP})),FT(mP,(function(t,e,n,r){return 1===arguments.length?gP(t):new mP(t,e,n,null==r?1:r)}),zT(GT,{brighter(t){return t=null==t?$T:Math.pow($T,t),new mP(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?WT:Math.pow(WT,t),new mP(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 cP(bP(t>=240?t-240:t+120,i,r),bP(t,i,r),bP(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new mP(yP(this.h),vP(this.s),vP(this.l),fP(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=fP(this.opacity);return`${1===t?"hsl(":"hsla("}${yP(this.h)}, ${100*vP(this.s)}%, ${100*vP(this.l)}%${1===t?")":`, ${t})`}`}}));const xP=Math.PI/180,wP=180/Math.PI;var MP=-.14861,OP=1.78277,EP=-.29227,kP=-.90649,SP=1.97294,AP=SP*kP,_P=SP*OP,TP=OP*EP-kP*MP;function PP(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof CP)return new CP(t.h,t.s,t.l,t.opacity);t instanceof cP||(t=aP(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(TP*r+AP*e-_P*n)/(TP+AP-_P),o=r-i,a=(SP*(n-i)-EP*o)/kP,s=Math.sqrt(a*a+o*o)/(SP*i*(1-i)),c=s?Math.atan2(a,o)*wP-120:NaN;return new CP(c<0?c+360:c,s,i,t.opacity)}(t):new CP(t,e,n,null==r?1:r)}function CP(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}FT(CP,PP,zT(GT,{brighter(t){return t=null==t?$T:Math.pow($T,t),new CP(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?WT:Math.pow(WT,t),new CP(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*xP,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new cP(255*(e+n*(MP*r+OP*i)),255*(e+n*(EP*r+kP*i)),255*(e+n*(SP*r)),this.opacity)}}));var NP=t=>()=>t;function LP(t,e){return function(n){return t+n*e}}function jP(t){return 1==(t=+t)?RP: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):NP(isNaN(e)?n:e)}}function RP(t,e){var n=e-t;return n?LP(t,n):NP(isNaN(t)?e:t)}!function t(e){var n=jP(e);function r(t,e){var r=n((t=sP(t)).r,(e=sP(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=RP(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 IP,BP=(IP=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=sP(t[e]),i[e]=n.r||0,o[e]=n.g||0,a[e]=n.b||0;return i=IP(i),o=IP(o),a=IP(a),n.opacity=1,function(t){return n.r=i(t),n.g=o(t),n.b=a(t),n+""}});function DP(t){return function e(n){function r(e,r){var i=t((e=PP(e)).h,(r=PP(r)).h),o=RP(e.s,r.s),a=RP(e.l,r.l),s=RP(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)}DP((function(t,e){var n=e-t;return n?LP(t,n>180||n<-180?n-360*Math.round(n/360):n):NP(isNaN(t)?e:t)}));var FP=DP(RP),zP=t=>BP(t[t.length-1]),GP=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(AT),WP=zP(GP),$P=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(AT),HP=zP($P),VP=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(AT),YP=zP(VP),UP=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(AT),qP=zP(UP),XP=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(AT),ZP=zP(XP),KP=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(AT),QP=zP(KP),JP=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(AT),tC=zP(JP),eC=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(AT),nC=zP(eC),rC=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(AT),iC=zP(rC),oC=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(AT),aC=zP(oC),sC=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(AT),cC=zP(sC),lC=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(AT),uC=zP(lC),fC=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(AT),dC=zP(fC),hC=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(AT),pC=zP(hC),gC=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(AT),mC=zP(gC),yC=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(AT),vC=zP(yC),bC=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(AT),xC=zP(bC),wC=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(AT),MC=zP(wC),OC=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(AT),EC=zP(OC),kC=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(AT),SC=zP(kC),AC=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(AT),_C=zP(AC),TC=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(AT),PC=zP(TC),CC=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(AT),NC=zP(CC),LC=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(AT),jC=zP(LC),RC=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(AT),IC=zP(RC),BC=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(AT),DC=zP(BC),FC=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(AT),zC=zP(FC);var GC=FP(PP(300,.5,0),PP(-240,.5,1)),WC=FP(PP(-100,.75,.35),PP(80,1.5,.8)),$C=FP(PP(260,.75,.35),PP(80,1.5,.8)),HC=PP();var VC=sP(),YC=Math.PI/3,UC=2*Math.PI/3;function qC(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var XC=qC(AT("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),ZC=qC(AT("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),KC=qC(AT("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),QC=qC(AT("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),JC=Object.freeze({__proto__:null,schemeCategory10:_T,schemeAccent:TT,schemeDark2:PT,schemeObservable10:CT,schemePaired:NT,schemePastel1:LT,schemePastel2:jT,schemeSet1:RT,schemeSet2:IT,schemeSet3:BT,schemeTableau10:DT,interpolateBrBG:WP,schemeBrBG:GP,interpolatePRGn:HP,schemePRGn:$P,interpolatePiYG:YP,schemePiYG:VP,interpolatePuOr:qP,schemePuOr:UP,interpolateRdBu:ZP,schemeRdBu:XP,interpolateRdGy:QP,schemeRdGy:KP,interpolateRdYlBu:tC,schemeRdYlBu:JP,interpolateRdYlGn:nC,schemeRdYlGn:eC,interpolateSpectral:iC,schemeSpectral:rC,interpolateBuGn:aC,schemeBuGn:oC,interpolateBuPu:cC,schemeBuPu:sC,interpolateGnBu:uC,schemeGnBu:lC,interpolateOrRd:dC,schemeOrRd:fC,interpolatePuBuGn:pC,schemePuBuGn:hC,interpolatePuBu:mC,schemePuBu:gC,interpolatePuRd:vC,schemePuRd:yC,interpolateRdPu:xC,schemeRdPu:bC,interpolateYlGnBu:MC,schemeYlGnBu:wC,interpolateYlGn:EC,schemeYlGn:OC,interpolateYlOrBr:SC,schemeYlOrBr:kC,interpolateYlOrRd:_C,schemeYlOrRd:AC,interpolateBlues:PC,schemeBlues:TC,interpolateGreens:NC,schemeGreens:CC,interpolateGreys:jC,schemeGreys:LC,interpolatePurples:IC,schemePurples:RC,interpolateReds:DC,schemeReds:BC,interpolateOranges:zC,schemeOranges:FC,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:GC,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return HC.h=360*t-100,HC.s=1.5-1.5*e,HC.l=.8-.9*e,HC+""},interpolateWarm:WC,interpolateCool:$C,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,VC.r=255*(e=Math.sin(t))*e,VC.g=255*(e=Math.sin(t+YC))*e,VC.b=255*(e=Math.sin(t+UC))*e,VC+""},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:XC,interpolateMagma:ZC,interpolateInferno:KC,interpolatePlasma:QC});function tN(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 mN(t,kr)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return fN(t,s);if(void 0!==i)return pN([i])?fN(t,s):gN(e)?"time":dN(t,o,a);return pN(e)?fN(t,s):gN(e)?"time":dN(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 hN(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)br(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 hN(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)br(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(sN({type:t}))return function(t,e,n){const r=t.map(Number),i=new ga({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 cN({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=Do,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?kT(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=JC[`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:lN(s,t,e,n,l,i,o),expectedDomain:c,guide:a,name:t,type:s})}function eN(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 nN(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=ir(i)+1,a=`${e}${o}`;t[a]=r,r.getOptions().key=a}else t[e]=r}return t}function rN(t,e){const[n]=bT("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[pr,pr];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 iN(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));aN(e,"x"),aN(e,"y")}function oN(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 aN(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(sN)?In(r):n.every(cN)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function sN(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function cN(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function lN(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=uN(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?[Pr(e),Cr(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 uN(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function uN(t,e,n,r,i){const[o]=bT("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=JC[`scheme${r}`],o=JC[`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 fN(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function dN(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function hN(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 pN(t){return mN(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function gN(t){return mN(t,(t=>t instanceof Date))}function mN(t,e){for(const n of t)if(n.some(e))return!0;return!1}const yN={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},vN={threshold:"threshold",quantize:"quantize",quantile:"quantile"},bN={ordinal:"ordinal",band:"band",point:"point"},xN={constant:"constant"};function wN(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=bT("component",n),a=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=bT("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?ET(n)?`${e}Y`:`${e}X`:"y"===t?ET(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[...EN(n),...SN(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=Z({},...e),{guide:m,field:y}=g,v=Array.isArray(m)?m:[m];for(const n of v){const[o,g]=TN(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 MN(t,e,n,r,i){const[o]=bT("component",r),{scaleInstances:a,scale:s,bbox:c}=t,l={bbox:c,library:r};return o(Oe(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:a,theme:n,value:l,scale:s})}function ON(t,e){const n=["left","right","bottom","top"],r=Wn(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=hr(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=ir(t,(t=>t.size)),r=ir(t,(t=>t.order)),i=ir(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function EN(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=Wn(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(...Lr(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,kN(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 PA)for(const{option:r,combination:i}of n)if(e.some((t=>Q(s(t),s(r)))))return[t,i];return null})).filter(br);return c}function kN(t){const{type:e}=t;return"string"!=typeof e?null:e in yN?"continuous":e in bN?"discrete":e in vN?"distribution":e in xN?"constant":null}function SN(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return MT(t,"helix").length>0}(e)||kT(e))return null;if(ET(e)&&(OT(e)||ST(e)))return null;if(n.startsWith("x"))return OT(e)?["axisArc",[t]]:ST(e)?["axisLinear",[t]]:[ET(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return OT(e)?["axisLinear",[t]]:ST(e)?["axisArc",[t]]:[ET(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(function(t){return MT(t,"radar").length>0}(e))return["axisRadar",[t]];if(!OT(e))return["axisY",[t]]}return null})).filter(br)}function AN(t){const e=MT(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=MT(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 _N(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]=AN(i);return["center",(a-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return MT(t,"parallel").length>0}(i))return ET(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=AN(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:OT(i)||ST(i)?["center",null]:"axisX"===t&&function(t){return MT(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return MT(t,"reflectY").length>0}(i)?["top",null]:e}function TN(t,e,n,r,i,o,a){const[s]=AN(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?_N(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&OT(a)&&"center"===r.position?["center","vertical"]:c}function PN(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")?RN:s.startsWith("group")?CN:s.startsWith("legendContinuous")?IN:"legendCategory"===s?BN:s.startsWith("slider")?jN:"title"===s?LN:s.startsWith("scrollbar")?NN:()=>{})(t,e,n,r,i,o)}function CN(t,e,n,r,i,o){const{children:a}=t,s=ir(a,(t=>t.crossPadding));a.forEach((t=>t.crossPadding=s)),a.forEach((t=>PN(t,e,n,r,i,o)));const c=ir(a,(t=>t.size));t.size=c,a.forEach((t=>t.size=c))}function NN(t,e,n,r,i,o){const{trackSize:a=6}=Z({},i.scrollbar,t);t.size=a}function LN(t,e,n,r,i,o){const a=Z({},i.title,t),{title:s,subtitle:c,spacing:l=0}=a,u=Oe(a,["title","subtitle","spacing"]);if(s){const e=$N(s,wr(u,"title"));t.size=e.height}if(c){const e=$N(c,wr(u,"subtitle"));t.size+=l+e.height}}function jN(t,e,n,r,i,o){const{trackSize:a,handleIconSize:s}=(()=>{const{slider:e}=i;return Z({},e,t)})(),c=Math.max(a,2.4*s);t.size=c}function RN(t,e,n,r,i,o){t.transform=t.transform||[{type:"hide"}];const a="left"===r||"right"===r,s=GN(t,r,i),{tickLength:c=0,labelSpacing:l=0,titleSpacing:u=0,labelAutoRotate:f}=s,d=Oe(s,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),h=DN(t,o),p=FN(d,h),g=c+l;if(p&&p.length){const r=ir(p,(t=>t.width)),i=ir(p,(t=>t.height));if(a)t.size=r+g;else{const{tickFilter:o,labelTransform:a}=t;!function(t,e,n,r,i){const o=hr(e,(t=>t.width));if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=WN(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}(h,p,e,n,o)||a||!1===f||null===f?t.size=i+g:(t.labelTransform="rotate(90)",t.size=r+g)}}else t.size=c;const m=zN(d);m&&(t.size+=a?u+m.width:u+m.height)}function IN(t,e,n,r,i,o){const a=(()=>{const{legendContinuous:e}=i;return Z({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=a,l=Oe(a,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=wr(l,"ribbon"),{size:d}=f,h=wr(l,"handleIcon"),{size:p}=h,g=Math.max(d,2.4*p);t.size=g;const m=FN(l,DN(t,o));if(m){const e=u?"width":"height",n=ir(m,(t=>t[e]));t.size+=n+s}const y=zN(l);y&&(u?t.size=Math.max(t.size,y.width):t.size+=c+y.height)}function BN(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 Z({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=Oe(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=zN(p),M=FN(p,DN(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,Z(t,{cols:v(r),gridRow:o})})():"number"==typeof g?(()=>{const e=Math.ceil(M.length/g),n=ir(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 DN(t,e){const[n]=bT("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 FN(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=Oe(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=function(t,e,n){const r=WN(t,n),i=r.map((t=>"number"==typeof t?Mm(t):t)),o=e?"string"==typeof e?QE(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(o)}(e,r,i),c=wr(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)=>$N(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 zN(t){const{title:e}=t,n=Oe(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=wr(n,"title"),{direction:i,transform:o}=r,a=Array.isArray(e)?e.join(","):e;if("string"!=typeof a)return null;return $N(a,Object.assign(Object.assign({},r),{transform:o||("vertical"===i?"rotate(-90)":"")}))}function GN(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${mr(e)}`]:s}=n;return Z({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function WN(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function $N(t,e){const n=function(t){return t instanceof zp?t:new Qp({style:{text:`${t}`}})}(t),r=Oe(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function HN(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(!OT(i)&&!ST(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=>GN(t,"axisArc"===t.type?"arc":"linear",n))),s=ir(a,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=o.flatMap(((t,e)=>FN(a[e],DN(t,r)))).filter(br),l=ir(c,(t=>t.height))+s,u=o.flatMap(((t,e)=>zN(a[e]))).filter((t=>null!==t)),f=0===u.length?0:ir(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=VN(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=VN(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 VN(t,e,n,r,i,o,a){const s=Gn(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${mr(qw(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=ir(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(PN(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=ar(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=ON(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 YN({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,En,a,x],right:[t-v,y,v,u,"horizontal",!1,En],bottom:[m,e-b,f,b,"vertical",!1,En,a,x],left:[0,y,m,u,"horizontal",!0,En],"top-left":[m,0,f,y,"vertical",!0,En],"top-right":[m,0,f,y,"vertical",!0,En],"bottom-left":[m,e-b,f,b,"vertical",!1,En],"bottom-right":[m,e-b,f,b,"vertical",!1,En],center:w,inner:w,outer:w}}function UN(t,e,n,r){const[i,o]=Nr(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return Qc(t)&&Xc(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):Xc(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):Qc(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]=el(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]=el(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 qN(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-hr(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},Z(i,{layout:{justifyContent:o}}),r+=a[t]}}}function XN(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=Oe(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function ZN(t,e,n){return ke(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=bT("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=Oe(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:a=[]}=o,s=[Oe(o,["transform"]),...a].map(i),c=yield function(t){return t.reduce(((t,e)=>n=>ke(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),pr)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?Tr(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function KN(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 QN(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=_r(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return br(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 JN(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=_r(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 tL(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=bT("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:sL(n)})}(o),s=_r(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function eL(t,e,n){const{tooltip:r={}}=e;return Sr(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:kr(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 nL(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(Sr(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(kr(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:c=(t=>t)}=e,l="string"==typeof c?QE(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);kr(t)?n[o]=t:n[o]={value:t}}return n}return e},{title:s,items:c=[]}=o,l=Oe(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 rL(t,e,n){const{encode:r}=e,i=Oe(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=Oe(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 iL(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",...Object.keys(r)])):["x","y"];return Z(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 oL(t,e,n){const{animate:r}=e;return r||void 0===r||Z(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function aL(t,e,n){return ke(this,void 0,void 0,(function*(){const r={library:n},[i,o]=yield function(t,e,n){return ke(this,void 0,void 0,(function*(){const{library:r}=n,[i]=bT("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[XN,ZN,KN,QN,JN,tL,rL,oL,iL,eL,...o.map(i),...s.map(i),...a.map(i),nL];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]}))}(t,e,r),{encode:a,scale:s,data:c,tooltip:l}=o;if(!1===Array.isArray(c))return null;const{channels:u}=e,f=Hn(Object.entries(a).filter((([,t])=>br(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=u.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),d=u.filter((t=>{const{name:e,required:n}=t;if(f.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:a}=t;return f.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const l=e.some((t=>t.visual)),u=e.some((t=>t.constant)),f=s[t]||{},{independent:d=!1,key:h=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=Oe(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:a})}}))}));return[o,Object.assign(Object.assign({},e),{index:i,channels:d,tooltip:l})]}))}function sL(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function cL(t,e,n,r){var i;return ke(this,void 0,void 0,(function*(){const[o]=bT("composition",n),[a]=bT("interaction",n),s=new Set(Object.keys(n).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(br)),c=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(br)),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,i]=e?pL(e,t,n):yield fL(t,n);g.set(r,t),p.push(r);const o=i.flatMap(h).map((t=>wT(t,n)));if(y.push(...o),o.every(f)){const t=yield Promise.all(o.map((t=>dL(t,n))));iN(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];m.set(n,r)}}}else{const e=h(u(t)?t:yield TL(t,n));Array.isArray(e)?y.push(...e):"function"==typeof e&&v.push(e())}}r.emitter.emit(TA.BEFORE_PAINT);const b=new Map,x=new Map,M=[];e.selectAll(LL(SS)).data(p,(t=>t.key)).join((t=>t.append("g").attr("className",SS).attr("id",(t=>t.key)).call(lL).each((function(t,e,i){gL(t,bm(i),M,n,r),b.set(t,i)}))),(t=>t.call(lL).each((function(t,e,i){gL(t,bm(i),M,n,r),x.set(t,i)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const O=(t,e,i)=>Array.from(t.entries()).map((([o,a])=>{const s=i||new Map,c=g.get(o),l=function(t,e,n,r){const i=function(t){const[,e]=bT("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(n),o=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,a=_L(e),s=a.map(i).filter(o).map((t=>t[0]));return(e,i,o)=>ke(this,void 0,void 0,(function*(){const a=[],[c,l]=yield fL(e,n);gL(c,t,a,n,r);for(const o of s.filter((t=>t!==i)))uL(o,t,e,c,n,r);for(const e of l)cL(e,t,n,r);return o(),{options:e,view:c}}))}(bm(a),c,n,r);return{view:o,container:a,options:c,setState:(t,e=(t=>t))=>s.set(t,e),update:(n,r)=>ke(this,void 0,void 0,(function*(){const i=gr(Array.from(s.values()))(c);return yield l(i,n,(()=>{w(r)&&e(t,r,s)}))}))}})),E=(t=x,e,n)=>{var i;const o=O(t,E,n);for(const t of o){const{options:n,container:s}=t,c=s.nameInteraction;let l=_L(n);e&&(l=l.filter((t=>e.includes(t[0]))));for(const e of l){const[n,s]=e,l=c.get(n);if(l&&(null===(i=l.destroy)||void 0===i||i.call(l)),s){const e=hL(t.view,n,s,a)(t,o,r.emitter);c.set(n,{destroy:e})}}}},k=O(b,E);for(const t of k){const{options:e}=t,n=new Map;t.container.nameInteraction=n;for(const i of _L(e)){const[e,o]=i;if(o){const i=hL(t.view,e,o,a)(t,k,r.emitter);n.set(e,{destroy:i})}}}E();const{width:S,height:A}=t,_=[];for(const t of v){const i=new Promise((i=>ke(this,void 0,void 0,(function*(){for(const i of t){const t=Object.assign({width:S,height:A},i);yield cL(t,e,n,r)}i()}))));_.push(i)}r.views=p,null===(i=r.animations)||void 0===i||i.forEach((t=>null==t?void 0:t.cancel())),r.animations=M,r.emitter.emit(TA.AFTER_PAINT);const T=M.filter(br).map(EL).map((t=>t.finished));return Promise.all([...T,..._])}))}function lL(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function uL(t,e,n,r,i,o){var a;const[s]=bT("interaction",i),c=e.node().nameInteraction,l=_L(n).find((([e])=>e===t)),u=c.get(t);if(!u)return;if(null===(a=u.destroy)||void 0===a||a.call(u),!l[1])return;const f=hL(r,t,l[1],s),d={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},h=f(d,[],o.emitter);c.set(t,{destroy:h})}function fL(t,e){return ke(this,void 0,void 0,(function*(){const n=yield function(t,e){return ke(this,void 0,void 0,(function*(){const[n,r]=bT("mark",e),i=new Set(Object.keys(e).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(br)),{marks:o}=t,a=[],s=[],c=[...o],{width:l,height:u}=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),f={options:t,width:l,height:u};for(;c.length;){const[t]=c.splice(0,1),o=yield TL(t,e),{type:l=yr("G2Mark type is required."),key:u}=o;if(i.has(l))s.push(o);else{const{props:t={}}=r(l),{composite:e=!0}=t;if(e){const{data:t}=o,e=Object.assign(Object.assign({},o),{data:t?Array.isArray(t)?t:t.value:t}),r=yield n(e,f),i=Array.isArray(r)?r:[r];c.unshift(...i.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else a.push(o)}}return Object.assign(Object.assign({},t),{marks:a,components:s})}))}(t,e),r=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=Oe(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)=>Z(t,e)),{}),u=[n,...s].reduce(((t,e)=>Z(t,e)),{}),f=[...c,r].reduce(((t,e)=>Z(t,e)),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:l,interaction:u,style:f})}(n);t.interaction=r.interaction,t.coordinate=r.coordinate,t.marks=[...r.marks,...r.components];const i=wT(r,e);return pL(yield dL(i,e),i,e)}))}function dL(t,e){return ke(this,void 0,void 0,(function*(){const[n]=bT("theme",e),[,r]=bT("mark",e),{theme:i,marks:o,coordinates:a=[]}=t,s=n(AL(i)),c=new Map;for(const t of o){const{type:n}=t,{props:i={}}=r(n),o=yield aL(t,i,e);if(o){const[t,e]=o;c.set(t,e)}}const l=Gn(Array.from(c.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of l.values()){const n=t.reduce(((t,{scale:e})=>Z(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],o=Array.from(new Set(i.map((t=>t.field)).filter(br))),c=Z({guide:{title:0===o.length?void 0:o},field:o[0]},n),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},tN(l,u,c,a,s,e)),{key:r});t.forEach((t=>t.scale=f))}return c}))}function hL(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(Z(o,Object.assign({type:e},n)))}function pL(t,e,n){const[r]=bT("mark",n),[i]=bT("theme",n),[o]=bT("labelTransform",n),{key:a,frame:s=!1,theme:c,clip:l,style:u={},labelTransform:f=[]}=e,d=i(AL(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=oN(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=Z({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:nt(t,i)});o.push(e)}}}return o}(h,e),g=function(t){return t.map((t=>{const e=Z(t,t.style);return delete e.style,e}))}(wN(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=HN(g,e,d,n),y=function(t,e,n){const[r]=bT("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 j_(p):new P_(p)}(m,e,n),v=s?Z({mainLineWidth:1,mainStroke:"#000"},u):u;!function(t,e,n){const r=Gn(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:YN({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:YN({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:YN({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]=Nr(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));a.length&&UN(a,e,o,i),s.length&&qN(n,0,o)}}(ON(g),y,m),function(t){const e=t.find((({type:t})=>"axisZ"===t));if(e){const n=t.find((({type:t})=>"axisX"===t));n.plane="xy";const r=t.find((({type:t})=>"axisY"===t));r.plane="xy",e.plane="yz",e.origin=[n.bbox.x,n.bbox.y,0],e.eulerAngles=[0,-90,0],e.bbox.x=n.bbox.x,e.bbox.y=n.bbox.y,t.push(Object.assign(Object.assign({},n),{plane:"xz",showLabel:!1,showTitle:!1,origin:[n.bbox.x,n.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},r),{plane:"yz",showLabel:!1,showTitle:!1,origin:[r.bbox.x+r.bbox.width,r.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},e),{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=rN(t,n);r.push(i),"y"===e&&i.update(Object.assign(Object.assign({},i.getOptions()),{xScale:b.x})),nN(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=_r(d,(t=>rN(t,n)));nN(b,h);const p=eN(u,h),g=r(e),[v,w,M]=mL(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:gr(f.map(o))},x]}function gL(t,e,n,r,i){return ke(this,void 0,void 0,(function*(){const{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=Oe(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),w=b.map((t=>Mr(Object.assign({},a.view,f),t))),M=["a","margin","padding","inset"].map((t=>wr(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)}(bm(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(LL(PS)).data(x.filter((t=>br(w[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",PS).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 Wn(o,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const C=e.selectAll(LL(_S)).data(o,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",_S).append((t=>MN(Z({animate:P,scale:h},t),l,a,r,c)))),(t=>t.transition((function(t,e,n){const{preserve:i=!1}=t;if(i)return;const o=MN(Z({animate:P,scale:h},t),l,a,r,c),{attributes:s}=o,[u]=n.childNodes;return u.update(s,!1)})))).transitions();n.push(...C.flat().filter(br));const N=e.selectAll(LL(AS)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",AS).call(PL).call(NL,Array.from(c.keys())).call(jL,d)),(t=>t.call(NL,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):PL(t))).call(jL,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=xL(o,a,t,r,i),h=OL(o,a,t,r),p=kL(o,a,t,r),g=SL(o,a,t,r),m=vL(e,f,l,"element"),y=f.selectAll(LL(kS)).selectFacetAll(m).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(d).attr("className",kS).attr("markType",u).transition((function(t,e,n){return h(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=xr((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){bL(i,e,n);const o=d(t,r),a=p(t,[i],[o]);return null!==a||(i.nodeName===o.nodeName&&"g"!==o.nodeName?vr(i,o):(i.parentNode.replaceChild(o,i),o.className=kS,o.markType=u,o.__data__=i.__data__)),a})).attr("markType",u).attr("className",kS)}))),(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",kS).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new xm(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new xm([],n.__toData__,n.parentNode).append(d).attr("className",kS).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...y.flat())}!function(t,e,n,r,i){const[o]=bT("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(LL(ES)).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]=bT("shape",r),{data:a}=t,{data:s,defaultLabelShape:c}=e,l=s.map((t=>t.points)),{theme:u,coordinate:f}=n,d=Object.assign(Object.assign({},i),{document:xT(i),theme:u,coordinate:f});return t=>{const{index:e,points:n}=t,r=a[e],{formatter:i=(t=>`${t}`),transform:s,style:f,render:h}=t,p=Oe(t,["formatter","transform","style","render"]),g=_r(Object.assign(Object.assign({},p),f),(t=>yL(t,r,e,a))),{shape:m=c,text:y}=g,v=Oe(g,["shape","text"]),b="string"==typeof i?QE(i):i,x=Object.assign(Object.assign({},v),{text:b(y,r,e,a),datum:r}),w=Object.assign({type:`label.${m}`,render:h},v);return o(w,d)(n,x,wL(u,"label",m,"label"),l)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(LL(kS)).nodes().filter((t=>!t.__removed__));return a.flatMap(((t,e)=>{const n=Oe(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=bm(c).selectAll(LL(TS)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",TS)),(t=>t.each((function(t,e,n){vr(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),h=Gn(d,(t=>u.get(t.__data__))),{coordinate:p}=t;for(const[t,e]of h){const{transform:n=[]}=t;gr(n.map(o))(e,p)}s&&s(d,p)}(t,e,0,r,i)}))}function mL([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])=>br(t)&&br(e)))&&(r.push(o),i.push(a))}return[r,i]}function yL(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"!=typeof t?t:void 0!==e[t]?e[t]:t}function vL(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 bL(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 xL(t,e,n,r,i){const[o]=bT("shape",r),{data:a}=t,{defaultShape:s,data:c,shape:l}=e,u=c.map((t=>t.points)),{theme:f,coordinate:d}=n,{type:h,style:p={}}=t,g=Object.assign(Object.assign({},i),{document:xT(i),coordinate:d,theme:f});return e=>{const{shape:n=s}=p,{shape:r=n,points:i,seriesIndex:c,index:d}=e,m=Oe(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},m),{index:d}),v=c?c.map((t=>a[t])):a[d],b=c||d,x=_r(p,(t=>yL(t,v,b,a)));return(l[r]?l[r](x,g):o(Object.assign(Object.assign({},x),{type:CL(t,r)}),g))(i,y,wL(f,h,r,s),u)}}function wL(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 ML(t,e,n,r,i){var o,a;const[,s]=bT("shape",i),[c]=bT("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(CL(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,Z(g,{delay:o,duration:a,easing:s}));return Array.isArray(u)?u:[u]}}function OL(t,e,n,r){return ML("enter",t,e,n,r)}function EL(t){return t.finished.then((()=>{t.cancel()})),t}function kL(t,e,n,r){return ML("update",t,e,n,r)}function SL(t,e,n,r){return ML("exit",t,e,n,r)}function AL(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=Oe(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function _L(t){const{interaction:e={}}=t;return Object.entries(Z({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function TL(t,e){return ke(this,void 0,void 0,(function*(){const n={library:e},{data:r}=t,i=Oe(t,["data"]);if(null==r)return t;const[,{data:o}]=yield ZN(0,{data:r},n);return Object.assign({data:o},i)}))}function PL(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 CL(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function NL(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(LL(OS)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",OS).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(LL(ES)).node()||t.append("g").attr("className",ES).style("zIndex",0)}function LL(...t){return t.map((t=>`.${t}`)).join("")}function jL(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 Kp({style:{x:r+i,y:n+o,width:a,height:s}})}))}function RL(t){const e=Z({},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=Z({},e[o]);e[o]=a,n.set(a,t),r.set(a,o),i.push(a)}}return e}function IL(t,e){const n=new EA;return n.registerPlugin(new SA),new dg({width:t,height:e,container:document.createElement("div"),renderer:n})}function BL(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480,depth:a=0}=t,s=RL(t),{canvas:c=IL(i,o),emitter:l=new _A,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(TA.BEFORE_RENDER);const h=bm(c.document.documentElement);return c.ready.then((()=>cL(Object.assign(Object.assign({},s),{width:i,height:o,depth:a}),h,u,e))).then((()=>{if(a){const[t,e]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(t,e,-a/2)}c.requestAnimationFrame((()=>{l.emit(TA.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=c.getConfig().container)?document.getElementById(p):p;var p}function DL(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 FL={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function zL(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:FL[e]}function GL(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>GL(t,e,n,r)))}function WL(t){GL(t,"visibility","hidden",!0)}function $L(t){GL(t,"visibility","visible",!0)}function HL(t){return bm(t).selectAll(`.${kS}`).nodes().filter((t=>!t.__removed__))}function VL(t,e){return YL(t,e).flatMap((({container:t})=>HL(t)))}function YL(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function UL(t){return bm(t).select(`.${AS}`).node()}function qL(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new Eu;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function XL(t,e){const{offsetX:n,offsetY:r}=e,i=qL(t),{min:[o,a],max:[s,c]}=i;return n<o||n>s||(r<a||r>c)?null:[n-o,r-a]}function ZL(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 KL(t){return t=>t.__data__.color}function QL(t){return t=>t.__data__.x}function JL(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[ej(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(ej(i,r))[e]}}function tj(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=zL(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 ej(t,e){return`${t},${e}`}function nj(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[ej(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=ej(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 rj(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 ij(t){var{link:e=!1,valueof:n=((t,e)=>t),coordinate:r}=t,i=Oe(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=Yn(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=oc(),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=_r(i,(t=>n(t,c))),{fill:g=c.getAttribute("fill")}=p,m=Oe(p,["fill"]),y=new qp({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 oj(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(Xc(n)){const{points:i}=t.__data__,[o,a]=qc(n)?Sm(i):i,s=n.getCenter(),c=Os(o,s),l=Os(a,s),u=Ss(c)+_s(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return qc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function aj(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=Oe(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(!zk(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(!zk(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 Cm(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=Oe(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=_r(a,(e=>o(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,lineWidth:d=0}=e,h=Oe(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(zk)})()?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 sj(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 cj(t){sj(t,t.cursor)}function lj(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function uj(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function fj(t,e=!1){const n=m(t,(t=>!!t)).map(((t,e)=>[0===e?"M":"L",...t]));return e&&n.push(["Z"]),n}function dj(t){return t.querySelectorAll(".element")}function hj(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function pj(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=Gn(d,r),g=rj(d,n),[m,y]=ij(Object.assign({elements:d,valueof:g,link:i,coordinate:c},wr(u.active,"link"))),[v,b,x]=aj(Object.assign({document:t.ownerDocument,scale:s,coordinate:c,background:o,valueof:g},wr(u.active,"background"))),w=Z(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 oj(d[n],e,c)}})}),{setState:M,removeState:O,hasState:E}=tj(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=lj(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 gj(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,o=Oe(t,["delay","createGroup","background","link"]);return(t,a,s)=>{const{container:c,view:l,options:u}=t,{scale:f,coordinate:d}=l;return pj(UL(c),Object.assign({elements:HL,datum:JL(l),groupKey:n?n(l):void 0,coordinate:d,scale:f,state:nj(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:s},o))}}function mj(t){return gj(Object.assign(Object.assign({},t),{createGroup:QL}))}function yj(t){return gj(Object.assign(Object.assign({},t),{createGroup:KL}))}function vj(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=Gn(d,r),g=rj(d,n),[m,y]=ij(Object.assign({link:i,elements:d,valueof:g,coordinate:a},wr(u.selected,"link"))),[v,b]=aj(Object.assign({document:t.ownerDocument,background:s,coordinate:a,scale:c,valueof:g},wr(u.selected,"background"))),x=Z(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 oj(d[n],e,a)}})}),{setState:w,removeState:M,hasState:O}=tj(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=lj(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 bj(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=Oe(t,["createGroup","background","link"]);return(t,o,a)=>{const{container:s,view:c,options:l}=t,{coordinate:u,scale:f}=c;return vj(UL(s),Object.assign({elements:HL,datum:JL(c),groupKey:e?e(c):void 0,coordinate:u,scale:f,state:nj(l,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:a},i))}}function xj(t){return bj(Object.assign(Object.assign({},t),{createGroup:QL}))}function wj(t){return bj(Object.assign(Object.assign({},t),{createGroup:KL}))}function Mj(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=(t=>`${t}`)}=t,o=Oe(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=Yn(y.map((t=>g[t]))),b=UL(s),x=s.getElementsByClassName(kS),w=Gn(s.getElementsByClassName(TS),(t=>t.__data__.key.split("-")[0])),M=new Up({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},wr(o,"rule"))}),O=new Qp({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},wr(o,"label"))});M.append(O),b.appendChild(M);const E=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return v[Nn(v,i)]},k=(t,e)=>{M.setAttribute("x1",t[0]),M.setAttribute("x2",t[0]),O.setAttribute("text",i(e))};let S;const A=rt((t=>{const e=XL(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[Sn((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=>{ke(this,void 0,void 0,(function*(){const{x:e}=f,n=E(d,e,t);k(t,n),l("chartIndex",(t=>{const e=Z({},t),r=e.marks.find((t=>"line"===t.type)),i=ir($n(y,(t=>ir(t,(t=>+p[t]))/ar(t,(t=>+p[t]))),(t=>m[t])).values());Z(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[Sn((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 Oj({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=UL(s),l=rt((t=>{const e=XL(c,t);if(!e)return a("fisheye"),void o();a("fisheye",(t=>{const n=Z({},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 Ej(t,e){if(e)return"string"==typeof e?document.querySelector(e):e;return t.ownerDocument.defaultView.getContextService().getDomElement().parentElement}function kj(t,e,n,r,i,o,a,s={}){const c=new sw({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:Z({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(c.HTMLTooltipElement),c}function Sj({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}){const d=Ej(t,u),h=Ej(t),p=a?h:t,g=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),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(h,d),{tooltipElement:y=kj(d,n,r,s,c,g,m,l)}=p,{items:v,title:b=""}=e;y.update(Object.assign({x:n,y:r,data:v,title:b,position:s,enterable:c},void 0!==i&&{content:i(o,{items:v,title:b})})),p.tooltipElement=y}function Aj({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const o=Ej(t),a=e?o:t,{tooltipElement:s}=a;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY)}function _j({root:t,single:e}){const n=Ej(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0)}function Tj(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function Pj(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function Cj(t,e=(t=>t)){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function Nj(t,e,n,r=t.map((t=>t.__data__)),i={}){const o=t=>t instanceof Date?+t:t,a=Cj(r.map((t=>t.title)),o).filter(br),s=r.flatMap(((r,o)=>{const a=t[o],{items:s=[],title:c}=r,l=s.filter(br),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=Pj(a)||i.color,name:o}=t,s=Oe(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 Ko)&&!(t instanceof Jo);if(s(r))return r.clone().invert(a);if(a&&r instanceof Ko&&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(Tj);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:Cj(s,(t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`))})}function Lj(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=Oe(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=fr(g),v=fr(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=Ss(Os([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 Up({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 jj(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function Rj(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function Ij(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function Bj(t,e){return void 0===t?e:t}function Dj(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function Fj(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,render:c,groupName:l,emitter:u,wait:f=50,leading:d=!0,trailing:h=!1,startX:p=0,startY:g=0,body:m=!0,single:y=!0,position:v,enterable:b,mount:x,bounding:w,theme:M,disableNative:O=!1,marker:E=!0,preserve:k=!1,style:S={},css:A={}}=e,_=Oe(e,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","disableNative","marker","preserve","style","css"]);const T=n(t),P=qc(a),C=Xc(a),N=Z(S,_),{innerWidth:L,innerHeight:j,width:R,height:I,insetLeft:B,insetTop:D}=a.getOptions(),F=[],z=[];for(const t of T){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?F.push(t):(r||i)&&z.push(t)}const W=!!(P?o.y:o.x).getBandWidth&&z.length>0;F.sort(((t,e)=>{const n=P?0:1,r=t=>t.getBounds().min[n];return P?r(e)-r(t):r(t)-r(e)}));const $=t=>{const e=P?1:0,{min:n,max:r}=t.getLocalBounds();return Yn([n[e],r[e]])};z.sort(((t,e)=>{const[n,r]=$(t),[i,o]=$(e),a=(n+r)/2,s=(i+o)/2;return P?s-a:a-s}));const H=new Map(F.map((t=>{const{__data__:e}=t,{seriesX:n}=e;return[t,[Yn(n.map(((t,e)=>e)),(t=>n[+t])),n]]}))),{x:V}=o,Y=(null==V?void 0:V.getBandWidth)?V.getBandWidth()/2:0,U=t=>{const[e]=a.invert(t);return e-Y},q=(t,e,n)=>{const r=U(t),i=n.filter(br),[o,a]=Yn([i[0],i[i.length-1]]);if(!W&&(r<o||r>a)&&!(o===a))return null;const s=Sn((t=>n[+t])).center;return e[s(e,r)]},X=(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]})))},K=rt((e=>{const n=XL(t,e);if(!n)return;const f=qL(t),d=f.min[0],h=f.min[1],O=[n[0]-p,n[1]-g];if(!O)return;const k=((t,e)=>{const n=t[P?1:0],r=e.filter((t=>{const[e,r]=$(t);return n>=e&&n<=r}));if(!W||r.length>0)return r;const i=Sn((t=>{const[e,n]=$(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(br)})(O,z),S=[],_=[];for(const t of F){const[e,n]=H.get(t),r=q(O,e,n);if(null!==r){S.push(t);const e=X(t,r),{x:n,y:i}=e,o=a.map([(n||0)+Y,i||0]);_.push([Object.assign(Object.assign({},e),{element:t}),o])}}const T=Array.from(new Set(_.map((t=>t[0].x)))),G=T[sr(T,(t=>Math.abs(t-U(O))))],V=_.filter((t=>t[0].x===G)),Z=[...V.map((t=>t[0])),...k.map((t=>t.__data__))],K=[...S,...k],J=Nj(K,o,l,Z,M);if(r&&J.items.sort(((t,e)=>r(t)-r(e))),i&&(J.items=J.items.filter(i)),0===K.length||Dj(J))Q(e);else{if(m&&Sj({root:t,data:J,x:n[0]+d,y:n[1]+h,render:c,event:e,single:y,position:v,enterable:b,mount:x,bounding:w,css:A}),s){const e=V.map((t=>t[1])),n=wr(N,"crosshairs");Lj(t,e,Object.assign(Object.assign({},n),{plotWidth:L,plotHeight:j,mainWidth:R,mainHeight:I,insetLeft:B,insetTop:D,startX:p,startY:g,transposed:P,polar:C}))}if(E){const e=wr(N,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const i=e.filter((t=>{const[{x:e,y:n}]=t;return br(e)&&br(n)})).map((t=>{const[{color:e,element:i},o]=t,a=e||i.style.fill||i.style.stroke||r.color;return new Gp({style:Object.assign({cx:o[0],cy:o[1],fill:a,r:4,stroke:"#fff",lineWidth:2},n)})}));for(const e of i)t.appendChild(e);t.markers=i}(t,{data:V,style:e,theme:M})}u.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:{x:Gk(o.x,U(O),!0)}}}))}}),f,{leading:d,trailing:h}),Q=e=>{Aj({root:t,single:y,emitter:u,event:e}),s&&jj(t),E&&Rj(t)},J=()=>{_j({root:t,single:y}),s&&jj(t),E&&Rj(t)},tt=({nativeEvent:e,data:n})=>{if(e)return;const{x:r}=n.data,{x:i}=o,s=i.map(r),[c,l]=a.map([s,.5]),{min:[u,f]}=t.getRenderBounds();K({offsetX:c+u,offsetY:l+f})},et=()=>{Aj({root:t,single:y,emitter:u,nativeEvent:!1})},nt=()=>{at(),J()},it=()=>{ot()},ot=()=>{O||(t.addEventListener("pointerenter",K),t.addEventListener("pointermove",K),t.addEventListener("pointerleave",Q))},at=()=>{O||(t.removeEventListener("pointerenter",K),t.removeEventListener("pointermove",K),t.removeEventListener("pointerleave",Q))};return ot(),u.on("tooltip:show",tt),u.on("tooltip:hide",et),u.on("tooltip:disable",nt),u.on("tooltip:enable",it),()=>{at(),u.off("tooltip:show",tt),u.off("tooltip:hide",et),u.off("tooltip:disable",nt),u.off("tooltip:enable",it),k?Aj({root:t,single:y,emitter:u,nativeEvent:!1}):J()}}function zj(t,{elements:e,scale:n,render:r,groupName:i,sort:o,filter:a,emitter:s,wait:c=50,leading:l=!0,trailing:u=!1,groupKey:f=(t=>t),single:d=!0,position:h,enterable:p,datum:g,view:m,mount:y,bounding:v,theme:b,shared:x=!1,body:w=!0,disableNative:M=!1,preserve:O=!1,css:E={}}){const k=e(t),S=Gn(k,f),A=rt((e=>{const{target:c}=e,l=hj(c,(t=>!!t.classList&&t.classList.includes("element")));if(!l)return void Aj({root:t,single:d,emitter:s,event:e});const u=f(l),g=S.get(u);if(!g)return;const M=1!==g.length||x?Nj(g,n,i,void 0,b):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(br).map((e=>{var{color:n=Pj(t)}=e,r=Oe(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(Tj);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(g[0]);if(o&&M.items.sort(((t,e)=>o(t)-o(e))),a&&(M.items=M.items.filter(a)),Dj(M))return void Aj({root:t,single:d,emitter:s,event:e});const{offsetX:O,offsetY:k}=e;w&&Sj({root:t,data:M,x:O,y:k,render:r,event:e,single:d,position:h,enterable:p,mount:y,bounding:v,css:E}),s.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:mT(l,m)}}))}),c,{leading:l,trailing:u}),_=e=>{Aj({root:t,single:d,emitter:s,event:e})},T=()=>{M||(t.addEventListener("pointermove",A),t.addEventListener("pointerleave",_))},P=()=>{M||(t.removeEventListener("pointermove",A),t.removeEventListener("pointerleave",_))},C=({nativeEvent:t,data:e})=>{if(t)return;const n=lj(k,e.data,g);if(!n)return;const r=n.getBBox(),{x:i,y:o,width:a,height:s}=r;A({target:n,offsetX:i+a/2,offsetY:o+s/2})},N=({nativeEvent:e}={})=>{e||Aj({root:t,single:d,emitter:s,nativeEvent:!1})};return s.on("tooltip:show",C),s.on("tooltip:hide",N),s.on("tooltip:enable",(()=>{T()})),s.on("tooltip:disable",(()=>{P(),_j({root:t,single:d})})),T(),()=>{P(),s.off("tooltip:show",C),s.off("tooltip:hide",N),O?Aj({root:t,single:d,emitter:s,nativeEvent:!1}):_j({root:t,single:d})}}function Gj(t){const{shared:e,crosshairs:n,series:r,name:i,item:o=(()=>({})),facet:a=!1}=t,s=Oe(t,["shared","crosshairs","series","name","item","facet"]);return(t,i,c)=>{const{container:l,view:u}=t,{scale:f,markState:d,coordinate:h,theme:p}=u,g=Ij(d,"seriesTooltip"),m=Ij(d,"crosshairs"),y=UL(l),v=Bj(r,g);if(v&&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}))}(d)&&!a)return Fj(y,Object.assign(Object.assign({},s),{theme:p,elements:HL,scale:f,coordinate:h,crosshairs:Bj(n,m),item:o,emitter:c}));if(v&&a){const e=i.filter((e=>e!==t&&e.options.parentKey===t.options.key)),r=VL(t,i),a=e[0].view.scale,l=y.getBounds(),u=l.min[0],f=l.min[1];return Object.assign(a,{facet:!0}),Fj(y.parentNode.parentNode,Object.assign(Object.assign({},s),{theme:p,elements:()=>r,scale:a,coordinate:h,crosshairs:Bj(n,m),item:o,startX:u,startY:f,emitter:c}))}return zj(y,Object.assign(Object.assign({},s),{datum:JL(u),elements:HL,scale:f,coordinate:h,groupKey:e?t=>t.__data__.x:void 0,item:o,emitter:c,view:u,theme:p,shared:e}))}}gj.props={reapplyWhenUpdate:!0},mj.props={reapplyWhenUpdate:!0},yj.props={reapplyWhenUpdate:!0},bj.props={reapplyWhenUpdate:!0},xj.props={reapplyWhenUpdate:!0},wj.props={reapplyWhenUpdate:!0},Mj.props={reapplyWhenUpdate:!0},Gj.props={reapplyWhenUpdate:!0};const Wj="legend-category",$j="legend-continuous",Hj="items-item",Vj="legend-category-item-marker",Yj="legend-category-item-label";function Uj(t){return t.getElementsByClassName(Vj)[0]}function qj(t){return t.getElementsByClassName(Yj)[0]}function Xj(t){return t.getElementsByClassName(Hj)}function Zj(t){return t.getElementsByClassName(Wj)}function Kj(t){return t.getElementsByClassName($j)}function Qj(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function Jj(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){return ke(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 Z({},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 tR(t,e){for(const n of t)Jj(n,Object.assign(Object.assign({},e),{facet:!0}))}function eR(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),o=i.length>0,a=t=>Qj(t).scales.map((t=>t.name)),s=[...Zj(r),...Kj(r)],c=s.flatMap(a),l=rt(o?tR:Jj,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=Qj(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===Wj?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:wr(d,"marker")},p={unselected:wr(d,"label")},{setState:g,removeState:m}=tj(h,void 0),{setState:y,removeState:v}=tj(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=()=>{sj(t,"pointer")},r=()=>{cj(t)},c=t=>ke(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=>ke(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=>ke(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:Xj,marker:Uj,label:qj,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 nR(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=Zj(r),s=HL(r),c=t=>Qj(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=nj(o,["active","inactive"]),f=rj(s,JL(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=Xj(t),o=l(r),a=Gn(s,(t=>o.invert(t.__data__[r]))),{state:h={}}=t.attributes,{inactive:p={}}=h,{setState:g,removeState:m}=tj(u,f),y={inactive:wr(p,"marker")},v={inactive:wr(p,"label")},{setState:b,removeState:x}=tj(y),{setState:w,removeState:M}=tj(v),O=t=>{for(const e of i){const n=Uj(e),r=qj(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 rR(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function iR(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function oR(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const aR=Fm((t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:c=10,document:l}=e,u=Oe(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=wr(Or(u,"handleNW","handleNE"),"handleN"),{render:p=d}=h,g=Oe(h,["render"]),m=wr(u,"handleE"),{render:y=d}=m,v=Oe(m,["render"]),b=wr(Or(u,"handleSE","handleSW"),"handleS"),{render:x=d}=b,w=Oe(b,["render"]),M=wr(u,"handleW"),{render:O=d}=M,E=Oe(M,["render"]),k=wr(u,"handleNW"),{render:S=d}=k,A=Oe(k,["render"]),_=wr(u,"handleNE"),{render:T=d}=_,P=Oe(_,["render"]),C=wr(u,"handleSE"),{render:N=d}=C,L=Oe(C,["render"]),j=wr(u,"handleSW"),{render:R=d}=j,I=Oe(j,["render"]),B=t=>()=>{const e=Fm((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=bm(t).attr("className",a).style("transform",`translate(${n}, ${r})`).style("draggable",!0);D.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(oR,Object.assign(Object.assign({width:i,height:o},Or(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(oR,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(oR,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(oR,w),D.maybeAppend("handle-w",B(O)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(oR,E),D.maybeAppend("handle-nw",B(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(oR,A),D.maybeAppend("handle-ne",B(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(oR,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(oR,L),D.maybeAppend("handle-sw",B(R)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(oR,I)}));function sR(t,e){var{brushed:n=(()=>{}),brushended:r=(()=>{}),brushcreated:i=(()=>{}),brushstarted:o=(()=>{}),brushupdated:a=(()=>{}),extent:s=iR(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=Oe(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;sj(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 qp({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:d,pointerEvents:"none"})}),v=new aR({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 aR({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]=ZL(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=ZL(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=ZL(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)?sj(t,"move"):j(n)&&sj(t,N[n.id].cursor):sj(t,"crosshair")},G=()=>{sj(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),sj(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 cR(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 lR(t,e,n){return cR(t,e,n).map((t=>t.options))}function uR(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=Oe(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=rj(y,o),w=wr(m,"mask"),{setState:M,removeState:O}=tj(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;rR([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=(t,e,n,r)=>{const i=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),E.set(t,e),e};for(const o of y){const a=E.get(o)||i(o);a.style.clipPath=new Kp({style:{x:t+A,y:e+_,width:n-t,height:r-e}}),M(o,"inactive"),M(a,"active")}},j=sR(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=$k(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=$k(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=$k(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=Hk(o,r),c=Hk(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 fR(t){var{facet:e,brushKey:n}=t,r=Oe(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:c}=t,l=UL(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 uR(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>VL(t,i),datum:JL(YL(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:nj(YL(t,i).map((t=>t.options)),f),emitter:o,scale:d,coordinate:h,selectedHandles:void 0},u),r))}const p=uR(l,Object.assign(Object.assign({elements:HL,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return cR(t,e,n).map((t=>UL(t.container)))}(t,i,n),datum:JL([s,...cR(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:nj([c,...lR(t,i,n)],f),emitter:o,scale:d,coordinate:h,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function dR(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function hR(t){return fR(Object.assign(Object.assign({},t),{brushRegion:dR,selectedHandles:["handle-e","handle-w"]}))}function pR(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function gR(t){return fR(Object.assign(Object.assign({},t),{brushRegion:pR,selectedHandles:["handle-n","handle-s"]}))}const mR="axis",yR="axis-line",vR="axis-main-group",bR="axis-hot-area";function xR(t){return t.getElementsByClassName(mR)}function wR(t){return t.getElementsByClassName(yR)[0]}function MR(t){return function(t){return t.getElementsByClassName(vR)[0]}(t).getLocalBounds()}function OR(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=Oe(e,["cross","offsetX","offsetY"]);const a=MR(t),s=wR(t),[c]=s.getLocalBounds().min,[l,u]=a.min,[f,d]=a.max,h=2*(f-l);return{brushRegion:pR,hotZone:new Kp({className:bR,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 ER(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=Oe(e,["offsetY","offsetX","cross"]);const a=MR(t),s=wR(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,d]=a.max,h=d-u;return{brushRegion:dR,hotZone:new Kp({className:bR,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 kR(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=UL(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=Oe(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),m=rj(p,a),{setState:y,removeState:v}=tj(u,m),b=new Map,x=wr(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(Wk(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)?ER:OR,{hotZone:r,brushRegion:i,extent:a}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=sR(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:HL,axes:xR,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:JL(o),state:nj(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function SR(t){var{hideX:e=!0,hideY:n=!0}=t,r=Oe(t,["hideX","hideY"]);return(t,i,o)=>{const{container:a,view:s,options:c,update:l,setState:u}=t,f=UL(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=wr(Oe(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=sR(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 $k(t,e,n,r,i,o)},filter:(t,r)=>ke(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=>Z({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 AR(t){return SR(Object.assign(Object.assign({hideX:!0},t),{brushRegion:dR}))}function _R(t){return SR(Object.assign(Object.assign({hideY:!0},t),{brushRegion:pR}))}const TR="slider";function PR(t,e,n,r=!1,i="x",o="y"){const{marks:a}=t,s=a.map((t=>{var a,s;return Z({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 CR(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return Wk(e,[Gk(e,o(r),!0),Gk(e,o(i),!1)])}function NR(t){return[t[0],t[t.length-1]]}function LR({initDomain:t={},className:e=TR,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=qc(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=NR(C.x),r=NR(C.y)]=e;return h?[Wk(k,n,m),Wk(S,r,b)]:[Wk(S,r,b),Wk(k,n,m)]}const{value:n}=t.detail;return[CR(n,v[l],A&&"horizontal"===e),C[u]]},N=rt((e=>ke(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:[NR(t),NR(n)]}}))}g(t,(t=>Object.assign(Object.assign({},PR(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 rp("valuechange",{data:i,nativeEvent:!1}));const c=h?Hk(a,k):Hk(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 rp("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 jR="g2-scrollbar";function RR(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(jR).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 LR(Object.assign(Object.assign({},t),{initDomain:l,className:jR,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 IR(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 BR={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 DR(t){return"text"===t.nodeName&&!!t.isOverflowing()}function FR(t){var{offsetX:e=8,offsetY:n=8}=t,r=Oe(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=wr(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!DR(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 Vp({className:"poptip",style:{innerHTML:IR("div",h,Object.assign(Object.assign({},BR),s)),x:f,y:d}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;DR(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()))}}}FR.props={reapplyWhenUpdate:!0};const zR={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function GR(t={}){const{originData:e=[],layout:n}=t,r=Oe(t,["originData","layout"]),i=Z({},zR,r),o=wr(i,"breadCrumb"),a=wr(i,"active");return t=>{const{update:r,setState:i,container:s,options:c}=t,l=function(t){return bm(t).select(`.${AS}`).node()}(s),u=c.marks[0],{state:f}=u,d=new Hp;l.appendChild(d);const h=(t,c)=>ke(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 Qp({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 Qp({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===ot(t)-1&&u.remove(),l}));c.forEach(((t,e)=>{if(e===ot(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(J(t,["style","path"]),J(t,["style","depth"]))}))}))}!function(t,e){[...Zj(t),...Kj(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=J(t,["id"]);return e&&(e.match(`${o}/`)||o.match(e))})).map((t=>({value:0===t.height?J(t,["value"]):void 0,name:J(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=DO(t,l,{value:"value"})[0]}else r=e.filter((t=>1===t.depth));const i=[];return r.forEach((({path:t})=>{i.push(N(t))})),Z({},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"!==J(n,["markType"]))return;const r=J(n,["__data__","key"]),i=A(e,(t=>t.id===r));J(i,"height")&&h(J(i,"path"),J(i,"depth"))};l.addEventListener("click",p);const g=E(Object.assign(Object.assign({},f.active),f.inactive)),m=()=>{dj(l).forEach((t=>{const n=J(t,["style","cursor"]),r=A(e,(e=>e.id===J(t,["__data__","key"])));if("pointer"!==n&&(null==r?void 0:r.height)){t.style.cursor="pointer";const e=et(t.attributes,g);t.addEventListener("mouseenter",(()=>{t.attr(f.active)})),t.addEventListener("mouseleave",(()=>{t.attr(Z(e,f.inactive))}))}}))};return m(),l.addEventListener("mousemove",m),()=>{d.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",m)}}}const WR={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},$R="movePoint",HR=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")))},VR=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},YR=(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})),UR=t=>{const e=J(t,["__data__","y"]),n=J(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:o},childNodes:a}=t.parentNode,s=A(o,(({type:t})=>"normalizeY"===t)),c=J(i,["y","field"]),l=r[a.indexOf(t)][c];return(t,e=!1)=>s||e?t/(1-t)/(n/(1-n))*l:t},qR=(t,e)=>{const n=J(t,["__data__","seriesItems",e,"0","value"]),r=J(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:o,transform:a}}=t.parentNode,s=A(a,(({type:t})=>"normalizeY"===t)),c=J(o,["y","field"]),l=i[r][c];return t=>s?1===n?t:t/(1-t)/(n/(1-n))*l:t},XR=(t,e,n)=>{t.forEach(((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)}))},ZR=(t,e,n,r)=>{const i=new qp({style:n}),o=new Qp({style:r});return e.appendChild(o),t.appendChild(i),[i,o]},KR=(t,e)=>{if(!J(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},QR=(t,e,n)=>{const r=uj(t,e),i=uj(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function JR(t={}){const{selection:e=[],precision:n=2}=t,r=Oe(t,["selection","precision"]),i=Object.assign(Object.assign({},WR),r||{}),o=wr(i,"path"),a=wr(i,"label"),s=wr(i,"point");return(t,r,i)=>{const{update:c,setState:l,container:u,view:f,options:{marks:d,coordinate:h}}=t,p=UL(u);let g,m=dj(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 Hp({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=J(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)=>ke(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=YR(c,a,s);return((t,e)=>{i.emit("element-point:moved",{nativeEvent:!0,data:{changeData:t,data:e}})})(c,l),Z({},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 Gp({name:$R,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),l=qR(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()),XR(E.childNodes,y,s);const[p,x]=ZR(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]=QR(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=fj([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=fj([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=fj([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=()=>ke(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",M),u.removeEventListener("mouseup",S),H(x.attr("text")))return;const e=Number(x.attr("text")),n=KR(N,b);g=yield B(i,e,n,["line","area"]),x.remove(),p.remove(),T(t)}));u.addEventListener("mouseup",S)})),E.appendChild(c)})),XR(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=UR(t),c=new Gp({name:$R,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=KR(N,b),[f,d]=ZR(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=fj([[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]=QR(R,[o,r],e),[l,u]=QR(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=uj(t,e[1]),o=uj(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=fj([[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=()=>ke(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",h),H(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",HR),t.addEventListener("mouseleave",VR)}));const P=t=>{const e=null==t?void 0:t.target;e&&(e.name===$R||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",HR),t.removeEventListener("mouseleave",VR)}))}}}function tI(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function eI(t,e){const[n,r]=t,[i,o]=e;return n>=i[0]&&n<=o[0]&&r>=i[1]&&r<=o[1]}const nI=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{$L(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]}(tI(e),tI(t.getLocalBounds()))));r?WL(t):n.push(t)})),t}};function rI([t,e],[n,r]){return r>t&&e>n}function iI(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function oI(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 aI=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]=iI(),[s,c]=iI(),[l,u]=iI(),[f,d]=iI();for(const e of t){const{min:t,max:n}=oI(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)=>En(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])&&!rI(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 sI(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function cI(t,e,n){return.2126*sI(t)+.7152*sI(e)+.0722*sI(n)}function lI(t,e){const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=cI(n,r,i),l=cI(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function uI(t,e){const n=or(e,(e=>lI(t,function(t){return"object"==typeof t?t:If(t)}(e))));return e[n]}const fI=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;lI(t.parsedStyle.fill,r)<e&&t.attr("fill",uI(r,n))})),t)},dI=()=>t=>(t.forEach((t=>{$L(t);const e=t.attr("bounds"),n=function(t,e){const[n,r]=t;return!(eI(n,e)&&eI(r,e))}(tI(t.getLocalBounds()),e);n&&WL(t)})),t);function hI(){return{"data.fetch":XO,"data.inline":rE,"data.sortBy":nE,"data.sort":JO,"data.filter":QO,"data.pick":tE,"data.rename":eE,"data.fold":ZO,"data.slice":cE,"data.custom":iE,"data.map":oE,"data.join":sE,"data.kde":dE,"data.log":hE,"transform.stackY":$r,"transform.binX":Is,"transform.bin":Rs,"transform.dodgeX":hi,"transform.jitter":Va,"transform.jitterX":Ya,"transform.jitterY":Ua,"transform.symmetryY":qa,"transform.diffY":Xa,"transform.stackEnter":pi,"transform.normalizeY":gi,"transform.select":ts,"transform.selectX":es,"transform.selectY":ns,"transform.groupX":ps,"transform.groupY":gs,"transform.groupColor":ms,"transform.group":hs,"transform.sortX":bs,"transform.sortY":ws,"transform.sortColor":xs,"transform.flexX":Ms,"transform.pack":Ns,"transform.sample":Ds,"transform.filter":Fs,"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":wM,"mark.rect":OM,"mark.line":AM,"mark.point":TM,"mark.text":CM,"mark.cell":LM,"mark.area":RM,"mark.link":BM,"mark.image":FM,"mark.polygon":GM,"mark.box":$M,"mark.vector":VM,"mark.lineX":XM,"mark.lineY":UM,"mark.connector":KM,"mark.range":eO,"mark.rangeX":rO,"mark.rangeY":oO,"mark.path":sO,"mark.shape":FO,"mark.density":gE,"mark.heatmap":yE,"palette.category10":vE,"palette.category20":bE,"scale.linear":wE,"scale.ordinal":ME,"scale.band":xE,"scale.identity":OE,"scale.point":EE,"scale.time":kE,"scale.log":SE,"scale.pow":AE,"scale.sqrt":CE,"scale.threshold":_E,"scale.quantile":TE,"scale.quantize":PE,"scale.sequential":NE,"scale.constant":LE,"theme.classic":BE,"theme.classicDark":zE,"theme.academy":WE,"theme.light":IE,"theme.dark":FE,"component.axisX":xk,"component.axisY":wk,"component.legendCategory":Ak,"component.legendContinuous":Nk,"component.legends":Qk,"component.title":Fk,"component.sliderX":Uk,"component.sliderY":qk,"component.scrollbarX":Zk,"component.scrollbarY":Kk,"animation.scaleInX":Jk,"animation.scaleOutX":tS,"animation.scaleInY":eS,"animation.scaleOutY":nS,"animation.waveIn":yS,"animation.fadeIn":rS,"animation.fadeOut":iS,"animation.zoomIn":vS,"animation.zoomOut":bS,"animation.pathIn":xS,"animation.morphing":mS,"animation.growInX":wS,"animation.growInY":MS,"interaction.elementHighlight":gj,"interaction.elementHighlightByX":mj,"interaction.elementHighlightByColor":yj,"interaction.elementSelect":bj,"interaction.elementSelectByX":xj,"interaction.elementSelectByColor":wj,"interaction.fisheye":Oj,"interaction.chartIndex":Mj,"interaction.tooltip":Gj,"interaction.legendFilter":eR,"interaction.legendHighlight":nR,"interaction.brushHighlight":fR,"interaction.brushXHighlight":hR,"interaction.brushYHighlight":gR,"interaction.brushAxisHighlight":kR,"interaction.brushFilter":SR,"interaction.brushXFilter":AR,"interaction.brushYFilter":_R,"interaction.sliderFilter":LR,"interaction.scrollbarFilter":RR,"interaction.poptip":FR,"interaction.treemapDrillDown":GR,"interaction.elementPointMove":JR,"composition.spaceLayer":D_,"composition.spaceFlex":F_,"composition.facetRect":eT,"composition.repeatMatrix":sT,"composition.facetCircle":hT,"composition.timingKeyframe":gT,"labelTransform.overlapHide":nI,"labelTransform.overlapDodgeY":aI,"labelTransform.overflowHide":dI,"labelTransform.contrastReverse":fI}}function pI(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const gI={};const mI=t=>t?parseInt(t):0;function yI(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 vI{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 yI(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return yI(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return yI(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 bI=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"],xI="__remove__",wI="__callback__";function MI(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function OI(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||mI(e.width),r=t.clientHeight||mI(e.height);return{width:n-(mI(e.paddingLeft)+mI(e.paddingRight)),height:r-(mI(e.paddingTop)+mI(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 EI(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of bI)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,MI(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===wI)e.children=t.value;else{const i=MI(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}function kI(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 bI)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 bI)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function SI(t,e,n){if("function"==typeof t){const e=new vI;return e.value=t,e.type=wI,e}const{type:r,children:i}=t,o=Oe(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 AI(t,e){const{type:n,children:r}=e,i=Oe(e,["type","children"]);t.type===n||void 0===n?Ar(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function _I(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=SI(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 TI(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function PI(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 CI(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 NI(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(kr(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 LI(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function jI(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function RI(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?TI(e,n,r):"array"===t?PI(e,n,r):"object"===t?CI(e,n,r):"node"===t?LI(e,n,r):"container"===t?jI(e,n,r):"mix"===t&&NI(e,n)}return e}}function II(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const BI={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"}},DI=Object.assign(Object.assign({},BI),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),FI=Object.assign(Object.assign({},BI),{labelTransform:{type:"array"}});let zI=class extends vI{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()&&$L(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&WL(t)}};zI=Ee([RI(FI)],zI);let GI=class extends vI{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)}};GI=Ee([RI(DI)],GI);const WI="G2_CHART_KEY";class $I extends zI{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:o}=t;super(Oe(t,["container","canvas","renderer","plugins","lib"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=U((()=>{this.forceFit()}),300),this._renderer=r||new EA,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[xI]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new _A,this._context={library:Object.assign(Object.assign({},o),gI),emitter:this._emitter,canvas:n},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)=>BL(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 EI(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,kI(t,e,n,r,i)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){AI(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 _I(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(TA.BEFORE_CLEAR),this._reset(),DL(0,this._context,!1),this.emit(TA.AFTER_CLEAR)}destroy(){this.options();this.emit(TA.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),DL(0,this._context,!0),this._container[xI]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(TA.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=OI(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(TA.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(TA.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(TA.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(TA.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 GI{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 zI{constructor(){super({},e)}};return n=Ee([RI(II(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))RI(II(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=WI}=t,{width:n,height:r,depth:i}=OI(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}=OI(this.options(),this._container);this._plugins.push(new SA),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new dg({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 HI=pI($I,Object.assign({},hI()));t.AREA_CLASS_NAME=PS,t.Academy=WE,t.Bin=Rs,t.BinX=Is,t.COMPONENT_CLASS_NAME=_S,t.Chart=HI,t.ChartEvent=TA,t.Classic=BE,t.ClassicDark=zE,t.Dark=FE,t.DiffY=Xa,t.DodgeX=hi,t.ELEMENT_CLASS_NAME=kS,t.Filter=Fs,t.FlexX=Ms,t.Group=hs,t.GroupColor=ms,t.GroupX=ps,t.GroupY=gs,t.Jitter=Va,t.JitterX=Ya,t.JitterY=Ua,t.LABEL_CLASS_NAME=TS,t.LABEL_LAYER_CLASS_NAME=ES,t.Light=IE,t.LinearAxis=vk,t.MAIN_LAYER_CLASS_NAME=OS,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=oi,t.MaybeDefaultY=ai,t.MaybeFunctionAttribute=ui,t.MaybeGradient=di,t.MaybeIdentityX=ii,t.MaybeIdentityY=ri,t.MaybeKey=Jr,t.MaybeSeries=ti,t.MaybeSize=Qr,t.MaybeStackY=Vr,t.MaybeTitle=qr,t.MaybeTooltip=si,t.MaybeTuple=fi,t.MaybeTupleX=ni,t.MaybeTupleY=ei,t.MaybeVisualPosition=li,t.MaybeZeroPadding=ci,t.MaybeZeroX=Xr,t.MaybeZeroY=Zr,t.MaybeZeroY1=On,t.MaybeZeroZ=Kr,t.NormalizeY=gi,t.PLOT_CLASS_NAME=AS,t.Pack=Ns,t.Runtime=$I,t.Sample=Ds,t.Select=ts,t.SelectX=es,t.SelectY=ns,t.Selection=xm,t.SortColor=xs,t.SortX=bs,t.SortY=ws,t.StackEnter=pi,t.StackY=$r,t.SymmetryY=qa,t.VIEW_CLASS_NAME=SS,t.corelib=hI,t.extend=pI,t.register=function(t,e){Object.assign(gI,{[t]:e})},t.render=BL,t.renderToMountedElement=function(t,e={},n=(()=>{}),r=(t=>{throw t})){var i;const{width:o=640,height:a=480}=t,s=RL(t),{group:c=new Hp,emitter:l=new _A,library:u}=e;(null==c?void 0:c.parentElement)||yr("renderToMountedElement can't render chart to unmounted group.");const f=bm(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(TA.BEFORE_RENDER),cL(Object.assign(Object.assign({},s),{width:o,height:a}),f,u,e).then((()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame((()=>{l.emit(TA.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),c},t.select=bm,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
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 void 0===t},V=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]=V(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=V(t[i]):e[i]=t[i];return e},Y=V;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 U(t,e){if(Object.hasOwn)return Object.hasOwn(t,e);if(null==t)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(t),e)}function X(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(U(e,i)){var o=e[i];null!==o&&S(o)?(S(t[i])||(t[i]={}),n<r?X(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 Z=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)X(t,e[r]);return t},K=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=K(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=K(t[i[r]],e[i[r]]));r++);return n}return!1},Q=K,J=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},tt=Object.prototype.hasOwnProperty,et=function(t,e){if(null===t||!S(t))return{};var n={};return O(e,(function(e){tt.call(t,e)&&(n[e]=t[e])})),n},nt=function(t,e){return P(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},rt=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},it=function(){};function ot(t){return v(t)?0:g(t)?t.length:Object.keys(t).length}var at=1e-6,st="undefined"!=typeof Float32Array?Float32Array:Array;function ct(){var t=new st(9);return st!=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 lt=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 ut(){var t=new st(16);return st!=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 ft(t){var e=new st(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 dt(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 ht(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 pt(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 gt(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 mt(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 yt(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 vt(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 bt(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 xt(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 wt(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 Mt(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 Ot(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 Et(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 kt(t,e,n){var r,i,o,a=n[0],s=n[1],c=n[2],l=Math.hypot(a,s,c);return l<at?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 St(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 At(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 _t(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 Tt(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 Pt(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Ct(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 Nt(t,e){var n=new st(3);Ct(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 Lt(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 jt(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 Rt(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 It=Rt;function Bt(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 Dt=Bt;function Ft(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 zt(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)<at&&Math.abs(g-w)<at&&Math.abs(m-M)<at?pt(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 Gt(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 Wt=vt,$t=Gt,Ht=Object.freeze({__proto__:null,create:ut,clone:ft,copy:dt,fromValues:function(t,e,n,r,i,o,a,s,c,l,u,f,d,h,p,g){var m=new st(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:ht,identity:pt,transpose:gt,invert:mt,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:yt,multiply:vt,translate:bt,scale:xt,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<at?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:wt,rotateY:Mt,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:Ot,fromScaling:Et,fromRotation:kt,fromXRotation:St,fromYRotation:At,fromZRotation:_t,fromRotationTranslation:Tt,fromQuat2:function(t,e){var n=new st(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)),Tt(t,e,n),t},getTranslation:Pt,getScaling:Ct,getRotation:Nt,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:Lt,fromQuat:jt,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:Rt,perspective:It,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:Bt,ortho:Dt,orthoZO:Ft,lookAt:zt,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:Gt,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)<=at*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-b)<=at*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=at*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-w)<=at*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-M)<=at*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(s-O)<=at*Math.max(1,Math.abs(s),Math.abs(O))&&Math.abs(c-E)<=at*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(l-k)<=at*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(u-S)<=at*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-A)<=at*Math.max(1,Math.abs(f),Math.abs(A))&&Math.abs(d-_)<=at*Math.max(1,Math.abs(d),Math.abs(_))&&Math.abs(h-T)<=at*Math.max(1,Math.abs(h),Math.abs(T))&&Math.abs(p-P)<=at*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-C)<=at*Math.max(1,Math.abs(g),Math.abs(C))&&Math.abs(m-N)<=at*Math.max(1,Math.abs(m),Math.abs(N))&&Math.abs(y-L)<=at*Math.max(1,Math.abs(y),Math.abs(L))},mul:Wt,sub:$t});function Vt(){var t=new st(3);return st!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Yt(t){var e=new st(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function qt(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function Ut(t,e,n){var r=new st(3);return r[0]=t,r[1]=e,r[2]=n,r}function Xt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Zt(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Kt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Qt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Jt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function te(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 ee(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ne(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 re(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 ie(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 oe(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 ae(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)<=at*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=at*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=at*Math.max(1,Math.abs(i),Math.abs(s))}var se=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)},ce=qt;function le(){var t=new st(4);return st!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function ue(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 fe(){var t=new st(4);return st!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function de(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 he(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 pe(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 ge(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}Vt(),function(){var t=le()}();var me=function(t,e,n,r){var i=new st(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ye=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ve=he,be=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};Vt(),Ut(1,0,0),Ut(0,1,0),fe(),fe(),ct(),function(){var t,e=(t=new st(2),st!=Float32Array&&(t[0]=0,t[1]=0),t)}();var xe=function(t,e){return xe=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])},xe(t,e)};function we(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}xe(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var Me=function(){return Me=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},Me.apply(this,arguments)};function Oe(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 Ee(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 ke(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 Se(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 Ae(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 _e(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 Te(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 Pe(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 Ce={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Ne(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 Le={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function je(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Le[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Re(t){return je(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Ie(t){return Re(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}function Be(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Le[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,Le[n]))),Le[n]););}function De(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 Fe(t){return t>=48&&t<=57||43===t||45===t||46===t}function ze(t){return t>=48&&t<=57}function Ge(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)),ze(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&ze(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;o<n&&ze(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;ze(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&&ze(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;o<n&&ze(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 We(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 $e(t){for(var e=t.pathValue,n=t.max;t.index<n&&We(e.charCodeAt(t.index));)t.index+=1}function He(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Le[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,$e(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Ge(t):De(t),t.err.length)return;t.data.push(t.param),$e(t),t.index<e&&44===n.charCodeAt(t.index)&&(t.index+=1,$e(t))}if(t.index>=t.max)break;if(!Fe(n.charCodeAt(t.index)))break}Be(t)}else Be(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var Ve=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 Ye(t){if(Re(t))return[].concat(t);var e=function(t){if(je(t))return[].concat(t);var e=new Ve(t);for($e(e);e.index<e.max&&!e.err.length;)He(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 qe(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 Ue(t){if(Ie(t))return[].concat(t);for(var e=Ye(t),n=Me({},Ce),r=0;r<e.length;r+=1){e[r]=qe(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 Xe(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Ze(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=Xe(g,m,-M)).x,m=u.y;var E=(g-(b=(u=Xe(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=Ze(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,q=(O=W.concat($,H,O)).length;Y<q;Y+=1)V[Y]=Y%2?Xe(O[Y-1],O[Y],M).y:Xe(O[Y],O[Y+1],M).x;return V}function Ke(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}var Qe=function(t,e,n,r){return Te(Te([],Ke([t,e],[n,r],.5),!0),[n,r,n,r],!1)};function Je(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(Ze(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(Qe(g,m,h,p));case"Z":return g===y&&m===v?["C",g,m,y,v,y,v]:["C"].concat(Qe(g,m,y,v))}return t}function tn(t,e){if(void 0===e&&(e=!1),function(t){return Ie(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=Ue(t),a=Me({},Ce),s=[],c="",l=o.length,u=[],f=0;f<l;f+=1){o[f]&&(c=o[f][0]),s[f]=c;var d=Je(o[f],a);o[f]=d,Ne(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 en(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function nn(t,e,n,r,i){var o=en([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=Ke([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 rn(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 on(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 nn(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=rn({x:1,y:0},_),P=rn(_,{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 an(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=on(t,e,n,r,i,o,a,s,c,S/y)).x,x=f.y,h&&k.push({x:b,y:x}),g&&(w+=en(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 sn(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 cn(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=sn(t,e,n,r,i,o,a,s,k/m)).x,b=u.y,d&&E.push({x:v,y:b}),p&&(x+=en(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 ln(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 un(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=ln(t,e,n,r,i,o,O/p)).x,y=c.y,u&&M.push({x:m,y:y}),d&&(v+=en(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 fn(t,e,n){for(var r,i,o,a,s,c,l,u,f,d=Ue(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=nn(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=an(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=cn(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=un(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=nn((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 dn(t){return function(t){var e=0,n=0,r=0;return tn(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 hn(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?cn(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=Ke(n,r,e),s=Ke(r,i,e),c=Ke(i,o,e),l=Ke(a,s,e),u=Ke(s,c,e),f=Ke(l,u,e);return[["C"].concat(a,l,f),["C"].concat(u,c,o)]}(r):[t,t]:[t],l:i}}))}function pn(t,e,n){var r=hn(t),i=hn(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:pn(g[0],g[1],f)}function gn(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}function mn(t,e){if(null!==t)return{type:"column",value:t,field:e}}function yn(t,e){const n=mn(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function vn(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function bn(t,e){const n=mn(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function xn(t,e){const n=[];for(const r of t)n[r]=e;return n}function wn(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function Mn(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=wn(t,n);if(null!==e)return[e,r]}}return[null,null]}function On(t){return!(t instanceof Date)&&"object"==typeof t}const En=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{y1:yn(xn(t,0))}})]};function kn(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Sn(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function An(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=kn,n=(e,n)=>kn(t(e),n),r=(e,n)=>t(e)-n):(e=t===kn||t===Sn?t:_n,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 _n(){return 0}function Tn(t){return null===t?NaN:+t}En.props={};const Pn=An(kn),Cn=Pn.right,Nn=Pn.left,Ln=An(Tn).center;var jn=Cn;function Rn(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 In(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 Bn(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 Dn extends Map{constructor(t,e=zn){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(Fn(this,t))}has(t){return super.has(Fn(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 Fn({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function zn(t){return null!==t&&"object"==typeof t?t.valueOf():t}function Gn(t){return t}function Wn(t,...e){return Yn(t,Gn,Gn,e)}function $n(t,...e){return Yn(t,Array.from,Gn,e)}function Hn(t,e,...n){return Yn(t,Gn,e,n)}function Vn(t,e,...n){return Yn(t,Array.from,e,n)}function Yn(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new Dn,s=r[o++];let c=-1;for(const t of i){const e=s(t,++c,i),n=a.get(e);n?n.push(t):a.set(e,[t])}for(const[e,n]of a)a.set(e,t(n,o));return e(a)}(t,0)}function qn(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const r=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),r.sort(((t,n)=>{for(const r of e){const e=Xn(r[t],r[n]);if(e)return e}}))):(n=t.map(n),r.sort(((t,e)=>Xn(n[t],n[e])))),function(t,e){return Array.from(e,(e=>t[e]))}(t,r)}return t.sort(Un(n))}function Un(t=kn){if(t===kn)return Xn;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 Xn(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}var Zn=Array.prototype.slice;function Kn(t){return()=>t}const Qn=Math.sqrt(50),Jn=Math.sqrt(10),tr=Math.sqrt(2);function er(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>=Qn?10:o>=Jn?5:o>=tr?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?er(t,e,2*n):[s,c,l]}function nr(t,e,n){return er(t=+t,e=+e,n=+n)[2]}function rr(t){return Math.max(1,Math.ceil(Math.log(Rn(t))/Math.LN2)+1)}function ir(){var t=Gn,e=Bn,n=rr;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===Bn&&([u,f]=function(t,e,n){let r;for(;;){const i=nr(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?er(e,t,n):er(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=nr(u,f,n)),d[d.length-1]>=f)if(t>=f&&e===Bn){const t=nr(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[jn(d,o,0,h)].push(r[i]);return y}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:Kn(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:Kn([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:Kn(Array.isArray(t)?Zn.call(t):t),r):n},r}function or(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 ar(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 sr(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 cr(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 lr(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?Xn:Un(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);lr(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(ur(t,n,e),i(t[r],o)>0&&ur(t,n,r);a<s;){for(ur(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?ur(t,n,s):(++s,ur(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function ur(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function fr(t,e,n=Tn){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>Tn(n(t[r],r,t)))),e<=0)return cr(r);if(e>=1)return ar(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return lr(i,a,0,o,((t,e)=>Xn(r[t],r[e]))),a=function(t,e=kn){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?kn(t,i)>0:0===kn(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 dr(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 hr(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 sr(t);if(e>=1)return or(t);var r,i=(r-1)*e,o=Math.floor(i),a=or(lr(t,o).subarray(0,o+1));return a+(sr(t.subarray(o+1))-a)*(i-o)}}(t,.5,e)}function pr(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 gr(t){return t}function mr(t){return t.reduce(((t,e)=>(n,...r)=>e(t(n,...r),...r)),gr)}function yr(t){return t.replace(/( |^)[a-z]/g,(t=>t.toUpperCase()))}function vr(t=""){throw new Error(t)}function br(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 xr(t){return null!=t&&!Number.isNaN(t)}function wr(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 Mr(t,e){return Or(t,e)||{}}function Or(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 Er(t,...e){return Object.fromEntries(Object.entries(t).filter((([t])=>e.every((e=>!t.startsWith(e))))))}function kr(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 Sr(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function Ar(t){return null===t||!1===t}function _r(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])?_r(t[i],o,n,r+1):t[i]=o}return t}}function Tr(t,e){return Object.entries(t).reduce(((n,[r,i])=>(n[r]=e(i,r,t),n)),{})}function Pr(t){return t.map(((t,e)=>e))}function Cr(t){return t[0]}function Nr(t){return t[t.length-1]}function Lr(t,e){const n=[[],[]];return t.forEach((t=>{n[e(t)?0:1].push(t)})),n}function jr(t,e=t.length){if(1===e)return t.map((t=>[t]));const n=[];for(let r=0;r<t.length;r++){jr(t.slice(r+1),e-1).forEach((e=>{n.push([t[r],...e])}))}return n}function Rr(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=wn(r,t))||void 0===e?void 0:e[0]]})).filter((([,t])=>xr(t)));return Array.from(Wn(e,(t=>i.map((([,e])=>e[t])).join("-"))).values())}function Ir(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce(((t,i)=>0!==t?t:kn(e[n][i],e[r][i])),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>$r((n=>t(e[n])))}(t):"series"===t?Fr:"value"===t?zr:"sum"===t?Gr:"maxIndex"===t?Wr:()=>null}function Br(t,e){for(const n of t)n.sort(e)}function Dr(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function Fr(t,e,n){return $r((t=>n[t]))}function zr(t,e,n){return $r((t=>e[t]))}function Gr(t,e,n){const r=Pr(t),i=Array.from(Wn(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,n.reduce(((t,n)=>t+ +e[n]))])));return $r((t=>o.get(n[t])))}function Wr(t,e,n){const r=Pr(t),i=Array.from(Wn(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,ar(n,(t=>e[t]))])));return $r((t=>o.get(n[t])))}function $r(t){return(e,n)=>kn(t(e),t(n))}const Hr=(t={})=>{const{groupBy:e="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=t;return(t,s)=>{const{data:c,encode:l,style:u={}}=s,[f,d]=wn(l,"y"),[h,p]=wn(l,"y1"),[g]=a?Mn(l,"series","color"):wn(l,"color"),m=Rr(e,t,s),y=Ir(n)(c,f,g);y&&Br(m,y);const v=new Array(t.length),b=new Array(t.length),x=new Array(t.length),w=[],M=[];for(const t of m){r&&t.reverse();const e=h?+h[t[0]]:0,n=[],i=[];for(const r of t){const t=x[r]=+f[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===f[o[s]];)s--;for(;c<a.length-1&&0===f[a[c]];)c++;w.push(o[s]),M.push(a[c]);let l=e;for(const t of i.reverse()){const e=x[t];l=v[t]=(b[t]=l)+e}let u=e;for(const t of n){const e=x[t];e>0?u=v[t]=(b[t]=u)+e:v[t]=b[t]=u}}const O=new Set(w),E=new Set(M),k="y"===i?v:b,S="y"===o?v:b;return[t,Z({},s,{encode:{y0:yn(f,d),y:mn(k,d),y1:mn(S,p)},style:Object.assign({first:(t,e)=>O.has(e),last:(t,e)=>E.has(e)},u)})]}};function Vr(t){const{type:e}=t;return"string"==typeof e&&["stackY","dodgeX","groupX"].includes(e)}Hr.props={};const Yr=t=>(e,n,r)=>{const{encode:i,transform:o=[]}=n;if(o.some(Vr))return[e,n];const{x:a,y:s}=i;if(void 0===a||void 0===s)return[e,n];const{series:c}=t;return Hr({groupBy:c?["x","series"]:"x"})(e,n,r)};function qr(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function Ur(t){const e=`${t.getFullYear()}-${qr(t.getMonth()+1)}-${qr(t.getDate())}`,n=t.getHours(),r=t.getMinutes(),i=t.getSeconds();return n||r||i?`${e} ${qr(n)}:${qr(r)}:${qr(i)}`:e}Yr.props={};const Xr=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(Ar(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=>wn(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?Ur(t[e]):t[e])).join(", ")};return[t,Z({},n,{tooltip:{title:s}})]}};Xr.props={};const Zr=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{x:yn(xn(t,0))},scale:{x:{guide:null}}})]};Zr.props={};const Kr=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{y:yn(xn(t,0))},scale:{y:{guide:null}}})]};Kr.props={};const Qr=()=>(t,e)=>{const{encode:n}=e,{z:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{z:yn(xn(t,0))},scale:{z:{guide:null}}})]};Qr.props={};const Jr=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,Z({},e,{encode:{size:vn(xn(t,3))}})]};Jr.props={};const ti=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=Oe(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,Z({},e,{encode:{key:mn(a)}})]};ti.props={};const ei=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[o,a]=wn(n,"color");return[t,Z({},e,{encode:{series:mn(o,a)}})]};ei.props={};const ni=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(On)?[t,e]:[t,Z({},e,{encode:{y:mn(n)}})]};ni.props={};const ri=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(On)?[t,e]:[t,Z({},e,{encode:{x:mn(n)}})]};ri.props={};const ii=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=wn(n,"y");return[t,Z({},e,{encode:{y1:mn([...i])}})]};ii.props={};const oi=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=wn(n,"x");return[t,Z({},e,{encode:{x1:mn([...i])}})]};oi.props={};const ai=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(On))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,Z({},e,{encode:{x:mn(r(n,0)),x1:mn(r(n,1))}})]}return[t,e]};ai.props={};const si=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(On))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,Z({},e,{encode:{y:mn(r(n,0)),y1:mn(r(n,1))}})]}return[t,e]};si.props={};const ci=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(Ar(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,Z({},n,{tooltip:{items:a}})]}};ci.props={};const li=()=>(t,e)=>[t,Z({scale:{x:{padding:0},y:{padding:0}}},e)];li.props={};const ui=()=>(t,e)=>{const{data:n,style:r={}}=e,i=Oe(e,["data","style"]),{x:o,y:a}=r,s=Oe(r,["x","y"]);if(null==o||null==a)return[t,e];const c=a||0;return[[0],Z({},i,{data:[0],cartesian:!0,encode:{x:mn([o||0]),y:mn([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};ui.props={};const fi=()=>(t,e)=>{const{style:n={}}=e;return[t,Z({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter((([,t])=>"function"==typeof t)).map((([t,e])=>[t,()=>e]))))})]};fi.props={};const di=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(On))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,Z({},e,{encode:{x:mn(i),y:mn(o)}})]};di.props={};const hi=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:o}=n;return!o||i?[t,e]:[t,Z({},e,{encode:{series:vn(xn(t,void 0))}})]};hi.props={};const pi=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return Oe(t,["groupBy","reverse","orderBy","padding"]),(t,o)=>{const{data:a,encode:s,scale:c}=o,{series:l}=c,[u]=wn(s,"y"),[f]=Mn(s,"series","color"),d=Dr(f,l),h=Rr(e,t,o),p=Ir(r)(a,u,f);p&&Br(h,p);const g=new Array(t.length);for(const t of h){n&&t.reverse();for(let e=0;e<t.length;e++)g[t[e]]=d[e]}return[t,Z({},o,{scale:{series:{domain:d,paddingInner:i}},encode:{series:mn(g)}})]}};pi.props={};const gi=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,wn(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(Wn(n,(e=>t[e])).values());e.push(...r)}l=e}if(r){const[t]=wn(s,r);t&&l.sort(((e,r)=>n(e,t)-n(r,t))),i&&l.reverse()}const u=(o||3e3)/l.length,[f]=o?[xn(t,u)]:Mn(s,"enterDuration",xn(t,u)),[d]=Mn(s,"enterDelay",xn(t,0)),h=new Array(t.length);for(let t=0,e=0;t<l.length;t++){const n=l[t],r=or(n,(t=>+f[t]));for(const t of n)h[t]=+d[t]+e;e+=r}return[t,Z({},a,{encode:{enterDuration:vn(f),enterDelay:vn(h)}})]}};gi.props={};const mi=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:o}=r,a=Oe(i,["x"]),s=Object.entries(a).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,wn(i,t)[0]])),[,c]=s.find((([t])=>"y"===t)),l=s.map((([e])=>[e,new Array(t.length)])),u=Rr(e,t,r),f=function(t){return"function"==typeof t?t:{min:(t,e)=>sr(t,(t=>e[+t])),max:(t,e)=>or(t,(t=>e[+t])),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>dr(t,(t=>e[+t])),median:(t,e)=>hr(t,(t=>e[+t])),sum:(t,e)=>pr(t,(t=>e[+t])),deviation:(t,e)=>In(t,(t=>e[+t]))}[t]||or}(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=Ar(o)||(null==o?void 0:o.items)&&0!==(null==o?void 0:o.items.length);return[t,Z({},r,Object.assign({encode:Object.fromEntries(l.map((([t,e])=>[t,mn(e,wn(i,t)[1])])))},!d&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function yi(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function vi(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function bi(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}mi.props={};const xi=Math.sqrt(50),wi=Math.sqrt(10),Mi=Math.sqrt(2);function Oi(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>=xi?10:o>=wi?5:o>=Mi?2:1)*10**i:-(10**-i)/(o>=xi?10:o>=wi?5:o>=Mi?2:1)}function Ei(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>=xi?i*=10:o>=wi?i*=5:o>=Mi&&(i*=2),e<t?-i:i}const ki=(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=Oi(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=Oi(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=Oi(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},Si=1e3,Ai=6e4,_i=36e5,Ti=864e5,Pi=6048e5,Ci=2592e6,Ni=31536e6;function Li(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 ji=Li(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Ri=Li(Si,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Si*e)}),(t=>t.getSeconds())),Ii=Li(Ai,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+Ai*e)}),(t=>t.getMinutes())),Bi=Li(_i,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+_i*e)}),(t=>t.getHours())),Di=Li(Ti,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Ti*e)}),(t=>t.getDate()-1)),Fi=Li(Ci,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),zi=Li(Pi,(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=Fi.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Pi)})),Gi=Li(Ni,(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())),Wi={millisecond:ji,second:Ri,minute:Ii,hour:Bi,day:Di,week:zi,month:Fi,year:Gi},$i=Li(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Hi=Li(Si,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Si*e)}),(t=>t.getUTCSeconds())),Vi=Li(Ai,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+Ai*e)}),(t=>t.getUTCMinutes())),Yi=Li(_i,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+_i*e)}),(t=>t.getUTCHours())),qi=Li(Ti,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Ti*e)}),(t=>t.getUTCDate()-1)),Ui=Li(Ci,(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)}),(t=>t.getUTCMonth())),Xi=Li(Pi,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Pi*e)}),(t=>{const e=Ui.floor(t),n=new Date(+t);return Math.floor((+n-+e)/Pi)})),Zi=Li(Ni,(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())),Ki={millisecond:$i,second:Hi,minute:Vi,hour:Yi,day:qi,week:Xi,month:Ui,year:Zi};function Qi(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?Ki:Wi,{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=bi(s,d,0,h,u);let g;if(p===h){g=[c,Ei(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(Ei(o,a,f),1)]}return g}const Ji=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Qi(a,s,n,r,i),u=[c.floor(a,l),c.ceil(s,l)];return o?u.reverse():u};var to=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},eo={}.toString,no=function(t,e){return eo.call(t)==="[object "+e+"]"},ro=function(t){return null==t},io=function(t){return Array.isArray?Array.isArray(t):no(t,"Array")},oo=function(t){return"object"==typeof t&&null!==t},ao=function(t){if(!oo(t)||!no(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},so=function(t){return no(t,"Number")},co=function(t){return null===t},lo=function(t){return void 0===t};function uo(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&&ao(o)?(ao(t[i])||(t[i]={}),n<r?uo(t[i],o,n+1,r):t[i]=e[i]):io(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var fo=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)uo(t,e[r]);return t},ho=function(t,e){if(!to(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},po=function(t){return t};function go(t){return ro(t)?0:to(t)?t.length:Object.keys(t).length}function mo(t){return!lo(t)&&!co(t)&&!Number.isNaN(t)}const yo=t=>e=>-t(-e),vo=(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?yo(r):r},bo=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?yo(n):n},xo=(t,e,n,r)=>{const i=t<0,o=vo(r,i),a=bo(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 wo={exports:{}},Mo={exports:{}},Oo=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))},Eo=Array.prototype.concat,ko=Array.prototype.slice,So=Mo.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];Oo(i)?e=Eo.call(e,ko.call(i)):e.push(i)}return e};So.wrap=function(t){return function(){return t(So(arguments))}};var Ao={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]},_o=Mo.exports,To=Object.hasOwnProperty,Po=Object.create(null);for(var Co in Ao)To.call(Ao,Co)&&(Po[Ao[Co]]=Co);var No=wo.exports={to:{},get:{}};function Lo(t,e,n){return Math.min(Math.max(e,t),n)}function jo(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}No.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=No.get.hsl(t),n="hsl";break;case"hwb":e=No.get.hwb(t),n="hwb";break;default:e=No.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},No.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]:To.call(Ao,e[1])?((i=Ao[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]=Lo(i[n],0,255);return i[3]=Lo(i[3],0,1),i},No.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,Lo(parseFloat(e[2]),0,100),Lo(parseFloat(e[3]),0,100),Lo(isNaN(n)?1:n,0,1)]}return null},No.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,Lo(parseFloat(e[2]),0,100),Lo(parseFloat(e[3]),0,100),Lo(isNaN(n)?1:n,0,1)]}return null},No.to.hex=function(){var t=_o(arguments);return"#"+jo(t[0])+jo(t[1])+jo(t[2])+(t[3]<1?jo(Math.round(255*t[3])):"")},No.to.rgb=function(){var t=_o(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]+")"},No.to.rgb.percent=function(){var t=_o(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]+")"},No.to.hsl=function(){var t=_o(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},No.to.hwb=function(){var t=_o(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},No.to.keyword=function(t){return Po[t.slice(0,3)]};var Ro=wo.exports;function Io(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 Bo(t){const e=Ro.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*Io(a,o,e+1/3),255*Io(a,o,e),255*Io(a,o,e-1/3),i]}(r):null}const Do=(t,e)=>n=>t*(1-n)+e*n,Fo=(t,e)=>"number"==typeof t&&"number"==typeof e?Do(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=Bo(t),r=Bo(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,zo=(t,e)=>{const n=Do(t,e);return t=>Math.round(n(t))};function Go({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Wo(t){return"object"==typeof t?t.valueOf():t}class $o extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Wo,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Go({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Go({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 Ho{constructor(t){this.options=fo({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=fo({},this.options,t),this.rescale(t)}rescale(t){}}const Vo=Symbol("defaultUnknown");function Yo(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function qo(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==Vo)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function Uo(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Xo extends Ho{getDefaultOptions(){return{domain:[],range:[],unknown:Vo}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Yo(this.domainIndexMap,this.getDomain(),this.domainKey),qo({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Yo(this.rangeIndexMap,this.getRange(),this.rangeKey),qo({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=Uo(e),this.rangeKey=Uo(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 Xo(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 Zo(t){return Math.round(1e12*t)/1e12}function Ko(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 $o(e.map(((t,e)=>{const n=m[e]*v;return[t,a?Math.floor(n):n]}))),x=new $o(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]=Zo(O);const n=e[t];O+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:E}}class Qo extends Xo{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:Vo,flex:[]}}constructor(t){super(t)}clone(){return new Qo(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 Ko(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 Jo=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=Oi(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 ta extends Ho{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:Jo}}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 so(r)&&so(i)?t(r,i,n):[]}clone(){return new ta(this.options)}}function ea(t){return Math.abs(t)<1e-14?t:parseFloat(t.toFixed(14))}const na=[1,5,2,2.5,4,3],ra=100*Number.EPSILON;function ia(t,e,n,r,i,o){const a=go(e),s=ho(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,o);return(l<ra||o-l<ra)&&r<=0&&i>=0&&(c=1),1-s/(a-1)-n+c}function oa(t,e,n){const r=go(e);return 1-ho(e,t)/(r-1)-n+1}function aa(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 sa(t,e){return t>=e?2-(t-1)/(e-1):1}function ca(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function la(t,e,n){const r=e-t;if(n>r){return 1-((n-r)/2)**2/(.1*r)**2}return 1}const ua=(t,e,n=5,r=!0,i=na,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=oa(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=sa(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=la(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=ia(l,i,c,n,h,p),y=ca(t,e,n,h),v=aa(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=ea(s.lmax),u=ea(s.lmin),f=ea(s.lstep),d=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,h=new Array(d);h[0]=ea(u);for(let t=1;t<d;t+=1)h[t]=ea(h[t-1]+f);return h};class fa extends Ho{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:ua}}map(t){return mo(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new fa(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return so(r)&&so(i)?n(r,i,e):[]}}const da=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=vi(r,i),c=n(o,a)):(s=vi(i,r),c=n(a,o)),yi(c,s)},ha=(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]=vi(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=bi(t,e,1,r)-1,a=i[n];return yi(o[n],a)(e)}},pa=(t,e,n,r)=>(Math.min(t.length,e.length)>2?ha:da)(t,e,r?zo:n);class ga extends Ho{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Do,tickCount:5}}map(t){return mo(t)?this.output(t):this.options.unknown}invert(t){return mo(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 ki}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]):po}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=pa(n.map(t),r,o,i);this.output=yi(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=pa(i,r.map(t),Do);this.input=yi(e,n,o)}}class ma extends ga{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Fo,tickMethod:Jo,tickCount:5}}chooseTransforms(){return[po,po]}clone(){return new ma(this.options)}}class ya extends Qo{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:Vo,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new ya(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const va=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class ba extends ga{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:Fo,tickMethod:Jo,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[po,po];const e=.5===t?va:(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 ba(this.options)}}class xa extends ba{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Fo,tickMethod:Jo,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new xa(this.options)}}class wa extends Ho{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!mo(t))return this.options.unknown;const e=bi(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 wa(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const Ma=(t,e,n,r=10)=>{const i=t<0,o=bo(r,i),a=vo(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=Jo(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);d=Jo(u,f,t).map(o)}return s?d.reverse():d};class Oa extends ga{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:Fo,tickMethod:Ma,tickCount:5}}chooseNice(){return xo}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[vo(t,n),bo(t,n)]}clone(){return new Oa(this.options)}}class Ea extends wa{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:ua}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=ki(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 Ea(this.options)}}function ka(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 Sa extends wa{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:ua}}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(ka(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 Sa(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}var Aa=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,_a=/\[([^]*?)\]/gm;function Ta(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}function Pa(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 Ca=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Na=["January","February","March","April","May","June","July","August","September","October","November","December"],La=Ta(Na,3),ja=Pa({},{dayNamesShort:Ta(Ca,3),dayNames:Ca,monthNamesShort:La,monthNames:Na,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),Ra=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},Ia={D:function(t){return String(t.getDate())},DD:function(t){return Ra(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return Ra(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 Ra(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 Ra(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return Ra(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return Ra(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return Ra(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return Ra(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return Ra(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return Ra(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return Ra(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?"-":"+")+Ra(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+Ra(Math.floor(Math.abs(e)/60),2)+":"+Ra(Math.abs(e)%60,2)}},Ba={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 Da=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Qi(a,s,n,r,i),u=c.range(a,new Date(+s+1),l,!0);return o?u.reverse():u};function Fa(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class za extends ga{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:Da,interpolate:Do,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return Ji}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?Ki:Wi,r=e?Fa:po;return e=>function(t,e,n){if(void 0===e&&(e=Ba.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=Ba[e]||e).replace(_a,(function(t,e){return r.push(e),"@@@"}));var i=Pa(Pa({},ja),n);return(e=e.replace(Aa,(function(e){return Ia[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 za(this.options)}}var Ga,Wa=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 $a=Ga=class extends ma{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:po,tickMethod:Jo,tickCount:5}}constructor(t){super(t)}clone(){return new Ga(this.options)}};function Ha(t,e,n){if(null===t)return[-.5,.5];const r=Dr(t,e),i=new Qo({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function Va(t,e,n){return e*(1-t)+n*t}$a=Ga=Wa([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 so(n)?Math.round(n):n})(i):i;this.output=yi(s,a,n,t)},n.prototype.invert=void 0}}((function(t){return[t(0),t(1)]}),(t=>{const[e,n]=t;return yi(Do(0,1),vi(e,n))}))],$a);const Ya=(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]=wn(o,"x"),[u]=wn(o,"y"),f=Ha(l,s,n),d=Ha(u,c,r),h=t.map((()=>Va(i(),...d))),p=t.map((()=>Va(i(),...f)));return[t,Z({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:mn(h),dx:mn(p)}})]}};Ya.props={};const qa=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{x:a}=o,[s]=wn(i,"x"),c=Ha(s,a,e),l=t.map((()=>Va(n(),...c)));return[t,Z({scale:{x:{padding:.5}}},r,{encode:{dx:mn(l)}})]}};qa.props={};const Ua=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{y:a}=o,[s]=wn(i,"y"),c=Ha(s,a,e),l=t.map((()=>Va(n(),...c)));return[t,Z({scale:{y:{padding:.5}}},r,{encode:{dy:mn(l)}})]}};Ua.props={};const Xa=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,i=Oe(r,["x"]),o=Object.entries(i).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,wn(r,t)[0]])),a=o.map((([e])=>[e,new Array(t.length)])),s=Rr(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]=Bn(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,Z({},n,{encode:Object.fromEntries(a.map((([t,e])=>[t,mn(e,wn(r,t)[1])])))})]}};Xa.props={};const Za=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(t,r)=>{const{encode:i}=r,[o]=wn(i,"y"),[a,s]=wn(i,"y1");n?Mn(i,"series","color"):wn(i,"color");const c=Rr(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,Z({},r,{encode:{y1:mn(l,s)}})]}};function Ka(t,e){return[t[0]]}function Qa(t,e){return[t[t.length-1]]}function Ja(t,e){return[t[ar(t,(t=>e[t]))]]}function ts(t,e){return[t[cr(t,(t=>e[t]))]]}Za.props={};const es=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:o}=i,a=Rr(e,t,i),[s]=wn(o,n),c=function(t){return"function"==typeof t?t:{first:Ka,last:Qa,max:Ja,min:ts}[t]||Ka}(r);return[a.flatMap((t=>c(t,s))),i]}};es.props={};const ns=(t={})=>{const{selector:e}=t,n=Oe(t,["selector"]);return es(Object.assign({channel:"x",selector:e},n))};ns.props={};const rs=(t={})=>{const{selector:e}=t,n=Oe(t,["selector"]);return es(Object.assign({channel:"y",selector:e},n))};function is(t){return e=>null===e?t:`${t} of ${e}`}function os(){return[(t,e)=>dr(t,(t=>+e[t])),is("mean")]}function as(){return[(t,e)=>hr(t,(t=>+e[t])),is("median")]}function ss(){return[(t,e)=>or(t,(t=>+e[t])),is("max")]}function cs(){return[(t,e)=>sr(t,(t=>+e[t])),is("min")]}function ls(){return[(t,e)=>t.length,is("count")]}function us(){return[(t,e)=>pr(t,(t=>+e[t])),is("sum")]}function fs(){return[(t,e)=>e[t[0]],is("first")]}function ds(){return[(t,e)=>e[t[t.length-1]],is("last")]}rs.props={};const hs=(t={})=>{const{groupBy:e}=t,n=Oe(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:os,max:ss,count:ls,first:fs,last:ds,sum:us,min:cs,median:as}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,c]=wn(o,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=wn(o,n);return r})(c,e),u=a.map((t=>n(t,null!=s?s:i)));return[t,Object.assign(Object.assign({},bn(u,(null==r?void 0:r(l))||l)),{aggregate:!0})]})),c=Object.keys(o).map((t=>{const[e,n]=wn(o,t),r=a.map((t=>e[t[0]]));return[t,mn(r,n)]})),l=a.map((t=>i[t[0]]));return[Pr(a),Z({},r,{data:l,encode:Object.fromEntries([...c,...s])})]}};hs.props={};const ps=(t={})=>{const{channels:e=["x","y"]}=t,n=Oe(t,["channels"]);return hs(Object.assign(Object.assign({},n),{groupBy:(t,n)=>Rr(e,t,n)}))};ps.props={};const gs=(t={})=>ps(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));gs.props={};const ms=(t={})=>ps(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));ms.props={};const ys=(t={})=>ps(Object.assign(Object.assign({},t),{channels:["color"]}));function vs(t,e,n){var r;const{reverse:i,slice:o,channel:a}=n,s=Oe(n,["reverse","slice","channel"]),{encode:c,scale:l={}}=e,u=null===(r=l[a])||void 0===r?void 0:r.domain,[f]=wn(c,a),d=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[o]=wn(n,r);if("function"==typeof i)return t=>i(t,o);if("max"===i)return t=>or(t,(t=>+o[t]));if("min"===i)return t=>sr(t,(t=>+o[t]));if("sum"===i)return t=>pr(t,(t=>+o[t]));if("median"===i)return t=>hr(t,(t=>+o[t]));if("mean"===i)return t=>dr(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?qn(Hn(t,e,n),(([t,e],[n,r])=>kn(e,r)||kn(t,n))):qn(Wn(t,n),(([t,n],[r,i])=>e(n,i)||kn(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,Z(e,{scale:{[a]:{domain:m}}})]}ys.props={};const bs=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,o=Oe(t,["reverse","slice","channel","ordinal"]);return(t,a)=>i?vs(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]=wn(o,i),s=qn(t,(t=>a[t]));return r&&s.reverse(),[s,e]}(t,a,Object.assign({reverse:e,slice:n,channel:r},o))};bs.props={};const xs=(t={})=>bs(Object.assign(Object.assign({},t),{channel:"x"}));xs.props={};const ws=(t={})=>bs(Object.assign(Object.assign({},t),{channel:"color"}));ws.props={};const Ms=(t={})=>bs(Object.assign(Object.assign({},t),{channel:"y"}));Ms.props={};const Os=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:o,encode:a}=i,[s]=wn(a,"x"),c=e?function(t,e){return"string"==typeof e?t.map((t=>t[e])):t.map(e)}(o,e):wn(a,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>pr(t,(t=>+e[t]));throw new Error(`Unknown reducer: ${t}`)}(r,c),u=Vn(t,l,(t=>s[t])).map((t=>t[1]));return[t,Z({},i,{scale:{x:{flex:u}}})]}};function Es([t,e],[n,r]){return[t-n,e-r]}function ks([t,e],[n,r]){return[t+n,e+r]}function Ss([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function As([t,e]){return Math.atan2(e,t)}function _s([t,e]){return As([t,e])+Math.PI/2}function Ts(t,e){const n=As(t),r=As(e);return n<r?r-n:2*Math.PI-(n-r)}function Ps(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 Cs([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function Ns(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]=Ps(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})`}))}}Os.props={};const Ls=t=>(e,n)=>[e,Z({},n,{modifier:Ns(t),axis:!1})];Ls.props={};const js="thresholds";function Rs(t){const[e,n]=Bn(t);return Math.min(200,function(t,e,n){const r=Rn(t),i=In(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}const Is=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=Oe(t,["groupChannels","binChannels"]),i={};return hs(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter((([t])=>!t.startsWith(js))))),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]=wn(a,t);return e})),c=Mr(r,js),l=t.filter((t=>s.every((e=>xr(e[t]))))),u=[...e.map((t=>{const[e]=wn(a,t);return e})).filter(xr).map((t=>e=>t[e])),...n.map(((t,e)=>{const n=s[e],r=c[t]||Rs(n),o=ir().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(Wn(l,(t=>u.map((e=>e(t))).join("-"))).values())}}))};Is.props={};const Bs=(t={})=>{const{thresholds:e}=t;return Is(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};function Ds(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]))}Bs.props={};const Fs=(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 Ds;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[cr(t,(t=>n[t]))]],max:(t,e,n)=>[t[ar(t,(t=>n[t]))]],median:(t,e,n)=>{return[t[(r=t,i=t=>n[t],fr(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=Rr(r,t,e),[s]=wn(o,"x"),[c]=wn(o,"y");return[a.flatMap((t=>i(t,s,c,n))),e]}};Fs.props={};const zs=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map((([t,e])=>{const[n]=wn(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(xr);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,Z({},n,{encode:Object.fromEntries(c),data:a.map((t=>i[t]))})]};function Gs(t){return function(){return t}}zs.props={};const Ws=Math.abs,$s=Math.atan2,Hs=Math.cos,Vs=Math.max,Ys=Math.min,qs=Math.sin,Us=Math.sqrt,Xs=1e-12,Zs=Math.PI,Ks=Zs/2,Qs=2*Zs;function Js(t){return t>=1?Ks:t<=-1?-Ks:Math.asin(t)}const tc=Math.PI,ec=2*tc,nc=1e-6,rc=ec-nc;function ic(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class oc{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?ic:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return ic;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>nc)if(Math.abs(u*s-c*l)>nc&&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((tc-Math.acos((p+f-g)/(2*m*y)))/2),b=v/y,x=v/m;Math.abs(b-1)>nc&&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)>nc||Math.abs(this._y1-l)>nc)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%ec+ec),f>rc?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>nc&&this._append`A${n},${n},0,${+(f>=tc)},${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 ac(){return new oc}function sc(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 oc(e)}function cc(t){return t.innerRadius}function lc(t){return t.outerRadius}function uc(t){return t.startAngle}function fc(t){return t.endAngle}function dc(t){return t&&t.padAngle}function hc(t,e,n,r,i,o,a){var s=t-n,c=e-r,l=(a?o:-o)/Us(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)*Us(Vs(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 pc(){var t=cc,e=lc,n=Gs(0),r=null,i=uc,o=fc,a=dc,s=null,c=sc(l);function l(){var l,u,f=+t.apply(this,arguments),d=+e.apply(this,arguments),h=i.apply(this,arguments)-Ks,p=o.apply(this,arguments)-Ks,g=Ws(p-h),m=p>h;if(s||(s=l=c()),d<f&&(u=d,d=f,f=u),d>Xs)if(g>Qs-Xs)s.moveTo(d*Hs(h),d*qs(h)),s.arc(0,0,d,h,p,!m),f>Xs&&(s.moveTo(f*Hs(p),f*qs(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>Xs&&(r?+r.apply(this,arguments):Us(f*f+d*d)),A=Ys(Ws(d-f)/2,+n.apply(this,arguments)),_=A,T=A;if(S>Xs){var P=Js(S/f*qs(k)),C=Js(S/d*qs(k));(O-=2*P)>Xs?(w+=P*=m?1:-1,M-=P):(O=0,w=M=(h+p)/2),(E-=2*C)>Xs?(b+=C*=m?1:-1,x-=C):(E=0,b=x=(h+p)/2)}var N=d*Hs(b),L=d*qs(b),j=f*Hs(M),R=f*qs(M);if(A>Xs){var I,B=d*Hs(x),D=d*qs(x),F=f*Hs(w),z=f*qs(w);if(g<Zs)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<Xs))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/qs(function(t){return t>1?0:t<-1?Zs:Math.acos(t)}((G*$+W*H)/(Us(G*G+W*W)*Us($*$+H*H)))/2),Y=Us(I[0]*I[0]+I[1]*I[1]);_=Ys(A,(f-Y)/(V-1)),T=Ys(A,(d-Y)/(V+1))}else _=T=0}E>Xs?T>Xs?(y=hc(F,z,N,L,d,T,m),v=hc(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,$s(y.y01,y.x01),$s(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,T,$s(y.y01,y.x01),$s(y.y11,y.x11),!m),s.arc(0,0,d,$s(y.cy+y.y11,y.cx+y.x11),$s(v.cy+v.y11,v.cx+v.x11),!m),s.arc(v.cx,v.cy,T,$s(v.y11,v.x11),$s(v.y01,v.x01),!m))):(s.moveTo(N,L),s.arc(0,0,d,b,x,!m)):s.moveTo(N,L),f>Xs&&O>Xs?_>Xs?(y=hc(j,R,B,D,f,-_,m),v=hc(N,L,F,z,f,-_,m),s.lineTo(y.cx+y.x01,y.cy+y.y01),_<A?s.arc(y.cx,y.cy,_,$s(y.y01,y.x01),$s(v.y01,v.x01),!m):(s.arc(y.cx,y.cy,_,$s(y.y01,y.x01),$s(y.y11,y.x11),!m),s.arc(0,0,f,$s(y.cy+y.y11,y.cx+y.x11),$s(v.cy+v.y11,v.cx+v.x11),m),s.arc(v.cx,v.cy,_,$s(v.y11,v.x11),$s(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-Zs/2;return[Hs(r)*n,qs(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:Gs(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:Gs(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:Gs(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Gs(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:Gs(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:Gs(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:Gs(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function gc(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function mc(t){this._context=t}function yc(t){return new mc(t)}function vc(t){return t[0]}function bc(t){return t[1]}function xc(t,e){var n=Gs(!0),r=null,i=yc,o=null,a=sc(s);function s(s){var c,l,u,f=(s=gc(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?vc:Gs(t),e="function"==typeof e?e:void 0===e?bc:Gs(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:Gs(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:Gs(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:Gs(!!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 wc(t,e,n){var r=null,i=Gs(!0),o=null,a=yc,s=null,c=sc(l);function l(l){var u,f,d,h,p,g=(l=gc(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 xc().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?vc:Gs(+t),e="function"==typeof e?e:Gs(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?bc:Gs(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:Gs(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:Gs(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:Gs(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:Gs(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:Gs(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:Gs(+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:Gs(!!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}ac.prototype=oc.prototype,mc.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 Mc=Ec(yc);function Oc(t){this._curve=t}function Ec(t){function e(e){return new Oc(t(e))}return e._curve=t,e}function kc(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(Ec(t)):e()._curve},t}function Sc(){}function Ac(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 _c(t,e){this._context=t,this._k=(1-e)/6}function Tc(t,e){this._context=t,this._k=(1-e)/6}function Pc(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Xs){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>Xs){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 Cc(t,e){this._context=t,this._alpha=e}function Nc(t,e){this._context=t,this._alpha=e}Oc.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))}},_c.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:Ac(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:Ac(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 _c(t,e)}return n.tension=function(e){return t(+e)},n}(0),Tc.prototype={areaStart:Sc,areaEnd:Sc,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:Ac(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 Tc(t,e)}return n.tension=function(e){return t(+e)},n}(0),Cc.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:Pc(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 Cc(t,e):new _c(t,0)}return n.alpha=function(e){return t(+e)},n}(.5),Nc.prototype={areaStart:Sc,areaEnd:Sc,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:Pc(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 Lc=function t(e){function n(t){return e?new Nc(t,e):new Tc(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function jc(t){this._context=t}function Rc(t){return new jc(t)}function Ic(t){return t<0?-1:1}function Bc(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(Ic(o)+Ic(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Dc(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function Fc(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 zc(t){this._context=t}function Gc(t){this._context=new Wc(t)}function Wc(t){this._context=t}function $c(t){return new zc(t)}function Hc(t){return new Gc(t)}function Vc(t,e){this._context=t,this._t=e}function Yc(t){return new Vc(t,.5)}function qc(t){return new Vc(t,0)}function Uc(t){return new Vc(t,1)}function Xc(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function Zc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function Kc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function Qc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function Jc(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function tl(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function el(t){return Qc(t)||Zc(t)}function nl(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find((t=>"polar"===t[0]));return[+n,+r]}function rl(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]}jc.prototype={areaStart:Sc,areaEnd:Sc,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))}},zc.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:Fc(this,this._t0,Dc(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,Fc(this,Dc(this,n=Bc(this,t,e)),n);break;default:Fc(this,this._t0,n=Bc(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(Gc.prototype=Object.create(zc.prototype)).point=function(t,e){zc.prototype.point.call(this,e,t)},Wc.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)}},Vc.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 il="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},ol={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}(ol);var al=ol.exports;function sl(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function cl(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function ll(){}var ul=.7,fl=1/ul,dl="\\s*([+-]?\\d+)\\s*",hl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",pl="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gl=/^#([0-9a-f]{3,8})$/,ml=new RegExp("^rgb\\("+[dl,dl,dl]+"\\)$"),yl=new RegExp("^rgb\\("+[pl,pl,pl]+"\\)$"),vl=new RegExp("^rgba\\("+[dl,dl,dl,hl]+"\\)$"),bl=new RegExp("^rgba\\("+[pl,pl,pl,hl]+"\\)$"),xl=new RegExp("^hsl\\("+[hl,pl,pl]+"\\)$"),wl=new RegExp("^hsla\\("+[hl,pl,pl,hl]+"\\)$"),Ml={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 Ol(){return this.rgb().formatHex()}function El(){return this.rgb().formatRgb()}function kl(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=gl.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Sl(e):3===n?new _l(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Al(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Al(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=ml.exec(t))?new _l(e[1],e[2],e[3],1):(e=yl.exec(t))?new _l(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=vl.exec(t))?Al(e[1],e[2],e[3],e[4]):(e=bl.exec(t))?Al(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=xl.exec(t))?Nl(e[1],e[2]/100,e[3]/100,1):(e=wl.exec(t))?Nl(e[1],e[2]/100,e[3]/100,e[4]):Ml.hasOwnProperty(t)?Sl(Ml[t]):"transparent"===t?new _l(NaN,NaN,NaN,0):null}function Sl(t){return new _l(t>>16&255,t>>8&255,255&t,1)}function Al(t,e,n,r){return r<=0&&(t=e=n=NaN),new _l(t,e,n,r)}function _l(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Tl(){return"#"+Cl(this.r)+Cl(this.g)+Cl(this.b)}function Pl(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Cl(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Nl(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new jl(t,e,n,r)}function Ll(t){if(t instanceof jl)return new jl(t.h,t.s,t.l,t.opacity);if(t instanceof ll||(t=kl(t)),!t)return new jl;if(t instanceof jl)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 jl(a,s,c,t.opacity)}function jl(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Rl(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Il(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Bl(t,e){var n=Math.min.apply(Math,Te([],_e(t),!1)),r=Math.min.apply(Math,Te([],_e(e),!1));return{x:n,y:r,width:Math.max.apply(Math,Te([],_e(t),!1))-n,height:Math.max.apply(Math,Te([],_e(e),!1))-r}}function Dl(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Fl(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function zl(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=Dl(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=Fl(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}}sl(ll,kl,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Ol,formatHex:Ol,formatHsl:function(){return Ll(this).formatHsl()},formatRgb:El,toString:El}),sl(_l,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof ll||(i=kl(i)),i?new _l((i=i.rgb()).r,i.g,i.b,i.opacity):new _l):new _l(t,e,n,null==r?1:r);var i}),cl(ll,{brighter:function(t){return t=null==t?fl:Math.pow(fl,t),new _l(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?ul:Math.pow(ul,t),new _l(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){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:Tl,formatHex:Tl,formatRgb:Pl,toString:Pl})),sl(jl,(function(t,e,n,r){return 1===arguments.length?Ll(t):new jl(t,e,n,null==r?1:r)}),cl(ll,{brighter:function(t){return t=null==t?fl:Math.pow(fl,t),new jl(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?ul:Math.pow(ul,t),new jl(this.h,this.s,this.l*t,this.opacity)},rgb:function(){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 _l(Rl(t>=240?t-240:t+120,i,r),Rl(t,i,r),Rl(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Gl=1e-4;function Wl(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,Te([],_e(t.concat([h])),!1)),i.apply(void 0,Te([],_e(e.concat([h])),!1))];(v=Il(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<Gl);d++){var m=a-f,y=a+f,v=(p=[i.apply(void 0,Te([],_e(t.concat([m])),!1)),i.apply(void 0,Te([],_e(e.concat([m])),!1))],Il(c[0],c[1],p[0],p[1]));if(m>=0&&v<s)a=m,s=v;else{var b=[i.apply(void 0,Te([],_e(t.concat([y])),!1)),i.apply(void 0,Te([],_e(e.concat([y])),!1))],x=Il(c[0],c[1],b[0],b[1]);y<=1&&x<s?(a=y,s=x):f*=.5}}return{x:i.apply(void 0,Te([],_e(t.concat([a])),!1)),y:i.apply(void 0,Te([],_e(e.concat([a])),!1))}}function $l(t,e,n,r){return Il(t,e,n,r)}function Hl(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Vl(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 Yl(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 ql(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 Ul(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],u=ql(t,n,i,a),f=ql(e,r,o,s),d=0;d<u.length;d++)c.push(Yl(t,n,i,a,u[d]));for(d=0;d<f.length;d++)l.push(Yl(e,r,o,s,f[d]));return Bl(c,l)}function Xl(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 Wl([t,n,i,a],[e,r,o,s],c,l,Yl,u)}(t,e,n,r,i,o,a,s,c,l,u);return Il(f.x,f.y,c,l)}function Zl(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+=Il(r[0],r[1],i[0],i[1])}return e}(t)}function Kl(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Ql(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 Jl(t,e,n,r,i,o){var a=Ql(t,n,i)[0],s=Ql(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(Kl(t,n,i,a)),void 0!==s&&l.push(Kl(e,r,o,s)),Bl(c,l)}function tu(t,e,n,r,i,o,a,s){var c=function(t,e,n,r,i,o,a,s){return Wl([t,n,i],[e,r,o],a,s,Kl)}(t,e,n,r,i,o,a,s);return Il(c.x,c.y,a,s)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==il||"undefined"!=typeof self&&self;var eu={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}()}(eu);var nu,ru,iu=eu.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"}(nu||(nu={})),function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"}(ru||(ru={}));var ou=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}(),au=function(){function t(t){this.clipSpaceNearZ=ru.NEGATIVE_ONE,this.plugins=[],this.config=Me({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 su(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function cu(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function lu(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function uu(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function fu(t){return void 0===t?0:t>360||t<-360?t%360:t}function du(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?Yt(t):j(t)?Ut(t,e,n):Ut(t[0],t[1]||e,t[2]||n)}function hu(t){return t*(Math.PI/180)}function pu(t){return t*(180/Math.PI)}function gu(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=_e(Ct(Vt(),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 st(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 yu(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=pu(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var vu=ut(),bu=ut(),xu=le(),wu=[Vt(),Vt(),Vt()],Mu=Vt();function Ou(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 Eu,ku=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){su(this.center,t),su(this.halfExtents,e),cu(this.min,this.center,this.halfExtents),lu(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){lu(this.center,e,t),uu(this.center,this.center,.5),cu(this.halfExtents,e,t),uu(this.halfExtents,this.halfExtents,.5),su(this.min,t),su(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],cu(this.min,n,r),lu(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?su([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?su([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}(),Su=function(){function t(t,e){this.distance=t||0,this.normal=e||Ut(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 ee(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/ce(this.normal);Jt(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&&re(n,t,e,i),o},t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(Eu||(Eu={}));var Au,_u,Tu,Pu=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new Su)}return t.prototype.extractFromVPMatrix=function(t){var e=_e(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];Zt(this.planes[0].normal,o-n,l-a,h-u),this.planes[0].distance=y-p,Zt(this.planes[1].normal,o+n,l+a,h+u),this.planes[1].distance=y+p,Zt(this.planes[2].normal,o+r,l+s,h+f),this.planes[2].distance=y+g,Zt(this.planes[3].normal,o-r,l-s,h-f),this.planes[3].distance=y-g,Zt(this.planes[4].normal,o-i,l-c,h-d),this.planes[4].distance=y-m,Zt(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}(),Cu=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}(),Nu=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}(),Lu="Method not implemented.",ju="Use document.documentElement instead.";!function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"}(Au||(Au={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"}(_u||(_u={})),function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"}(Tu||(Tu={}));var Ru,Iu,Bu,Du,Fu,zu="updated",Gu=2e-4,Wu=function(){function t(){this.clipSpaceNearZ=ru.NEGATIVE_ONE,this.eventEmitter=new al,this.matrix=ut(),this.right=Ut(1,0,0),this.up=Ut(0,1,0),this.forward=Ut(0,0,1),this.position=Ut(0,0,1),this.focalPoint=Ut(0,0,0),this.distanceVector=Ut(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=ut(),this.projectionMatrixInverse=ut(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Au.EXPLORING,this.trackingMode=_u.DEFAULT,this.projectionMode=Tu.PERSPECTIVE,this.frustum=new Pu,this.orthoMatrix=ut()}return t.prototype.isOrtho=function(){return this.projectionMode===Tu.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===Au.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Au.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!==Au.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 mt(ut(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(t,e){var n=Ot(ut(),[t,e,0]);this.jitteredProjectionMatrix=vt(ut(),n,this.projectionMatrix)},t.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},t.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},t.prototype.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===Tu.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===Tu.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===Tu.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===Tu.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===Tu.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Tu.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=Ut(a.x-r,a.y-i,0),c=ee(s,this.right)/qt(this.right),l=ee(s,this.up)/qt(this.up);return this.pan(-c,-l),this},t.prototype.setPerspective=function(t,e,n,r){var i;this.projectionMode=Tu.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(hu(.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,o-a,t,this.far,this.clipSpaceNearZ===ru.ZERO),xt(this.projectionMatrix,this.projectionMatrix,Ut(1,-1,1)),mt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(t,e,n,r,i,o){var a;this.projectionMode=Tu.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===ru.NEGATIVE_ONE?Dt(this.projectionMatrix,f,d,p,h,i,o):Ft(this.projectionMatrix,f,d,p,h,i,o),xt(this.projectionMatrix,this.projectionMatrix,Ut(1,-1,1)),mt(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=du(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=Ut(0,1,0);if(this.focalPoint=du(t,e,n),this.trackingMode===_u.CINEMATIC){var i=Qt(Vt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=qt(i),a=pu(Math.asin(e/o)),s=90+pu(Math.atan2(n,t)),c=ut();Mt(c,c,hu(s)),wt(c,c,hu(a)),r=ie(Vt(),[0,1,0],c)}return mt(this.matrix,zt(ut(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},t.prototype.getDistance=function(){return this.distance},t.prototype.getDistanceVector=function(){return this.distanceVector},t.prototype.setDistance=function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<Gu&&(this.distance=Gu),this.dollyingStep=this.distance/100;var e=Vt();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=fu(t),this.computeMatrix(),this._getAxes(),this.type===Au.ORBITING||this.type===Au.EXPLORING?this._getPosition():this.type===Au.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(t){return this.elevation=fu(t),this.computeMatrix(),this._getAxes(),this.type===Au.ORBITING||this.type===Au.EXPLORING?this._getPosition():this.type===Au.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(t){return this.roll=fu(t),this.computeMatrix(),this._getAxes(),this.type===Au.ORBITING||this.type===Au.EXPLORING?this._getPosition():this.type===Au.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=de(fe(),[0,0,1],hu(this.roll));pt(this.matrix);var e=de(fe(),[1,0,0],hu((this.rotateWorld&&this.type!==Au.TRACKING||this.type===Au.TRACKING?1:-1)*this.elevation)),n=de(fe(),[0,1,0],hu((this.rotateWorld&&this.type!==Au.TRACKING||this.type===Au.TRACKING?1:-1)*this.azimuth)),r=he(fe(),n,e);r=he(fe(),r,t);var i=jt(ut(),r);this.type===Au.ORBITING||this.type===Au.EXPLORING?(bt(this.matrix,this.matrix,this.focalPoint),vt(this.matrix,this.matrix,i),bt(this.matrix,this.matrix,[0,0,this.distance])):this.type===Au.TRACKING&&(bt(this.matrix,this.matrix,this.position),vt(this.matrix,this.matrix,i))},t.prototype._setPosition=function(t,e,n){this.position=du(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(){Xt(this.right,du(ue(le(),[1,0,0,0],this.matrix))),Xt(this.up,du(ue(le(),[0,1,0,0],this.matrix))),Xt(this.forward,du(ue(le(),[0,0,1,0],this.matrix))),te(this.right,this.right),te(this.up,this.up),te(this.forward,this.forward)},t.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=qt(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===Au.TRACKING||this.rotateWorld?(this.elevation=pu(Math.asin(e/r)),this.azimuth=pu(Math.atan2(-t,-n))):(this.elevation=-pu(Math.asin(e/r)),this.azimuth=-pu(Math.atan2(-t,-n)))},t.prototype._getPosition=function(){Xt(this.position,du(ue(le(),[0,0,0,1],this.matrix))),this._getDistance()},t.prototype._getFocalPoint=function(){var t,e;oe(this.distanceVector,[0,0,-this.distance],(t=ct(),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)),Kt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},t.prototype._getDistance=function(){this.distanceVector=Qt(Vt(),this.focalPoint,this.position),this.distance=qt(this.distanceVector),this.dollyingStep=this.distance/100},t.prototype._getOrthoMatrix=function(){if(this.projectionMode===Tu.ORTHOGRAPHIC){var t=this.position,e=de(fe(),[0,0,1],-this.roll*Math.PI/180);Lt(this.orthoMatrix,e,Ut((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Ut(this.zoom,this.zoom,1),t)}},t.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=vt(ut(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(zu)}},t.prototype.rotate=function(t,e,n){throw new Error(Lu)},t.prototype.pan=function(t,e){throw new Error(Lu)},t.prototype.dolly=function(t){throw new Error(Lu)},t.prototype.createLandmark=function(t,e){throw new Error(Lu)},t.prototype.gotoLandmark=function(t,e){throw new Error(Lu)},t.prototype.cancelLandmarkAnimation=function(){throw new Error(Lu)},t}();function $u(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($u.Cache||Map),n}$u.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"}(Ru||(Ru={})),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"}(Iu||(Iu={})),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"}(Bu||(Bu={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Du||(Du={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Fu||(Fu={}));var Hu,Vu=[{name:"em",unit_type:Ru.kEms},{name:"px",unit_type:Ru.kPixels},{name:"deg",unit_type:Ru.kDegrees},{name:"rad",unit_type:Ru.kRadians},{name:"grad",unit_type:Ru.kGradians},{name:"ms",unit_type:Ru.kMilliseconds},{name:"s",unit_type:Ru.kSeconds},{name:"rem",unit_type:Ru.kRems},{name:"turn",unit_type:Ru.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"}(Hu||(Hu={}));var Yu,qu=function(t){return t?"number"===t?Ru.kNumber:"percent"===t||"%"===t?Ru.kPercentage:function(t){return Vu.find((function(e){return e.name===t})).unit_type}(t):Ru.kUnknown},Uu=function(t){var e=1;switch(t){case Ru.kPixels:case Ru.kDegrees:case Ru.kSeconds:break;case Ru.kMilliseconds:e=.001;break;case Ru.kRadians:e=180/Math.PI;break;case Ru.kGradians:e=.9;break;case Ru.kTurns:e=360}return e},Xu=function(t){switch(t){case Ru.kNumber:case Ru.kInteger:return"";case Ru.kPercentage:return"%";case Ru.kEms:return"em";case Ru.kRems:return"rem";case Ru.kPixels:return"px";case Ru.kDegrees:return"deg";case Ru.kRadians:return"rad";case Ru.kGradians:return"grad";case Ru.kMilliseconds:return"ms";case Ru.kSeconds:return"s";case Ru.kTurns:return"turn"}return""},Zu=function(){function t(){}return t.isAngle=function(t){return t===Ru.kDegrees||t===Ru.kRadians||t===Ru.kGradians||t===Ru.kTurns},t.isLength=function(t){return t>=Ru.kEms&&t<Ru.kDegrees},t.isRelativeUnit=function(t){return t===Ru.kPercentage||t===Ru.kEms||t===Ru.kRems},t.isTime=function(t){return t===Ru.kSeconds||t===Ru.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(Du.kNo,Fu.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=Hu.kUnitType&&this.getType()<=Hu.kClampType},t}(),Ku=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return we(e,t),e.prototype.getType=function(){return Hu.kColorType},e.prototype.to=function(t){return this},e}(Zu);!function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"}(Yu||(Yu={}));var Qu=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return we(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 Hu.kColorType},e}(Zu),Ju=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return we(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return Hu.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(Zu),tf=$u((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),ef=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function nf(t){return"function"==typeof t}var rf={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},of=$u((function(t){var e=tf(t),n=rf[e];return e=(null==n?void 0:n.alias)||e})),af=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},sf=function(t){return function(t){switch(t){case Iu.kUNumber:return Ru.kNumber;case Iu.kULength:return Ru.kPixels;case Iu.kUPercent:return Ru.kPercentage;case Iu.kUTime:return Ru.kSeconds;case Iu.kUAngle:return Ru.kDegrees;default:return Ru.kUnknown}}(function(t){switch(t){case Ru.kNumber:case Ru.kInteger:return Iu.kUNumber;case Ru.kPercentage:return Iu.kUPercent;case Ru.kPixels:return Iu.kULength;case Ru.kMilliseconds:case Ru.kSeconds:return Iu.kUTime;case Ru.kDegrees:case Ru.kRadians:case Ru.kGradians:case Ru.kTurns:return Iu.kUAngle;default:return Iu.kUOther}}(t))},cf=function(t){function e(e,n){void 0===n&&(n=Ru.kNumber);var r,i=t.call(this)||this;return r="string"==typeof n?qu(n):n,i.unit=r,i.value=e,i}return we(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 Hu.kUnitType},e.prototype.convertTo=function(t){if(this.unit===t)return new e(this.value,this.unit);var n=sf(this.unit);if(n!==sf(t)||n===Ru.kUnknown)return null;var r=Uu(this.unit)/Uu(t);return new e(this.value*r,t)},e.prototype.buildCSSText=function(t,e,n){var r;switch(this.unit){case Ru.kUnknown:break;case Ru.kInteger:r=Number(this.value).toFixed(0);break;case Ru.kNumber:case Ru.kPercentage:case Ru.kEms:case Ru.kRems:case Ru.kPixels:case Ru.kDegrees:case Ru.kRadians:case Ru.kGradians:case Ru.kMilliseconds:case Ru.kSeconds:case Ru.kTurns:var i=this.value,o=Xu(this.unit);if(i<-999999||i>999999){var a=Xu(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?af(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r},e}(Zu),lf=new cf(0,"px");new cf(1,"px");var uf,ff,df=new cf(0,"deg"),hf=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 we(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}(Ku),pf=new Ju("unset"),gf=new Ju("initial"),mf=new Ju("inherit"),yf={"":pf,unset:pf,initial:gf,inherit:mf},vf=function(t){return yf[t]||(yf[t]=new Ju(t)),yf[t]},bf=new hf(0,0,0,0,!0),xf=new hf(0,0,0,0),wf=$u((function(t,e,n,r){return new hf(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Mf=function(t,e){return void 0===e&&(e=Ru.kNumber),new cf(t,e)};new cf(50,"%"),function(t){t[t.Standard=0]="Standard"}(uf||(uf={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"}(ff||(ff={}));var Of,Ef={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Nu(0,0,0,0)};function kf(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>"}(Of||(Of={}));var Sf=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 Af=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,_f=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Tf=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Pf=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Cf={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},Nf=$u((function(t){var e;return e="angular"===t.type?Number(t.value):Cf[t.value]||0,Mf(e,"deg")})),Lf=$u((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:Mf(e,r),cy:Mf(n,i)}})),jf=$u((function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Sf(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:Mf(Number(t.length.value),"%"),color:kf(t)}}));if("linear-gradient"===e)return new Qu(Yu.LinearGradient,{angle:n?Nf(n):df,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o=Lf(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?vf(f):Mf(f,u)}return new Qu(Yu.RadialGradient,{cx:a,cy:s,size:c,steps:i})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=Af.exec(t);if(r){var i=(null===(e=r[2].match(Pf))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return[new Qu(Yu.LinearGradient,{angle:Mf(parseFloat(r[1]),"deg"),steps:i.map((function(t){var e=_e(t,2),n=e[0],r=e[1];return{offset:Mf(100*Number(n),"%"),color:r}}))})]}}else if("r"===n){var o=function(t){var e,n=_f.exec(t);if(n){var r=(null===(e=n[4].match(Pf))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:Mf(50,"%"),cy:Mf(50,"%"),steps:r.map((function(t){var e=_e(t,2),n=e[0],r=e[1];return{offset:Mf(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!C(o))return[new Qu(Yu.RadialGradient,o)];t=o}}else if("p"===n)return function(t){var e=Tf.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 Rf(t){return t&&!!t.image}function If(t){return t&&!v(t.r)&&!v(t.g)&&!v(t.b)}var Bf=$u((function(t){if(Rf(t))return Me({repetition:"repeat"},t);if(v(t)&&(t=""),"transparent"===t)return xf;if("currentColor"===t)t="black";else if("none"===t)return bf;var e=jf(t);if(e)return e;var n=kl(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),wf.apply(void 0,Te([],_e(r),!1))}));function Df(t,e){if(If(t)&&If(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 Ff(t,e){if(v(e))return Mf(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Mf(Number(e),"px");if("deg".search(t)>=0)return Mf(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 Mf(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var zf=function(t){return Ff(new RegExp("px","g"),t)},Gf=$u(zf);$u((function(t){return Ff(new RegExp("%","g"),t)}));var Wf=function(t){return j(t)||isFinite(Number(t))?Mf(Number(t)||0,"px"):Ff(new RegExp("px|%|em|rem","g"),t)},$f=$u(Wf),Hf=function(t){return Ff(new RegExp("deg|rad|grad|turn","g"),t)},Vf=$u(Hf);function Yf(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,c=sf(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(a=l.value,s=u.value,o=Xu(t.unit)):(cf.isLength(t.unit)||cf.isLength(e.unit))&&(a=Zf(t,i,n),s=Zf(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function qf(t){var e=0;return t.unit===Ru.kDegrees?e=t.value:t.unit===Ru.kRadians?e=pu(Number(t.value)):t.unit===Ru.kTurns&&(e=360*Number(t.value)),e}function Uf(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 Xf(t){return C(t)?t.split(" ").map((function(t){return $f(t)})):t.map((function(t){return $f(t.toString())}))}function Zf(t,e,n,r){if(void 0===r&&(r=!1),t.unit===Ru.kPixels)return Number(t.value);if(t.unit===Ru.kPercentage&&n){var i=n.nodeName===nu.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var Kf=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Qf(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,Kf.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Ff(/deg|rad|grad|turn|px|%/g,t)||Bf(t)}))}),n.lastIndex===t.length)return r}return[]}function Jf(t){return t.toString()}var td=function(t){return"number"==typeof t?Mf(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Mf(Number(t)):Mf(0)},ed=$u(td);function nd(t,e){return[t,e,Jf]}function rd(t,e){return function(n,r){return[n,r,function(n){return Jf(L(n,t,e))}]}}function id(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function od(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=fn(t.parsedStyle.d.absolutePath,void 0,Me(Me({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function ad(t,e){return t[0]===e[0]&&t[1]===e[1]}function sd(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 cd(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}$u((function(t){return C(t)?t.split(" ").map(ed):t.map(ed)}));var ld=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)},ud=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var c=hu(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=ld({x:1,y:0},v),x=ld(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 fd(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=ud({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),d=ud({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 dd(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function hd(t,e){return dd(t)*dd(e)?(t[0]*e[0]+t[1]*e[1])/(dd(t)*dd(e)):1}function pd(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(hd(t,e))}function gd(t,e){var n=e[1],r=e[2],i=F(hu(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=pd([1,0],x),O=pd(x,w);return hd(x,w)<=-1&&(O=Math.PI),hd(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:ad(t,[l,u])?0:n,ry:ad(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 yd(t,e){void 0===e&&(e=t.getLocalTransform());var n=[];switch(t.nodeName){case nu.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 nu.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 nu.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 nu.POLYLINE:case nu.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===nu.POLYGON);break;case nu.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=_e(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 nu.PATH:n=Te([],_e(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=Ut(e[1],e[2],0);n&&ie(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=Ut(e[1],e[2],0),a=Ut(e[3],e[4],0),s=Ut(e[5],e[6],0);n&&(ie(o,o,n),ie(a,a,n),ie(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=Ut(e[6],e[7],0);n&&ie(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=Ut(e[1],e[2],0),a=Ut(e[3],e[4],0),n&&(ie(o,o,n),ie(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 vd=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=Ue(t)}catch(n){e=Ue(""),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&&ad(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=gd(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]&&ad(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=cd((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=cd((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=fd(u,0),x=b.x,w=b.y,M=fd(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=Jl(c[0],c[1],s[1],s[2],s[3],s[4]);break;case"C":l=Ul(c[0],c[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var u=g.arcParams;l=zl(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-=sd(g,e).xExtra:a[0]===h&&(h+=sd(g,e).xExtra),a[1]===d?d-=sd(g,e).yExtra:a[1]===p&&(p+=sd(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}}},bd=$u(vd);function xd(t){return C(t)?bd(t):vd(t)}function wd(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=tn(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=tn(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=pn(r,i));var a,s,c,l,u,f,d,h,p=dn(o[0])!==dn(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+=en(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 Md(t,e){var n;return n=C(t)?t.split(" ").map((function(t){var e=_e(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]})):t,{points:n,totalLength:0,segments:[]}}function Od(t,e){return[t.points,e.points,function(t){return t}]}var Ed=null;function kd(t){return function(e){var n=0;return t.map((function(t){return t===Ed?e[n++]:t}))}}function Sd(t){return t}var Ad={matrix:["NNNNNN",[Ed,Ed,0,0,Ed,Ed,0,0,0,0,1,0,Ed,Ed,0,1],Sd],matrix3d:["NNNNNNNNNNNNNNNN",Sd],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",kd([Ed,Ed,new cf(1)]),Sd],scalex:["N",kd([Ed,new cf(1),new cf(1)]),kd([Ed,new cf(1)])],scaley:["N",kd([new cf(1),Ed,new cf(1)]),kd([new cf(1),Ed])],scalez:["N",kd([new cf(1),new cf(1),Ed])],scale3d:["NNN",Sd],skew:["Aa",null,Sd],skewx:["A",null,kd([Ed,df])],skewy:["A",null,kd([df,Ed])],translate:["Tt",kd([Ed,Ed,lf]),Sd],translatex:["T",kd([Ed,lf,lf]),kd([Ed,lf])],translatey:["T",kd([lf,Ed,lf]),kd([lf,Ed])],translatez:["L",kd([lf,lf,Ed])],translate3d:["TTL",Sd]};function _d(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=Ad[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()?df:Vf(t)},N:ed,T:$f,L:Gf}[d.toUpperCase()](f):{a:df,n:l[0],t:lf}[d]))return[];l.push(h)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function Td(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=Ad[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()?df:Hf(t)},N:td,T:Wf,L:zf}[d.toUpperCase()](f):{a:df,n:l[0],t:lf}[d]))return[];l.push(h)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function Pd(t){var e,n,r,i;switch(t.t){case"rotatex":return i=hu(qf(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=hu(qf(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=hu(qf(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=hu(qf(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=hu(qf(t.d[0])),f=hu(qf(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=hu(qf(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=hu(qf(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=Zf(t.d[0],0,null)||0,n=Zf(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Zf(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=Zf(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=Zf(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Zf(t.d[0],0,null)||0,n=Zf(t.d[1],0,null)||0,r=Zf(t.d[2],0,null)||0,1];case"perspective":var d=Zf(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 Cd(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 Nd(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}(vu,t))return!1;if(dt(bu,vu),bu[3]=0,bu[7]=0,bu[11]=0,bu[15]=1,Math.abs(yt(bu))<1e-8)return!1;var a,s,c=vu[3],l=vu[7],u=vu[11],f=vu[12],d=vu[13],h=vu[14],p=vu[15];if(0!==c||0!==l||0!==u){if(xu[0]=c,xu[1]=l,xu[2]=u,xu[3]=p,!mt(bu,bu))return!1;gt(bu,bu),ue(i,xu,bu)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=d,e[2]=h,s=vu,(a=wu)[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]=qt(wu[0]),te(wu[0],wu[0]),r[0]=ee(wu[0],wu[1]),Ou(wu[1],wu[1],wu[0],1,-r[0]),n[1]=qt(wu[1]),te(wu[1],wu[1]),r[0]/=n[1],r[1]=ee(wu[0],wu[2]),Ou(wu[2],wu[2],wu[0],1,-r[1]),r[2]=ee(wu[1],wu[2]),Ou(wu[2],wu[2],wu[1],1,-r[2]),n[2]=qt(wu[2]),te(wu[2],wu[2]),r[1]/=n[2],r[2]/=n[2],ne(Mu,wu[1],wu[2]),ee(wu[0],Mu)<0)for(var g=0;g<3;g++)n[g]*=-1,wu[g][0]*=-1,wu[g][1]*=-1,wu[g][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+wu[0][0]-wu[1][1]-wu[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-wu[0][0]+wu[1][1]-wu[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-wu[0][0]-wu[1][1]+wu[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+wu[0][0]+wu[1][1]+wu[2][2],0)),wu[2][1]>wu[1][2]&&(o[0]=-o[0]),wu[0][2]>wu[2][0]&&(o[1]=-o[1]),wu[1][0]>wu[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(Pd).reduce(Cd)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var Ld=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 jd(t){return t.toFixed(6).replace(".000000","")}function Rd(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=Nd(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=Nd(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 Ld(t[0],t[1],t[2],e,t[4]).map(jd).join(",")}])}function Id(t){return t.replace(/[xy]/,"")}function Bd(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Dd(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?Mf(a):Mf(a,t.unit)}))})},o=0;o<t.length;o++)i(o)}var a,s,c=[],l=[],u=[];if(t.length!==e.length)c=[(v=Rd(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=Ad[f],m=Ad[d],y=void 0;if(s=d,"perspective"===(a=f)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var v=Rd([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]&&Id(f)===Id(d))y=Id(f),h=g[2](h),p=m[2](p);else{if(!g[1]||!m[1]||Bd(f)!==Bd(d)){c=[(v=Rd(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];break}y=Bd(f),h=g[1](h),p=m[1](p)}for(var b=[],x=[],w=[],M=0;M<h.length;M++){v=Yf(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 Fd=$u((function(t){if(C(t)){if("text-anchor"===t)return[Mf(0,"px"),Mf(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:[$f(Gd(e[0])),$f(Gd(e[1]))]}return[Mf(t[0]||0,"px"),Mf(t[1]||0,"px")]})),zd=function(t){if(C(t)){if("text-anchor"===t)return[Mf(0,"px"),Mf(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:[Wf(Gd(e[0])),Wf(Gd(e[1]))]}return[Mf(t[0]||0,"px"),Mf(t[1]||0,"px")]};function Gd(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var Wd=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Of.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Of.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Of.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Of.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Of.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Of.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Of.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Of.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Of.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Of.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Of.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:Of.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Of.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Of.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Of.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Of.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Of.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Of.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:Of.FILTER},{n:"clipPath",syntax:Of.DEFINED_PATH},{n:"textPath",syntax:Of.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Of.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Of.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:Of.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:Of.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:Of.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:Of.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Of.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Of.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Of.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:Of.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:Of.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:Of.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Of.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Of.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Of.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Of.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Of.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Of.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Of.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Of.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Of.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:Of.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Of.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Of.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Of.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Of.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:Of.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Of.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Of.NUMBER,d:function(t){return t===nu.PATH||t===nu.POLYGON||t===nu.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:Of.MARKER},{n:"markerEnd",syntax:Of.MARKER},{n:"markerMid",syntax:Of.MARKER},{n:"markerStartOffset",syntax:Of.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Of.LENGTH,l:!0,int:!0,d:"0"}],$d=Wd.filter((function(t){return!!t.l})).map((function(t){return t.n})),Hd={},Vd=new WeakMap,Yd=function(){function t(t){var e=this;this.runtime=t,Wd.forEach((function(t){e.registerMetadata(t)}))}return t.prototype.registerMetadata=function(t){Te([t.n],_e(t.a||[]),!1).forEach((function(e){Hd[e]=t}))},t.prototype.unregisterMetadata=function(t){delete Hd[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=Hd[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<$d.length;g++)if($d[g]in e){p=!0;break}e.fill&&(t.parsedStyle.fill=Bf(e.fill)),e.stroke&&(t.parsedStyle.stroke=Bf(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=Bf(e.shadowColor)),e.filter&&(t.parsedStyle.filter=Qf(e.filter)),v(e.radius)||(t.parsedStyle.radius=Uf(e.radius,4)),v(e.lineDash)||(t.parsedStyle.lineDash=Uf(e.lineDash,2)),e.points&&(t.parsedStyle.points=Md(e.points)),""===e.d&&(t.parsedStyle.d=Me({},Ef)),e.d&&(t.parsedStyle.d=xd(e.d)),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},t,null),H(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=_d(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=Fd(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=Hd[t],o=e;if((""===e||v(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)o=vf(e);else if(i){var a=i.k,s=i.syntax,c=s&&this.getPropertySyntax(s);a&&a.indexOf(e)>-1?o=vf(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=Hd[t],o="g-root"===n.id,a=e;if(i){var s=i.syntax,c=i.inh,l=i.d;if(e instanceof Ju){var u=e.value;if("unset"===u&&(u=c&&!o?"inherit":"initial"),"initial"===u)v(l)||(e=this.parseProperty(t,nf(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 Ju?e.value:e}return a},t.prototype.postProcessProperty=function(t,e,n){var r=Hd[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=Vd.get(t);n||(Vd.set(t,[]),n=Vd.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=Vd.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=Vd.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Vd.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 ku),r.renderBounds||(r.renderBounds=new ku);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===nu.POLYLINE||e===nu.POLYGON||e===nu.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,lu(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?Zf(P[0],0,t,!0):0),q=(V?-1:1)*(P?Zf(P[1],1,t,!0):0);(Y||q)&&t.setOrigin(Y,q)}},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===nu.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===nu.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))},t.prototype.isPropertyInheritable=function(t){var e=Hd[t];return!!e&&e.inh},t}(),qd=function(){function t(){this.parser=Vf,this.parserUnmemoize=Hf,this.parserWithCSSDisabled=null,this.mixer=nd}return t.prototype.calculator=function(t,e,n,r){return qf(n)},t}(),Ud=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof Ju&&(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}(),Xd=function(){function t(){this.parser=Bf,this.parserWithCSSDisabled=Bf,this.mixer=Df}return t.prototype.calculator=function(t,e,n,r){return n instanceof Ju?"none"===n.value?bf:xf:n},t}(),Zd=function(){function t(){this.parser=Qf}return t.prototype.calculator=function(t,e,n){return n instanceof Ju?[]:n},t}();function Kd(t){var e=t.parsedStyle.fontSize;return v(e)?null:e}var Qd=function(){function t(){this.parser=$f,this.parserUnmemoize=Wf,this.parserWithCSSDisabled=null,this.mixer=nd}return t.prototype.calculator=function(t,e,n,r,i){var o;if(j(n))return n;if(!cf.isRelativeUnit(n.unit))return n.value;var a=i.styleValueRegistry;if(n.unit===Ru.kPercentage)return 0;if(n.unit===Ru.kEms){if(r.parentNode){if(s=Kd(r.parentNode))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}if(n.unit===Ru.kRems){if(null===(o=null==r?void 0:r.ownerDocument)||void 0===o?void 0:o.documentElement){var s;if(s=Kd(r.ownerDocument.documentElement))return s*=n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}},t}(),Jd=function(){function t(){this.mixer=id}return t.prototype.parser=function(t){var e=Xf(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}(),th=function(){function t(){this.mixer=id}return t.prototype.parser=function(t){var e=Xf(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}(),eh=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof Ju&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),nh=function(){function t(){this.mixer=nd,this.parser=ed,this.parserUnmemoize=td,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),rh=function(){function t(){this.parser=ed,this.parserUnmemoize=td,this.parserWithCSSDisabled=null,this.mixer=rd(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===nu.LINE||i===nu.PATH||i===nu.POLYLINE){var o=n.getPoint(r);o&&t.setLocalPosition(o.x,o.y)}}},t}(),ih=function(){function t(){this.parser=ed,this.parserUnmemoize=td,this.parserWithCSSDisabled=null,this.mixer=rd(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),oh=function(){function t(){this.parser=xd,this.parserWithCSSDisabled=xd,this.mixer=wd}return t.prototype.calculator=function(t,e,n){return n instanceof Ju&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Nu(0,0,0,0)}:n},t}(),ah=function(){this.parser=Md,this.mixer=Od},sh=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.mixer=rd(0,1/0),e}return we(e,t),e}(Qd),ch=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Ju?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),lh=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}(),uh={},fh=0;var dh="undefined"!=typeof window&&void 0!==window.document;function hh(t){return!!t.getAttribute}function ph(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 gh(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(dh)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var yh={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},vh="object"==typeof performance&&performance.now?performance:Date;function bh(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 xh=1,wh="object"==typeof self&&self.self==self?self:"object"==typeof il&&il.global==il?il:{},Mh=Date.now(),Oh={},Eh=Date.now(),kh=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-Eh,r=n>16?0:16-n,i=xh++;return Oh[i]=t,Object.keys(Oh).length>1||setTimeout((function(){Eh=e;var t=Oh;Oh={},Object.keys(t).forEach((function(e){return t[e](wh.performance&&"function"==typeof wh.performance.now?wh.performance.now():Date.now()-Mh)}))}),r),i},Sh=function(t){delete Oh[t]},Ah=function(t){return"string"!=typeof t?kh:""===t?wh.requestAnimationFrame:wh[t+"RequestAnimationFrame"]},_h=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!!Ah(t)})),Th=Ah(_h),Ph=function(t){return"string"!=typeof t?Sh:""===t?wh.cancelAnimationFrame:wh[t+"CancelAnimationFrame"]||wh[t+"CancelRequestAnimationFrame"]}(_h);wh.requestAnimationFrame=Th,wh.cancelAnimationFrame=Ph;var Ch=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,Te([],_e(t),!1))})))},t}(),Nh=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 ke(this,void 0,void 0,(function(){var e,n,r;return Se(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,Te([],_e(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}(),Lh=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}(),jh=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}(),Rh=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ih=/([\"\'])[^\'\"]+\1/;function Bh(t,e,n){return pt(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var Dh=1e-5,Fh=ut(),zh=ut();function Gh(t,e){if(t.length){var n=pt(Fh);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,Dh)})))||[1,1];Et(zh,[i[0],i[1],1])}else if("scalex"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Dh)})))||[1];Et(zh,[i[0],1,1])}else if("scaley"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Dh)})))||[1];Et(zh,[1,i[0],1])}else if("scalez"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Dh)})))||[1];Et(zh,[1,1,i[0]])}else if("scale3d"===e){i=(null==r?void 0:r.map((function(t){return Math.max(t.value,Dh)})))||[1,1,1];Et(zh,[i[0],i[1],i[2]])}else if("translate"===e){Ot(zh,[(o=r||[lf,lf])[0].value,o[1].value,0])}else if("translatex"===e){Ot(zh,[(o=r||[lf])[0].value,0,0])}else if("translatey"===e){Ot(zh,[0,(o=r||[lf])[0].value,0])}else if("translatez"===e){Ot(zh,[0,0,(o=r||[lf])[0].value])}else if("translate3d"===e){var o;Ot(zh,[(o=r||[lf,lf,lf])[0].value,o[1].value,o[2].value])}else if("rotate"===e){_t(zh,hu(qf((a=r||[df])[0])))}else if("rotatex"===e){St(zh,hu(qf((a=r||[df])[0])))}else if("rotatey"===e){At(zh,hu(qf((a=r||[df])[0])))}else if("rotatez"===e){_t(zh,hu(qf((a=r||[df])[0])))}else if("rotate3d"===e){var a;kt(zh,hu(qf((a=r||[lf,lf,lf,df])[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];Bh(zh,hu(s[0]),hu(s[1]))}else if("skewx"===e){s=(null==r?void 0:r.map((function(t){return t.value})))||[0];Bh(zh,hu(s[0]),0)}else if("skewy"===e){s=(null==r?void 0:r.map((function(t){return t.value})))||[0];Bh(zh,0,hu(s[0]))}else if("matrix"===e){var c=_e(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];ht(zh,l,u,0,0,f,d,0,0,0,0,1,0,h,p,0,1)}else"matrix3d"===e&&ht.apply(Ht,Te([zh],_e(r.map((function(t){return t.value}))),!1));Wt(n,n,zh)})),e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var Wh=function(){function t(){this.parser=_d,this.parserUnmemoize=Td,this.parserWithCSSDisabled=Td,this.mixer=Dd}return t.prototype.calculator=function(t,e,n,r){return n instanceof Ju?[]:n},t.prototype.postProcessor=function(t){Gh(t.parsedStyle.transform,t)},t}(),$h=function(){function t(){this.parser=Fd,this.parserUnmemoize=zd}return t.prototype.postProcessor=function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===Ru.kPixels&&e[1].unit===Ru.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()},t}(),Hh=function(){function t(){this.parser=ed,this.parserUnmemoize=td}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=ff.Z_INDEX_CHANGED)}},t}(),Vh=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}(),Yh=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}(),qh=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}(),Uh=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}(),Xh=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,Te([],_e(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,Te([],_e(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,Te([],_e(e.map((function(t){return t[1]}))),!1)),o=Math.max.apply(Math,Te([],_e(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}(),Zh=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}(),Kh=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 kp.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}(),Qh=function(){function t(){}return t.prototype.update=function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}},t}();var Jh,tp=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 Cu,this.page=new Cu,this.canvas=new Cu,this.viewport=new Cu,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(Lu)},t}(),ep=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.client=new Cu,e.movement=new Cu,e.offset=new Cu,e.global=new Cu,e.screen=new Cu,e}return we(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(Lu)},e}(tp),np=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return we(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}(ep),rp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return we(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(ep),ip=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 we(e,t),e}(tp),op=function(){function t(){this.emitter=new al}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=nf(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var c=_e(t.split(":"),2),l=c[0];t=c[1],s=l,a=!0}if(t=r?"".concat(t,"capture"):t,e=nf(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,Te([],_e(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=nf(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=nf(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new ip(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}(),ap=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 we(e,t),e.isNode=function(t){return!!t.childNodes},Object.defineProperty(e.prototype,"textContent",{get:function(){var t,e,n="";this.nodeName===nu.TEXT&&(n+=this.style.text);try{for(var r=Ae(this.childNodes),i=r.next();!i.done;i=r.next()){var o=i.value;o.nodeName===nu.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===nu.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(Lu)},e.prototype.lookupNamespaceURI=function(t){throw new Error(Lu)},e.prototype.lookupPrefix=function(t){throw new Error(Lu)},e.prototype.normalize=function(){throw new Error(Lu)},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}(op),sp=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new al,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=ut(),this.tmpVec3=Vt(),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=vh.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")}ap.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"),ap.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&&ap.isNode(o)&&o.parentNode;f&&f!==(ap.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(ap.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!==(ap.isNode(n.rootTarget)&&n.rootTarget.parentNode);)d.currentTarget=d.target,n.notifyTarget(d),r&&n.notifyTarget(d,"mouseenter"),ap.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!==(ap.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),ap.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!==(ap.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),ap.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"),ap.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;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 Cu((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 Cu((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=vt(this.tmpMatrix,c,s),u=Zt(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return ie(u,u,l),new Cu(u[0],u[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=vt(this.tmpMatrix,n,r),o=Zt(this.tmpVec3,t.x,t.y,0);ie(this.tmpVec3,this.tmpVec3,i);var a=this.context.config,s=a.width,c=a.height;return new Cu((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++)ap.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=Ae(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(np);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(rp);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(rp);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(np);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=vh.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||ap.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=hh(e)&&e.getAttribute("cursor");if(n)return n;e=ap.isNode(e)&&e.parentNode}},t}(),cp=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||kp.offscreenCanvas)this.canvas=t||kp.offscreenCanvas,this.context=this.canvas.getContext("2d",Me({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",Me({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",Me({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"}(Jh||(Jh={}));var lp,up=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 Lh,initAsync:new Ch,dirtycheck:new jh,cull:new jh,beginFrame:new Lh,beforeRender:new Lh,render:new Lh,afterRender:new Lh,endFrame:new Lh,destroy:new Lh,pick:new Nh,pickSync:new jh,pointerDown:new Lh,pointerUp:new Lh,pointerMove:new Lh,pointerOut:new Lh,pointerOver:new Lh,pointerWheel:new Lh,pointerCancel:new Lh,click:new Lh}}return t.prototype.init=function(t){var e=this,n=Me(Me({},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(Jh.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(Jh.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!==ff.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;ph(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(ph)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(Jh.DISPLAY_OBJECT_CHANGED)},t}(),fp=/\[\s*(.*)=(.*)\s*\]/,dp=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(fp),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}(),hp=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 we(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(tp);function pp(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"}(lp||(lp={}));var gp,mp,yp,vp=new hp(lp.REPARENT,null,"","","",0,"",""),bp=function(){function t(t){var e,n,r,i,o,a,s,c,l=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new ip(lp.BOUNDS_CHANGED),this.rotate=(e=fe(),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=Ut(n,r,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var s=fe();ge(s,n[0],n[1],n[2]);var c=l.getRotation(t),u=l.getRotation(t.parentNode);ye(e,u),pe(e,e),he(s,e,s),he(a.localRotation,s,c),be(a.localRotation,a.localRotation),o&&l.dirtifyLocal(t,a)}else l.rotateLocal(t,n)}),this.rotateLocal=(n=fe(),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=Ut(e,r,i));var a=t.transformable;ge(n,e[0],e[1],e[2]),ve(a.localRotation,a.localRotation,n),o&&l.dirtifyLocal(t,a)}),this.setEulerAngles=(r=fe(),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=Ut(e,n,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){ge(a.localRotation,e[0],e[1],e[2]);var s=l.getRotation(t.parentNode);ye(r,pe(fe(),s)),ve(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=Ut(e,n,r));var o=t.transformable;ae(e,Vt())||(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),Kt(o.localPosition,o.localPosition,e),i&&l.dirtifyLocal(t,o))},this.setPosition=(i=ut(),o=Vt(),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,!ae(l.getPosition(t),o)){if(Xt(r.position,o),null!==t.parentNode&&t.parentNode.transformable){var a=t.parentNode.transformable;dt(i,a.worldTransform),mt(i,i),ie(r.localPosition,o,i)}else Xt(r.localPosition,o);n&&l.dirtifyLocal(t,r)}}),this.setLocalPosition=function(){var t=Vt();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,ae(i.localPosition,t)||(Xt(i.localPosition,t),r&&l.dirtifyLocal(e,i))}}(),this.translate=(a=Vt(),s=Vt(),c=Vt(),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=Zt(s,e,n,r)),ae(e,a)||(Kt(c,l.getPosition(t),e),l.setPosition(t,c,i))}),this.setRotation=function(){var t=fe();return function(e,n,r,i,o,a){void 0===a&&(a=!0);var s=e.transformable;if("number"==typeof n&&(n=me(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var c=l.getRotation(e.parentNode);ye(t,c),pe(t,t),he(s.localRotation,t,n),be(s.localRotation,s.localRotation),a&&l.dirtifyLocal(e,s)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=ut(),e=Vt(),n=me(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(Lt(r.localTransform,r.localRotation,r.localPosition,Ut(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=pt(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),vt(r.localTransform,r.localTransform,i)}var o=Lt(t,n,e,r.localScale,r.origin);vt(r.localTransform,r.localTransform,o)}else Lt(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=ff.ADDED);var a=t.transformable;a&&this.dirtifyWorld(t,a),a.frozen&&this.unfreezeParentToRoot(t),i&&t.dispatchEvent(vp)},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=ff.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=Ut(e,n,r));var o=t.transformable;ge(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=Ut(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=Ut(e[0],e[1],e[2]||r.localScale[2]);ae(i,r.localScale)||(Xt(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=me(e,n,r,i));var a=t.transformable;ye(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 st(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=_e(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;)pp(n),n=n.parentNode;e&&t.forEach((function(t){pp(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 hp(lp.ATTR_MODIFIED,n,e,e,t,hp.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))},t.prototype.getPosition=function(t){var e=t.transformable;return Pt(e.position,this.getWorldTransform(t,e))},t.prototype.getRotation=function(t){var e=t.transformable;return Nt(e.rotation,this.getWorldTransform(t,e))},t.prototype.getScale=function(t){var e=t.transformable;return Ct(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=Pt(Vt(),e),r=Nt(fe(),e),i=Ct(Vt(),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(ku.isEmpty(r))return null;var i=n||new ku;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&&kp.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new ku},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 ku).update(r.center,r.halfExtents))})),o||(o=new ku),e){var a=gh(t);if(a){var s=a.parsedStyle.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o.update(s.center,s.halfExtents)}}return e?(r.renderBounds=o,r.renderBoundsDirty=!1):(r.bounds=o,r.boundsDirty=!1),o},t.prototype.getLocalBounds=function(t){if(t.parentNode){var e=ut();t.parentNode.transformable&&(e=mt(ut(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!ku.isEmpty(n)){var r=new ku;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);ku.isEmpty(i)||(r=new ku).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=_e(r.getMin(),2),s=a[0],c=a[1],l=_e(r.getMax(),2),u=l[0],f=l[1];return new Nu(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),u-s,f-c)}return new Nu((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?vt(e.worldTransform,r.worldTransform,e.localTransform):dt(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}(),xp={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]},wp=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Mp=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Op=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Ep=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!Op.exec(n)&&!Mp.exec(t))},this.trimByKinsokuShorui=function(t){var e=Te([],_e(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=xp.MetricsString+xp.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(xp.BaselineSymbol).width),c=xp.HeightMultiplier*s;s=s*xp.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();!Ih.test(p)&&Rh.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 Nu(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&&xp.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&xp.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=Te([],_e(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||!wp.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(!wp.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}(),kp={},Sp=(mp=new Zh,yp=new Xh,(gp={})[nu.CIRCLE]=new Vh,gp[nu.ELLIPSE]=new Yh,gp[nu.RECT]=mp,gp[nu.IMAGE]=mp,gp[nu.GROUP]=new Qh,gp[nu.LINE]=new qh,gp[nu.TEXT]=new Kh(kp),gp[nu.POLYLINE]=yp,gp[nu.POLYGON]=yp,gp[nu.PATH]=new Uh,gp[nu.HTML]=null,gp[nu.MESH]=null,gp),Ap=function(){var t,e=new Xd,n=new Qd;return(t={})[Of.PERCENTAGE]=null,t[Of.NUMBER]=new nh,t[Of.ANGLE]=new qd,t[Of.DEFINED_PATH]=new Ud,t[Of.PAINT]=e,t[Of.COLOR]=e,t[Of.FILTER]=new Zd,t[Of.LENGTH]=n,t[Of.LENGTH_PERCENTAGE]=n,t[Of.LENGTH_PERCENTAGE_12]=new Jd,t[Of.LENGTH_PERCENTAGE_14]=new th,t[Of.COORDINATE]=new Qd,t[Of.OFFSET_DISTANCE]=new rh,t[Of.OPACITY_VALUE]=new ih,t[Of.PATH]=new oh,t[Of.LIST_OF_POINTS]=new ah,t[Of.SHADOW_BLUR]=new sh,t[Of.TEXT]=new ch,t[Of.TEXT_TRANSFORM]=new lh,t[Of.TRANSFORM]=new Wh,t[Of.TRANSFORM_ORIGIN]=new $h,t[Of.Z_INDEX]=new Hh,t[Of.MARKER]=new eh,t}();kp.CameraContribution=Wu,kp.AnimationTimeline=null,kp.EasingFunction=null,kp.offscreenCanvasCreator=new cp,kp.sceneGraphSelector=new dp,kp.sceneGraphService=new bp(kp),kp.textService=new Ep(kp),kp.geometryUpdaterFactory=Sp,kp.CSSPropertySyntaxFactory=Ap,kp.styleValueRegistry=new Yd(kp),kp.layoutRegistry=null,kp.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==il?il:{},kp.enableCSSParsing=!1,kp.enableDataset=!1,kp.enableStyleSyntax=!0,kp.enableAttributeDashCased=!1,kp.enableSizeAttenuation=!1;var _p=0,Tp=new hp(lp.INSERTED,null,"","","",0,"",""),Pp=new hp(lp.REMOVED,null,"","","",0,"",""),Cp=new ip(lp.DESTROY),Np=function(t){function e(){var e=t.call(this)||this;return e.entity=_p++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.cullable={strategy:uf.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=kp.enableCSSParsing?{opacity:pf,fillOpacity:pf,strokeOpacity:pf,fill:pf,stroke:pf,transform:pf,transformOrigin:pf,visibility:pf,pointerEvents:pf,lineWidth:pf,lineCap:pf,lineJoin:pf,increasedLineWidthForHitTesting:pf,fontSize:pf,fontFamily:pf,fontStyle:pf,fontWeight:pf,fontVariant:pf,textAlign:pf,textBaseline:pf,textTransform:pf,zIndex:pf,filter:pf,shadowType:pf}:null,e.parsedStyle={},e.attributes={},e}return we(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(Lu)},e.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return kp.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),this.isMutationObserved&&(Tp.relatedNode=this,t.dispatchEvent(Tp)),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 Pp.relatedNode=this,t.dispatchEvent(Pp),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),kp.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 kp.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return kp.sceneGraphService.querySelector("#".concat(t),this)},e.prototype.getElementsByName=function(t){return kp.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},e.prototype.getElementsByClassName=function(t){return kp.sceneGraphService.querySelectorAll(".".concat(t),this)},e.prototype.getElementsByTagName=function(t){return kp.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return kp.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return kp.sceneGraphService.querySelectorAll(t,this)},e.prototype.closest=function(t){var e=this;do{if(kp.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=_e(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,Te([],_e(a),!1))}},e.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,Te([],_e(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,Te([],_e(t),!1))},e.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.prototype.destroy=function(){this.dispatchEvent(Cp),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return kp.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return kp.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return kp.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return kp.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return kp.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 kp.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){if(kp.enableAttributeDashCased){var n=of(t);e=this.attributes[n]}return kp.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(Lu)},e.prototype.getAttributeNode=function(t){throw new Error(Lu)},e.prototype.getAttributeNodeNS=function(t,e){throw new Error(Lu)},e.prototype.hasAttributeNS=function(t,e){throw new Error(Lu)},e.prototype.removeAttributeNS=function(t,e){throw new Error(Lu)},e.prototype.removeAttributeNode=function(t){throw new Error(Lu)},e.prototype.setAttributeNS=function(t,e,n){throw new Error(Lu)},e.prototype.setAttributeNode=function(t){throw new Error(Lu)},e.prototype.setAttributeNodeNS=function(t){throw new Error(Lu)},e.prototype.toggleAttribute=function(t,e){throw new Error(Lu)},e}(ap);function Lp(t){return!!(null==t?void 0:t.nodeName)}var jp,Rp=kp.globalThis.Proxy?kp.globalThis.Proxy:function(){},Ip=new hp(lp.ATTR_MODIFIED,null,null,null,null,hp.MODIFICATION,null,null),Bp={opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Dp={fill:bf,stroke:bf,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},Fp=Te(Te([],_e(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),zp="data-",Gp=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||nu.GROUP,kp.enableCSSParsing?(Object.assign(n.attributes,Bp),Object.assign(n.parsedStyle,Dp,n.config.initialParsedStyle)):n.config.initialParsedStyle&&Object.assign(n.parsedStyle,n.config.initialParsedStyle),n.initAttributes(n.config.style),kp.enableDataset&&(n.dataset=new Rp({},{get:function(t,e){var r="".concat(zp).concat(ef(e));return void 0!==t[r]?t[r]:n.getAttribute(r)},set:function(t,e,r){return n.setAttribute("".concat(zp).concat(ef(e)),r),!0}})),kp.enableStyleSyntax&&(n.style=new Rp({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 we(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=Me({},this.attributes);for(var r in n){var i=n[r];Lp(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};kp.enableCSSParsing&&(n.usedAttributes=Fp);var r=t;if(kp.enableAttributeDashCased)for(var i in r={},t){r[of(i)]=t[i]}kp.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),kp.enableAttributeDashCased&&(e=of(e)),H(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];kp.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(Ip.relatedNode=this,Ip.prevValue=o,Ip.newValue=e,Ip.attrName=t,Ip.prevParsedValue=a,Ip.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(Ip):(Ip.target=this,this.ownerDocument.defaultView.dispatchEvent(Ip,!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=_e(t.getMin(),2),n=e[0],r=e[1],i=_e(t.getMax(),2),o=i[0],a=i[1];return new Nu(n,r,o-n,a-r)},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),kp.sceneGraphService.setOrigin(this,du(t,e,n)),this},e.prototype.getOrigin=function(){return kp.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),kp.sceneGraphService.setPosition(this,du(t,e,n)),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),kp.sceneGraphService.setLocalPosition(this,du(t,e,n)),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),kp.sceneGraphService.translate(this,du(t,e,n)),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),kp.sceneGraphService.translateLocal(this,du(t,e,n)),this},e.prototype.getPosition=function(){return kp.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return kp.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=du(t,e=e||t,n=n||t)),kp.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=du(t,e=e||t,n=n||t)),kp.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return kp.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return kp.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){return pu(_e(gu(Vt(),kp.sceneGraphService.getWorldTransform(this)),3)[2])},e.prototype.getLocalEulerAngles=function(){return pu(_e(gu(Vt(),kp.sceneGraphService.getLocalRotation(this)),3)[2])},e.prototype.setEulerAngles=function(t){return kp.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return kp.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return v(e)&&v(n)?kp.sceneGraphService.rotateLocal(this,0,0,t):kp.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return v(e)&&v(n)?kp.sceneGraphService.rotate(this,0,0,t):kp.sceneGraphService.rotate(this,t,e,n),this},e.prototype.setRotation=function(t,e,n,r){return kp.sceneGraphService.setRotation(this,t,e,n,r),this},e.prototype.setLocalRotation=function(t,e,n,r){return kp.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.prototype.setLocalSkew=function(t,e){return kp.sceneGraphService.setLocalSkew(this,t,e),this},e.prototype.getRotation=function(){return kp.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return kp.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return kp.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return kp.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return kp.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(t){return kp.sceneGraphService.setLocalTransform(this,t),this},e.prototype.resetLocalTransform=function(){kp.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 kp.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,Te([],_e(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,Te([],_e(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=_e(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=_e(Pt(Vt(),e),2),r=n[0],i=n[1],o=_e(Ct(Vt(),e),2),a=o[0],s=o[1],c=Nt(fe(),e),l=_e(gu(Vt(),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=_e(yu(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=_e(yu(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(){kp.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},e.prototype.hide=function(){kp.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}(Np),Wp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Me({type:nu.CIRCLE},e))||this}return we(e,t),e}(Gp),$p=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Oe(e,["style"]);return(n=t.call(this,Me({style:(kp.enableCSSParsing,Me({},r))},i))||this).isCustomElement=!0,n}return we(e,t),e}(Gp),Hp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Me({type:nu.ELLIPSE},e))||this}return we(e,t),e}(Gp),Vp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Me({type:nu.GROUP},e))||this}return we(e,t),e}(Gp),Yp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Oe(e,["style"]);return(n=t.call(this,Me({type:nu.HTML,style:kp.enableCSSParsing?Me({x:"",y:"",width:"auto",height:"auto",innerHTML:""},r):Me({},r)},i))||this).cullable.enable=!1,n}return we(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 Nu(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 ku,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=mt(ut(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!ku.isEmpty(e)){var n=new ku;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(Gp),qp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Me({type:nu.IMAGE},e))||this}return we(e,t),e}(Gp),Up=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Oe(e,["style"]);(n=t.call(this,Me({type:nu.LINE,style:Me({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&&Lp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),s&&Lp(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return we(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&&Lp(r)&&(this.markerStartAngle=0,r.remove()),i&&Lp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&Lp(r)&&(this.markerEndAngle=0,r.remove()),i&&Lp(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&&Lp(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=Hl(n.x1,n.y1,n.x2,n.y2,t),i=r.x,o=r.y,a=ie(Vt(),Ut(i,o,0),e?this.getWorldTransform():this.getLocalTransform());return new Cu(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 $l(t.x1,t.y1,t.x2,t.y2)},e}(Gp),Xp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Oe(e,["style"]);(n=t.call(this,Me({type:nu.PATH,style:kp.enableCSSParsing?Me({d:"",miterLimit:""},r):Me({},r),initialParsedStyle:kp.enableCSSParsing?null:{miterLimit:4,d:Me({},Ef)}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&Lp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&Lp(c)&&n.placeMarkerMid(c),s&&Lp(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return we(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&&Lp(r)&&(this.markerStartAngle=0,r.remove()),i&&Lp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Lp(r)&&(this.markerEndAngle=0,r.remove()),i&&Lp(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&&Lp(a)){var s,c,l,u,f,d,h;if(t){var p=_e(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=_e(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&&Lp(t))for(var n=1;n<e.length-1;n++){var r=_e(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 od(this)},e.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=function(t,e,n){return fn(t,e,Me(Me({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,o=ie(Vt(),Ut(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new Cu(o[0],o[1])},e.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*od(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}(Gp),Zp=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=Oe(e,["style"]);(n=t.call(this,Me({type:nu.POLYGON,style:kp.enableCSSParsing?Me({points:"",miterLimit:"",isClosed:!0},r):Me({},r),initialParsedStyle:kp.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&&Lp(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&Lp(c)&&n.placeMarkerMid(c),s&&Lp(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return we(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&&Lp(r)&&(this.markerStartAngle=0,r.remove()),i&&Lp(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&Lp(r)&&(this.markerEndAngle=0,r.remove()),i&&Lp(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&&Lp(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&&Lp(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}(Gp),Kp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Oe(e,["style"]);return t.call(this,Me({type:nu.POLYLINE,style:kp.enableCSSParsing?Me({points:"",miterLimit:"",isClosed:!1},n):Me({},n),initialParsedStyle:kp.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r))||this}return we(e,t),e.prototype.getTotalLength=function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=Zl(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=$l(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=Hl(n[l][0],n[l][1],n[l+1][0],n[l+1][1],c),f=u.x,d=u.y,h=ie(Vt(),Ut(f,d,0),e?this.getWorldTransform():this.getLocalTransform());return new Cu(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}(Zp),Qp=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Me({type:nu.RECT},e))||this}return we(e,t),e}(Gp),Jp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Oe(e,["style"]);return t.call(this,Me({type:nu.TEXT,style:kp.enableCSSParsing?Me({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):Me({fill:"black"},n)},r))||this}return we(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}(Gp),tg=function(){function t(){this.registry={},this.define(nu.CIRCLE,Wp),this.define(nu.ELLIPSE,Hp),this.define(nu.RECT,Qp),this.define(nu.IMAGE,qp),this.define(nu.LINE,Up),this.define(nu.GROUP,Vp),this.define(nu.PATH,Xp),this.define(nu.POLYGON,Zp),this.define(nu.POLYLINE,Kp),this.define(nu.TEXT,Jp),this.define(nu.HTML,Yp)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),eg=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;kp.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},ng=function(t){function e(){var e=t.call(this)||this;e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new kp.AnimationTimeline(e)}catch(t){}var n={};return Wd.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=nf(i)?i(nu.GROUP):i)})),e.documentElement=new Vp({id:"g-root",style:n}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return we(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?Jp:Vp);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(Lu)},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 ke(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return Se(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 ke(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return Se(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(ju)},e.prototype.insertBefore=function(t,e){throw new Error(ju)},e.prototype.removeChild=function(t,e){throw new Error(ju)},e.prototype.replaceChild=function(t,e,n){throw new Error(ju)},e.prototype.append=function(){throw new Error(ju)},e.prototype.prepend=function(){throw new Error(ju)},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}(ap),rg=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 ip(lp.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="Culling",t}(),ig=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new np(null),this.rootWheelEvent=new rp(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=Ae(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=Ae(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=Ae(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=Ae(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=Ae(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=yh[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=vh.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];H(i.button)&&(i.button=0),H(i.buttons)&&(i.buttons=1),H(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),H(i.width)&&(i.width=i.radiusX||1),H(i.height)&&(i.height=i.radiusY||1),H(i.tiltX)&&(i.tiltX=0),H(i.tiltY)&&(i.tiltY=0),H(i.pointerType)&&(i.pointerType="touch"),H(i.pointerId)&&(i.pointerId=i.identifier||0),H(i.pressure)&&(i.pressure=i.force||.5),H(i.twist)&&(i.twist=0),H(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;H(o.isPrimary)&&(o.isPrimary=!0),H(o.width)&&(o.width=1),H(o.height)&&(o.height=1),H(o.tiltX)&&(o.tiltX=0),H(o.tiltY)&&(o.tiltY=0),H(o.pointerType)&&(o.pointerType="mouse"),H(o.pointerId)&&(o.pointerId=1),H(o.pressure)&&(o.pressure=.5),H(o.twist)&&(o.twist=0),H(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),og=[nu.CIRCLE,nu.ELLIPSE,nu.IMAGE,nu.RECT,nu.LINE,nu.POLYLINE,nu.POLYGON,nu.TEXT,nu.PATH,nu.HTML],ag=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(ku.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||Eu.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==Eu.OUTSIDE,i.visible},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===Eu.OUTSIDE||n===Eu.INSIDE)return n;for(var i=Eu.INSIDE,o=og.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(ee(u,e.getPositiveFarPoint(r[a]))+f<0)return Eu.OUTSIDE;ee(u,e.getNegativeFarPoint(r[a]))+f<0&&(i|=c)}}return i},t}(),sg=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;kp.enableSizeAttenuation&&kp.styleValueRegistry.updateSizeAttenuation(e,s.getCamera().getZoom()),kp.enableCSSParsing&&kp.styleValueRegistry.recalc(e),kp.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),kp.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(t.tag,(function(){s.addEventListener(lp.MOUNTED,u),s.addEventListener(lp.UNMOUNTED,f),s.addEventListener(lp.ATTR_MODIFIED,c),s.addEventListener(lp.BOUNDS_CHANGED,l)})),i.hooks.destroy.tap(t.tag,(function(){s.removeEventListener(lp.MOUNTED,u),s.removeEventListener(lp.UNMOUNTED,f),s.removeEventListener(lp.ATTR_MODIFIED,c),s.removeEventListener(lp.BOUNDS_CHANGED,l),r.toSync.clear()}));var d=null!==(n=kp.globalThis.requestIdleCallback)&&void 0!==n?n:Th.bind(kp.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 ku),a.dirtyRenderBounds.update(o.center,o.halfExtents));var s=_e(o.getMin(),2),c=s[0],l=s[1],u=_e(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"}(jp||(jp={}));var cg=new ip(lp.MOUNTED),lg=new ip(lp.UNMOUNTED),ug=new ip(jp.BEFORE_RENDER),fg=new ip(jp.RERENDER),dg=new ip(jp.AFTER_RENDER),hg=function(t){function e(e){var n=t.call(this)||this;n.Element=Gp,n.inited=!1,n.context={},n.document=new ng,n.document.defaultView=n,n.customElements=new tg;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||fh++;uh[n]&&uh[n].destroy(),uh[n]=e}}(r,n);var E=a,k=s,S=c;return i&&(S=(S=c||dh&&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&&(kp.offscreenCanvas=o),n.devicePixelRatio=S,n.requestAnimationFrame=null!=h?h:Th.bind(kp.globalThis),n.cancelAnimationFrame=null!=p?p:Ph.bind(kp.globalThis),n.supportsTouchEvents=null!=y?y:"ontouchstart"in kp.globalThis,n.supportsPointerEvents=null!=m?m:!!kp.globalThis.PointerEvent,n.isTouchEvent=null!=M?M:function(t){return n.supportsTouchEvents&&t instanceof kp.globalThis.TouchEvent},n.isMouseEvent=null!=O?O:function(t){return!kp.globalThis.MouseEvent||t instanceof kp.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof kp.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 we(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 kp.CameraContribution;i.clipSpaceNearZ=n,i.setType(Au.EXPLORING,_u.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(zu,(function(){r.context.renderingContext.renderReasons.add(Jh.CAMERA_CHANGED),kp.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){kp.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 ip(jp.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 ip(jp.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===Tu.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new ip(jp.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;this.dispatchEvent(ug),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(fg)})),this.dispatchEvent(dg)},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 iu,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new ig,new sg,new rg([new ag])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(Me(Me({},kp),this.context)),this.context.renderingService=new up(kp,this.context),this.context.eventService=new sp(kp,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 ip(jp.READY))})):r.dispatchEvent(new ip(jp.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new ip(jp.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(kp)}))},e.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),Te([],_e(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy(kp)})),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(lg):(lg.target=t,this.dispatchEvent(lg,!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(cg):(cg.target=t,this.dispatchEvent(cg,!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}(op),pg=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.landmarks=[],e}return we(e,t),e.prototype.rotate=function(t,e,n){if(this.relElevation=fu(e),this.relAzimuth=fu(t),this.relRoll=fu(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Au.EXPLORING){var r=de(fe(),[1,0,0],hu((this.rotateWorld?1:-1)*this.relElevation)),i=de(fe(),[0,1,0],hu((this.rotateWorld?1:-1)*this.relAzimuth)),o=de(fe(),[0,0,1],hu(this.relRoll)),a=he(fe(),i,r);a=he(fe(),a,o);var s=jt(ut(),a);bt(this.matrix,this.matrix,[0,0,-this.distance]),vt(this.matrix,this.matrix,s),bt(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===Au.ORBITING||this.type===Au.EXPLORING?this._getPosition():this.type===Au.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(t,e){var n=du(t,e,0),r=Yt(this.position);return Kt(r,r,Jt(Vt(),this.right,n[0])),Kt(r,r,Jt(Vt(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},e.prototype.dolly=function(t){var e=this.forward,n=Yt(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===Au.ORBITING||this.type===Au.EXPLORING?this._getDistance():this.type===Au.TRACKING&&Kt(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 kp.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:ft(d.getWorldTransform()),right:Yt(d.right),up:Yt(d.up),forward:Yt(d.forward),position:Yt(d.getPosition()),focalPoint:Yt(d.getFocalPoint()),distanceVector:Yt(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;if(0===c)return this.syncFromLandmark(r),void(d&&d());this.cancelLandmarkAnimation();var g,m=r.position,y=r.focalPoint,v=r.zoom,b=r.roll,x=u||kp.EasingFunction(a),w=function(){n.setFocalPoint(y),n.setPosition(m),n.setRoll(b),n.setZoom(v),n.computeMatrix(),n.triggerUpdate(),d&&d()},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=Vt(),s=Vt();re(a,n.focalPoint,y,o),re(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),se(a,y)+se(s,m)<=.01&&null==v&&null==b?w():(n.computeMatrix(),n.triggerUpdate(),e<c&&(p&&p(o),n.landmarkAnimationID=n.canvas.requestAnimationFrame(M)))}};this.canvas.requestAnimationFrame(M)}},e.prototype.syncFromLandmark=function(t){this.matrix=dt(this.matrix,t.matrix),this.right=Xt(this.right,t.right),this.up=Xt(this.up,t.up),this.forward=Xt(this.forward,t.forward),this.position=Xt(this.position,t.position),this.focalPoint=Xt(this.focalPoint,t.focalPoint),this.distanceVector=Xt(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},e}(Wu);kp.CameraContribution=pg;var gg=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 we(e,t),e}(tp),mg=0,yg=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 gg(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(Lu)},t.prototype.addEventListener=function(t,e,n){throw new Error(Lu)},t.prototype.removeEventListener=function(t,e,n){throw new Error(Lu)},t.prototype.dispatchEvent=function(t){throw new Error(Lu)},t.prototype.commitStyles=function(){throw new Error(Lu)},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 gg(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 gg(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),vg=.1,bg="function"==typeof Float32Array,xg=function(t,e){return 1-3*e+3*t},wg=function(t,e){return 3*e-6*t},Mg=function(t){return 3*t},Og=function(t,e,n){return((xg(e,n)*t+wg(e,n))*t+Mg(e))*t},Eg=function(t,e,n){return 3*xg(e,n)*t*t+2*wg(e,n)*t+Mg(e)},kg=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=bg?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=Og(o*vg,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=vg;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*vg,s=Eg(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=Eg(e,n,r);if(0===o)return e;e-=(Og(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=Og(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+vg,t,n)};return function(t){return 0===t||1===t?t:Og(a(t),e,r)}},Sg=function(t){return Math.pow(t,2)},Ag=function(t){return Math.pow(t,3)},_g=function(t){return Math.pow(t,4)},Tg=function(t){return Math.pow(t,5)},Pg=function(t){return Math.pow(t,6)},Cg=function(t){return 1-Math.cos(t*Math.PI/2)},Ng=function(t){return 1-Math.sqrt(1-t*t)},Lg=function(t){return t*t*(3*t-2)},jg=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)},Rg=function(t,e){void 0===e&&(e=[]);var n=_e(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)},Ig=function(t,e,n){void 0===e&&(e=[]);var r=_e(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},Bg=function(t,e){void 0===e&&(e=[]);var n=_e(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},Dg=function(t,e){void 0===e&&(e=[]);var n=_e(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return kg(r,i,o,a)(t)},Fg=kg(.42,0,1,1),zg=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},Gg=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}},Wg=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}},$g={steps:Bg,"step-start":function(t){return Bg(t,[1,"start"])},"step-end":function(t){return Bg(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Dg,ease:function(t){return Dg(t,[.25,.1,.25,1])},in:Fg,out:zg(Fg),"in-out":Gg(Fg),"out-in":Wg(Fg),"in-quad":Sg,"out-quad":zg(Sg),"in-out-quad":Gg(Sg),"out-in-quad":Wg(Sg),"in-cubic":Ag,"out-cubic":zg(Ag),"in-out-cubic":Gg(Ag),"out-in-cubic":Wg(Ag),"in-quart":_g,"out-quart":zg(_g),"in-out-quart":Gg(_g),"out-in-quart":Wg(_g),"in-quint":Tg,"out-quint":zg(Tg),"in-out-quint":Gg(Tg),"out-in-quint":Wg(Tg),"in-expo":Pg,"out-expo":zg(Pg),"in-out-expo":Gg(Pg),"out-in-expo":Wg(Pg),"in-sine":Cg,"out-sine":zg(Cg),"in-out-sine":Gg(Cg),"out-in-sine":Wg(Cg),"in-circ":Ng,"out-circ":zg(Ng),"in-out-circ":Gg(Ng),"out-in-circ":Wg(Ng),"in-back":Lg,"out-back":zg(Lg),"in-out-back":Gg(Lg),"out-in-back":Wg(Lg),"in-bounce":jg,"out-bounce":zg(jg),"in-out-bounce":Gg(jg),"out-in-bounce":Wg(jg),"in-elastic":Rg,"out-elastic":zg(Rg),"in-out-elastic":Gg(Rg),"out-in-elastic":Wg(Rg),spring:Ig,"spring-in":Ig,"spring-out":zg(Ig),"spring-in-out":Gg(Ig),"spring-out-in":Wg(Ig)},Hg=function(t){return $g[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)]||$g.linear},Vg=function(t){return t},Yg=1,qg=.5,Ug=0;function Xg(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Zg="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Kg=new RegExp("cubic-bezier\\("+Zg+","+Zg+","+Zg+","+Zg+"\\)"),Qg=/steps\(\s*(\d+)\s*\)/,Jg=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function tm(t){var e=Kg.exec(t);if(e)return kg.apply(void 0,Te([],_e(e.slice(1).map(Number)),!1));var n=Qg.exec(t);if(n)return Xg(Number(n[1]),Ug);var r=Jg.exec(t);return r?Xg(Number(r[1]),{start:Yg,middle:qg,end:Ug}[r[2]]):Hg(t)}function em(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 nm=0,rm=1,im=2,om=3;function am(t,e,n){var r=function(t,e,n){if(null===e)return nm;var r=n.endTime;return e<Math.min(n.delay,r)?rm:e>=Math.min(n.delay+t+n.endDelay,r)?im:om}(t,e,n),i=function(t,e,n,r,i){switch(r){case rm:return"backwards"===e||"both"===e?0:null;case om:return n-i;case im:return"forwards"===e||"both"===e?t:null;case nm: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!==rm&&(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!==im||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===im&&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 sm(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(cm(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:tm(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:um(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)cm(n)&&t.setAttribute(n,null)}}function cm(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var lm=function(t,e,n){return function(r){var i=fm(t,e,r);return!kp.enableCSSParsing&&j(i)?i:n(i)}};function um(t,e,n,r){var i=Hd[t];if(i&&i.syntax&&i.int){var o=kp.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(kp.enableCSSParsing){var c=kp.styleValueRegistry.parseProperty(t,e,r,!1),l=kp.styleValueRegistry.parseProperty(t,n,r,!1);a=kp.styleValueRegistry.computeProperty(t,c,r,!1),s=kp.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=lm.apply(void 0,Te([],_e(f),!1));return function(t){return 0===t?e:1===t?n:d(t)}}}}return lm(!1,!0,(function(t){return t?n:e}))}function fm(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(fm(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var dm=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Vg,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=tm(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function hm(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 pm="backwards|forwards|both|none".split("|"),gm="reverse|alternate|alternate-reverse".split("|");function mm(t,e){return function(t,e){var n=new dm;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===pm.indexOf(t[e]))return;if("direction"===e&&-1===gm.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 ym=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=em(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=hm(e,this.timing),this.interpolations=sm(this.normalizedKeyframes,this.timing,this.target);var i=kp.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=am(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=hm(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 vm(t,e){return Number(t.id)-Number(e.id)}var bm=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(vm),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 ym(t,e,n),i=new yg(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(vm),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,Te([],_e(a),!1)),(i=this.pendingEffects).push.apply(i,Te([],_e(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,l]},t}();function xm(t){return new wm([t],null,t,t.ownerDocument)}kp.EasingFunction=tm,kp.AnimationTimeline=bm;class wm{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 wm(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new wm(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 wm([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 wm(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 wm(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new wm([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 wm([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=Wn(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 wm([],r,this._parent,this._document),new wm(i,null,this._parent,this._document),new wm(o,null,this._parent,this._document),new wm([],a,this._parent,this._document),new wm(s,null,this._parent,this._document)];return new wm(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new wm(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=wm.registry[t];return e?new e:vr(`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 wm([],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 Mm(t,e,n){return Math.max(e,Math.min(t,n))}function Om(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function Em(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function km(t,e,n,r,i){const o=As(Es(r,e))+Math.PI,a=As(Es(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function Sm(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=Pr(a),[l,u]=Bn(c,(t=>a[t])),f=new ma({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 Am(t){const[e,n,r,i]=t;return[i,e,n,r]}function _m(t,e,n){const[r,i,,o]=Xc(t)?Am(e):e,[a,s]=n,c=t.getCenter(),l=_s(Es(r,c)),u=_s(Es(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:Ss(o,c),outerRadius:Ss(r,c)}}function Tm(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function Pm(t,e){if(!Zc(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function Cm(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 Nm(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=Oe(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!Zc(r)&&!Qc(r)){const n=!!Xc(r),[i,,o]=n?Am(e):e,[a,b]=i,[x,w]=Es(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?Mm(E,y,1/0):Mm(E,g,m),A=n?Mm(k,g,m):Mm(k,y,1/0),_=n?M:M-(S-E)/2,T=n?O-(A-k)/2:O-(A-k);return xm(t.createElement("rect",{})).style("x",_).style("y",T).style("width",S).style("height",A).style("radius",[h,p,d,f]).call(Em,v).node()}const{y:b,y1:x}=n,w=r.getCenter(),M=_m(r,e,[b,x]),O=pc().cornerRadius(a).padAngle(o*Math.PI/180);return xm(t.createElement("path",{})).style("d",O(M)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",a).style("inset",o).call(Em,v).node()}wm.registry={g:Vp,rect:Qp,circle:Wp,path:Xp,text:Jp,ellipse:Hp,image:qp,line:Up,polygon:Zp,polyline:Kp,html:Yp};const Lm=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=t,a=Oe(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,d=Oe(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=Oe(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"];Xc(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 xm(Nm(c,e,r,s,F)).call(Em,d).style("fill","transparent").style(n,R).style(Tm(t),I).style("lineWidth",k).style("stroke",void 0===p?R:p).call(Em,j).node()}};Lm.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const jm=(t,e)=>Lm(Object.assign({colorAttribute:"fill"},t),e);jm.props=Object.assign(Object.assign({},Lm.props),{defaultMarker:"square"});const Rm=(t,e)=>Lm(Object.assign({colorAttribute:"stroke"},t),e);function Im(t,e,n){const[r,i,o,a]=t;if(Xc(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]}Rm.props=Object.assign(Object.assign({},Lm.props),{defaultMarker:"hollowSquare"});const Bm=(t,e)=>{const{adjustPoints:n=Im}=t,r=Oe(t,["adjustPoints"]),{coordinate:i,document:o}=e;return(t,e,a,s)=>{const{index:c}=e,{color:l}=a,u=Oe(a,["color"]),f=s[c+1],d=n(t,f,i),h=!!Xc(i),[p,g,m,y]=h?Am(d):d,{color:v=l,opacity:b}=e,x=xc().curve(Rc)([p,g,m,y]);return xm(o.createElement("path",{})).call(Em,u).style("d",x).style("fill",v).style("fillOpacity",b).call(Em,r).node()}};function Dm(t,e,n){const[r,i,o,a]=t;if(Xc(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]}Bm.props={defaultMarker:"square"};const Fm=(t,e)=>Bm(Object.assign({adjustPoints:Dm},t),e);function zm(t){const e="function"==typeof t?t:t.render;return class extends $p{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Fm.props={defaultMarker:"square"};const Gm=zm((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;xm(t).maybeAppend("line",(()=>o.createElement("path",{}))).style("d",e).call(Em,r),xm(t).maybeAppend("line1",(()=>o.createElement("path",{}))).style("d",n).call(Em,i)}));const Wm=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=(t=>!Number.isNaN(t)&&null!=t),connect:a=!1}=t,s=Oe(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:d}=u,h=Oe(u,["color","lineWidth"]),{color:p=f,size:g=d,seriesColor:m,seriesX:y,seriesY:v}=e,b=Pm(c,e),x=Xc(c),w=r&&m?Sm(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(Zc(c)){const t=c.getCenter();O=e=>kc(xc().curve(Mc)).angle(((n,r)=>_s(Es(e[r],t)))).radius(((n,r)=>Ss(e[r],t))).defined((([t,e])=>o(t)&&o(e))).curve(n)(e)}else O=xc().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=Mr(M,"connect"),A=!!k.length;if(!A||a&&!Object.keys(S).length)return xm(l.createElement("path",{})).style("d",O(E)||[]).call(Em,M).node();if(A&&!a)return xm(l.createElement("path",{})).style("d",O(t)).call(Em,M).node();return xm(new Gm).style("style1",Object.assign(Object.assign({},M),S)).style("style2",M).style("d1",(_=k,_.map(O).join(","))).style("d2",O(t)).node();var _}};Wm.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const $m=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Zc(n)?Rc:yc;return Wm(Object.assign({curve:i},t),e)(...r)}};$m.props=Object.assign(Object.assign({},Wm.props),{defaultMarker:"line"});const Hm=(t,e)=>{const n=Oe(t,[]),{coordinate:r}=e;return(...t)=>{const i=Zc(r)?Lc:Xc(r)?Hc:$c;return Wm(Object.assign({curve:i},n),e)(...t)}};Hm.props=Object.assign(Object.assign({},Wm.props),{defaultMarker:"smooth"});const Vm=(t,e)=>Wm(Object.assign({curve:Uc},t),e);Vm.props=Object.assign(Object.assign({},Wm.props),{defaultMarker:"hv"});const Ym=(t,e)=>Wm(Object.assign({curve:qc},t),e);Ym.props=Object.assign(Object.assign({},Wm.props),{defaultMarker:"vh"});const qm=(t,e)=>Wm(Object.assign({curve:Yc},t),e);function Um(t,e,n,r,i){const o=As(Es(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=ks(e,s),d=ks(n,c),h=ks(d,l),p=ks(n,l),g=Es(p,c),m=Es(n,c),y=Es(e,s),v=Es(y,u),b=Es(e,u),x=Es(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()}qm.props=Object.assign(Object.assign({},Wm.props),{defaultMarker:"hvh"});const Xm=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=Oe(i,["color"]),l=ac();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(xr)&&Um(l,n,r,i,a)}return xm(n.createElement("path",{})).call(Em,c).style("fill",a||s).style("d",l.toString()).call(Em,t).node()}};Xm.props=Object.assign(Object.assign({},Wm.props),{defaultMarker:"line"});const Zm=(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"]];Zm.style=["fill"];const Km=Zm.bind(void 0);Km.style=["stroke","lineWidth"];const Qm=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];Qm.style=["fill"];const Jm=Qm.bind(void 0);Jm.style=["fill"];const ty=Qm.bind(void 0);ty.style=["stroke","lineWidth"];const ey=(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"]]};ey.style=["fill"];const ny=ey.bind(void 0);ny.style=["stroke","lineWidth"];const ry=(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"]]};ry.style=["fill"];const iy=ry.bind(void 0);iy.style=["stroke","lineWidth"];const oy=(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"]]};oy.style=["fill"];const ay=oy.bind(void 0);ay.style=["stroke","lineWidth"];const sy=(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"]]};sy.style=["fill"];const cy=sy.bind(void 0);cy.style=["stroke","lineWidth"];const ly=(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"]]};ly.style=["fill"];const uy=ly.bind(void 0);uy.style=["stroke","lineWidth"];const fy=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];fy.style=["stroke","lineWidth"];const dy=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];dy.style=["stroke","lineWidth"];const hy=(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]];hy.style=["stroke","lineWidth"];const py=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];py.style=["stroke","lineWidth"];const gy=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];gy.style=["stroke","lineWidth"];const my=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];my.style=["stroke","lineWidth"];const yy=my.bind(void 0);yy.style=["stroke","lineWidth"];const vy=(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]];vy.style=["stroke","lineWidth"];const by=(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]];by.style=["stroke","lineWidth"];const xy=(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]];xy.style=["stroke","lineWidth"];const wy=(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]];wy.style=["stroke","lineWidth"];const My=(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]];My.style=["stroke","lineWidth"];const Oy=new Map([["bowtie",ly],["cross",dy],["dash",yy],["diamond",ey],["dot",my],["hexagon",sy],["hollowBowtie",uy],["hollowDiamond",ny],["hollowHexagon",cy],["hollowPoint",Km],["hollowSquare",ty],["hollowTriangle",iy],["hollowTriangleDown",ay],["hv",by],["hvh",wy],["hyphen",gy],["line",fy],["plus",py],["point",Zm],["rect",Jm],["smooth",vy],["square",Qm],["tick",hy],["triangleDown",oy],["triangle",ry],["vh",xy],["vhv",My]]);function Ey(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||tl(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 ky=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=Oe(t,["colorAttribute","symbol","mode"]),a=Oy.get(r)||Oy.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]=Cm(e),v=Ey(i,e,r,s)||o.r||l.r;return xm(c.createElement("path",{})).call(Em,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(Tm(t),g).style(n,h).call(Em,o).node()}};ky.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Sy=(t,e)=>ky(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);Sy.props=Object.assign({defaultMarker:"hollowBowtie"},ky.props);const Ay=(t,e)=>ky(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);Ay.props=Object.assign({defaultMarker:"hollowDiamond"},ky.props);const _y=(t,e)=>ky(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);_y.props=Object.assign({defaultMarker:"hollowHexagon"},ky.props);const Ty=(t,e)=>ky(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);Ty.props=Object.assign({defaultMarker:"hollowPoint"},ky.props);const Py=(t,e)=>ky(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);Py.props=Object.assign({defaultMarker:"hollowSquare"},ky.props);const Cy=(t,e)=>ky(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);Cy.props=Object.assign({defaultMarker:"hollowTriangle"},ky.props);const Ny=(t,e)=>ky(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);Ny.props=Object.assign({defaultMarker:"hollowTriangleDown"},ky.props);const Ly=(t,e)=>{const{colorAttribute:n,mode:r="auto"}=t,i=Oe(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]=Cm(e),y=Ey(r,e,s,o)||i.r||c.r;return xm(a.createElement("circle",{})).call(Em,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(Tm(t),p).style(n,d).call(Em,i).node()}},jy=(t,e)=>Ly(Object.assign({colorAttribute:"fill"},t),e);jy.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const Ry=(t,e)=>Ly(Object.assign({colorAttribute:"stroke"},t),e);Ry.props=Object.assign({defaultMarker:"hollowPoint"},jy.props);const Iy=(t,e)=>ky(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);Iy.props=Object.assign({defaultMarker:"bowtie"},ky.props);const By=(t,e)=>ky(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);By.props=Object.assign({defaultMarker:"cross"},ky.props);const Dy=(t,e)=>ky(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);Dy.props=Object.assign({defaultMarker:"diamond"},ky.props);const Fy=(t,e)=>ky(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Fy.props=Object.assign({defaultMarker:"hexagon"},ky.props);const zy=(t,e)=>ky(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);zy.props=Object.assign({defaultMarker:"hyphen"},ky.props);const Gy=(t,e)=>ky(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);Gy.props=Object.assign({defaultMarker:"line"},ky.props);const Wy=(t,e)=>ky(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);Wy.props=Object.assign({defaultMarker:"plus"},ky.props);const $y=(t,e)=>ky(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);$y.props=Object.assign({defaultMarker:"point"},ky.props);const Hy=(t,e)=>ky(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);Hy.props=Object.assign({defaultMarker:"square"},ky.props);const Vy=(t,e)=>ky(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);Vy.props=Object.assign({defaultMarker:"tick"},ky.props);const Yy=(t,e)=>ky(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);Yy.props=Object.assign({defaultMarker:"triangle"},ky.props);const qy=(t,e)=>ky(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);qy.props=Object.assign({defaultMarker:"triangleDown"},ky.props);const Uy=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=Oe(t,["arrow","arrowSize"]),{document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Oe(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,d]=t,h=ac();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*Ss(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(...d),h.lineTo(...t),h.moveTo(...d),h.lineTo(...e)}return xm(o.createElement("path",{})).call(Em,c).style("d",h.toString()).style("stroke",l).style("transform",u).call(Em,i).node()}};function Xy(t,e){e(t),t.children&&t.children.forEach((function(t){t&&Xy(t,e)}))}function Zy(t){Qy(t,!0)}function Ky(t){Qy(t,!1)}function Qy(t,e){var n=e?"visible":"hidden";Xy(t,(function(t){t.attr("visibility",n)}))}Uy.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Jy=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,Te([],_e(e),!1))||this;return r.isMutationObserved=!0,r.addEventListener(lp.INSERTED,(function(){Ky(r)})),r}return we(e,t),e}(Vp);function tv(t){var e=t.appendChild(new Jy({class:"offscreen"}));return Ky(e),e}var ev=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Oe(e,["style"]);return t.call(this,Me({style:Me({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return we(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=tv(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(Jp);function nv(t){return t*Math.PI/180}function rv(t){return Number((180*t/Math.PI).toPrecision(5))}var iv=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 ov(t,e){return y(t)?t.apply(void 0,Te([],_e(e),!1)):t}var av,sv=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=_e(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},cv=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var o=_e(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?cv(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)}))},lv=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)cv(t,e[r]);return t},uv=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},fv=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 av||(av=kp.offscreenCanvasCreator.getOrCreateContext(void 0)),av.font=[o,a,i,"".concat(n,"px"),r].join(" "),av.measureText(t).width}),(function(t,e){return[t,Object.values(e||dv(t)).join()].join("")}),4096),dv=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 hv(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function pv(t,e){var n=hv(t);n&&n.attr(e)}function gv(t,e,n){void 0===n&&(n="..."),pv(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 yv(t){return"function"==typeof t?t():C(t)||j(t)?new ev({style:{text:String(t)}}):t}function vv(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 bv(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 xv=function(t,e){return function(n){return t*(1-n)+e*n}};function wv(t,e){return"number"==typeof t&&"number"==typeof e?xv(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]=wv(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=_e(e,2),o=i[0],a=i[1];o in t?n[o]=wv(t[o],a):r[o]=a})),function(t){return Object.entries(n).forEach((function(e){var n=_e(e,2),i=n[0],o=n[1];return r[i]=o(t)})),r}}(t,e):function(e){return t}}function Mv(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=_e([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 iv(e,n,r-e,i-n)}var Ov=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=_e([0,0],2),g=p[0],m=p[1],y=e.map((function(t){var e,n=t.width,r=t.height,i=_e([g,m],2),o=i[0],a=i[1];return e=_e([g+n*h[0],m+r*h[1]],2),g=e[0],m=e[1],new iv(o,a,n,r)})),v=Mv(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=iv.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r}));Mv(x);var w=function(t){var e=_e(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=iv.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=iv.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},Ev=function(t,e,n){return[]};function kv(t,e){return[t[0]*e,t[1]*e]}function Sv(t,e){return[t[0]+e[0],t[1]+e[1]]}function Av(t,e){return[t[0]-e[0],t[1]-e[1]]}function _v(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Tv(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Pv(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Cv(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 Nv(t,e){return+t.toPrecision(e)}function Lv(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 jv(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=_e(r,2))[0],h=i[1];for(var p=0,g=t.length;p<g;p+=1)d=_v(d,y=t[p]),h=Tv(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=kv(v=Av(a=t[n?(p+1)%m:p+1],o),e);var b=Pv(y,o),x=Pv(y,a),w=b+x;0!==w&&(b/=w,x/=w);var M=kv(v,-b),O=kv(v,x);c=Sv(y,M),s=_v(s=Sv(y,O),Tv(a,y)),s=Tv(s,_v(a,y)),c=_v(c=Sv(y,M=kv(M=Av(s,y),-b/x)),Tv(o,y)),s=Sv(y,O=kv(O=Av(y,c=Tv(c,_v(o,y))),x/b)),f&&(c=_v(c=Tv(c,d),h),s=_v(s=Tv(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=_e(i,1)[0],d.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),d}var Rv=["$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 Iv(t){return Rv.includes(t)}function Bv(t){var e={};for(var n in t)Iv(n)&&(e[n]=t[n]);return e}function Dv(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 Fv=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=_e(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=Pe(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=Pe(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=Pe(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,Ae(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=Te(Te([],_e(this._elements),!1),_e(t._elements),!1),r=Te(Te([],_e(this._transitions),!1),_e(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=_e(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,Te([this._parent,this],_e(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:Vp,rect:Qp,circle:Wp,path:Xp,text:ev,ellipse:Hp,image:qp,line:Up,polygon:Zp,polyline:Kp,html:Yp},t}();function zv(t){return new Fv([t],null,t,t.ownerDocument)}function Gv(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 Wv(t){var e=t.getLocalBounds(),n=_e([e.min,e.max],2),r=_e(n[0],2),i=r[0],o=r[1],a=_e(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 $v(t,e){var n=_e(t,2),r=n[0],i=n[1],o=_e(e,2),a=o[0],s=o[1];return r!==a&&i===s}function Hv(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Vv(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 Yv=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function qv(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i=_e(t,2),o=i[0],a=i[1];if("className"===o||"class"===o);else if(Yv(o,"show")&&Yv(Vv(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(Hv(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(Hv(e)),"")]=a;else if(!Yv(o,"show")&&Yv(o,e)!==n){var s=Vv(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}})),r}function Uv(t,e){return Object.entries(t).reduce((function(t,n){var r=_e(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(Hv(i))]=o,t}),{})}function Xv(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=_e(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)})),[r,i]}function Zv(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=_e([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 Kv(){Qy(this,"hidden"!==this.attributes.visibility)}var Qv=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,lv({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return we(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=tv(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&&Kv.call(this)},e.prototype.update=function(t,e){var n;return this.attr(lv({},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}($p),Jv=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"]]},tb=Jv,eb=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},nb=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},rb=nb;var ib=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function ob(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 ab=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return we(e,t),e.prototype.render=function(t,n){var r=t.symbol,i=t.size,o=void 0===i?16:i,a=t.x,s=void 0===a?0:a,c=t.y,l=void 0===c?0:c,u=Oe(t,["symbol","size","x","y","transform","transformOrigin"]),f=ob(r);vv(!!f,zv(n),(function(t){t.maybeAppendByClassName("marker",f).attr("className","marker ".concat(f,"-marker")).call((function(t){if("image"===f){var n=2*o;t.styles({img:r,width:n,height:n,x:s-o,y:l-o})}else{n=o/2;var i=y(r)?r:e.getSymbol(r);t.styles(Me({d:null==i?void 0:i(s,l,n)},u))}}))}))},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}(Qv);ab.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]]})),ab.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),ab.registerSymbol("line",eb),ab.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),ab.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]]})),ab.registerSymbol("circle",Jv),ab.registerSymbol("point",tb),ab.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"]]})),ab.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"]]})),ab.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"]]})),ab.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),ab.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"]]})),ab.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"]]})),ab.registerSymbol("line",eb),ab.registerSymbol("dot",nb),ab.registerSymbol("dash",rb),ab.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]]})),ab.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]]})),ab.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]]})),ab.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]]})),ab.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 sb=function(t){function e(e){var n=this,r=e.style,i=Oe(e,["style"]);return(n=t.call(this,Z({},{type:"column"},Me({style:r},i)))||this).columnsGroup=new Vp({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return we(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,")"),zv(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(lv({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Gp),cb=function(t){function e(e){var n=this,r=e.style,i=Oe(e,["style"]);return(n=t.call(this,Z({},{type:"lines"},Me({style:r},i)))||this).linesGroup=n.appendChild(new Vp),n.areasGroup=n.appendChild(new Vp),n.render(),n}return we(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(lv({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){zv(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){zv(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}(Gp);function lb(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return Te([e===n?"M":"L"],_e(t),!1)}));return e?r.reverse():r}function ub(t,e){if(void 0===e&&(e=!1),t.length<=2)return lb(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];Q(o,n.slice(-2))||n.push.apply(n,Te([],_e(o),!1))}var a=jv(n,!1);return e?a.unshift(Te(["M"],_e(t[r-1]),!1)):a.unshift(Te(["M"],_e(t[0]),!1)),a}function fb(t,e,n){var r=Y(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function db(t){return 0===t.length?[0,0]:[T(D(t,(function(t){return T(t)||0}))),_(B(t,(function(t){return _(t)||0})))]}function hb(t){for(var e=Y(t),n=e[0].length,r=_e([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 pb=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 we(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=Y(t);return j(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?hb(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=_e(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=qv(this.attributes,"area"),a=qv(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=_e(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=_e([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=ub(o),s=void 0;if(0===i)s=fb(a,e,n);else{var c=ub(t[i-1],!0),l=o[0];c[0][0]="L",s=Te(Te(Te([],_e(a),!1),_e(c),!1),[Te(["M"],_e(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=lb(t[i]),a=void 0;if(0===i)a=fb(o,e,n);else{var s=lb(t[i-1],!0);s[0][0]="L",a=Te(Te(Te([],_e(o),!1),_e(s),!1),[["Z"]],!1)}r.push(a)}return r}(u,s,d):function(t,e,n,r){return t.map((function(t){return fb(e?ub(t):lb(t),n,r)}))}(u,i,s,d)}return{lines:u.map((function(e,n){return Me({stroke:t.getColor(n),d:i?ub(e):lb(e)},a)})),areas:f.map((function(e,n){return Me({d:e,fill:t.getColor(n)},o)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=qv(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=hb(s));var c=this.createScales(s),l=c.x,u=c.y,f=_e(db(s),2),d=f[0],h=f[1],p=new ma({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 Me(Me({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)?zv(n).select(r):zv(n).append(i)).attr("className","container").node();var o=t.type,a=t.x,s=t.y,c="spark".concat(o),l=Me({x:a,y:s},"line"===o?this.linesStyle:this.columnsStyle);zv(e).selectAll(".spark").data([o]).join((function(t){return t.append((function(t){return"line"===t?new cb({className:c,style:l}):new sb({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=_e(db(t),2),h=d[0],p=d[1],g=new ma({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 ma({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new Qo({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}(Qv);function gb(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=_e(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,Me(Me({},t[e]),n)]:[e,n]})))}function mb(t,e){t?t.finished.then(e):e()}function yb(t,e){"update"in t?t.update(e):t.attr(e)}function vb(t,e,n){return 0===e.length?null:n?t.animate(e,n):(yb(t,{style:e.slice(-1)[0]}),null)}function bb(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=_e(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?vb(t,[r,i],Me({fill:"both"},n)):(yb(t,i),null)}function xb(t,e){return t.style.opacity||(t.style.opacity=1),bb(t,{opacity:0},e)}var wb={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},Mb={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Ob={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},Eb=sv({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),kb=sv({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),Sb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return we(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=Oe(t,["x","y","size","radius","orientation"]),u=o,f=2.4*u,d=zv(e).maybeAppendByClassName(kb.iconRect,"rect").styles(Me(Me({},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(kb.iconLine,"-1"),"line").styles(Me({x1:h,x2:h,y1:g,y2:m},l)),d.maybeAppendByClassName("".concat(kb.iconLine,"-2"),"line").styles(Me({x1:p,x2:p,y1:g,y2:m},l)),"vertical"===c&&(d.node().style.transform="rotate(90)")},e}(Qv),Ab=function(t){function e(e){return t.call(this,e,Ob)||this}return we(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,o=n.showLabel,a=qv(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=_e(Xv(Oe(a,["x","y","transform","transformOrigin"]),[]),2),p=h[0],g=h[1],m=zv(t).maybeAppendByClassName(kb.labelGroup,"g").styles(g),y=Me(Me({},Mb),p),v=y.text,b=Oe(y,["text"]);vv(!!o,m,(function(t){e.label=t.maybeAppendByClassName(kb.label,"text").styles(Me(Me({},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=Me(Me({x:n,y:r,orientation:i},wb),qv(this.attributes,"icon")),s=this.attributes.iconShape,c=void 0===s?function(){return new Sb({style:a})}:s;zv(t).maybeAppendByClassName(kb.iconGroup,"g").selectAll(kb.icon.class).data([c]).join((function(t){return t.append("string"==typeof c?c:function(){return c(o)}).attr("className",kb.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}(Qv),_b=function(t){function e(e){var n=t.call(this,e,Me(Me(Me({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},Uv(Ob,"handle")),Uv(wb,"handleIcon")),Uv(Mb,"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 ip("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 we(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=qv(this.attributes,"sparkline");return Me(Me({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=_e(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=_e(Gv(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(Eb.selection.class).each((function(n,r){bb(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&bb(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&bb(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=qv(this.attributes,"track");this.trackShape=zv(t).maybeAppendByClassName(Eb.track,"rect").styles(Me(Me({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=zv(t).maybeAppendByClassName(Eb.brushArea,"rect").styles(Me({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;vv("horizontal"===n.orientation,zv(t).maybeAppendByClassName(Eb.sparklineGroup,"g"),(function(t){var n=Me(Me({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName(Eb.sparkline,(function(){return new pb({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(Eb.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 Ab({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(Eb.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=zv(t).maybeAppendByClassName(Eb.foreground,"g");var a=qv(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(Me(Me({},a),{transform:"translate(".concat(n,", ").concat(r,")")}))},c=this;this.foregroundGroup.selectAll(Eb.selection.class).data("value"===i?[]:this.calcSelectionArea().map((function(t,e){return{style:Me({},t),index:e,show:"select"===o?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",Eb.selection.name).call(s).each((function(t,e){var n=this;1===e?(c.selectionShape=zv(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=_e(this.range,2),i=r[0],o=r[1],a=_e(this.getValues().map((function(t){return Nv(t,e)})),2),s=a[0],c=a[1],l=_e(((Array.isArray(t)?t:[s,null!=t?t:c])||[s,c]).map((function(t){return Nv(t,e)})),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,L(f,i,o)];u>f&&(u=(n=_e([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=_e(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=_e(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=qv(this.attributes,"handle"),c=qv(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),d=o("start"===t?f[0]:f[1]),h=new ev({style:Me(Me(Me({},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=qv(this.attributes,"handleLabel");return Me(Me(Me({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=qv(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return Me({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),Me(Me(Me({},Uv(this.getHandleIconStyle(),"icon")),Uv(Me(Me({},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=_e(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=_e(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 ip(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}(Qv),Tb=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 ip("scroll",r)),n.dispatchEvent(new ip("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=_e(n.getLocalPosition(),2),r=e[0],i=e[1],o=_e(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 ip("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new ip("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new ip("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new ip("trackMouseleave",{detail:t.detail}))},n}return we(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return Gv(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=_e(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=_e(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=_e(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=_e(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=qv(this.attributes,"track"),l=qv(this.attributes,"thumb"),u=Me(Me({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()},Uv(c,"track")),Uv(l,"selection"));this.slider=zv(t).maybeAppendByClassName("scrollbar",(function(){return new _b({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=_e(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}(Qv),Pb={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 Xp({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:[]};Z({},Pb,{style:{type:"arc"}}),Z({},Pb,{style:{}});var Cb=sv({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"),Nb=sv({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Lb(t){return t.reduce((function(t,e,n){return t.push(Te([0===n?"M":"L"],_e(e),!1)),t}),[])}function jb(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 Lb(t);if(!o)return[];var a=Pv(t[0],o),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push(Te(["M"],_e(e),!1)):t.push(Te(["A",a,a,0,0,s],_e(e),!1)),t}),[])}(t,e,n):Lb(t)}function Rb(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=_e([jb(t,n),jb(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=_e([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([Te(["L"],_e(d),!1)],[Te(["L"],_e(f),!1)]);if(!o)throw new Error("Arc grid need to specified center");var p=_e([Pv(d,o),Pv(f,o)],2),g=p[0],m=p[1];return h([Te(["A",g,g,0,0,1],_e(d),!1),Te(["L"],_e(d),!1)],[Te(["A",m,m,0,0,0],_e(f),!1),Te(["L"],_e(f),!1)])}var Ib=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return we(e,t),e.prototype.render=function(t,e){var n=Oe(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=_e(e,1)[0];return Me(Me({},t),{points:Te(Te([],_e(e),!1),[n],!1)})})):n}(t),i=zv(e).maybeAppendByClassName(Nb.lineGroup,"g"),o=zv(e).maybeAppendByClassName(Nb.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:jb(t.points,n)}}));return t.selectAll(Nb.line.class).data(a,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=ov(Bv(Me({d:t.d},r)),[t,e,a]);this.attr(Me({class:Nb.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))}))}),(function(t){return t.transition((function(t,e){return bb(this,ov(Bv(Me({d:t.d},r)),[t,e,a]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=xb(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=_e([e[l].points,e[l+1].points],2),f=Rb(u[0],u[1],n);c.push({d:f,fill:s(l)})}return t.selectAll(Nb.region.class).data(c,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=ov(t,[t,e,c]);this.attr(n)})).attr("className",Nb.region.name)}),(function(t){return t.transition((function(t,e){return bb(this,ov(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=xb(this,r.exit);return mb(e,(function(){return t.remove()})),e}))})).transitions()}(o,r,t);return Te(Te([],_e(a),!1),_e(s),!1)},e}(Qv);function Bb(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=_e(t,2);return[n[0],ov(n[1],e)]})))}function Db(t,e){return e&&y(e)?t.filter(e):t}function Fb(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function zb(t,e){if("linear"===e.type){var n=_e(e.startPos,2),r=n[0],i=n[1],o=_e(e.endPos,2),a=_e([o[0]-r,o[1]-i],2);return Cv([a[0],a[1]])}var s=nv(Fb(t,e));return[-Math.sin(s),Math.cos(s)]}function Gb(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(zb(t,n),"positive"!==e)}function Wb(t,e){return Gb(t,e.labelDirection,e)}function $b(t,e){return"linear"===e.type?function(t,e){var n=_e(e.startPos,2),r=n[0],i=n[1],o=_e(e.endPos,2),a=_e([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=_e(e.center,2),i=r[0],o=r[1],a=nv(Fb(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function Hb(t){return 0===zb(0,t)[1]}function Vb(t){return 0===zb(0,t)[0]}function Yb(t,e){return e-t==360}function qb(t,e,n,r,i){var o=e-t,a=_e([i,i],2),s=a[0],c=a[1],l=_e([nv(t),nv(e)],2),u=l[0],f=l[1],d=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},h=_e(d(u),2),p=h[0],g=h[1],m=_e(d(f),2),y=m[0],v=m[1];if(Yb(t,e)){var b=_e(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 Ub(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(Cb.line.class).data([{d:qb.apply(void 0,Te(Te([i,o],_e(a),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",Cb.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=wv(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,Me({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return Te(Te([n,r],_e(i),!1),[o],!1)}(this),Te(Te([i,o],_e(a),!1),[s],!1),r.update);if(e){var n=function(){var e=J(t.attributes,"__keyframe_data__");t.style.d=qb.apply(void 0,Te([],_e(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function Xb(t){var e=_e(t,2),n=_e(e[0],2),r=n[0],i=n[1],o=_e(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function Zb(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,c=e.lineExtension,l=_e([o,a],2),u=_e(l[0],2),f=u[0],d=u[1],h=_e(l[1],2),p=h[0],g=h[1],m=_e(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=_e([t,e,n],3),i=_e(r[0],2),o=i[0],a=i[1],s=_e(r[1],2),c=s[0],l=s[1],u=_e(r[2],2),f=u[0],d=u[1],h=_e([c-o,l-a],2),p=h[0],g=h[1],m=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),y=_e([-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(Cb.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(Cb.line.name," ").concat(t.className)})).styles(n).transition((function(t){return bb(this,Xb(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return bb(this,Xb(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:Cb.line.name}]);var M=_e(s,2),O=M[0],E=M[1],k=p-f,S=g-d,A=_e([f+k*O,d+S*O],2),_=A[0],T=A[1],P=_e([f+k*E,d+S*E],2),C=P[0],N=P[1];return w([{line:[[f+y,d+v],[_,T]],className:Cb.lineFirst.name},{line:[[C,N],[p+b,g+x]],className:Cb.lineSecond.name}])}function Kb(t,e,n){var r,i=e.type,o=qv(e,"line");return r="linear"===i?Zb(t,e,Lv(o,"arrow"),n):Ub(t,e,Lv(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(Cb.line.class):a?t.select(Cb.lineSecond.class):t.select(Cb.line.class),!o||!s||"arc"===n.type&&Yb(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=yv(s);f.attr(r),Dv(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function Qb(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Jb(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=_e($b(i,e),2),a=o[0],s=o[1],c=_e(kv(function(t,e){return Gb(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}}))}function tx(t,e,n,r){var i=qv(n,"grid"),o=i.type,a=i.areaFill,s=Qb(n),c=Db(e,n.gridFilter),l="segment"===o?Jb(c,n):function(t,e){var n=e.gridControlAngles,r=Qb(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=_e(r,2),o=i[0],a=i[1];return t.map((function(t,r){var i=_e($b(t.value,e),2),s=i[0],c=i[1],l=_e([s-o,c-a],2),u=l[0],f=l[1],d=[];return n.forEach((function(t){var e=nv(t),n=_e([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=Me(Me({},i),{center:s,areaFill:y(a)?c.map((function(t,e){return ov(a,[t,e,c])})):a,animate:r,data:l});return t.selectAll(Cb.grid.class).data([1]).join((function(t){return t.append((function(){return new Ib({style:u})})).attr("className",Cb.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}var ex=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 nx(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getBounds(),i=_e(r.min,2),o=i[0],a=i[1],s=_e(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=hv(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=_e(Gv(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 ex((h+=o)-(void 0===A?E:A),(p+=a)-M,h+f+E,p+d+S);return t.setEulerAngles(n),_.rotatedPoints(nv(n),g,m)}function rx(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 ix(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 ox(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=ix((r=d)[0],r[1],i[0]),a=ix(r[0],r[1],i[1]),s=ix(i[0],i[1],r[0]),c=ix(i[0],i[1],r[1]),o!==a&&s!==c||0===o&&rx(r,i[0])||0===a&&rx(r,i[1])||0===s&&rx(i,r[0])||0===c&&rx(i,r[1])){if(0===ix(d[0],e,d[1]))return rx(d,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(t,e)}))}function ax(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=_e(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=_e(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 sx(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=_e(o,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-a-u,d=a+u,h=_e(Gv(e),4),p=h[0],g=h[1],m=h[2],y=h[3];return new ex(c+f-y,l+f-p,c+d+g,l+d+m)}var v=_e(t.startPos,2),b=v[0],x=v[1],w=_e(t.endPos,2),M=w[0],O=w[1],E=_e(Vb(t)?[-e,0,e,0]:[0,e,0,-e],4),k=E[0],S=E[1],A=E[2],_=E[3],T=kv(Wb(0,t),i),P=new ex(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 ox([[r,o],[i,o],[i,a],[r,a]],nx(e,n))}(c,t)},u=function(t,e){return!t||!t.firstChild||!function(t,e,n){var r,i,o=nx(t,n).flat(1),a=nx(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=Ae(s),l=c.next();!l.done;l=c.next())if(ax(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,Gv(n))};try{for(var f=Ae(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 cx(t,e){return void 0===e&&(e={}),v(t)?0:"number"==typeof t?t:Math.floor(fv(t,e))}var lx=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(Ky(t),!1)}))};var ux=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=lx,f=function(t){return t.forEach(r.show),t},d=2,h=t.slice(),p=t.slice(),g=Math.min.apply(Math,Te([1],_e(t.map((function(t){return t.getBBox().width}))),!1));if("linear"===n.type&&(Hb(n)||Vb(n))){var m=Wv(t[0]).left,y=Wv(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&&sx((l=c?Te(Te([c],_e(p),!1),[s],!1):Te([s],_e(p),!1),l.filter(uv)),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=Ae(s),p=h.next();!p.done;p=h.next()){if(d(p.value),sx(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=dv(r.getTextShape(t[0])),p=cx(u,h),g=a?cx(a,h):p,m=cx(c,h);(v(m)||m===1/0)&&(m=Math.max.apply(null,t.map((function(t){return t.getBBox().width}))));var y=t.slice();_e(d,4);for(var b=function(e){if(y.forEach((function(t){r.ellipsis(r.getTextShape(t),e,o)})),(y=sx(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,Te([],_e(d),!1)),p=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&Hb(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),sx(t,n,f).length<1)return;l&&g(d)}}]]);function fx(){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 dx(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function hx(t,e){var n=_e(t,2),r=n[0],i=n[1],o=_e(e,2),a=o[0],s=o[1],c=_e([r*a+i*s,r*s-i*a],2),l=c[0],u=c[1];return Math.atan2(u,l)}function px(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=Wb(t.value,n),a=zb(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return bv(e,-90,90)||(e+=180),e}(rv("perpendicular"===i?hx([1,0],o):hx([a[0]<0?-1:1,0],a)))}function gx(t,e,n){var r=n.type,i=n.labelAlign,o=Wb(t,n),a=dx(e),s=dx(rv(hx([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?(bv(a,0,90,!1,!0)||bv(a,0,90)||bv(a,270,360))&&(c="start"):90===s?bv(a,0,90,!1,!0)?c="start":(bv(a,90,180)||bv(a,270,360))&&(c="end"):270===s?bv(a,0,90,!1,!0)?c="end":(bv(a,90,180)||bv(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(bv(a,0,90)||bv(a,270,360))&&(c="end")):c="center":"parallel"===i?l=bv(s,0,180,!0)?"top":"bottom":"horizontal"===i?bv(s,90,270,!1)?c="end":(bv(s,270,360,!1)||bv(s,0,90))&&(c="start"):"perpendicular"===i&&(c=bv(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=ov(s,[t,c,e]),u=_e([Wb(t.value,n),fx(a,o)],2),f=_e(Sv(kv(u[0],l+(1===u[1]?ov(r?i:0,[t,c,e]):0)),$b(t.value,n)),2);return{x:f[0],y:f[1]}}function yx(t,e){"text"===t.nodeName&&t.attr(e)}function vx(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=ux.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:Ky,show:Zy,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=gx(e.__data__.value,t,n),i=e.querySelector(Cb.labelItem.class);i&&yx(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&gv(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"),pv(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function bx(t,e,n,r,i){var o=n.indexOf(e),a=zv(t).append(function(t,e,n,r){var i=r.labelFormatter;return y(i)?function(){return yv(ov(i,[t,e,n,Wb(t.value,r)]))}:function(){return yv(t.label||"")}}(e,o,n,i)).attr("className",Cb.labelItem.name).node(),s=_e(Xv(Bb(r,[e,o,n])),2),c=s[0],l=s[1],u=l.transform,f=Oe(l,["transform"]);Zv(a,u);var d=px(e,a,i);return a.getLocalEulerAngles()||a.setLocalEulerAngles(d),yx(a,Me(Me({},gx(e.value,d,i)),c)),t.attr(f),a}function xx(t,e,n,r){var i=Db(e,n.labelFilter),o=qv(n,"label");return t.selectAll(Cb.label.class).data(i,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",Cb.label.name).transition((function(t){bx(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(){vx.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&&Ky(t),e.isVisible()&&Zy(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=_e(t.getGeometryBounds().center,2),d=f[0],h=f[1],p=_e(e.getGeometryBounds().center,2),g=_e([(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)}],Me(Me({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)}],Me(Me({fill:"both"},n),{duration:l+u,delay:c+l-u}));return mb(k,i),[E,k]}(this.querySelector(Cb.labelItem.class),bx(this,t,e,o,n),r.update),a=mx(t,e,n),s=a.x,c=a.y,l=bb(this,{transform:"translate(".concat(s,", ").concat(c,")")},r.update);return Te(Te([],_e(i),!1),[l],!1)})).call((function(e){var r,i,o=J(e,"_transitions").flat().filter(uv);i=function(){vx.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=xb(this.childNodes[0],r.exit);return mb(e,(function(){return zv(t).remove()})),e}))})).transitions()}function wx(t,e){return Gb(t,e.tickDirection,e)}function Mx(t,e,n,r,i){var o=_e(function(t,e){var n=_e(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,ov(i.tickLength,[t,e,n])),2),a=_e(o[0],2),s=a[0],c=a[1],l=_e(o[1],2);return{x1:s,x2:l[0],y1:c,y2:l[1]}}function Ox(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=wx(e.value,i),s="line";return y(o)&&(s=function(){return ov(o,[e,n,r,a])}),t.append(s).attr("className",Cb.tickItem.name)}(zv(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=wx(t.value,o),c=Mx(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,d=c.y2,h=_e(Xv(Bb(a,[t,e,n,s])),2),p=h[0],g=h[1];"line"===r.node().nodeName&&r.styles(Me({x1:l,x2:u,y1:f,y2:d},p)),i.attr(g),r.styles(p)}(t,e,n,a,this,r,i);var s=_e($b(t.value,r),2),c=s[0],l=s[1];return bb(this,{transform:"translate(".concat(c,", ").concat(l,")")},o)}var Ex=sv({text:"text"},"title");function kx(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function Sx(t,e){var n=Object.entries(e).reduce((function(e,n){var r=_e(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e}),{});t.styles(n)}var Ax=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 we(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(Ex.text.class);if(!a)return new iv(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=_e(Gv(i),4),f=u[0],d=u[1],h=u[2],p=u[3],g=_e([0,0,+e,+n],4),m=g[0],y=g[1],v=g[2],b=g[3],x=kx(r);if(x.includes("i"))return new iv(m,y,v,b);x.forEach((function(t,r){var i,o,a,s;"t"===t&&(i=_e(0===r?[l+h,+n-l-h]:[0,+n],2),y=i[0],b=i[1]),"r"===t&&(o=_e([+e-c-p],1),v=o[0]),"b"===t&&(a=_e([+n-l-f],1),b=a[0]),"l"===t&&(s=_e(0===r?[c+d,+e-c-d]:[0,+e],2),m=s[0],v=s[1])}));var w=_e(Gv(o),4),M=w[0],O=w[1],E=w[2],k=w[3],S=_e([k+O,M+E],2),A=S[0],_=S[1];return new iv(m+k,y+M,v-A,b-_)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new iv(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=Oe(t,["width","height","position","spacing"]),i=_e(Xv(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,c=o.position,l=_e([+a/2,+s/2],2),u=_e([+l[0],+l[1],"center","middle"],4),f=u[0],d=u[1],h=u[2],p=u[3],g=kx(c);return g.includes("l")&&(f=(e=_e([0,"start"],2))[0],h=e[1]),g.includes("r")&&(f=(n=_e([+a,"end"],2))[0],h=n[1]),g.includes("t")&&(d=(r=_e([0,"top"],2))[0],p=r[1]),g.includes("b")&&(d=(i=_e([+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;vv(!!r.text,zv(e),(function(t){n.title=t.maybeAppendByClassName(Ex.text,"text").styles(i).call(Sx,{x:a,y:s,textAlign:c,textBaseline:l}).node()}))},e}(Qv);function _x(t,e,n,r,i){var o=_e(Xv(qv(r,"title")),2),a=o[0],s=o[1],c=s.transform,l=s.transformOrigin,u=Oe(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(Me(Me({},a),{transformOrigin:l})),Zv(t.node(),f);var d=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=kx(i),s=t.node().getLocalBounds(),c=_e(s.min,2),l=c[0],u=c[1],f=_e(s.halfExtents,2),d=f[0],h=f[1],p=_e(e.node().getLocalBounds().halfExtents,2),g=p[0],m=p[1],y=_e([l+d,u+h],2),v=y[0],b=y[1],x=_e(Gv(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=_e("start"===i?[k,S]:[S,k],2),_=A[0],T=A[1],P=_e(kv(Cv([-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}}(zv(n._offscreen||n.querySelector(Cb.mainGroup.class)),e,r),h=d.x,p=d.y;return bb(e.node(),{transform:"translate(".concat(h,", ").concat(p,")")},i)}function Tx(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=vv(i,e.maybeAppendByClassName(Cb.lineGroup,"g"),(function(e){return Kb(e,t,r)}))||[],c=vv(o,e.maybeAppendByClassName(Cb.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=Db(e,n.tickFilter),o=qv(n,"tick");return t.selectAll(Cb.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",Cb.tick.name).transition((function(t,e){return Ox.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),Ox.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=xb(this.childNodes[0],r.exit);return mb(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=vv(a,e.maybeAppendByClassName(Cb.labelGroup,"g"),(function(e){return xx(e,n,t,r)}))||[];return Te(Te(Te([],_e(s),!1),_e(c),!1),_e(l),!1).filter((function(t){return!!t}))}var Px=function(t){function e(e){return t.call(this,e,Pb)||this}return we(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=gb(void 0===n?a:n),h=vv(c,zv(e).maybeAppendByClassName(Cb.gridGroup,"g"),(function(e){return tx(e,f,t,d)}))||[],p=zv(e).maybeAppendByClassName(Cb.mainGroup,"g");i&&(!this.initialized&&d.enter||this.initialized&&d.update)&&Tx(t,zv(this.offscreenGroup),f,gb(!1));var g=Tx(t,zv(p.node()),f,d),m=vv(s,zv(e).maybeAppendByClassName(Cb.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(Cb.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 yv(i)})).attr("className",Cb.title.name).transition((function(){return _x(zv(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return _x(zv(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,d)}))||[];return Te(Te(Te([],_e(h),!1),_e(g),!1),_e(m),!1).flat().filter((function(t){return!!t}))},e}(Qv),Cx=sv({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"),Nx=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:ib(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 Vp({class:Cx.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new Vp({class:Cx.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return we(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=_e(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,Te([],_e(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 iv(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=_e(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=vb(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(Cx.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)?Zy(e):Ky(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=_e("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=_e(v.offset,3),x=_e(b[0],2),w=x[0],M=x[1],O=_e(b[1],2),E=O[0],k=O[1],S=_e(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(Cx.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=_e(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(Cx.controller,"g");if(Qy(s.node(),a),a){var c=qv(this.attributes,"button"),l=qv(this.attributes,"pageNum"),u=_e(Xv(c),2),f=u[0],d=u[1],h=f.size,p=Oe(f,["size"]),g=!s.select(Cx.prevBtnGroup.class).node(),m=s.maybeAppendByClassName(Cx.prevBtnGroup,"g").styles(d);this.prevBtnGroup=m.node();var y=m.maybeAppendByClassName(Cx.prevBtn,"path"),v=s.maybeAppendByClassName(Cx.nextBtnGroup,"g").styles(d);this.nextBtnGroup=v.node(),[y,v.maybeAppendByClassName(Cx.nextBtn,"path")].forEach((function(t){t.styles(Me(Me({},p),{transformOrigin:"center"})),Dv(t.node(),h,!0)}));var b=s.maybeAppendByClassName(Cx.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(Cx.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=zv(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(lp.INSERTED,e),this.playWindow.addEventListener(lp.REMOVED,e)},e}(Qv);function Lx(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}ab.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"]]})),ab.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]]})),ab.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 jx=sv({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 Rx=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new Wp({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return we(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=_e(Gv(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=_e(this.spacing,2),f=u[0],d=u[1];if(r){var h=r-n-f-d,p=_e(this.span,2);c=(t=_e([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=_e(Gv(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=_e(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(jx.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=qv(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(jx.markerGroup,"g").style("zIndex",0),vv(!!n,this.markerGroup,(function(){var t=e.markerGroup.node(),i=t.getElementsByClassName(jx.marker.name)[0],o=n();i?o.nodeName===i.nodeName?(!function(t,e){var n,r,i=e.attributes;try{for(var o=Ae(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=_e(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}}}(i,o),zv(i).styles(r)):(i.remove(),zv(o).attr("className",jx.marker.name).styles(r),t.appendChild(o)):(zv(o).attr("className",jx.marker.name).styles(r),t.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var a=Dv(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(a,")")}))},e.prototype.renderLabel=function(t){var e=qv(this.attributes,"label"),n=e.text,r=Oe(e,["text"]);this.labelGroup=t.maybeAppendByClassName(jx.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(jx.label,(function(){return yv(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=qv(this.attributes,"value"),r=n.text,i=Oe(n,["text"]);this.valueGroup=t.maybeAppendByClassName(jx.valueGroup,"g").style("zIndex",0),vv(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(jx.value,(function(){return yv(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=qv(this.attributes,"background");this.background=t.maybeAppendByClassName(jx.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(jx.background,"rect").styles(Me({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=_e(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,")")}),gv(this.labelGroup.select(jx.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(c,")")}),gv(this.valueGroup.select(jx.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=zv(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}(Qv),Ix=sv({page:"item-page",navigator:"navigator",item:"item"},"items"),Bx=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Dx=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:it,mouseenter:it,mouseleave:it})||this;return n.navigatorShape=[0,0],n}return we(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=qv(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:Me({layout:n,labelText:s,valueText:c},Object.fromEntries(Object.entries(r).map((function(n){var r=_e(n,2);return[r[0],ov(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=_e(this.navigatorShape,1)[0],s=_e(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=_e(y,2),b=v[0],x=v[1],w=(r-a-(l-1)*o)/l,M=e.getBBox().height,O=_e([0,0],2),E=O[0],k=O[1];return"horizontal"===n?(E=(d=_e([f,b*(M+i)],2))[0],k=d[1],f=x===l-1?0:f+w+o):(E=(h=_e([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=_e(this.navigatorShape,1)[0],a=_e(this.grid,2),s=a[0],c=a[1],l=_e([e-o,n],2),u=l[0],f=l[1],d=_e([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&&Bx(y,(function(t){return t<c}))?(n=_e([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=_e([v+1,0,0,x+M+r],4),v=o[0],y=o[1],b=o[2],(x=o[3])+M<=f&&Bx(v,(function(t){return t<s}))?(a=_e([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=_e([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 Lx(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(Ix.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(Ix.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);zv(t).selectAll(Ix.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new Rx({style:e})})).attr("className",Ix.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=_e(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=_e(t,2);return{page:e[0],layouts:e[1]}})),i=Te([],_e(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new Vp({className:Ix.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=qv(this.attributes,"nav"),r=lv({orientation:e},n),i=this;return t.selectAll(Ix.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new Nx({style:r})})).attr("className",Ix.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(zv(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new ip(t,{detail:e});this.dispatchEvent(n)},e}(Qv),Fx=sv({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),zx={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},Gx=function(t){function e(e){return t.call(this,e,zx)||this}return we(e,t),e.prototype.render=function(t,e){var n=zv(e).maybeAppendByClassName(Fx.markerGroup,"g");this.renderMarker(n);var r=zv(e).maybeAppendByClassName(Fx.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?Lx(r,"horizontalHandle","verticalHandle"):i;vv(!!o,t,(function(t){var n=qv(e.attributes,"marker"),r=Me({symbol:o},n);e.marker=t.maybeAppendByClassName(Fx.marker,(function(){return new ab({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;vv(r,t,(function(t){var n,r=qv(e.attributes,"label"),o=r.text,c=Oe(r,["text"]),l=(null===(n=t.select(Fx.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,d=l.height,h=_e(Lx(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(Fx.label,"text").styles(Me(Me({},c),{x:p,y:g,text:s(o).toString(),textAlign:m,textBaseline:y}))}))},e}(Qv),Wx={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},$x=lv({},Wx,{}),Hx=lv({},Wx,Uv(zx,"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"}),Vx=sv({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"),Yx=function(t){function e(e){return t.call(this,e,$x)||this}return we(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=_e(Xv(qv(this.attributes,"title")),2),s=a[0],c=a[1];this.titleGroup=t.maybeAppendByClassName(Vx.titleGroup,"g").styles(c);var l=Me(Me({width:e,height:n},s),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(Vx.title,(function(){return new Ax({style:l})})).update(l)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,o=e.height,a=_e(Xv(qv(this.attributes,"title",!0)),2),s=a[0],c=a[1],l=Me(Me({},s),{width:i,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Vx.itemsGroup,"g").styles(Me(Me({},c),{transform:"translate(".concat(n,", ").concat(r,")")}));var u=this;this.itemsGroup.selectAll(Vx.items.class).data(["items"]).join((function(t){return t.append((function(){return new Dx({style:l})})).attr("className",Vx.items.name).each((function(){u.items=zv(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 iv(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=kx(r),u=_e(Gv(a?i:0),4),f=u[0],d=u[1],h=u[2],p=u[3],g=_e(Gv(o),4),m=g[0],y=g[1],v=g[2],b=g[3],x=_e([p+d,f+h],2),w=x[0],M=x[1],O=_e([b+y,m+v],2),E=O[0],k=O[1];if("l"===l[0])return new iv(s.x,s.y,c.width+s.width+w+E,Math.max(c.height+k,s.height));if("t"===l[0])return new iv(s.x,s.y,Math.max(c.width+E,s.width),c.height+s.height+M+k);var S=_e([e.attributes.width||c.width,e.attributes.height||c.height],2),A=S[0],_=S[1];return new iv(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=zv(e);e.style.transform="translate(".concat(a,", ").concat(c,")"),this.renderTitle(l,r,i),this.renderItems(l,this.availableSpace),this.adjustLayout()},e}(Qv),qx={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},Ux=sv({background:"background",labelGroup:"label-group",label:"label"},"indicator"),Xx=function(t){function e(e){var n=t.call(this,e,qx)||this;return n.point=[0,0],n.group=n.appendChild(new Vp({})),n.isMutationObserved=!0,n}return we(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=_e(Gv(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 iv(c[0]-a,c[1]-r,l[0]+i-c[0]+a,l[1]+o-c[1]+r),f=this.getPath(e,u),d=qv(this.attributes,"background");this.background=zv(this.group).maybeAppendByClassName(Ux.background,"path").styles(Me(Me({},d),{d:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=_e(Xv(qv(this.attributes,"label")),2),i=r[0],o=r[1],a=Oe(i,["text"]);(this.label=zv(this.group).maybeAppendByClassName(Ux.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(Ux.label,(function(){return yv(e(n))})).style("text",e(n).toString()).selectAll("text").styles(a)},e.prototype.adjustLayout=function(){var t=_e(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,Te([c+1,1],_e(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=$v.apply(void 0,Te([],_e(t),!1)),r=_e(t,2),i=_e(r[0],2),o=i[0],a=i[1],s=_e(r[1],2),c=s[0],l=s[1],u=_e(n?[c-o,[o,c]]:[l-a,[a,l]],2),f=u[0],d=_e(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=_e([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?Ky(this):Zy(this)},e.prototype.bindEvents=function(){this.label.on(lp.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(Qv);function Zx(t,e){var n=_e(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 Kx=sv({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function Qx(t){var e=t.orientation,n=t.size,r=t.length;return Lx(e,[r,n],[n,r])}function Jx(t){var e=t.type,n=_e(Qx(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 tw(t){return Jx(t)}function ew(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 Bf(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(Lx(n,"0","270"),")")):""}function nw(t){var e=t.orientation,n=t.range;if(!n)return[];var r=_e(Qx(t),2),i=r[0],o=r[1],a=_e(n,2),s=a[0],c=a[1],l=Lx(e,s*i,0),u=Lx(e,0,s*o),f=Lx(e,c*i,i),d=Lx(e,o,c*o);return[["M",l,u],["L",l,d],["L",f,d],["L",f,u],["Z"]]}var rw=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 we(e,t),e.prototype.render=function(t,e){!function(t,e){var n=qv(e,"track");t.maybeAppendByClassName(Kx.track,"path").styles(Me({d:Jx(e)},n))}(zv(e).maybeAppendByClassName(Kx.trackGroup,"g"),t),function(t,e){var n=qv(e,"selection"),r=ew(e),i=t.maybeAppendByClassName(Kx.selection,"path").styles(Me({d:tw(e),fill:r},n)),o=i.maybeAppendByClassName(Kx.clipPath,"path").styles({d:nw(e)}).node();i.style("clipPath",o)}(zv(e).maybeAppendByClassName(Kx.selectionGroup,"g"),t)},e}(Qv);var iw=function(t){function e(e){var n=t.call(this,e,Hx)||this;return n.eventToOffsetScale=new ma({}),n.innerRibbonScale=new ma({}),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=Zx(r.map((function(t){return t.value})),o).range;n.showIndicator((a[0]+a[1])/2,"".concat(a[0],"-").concat(a[1])),n.dispatchIndicated(o,a)}else{var s=n.getTickValue(o);n.showIndicator(s),n.dispatchIndicated(s)}},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=_e(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 we(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 iv(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(zv(e));var i=this.availableSpace,o=i.x,a=i.y,s=zv(e).maybeAppendByClassName(Vx.contentGroup,"g").styles({transform:"translate(".concat(o,", ").concat(a,")")});vv(!!r,s.maybeAppendByClassName(Vx.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(Vx.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(Vx.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,Te([],_e(t.map((function(t){return t.value}))),!1)),max:Math.max.apply(Math,Te([],_e(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=_e(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=_e(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Lx(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=qv(this.attributes,"title"),s=Me(Me({},a),{width:i,height:o,text:r}),c=this;t.selectAll(Vx.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new Ax({style:s})})).attr("className",Vx.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 iv(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 iv(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(Cb.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new iv(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=_e(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=_e(this.ifHorizontal([b,m],[m,b]),2),w=x[0],M=x[1],O=["top","left"].includes(y)?s:0,E=_e(this.ifHorizontal([v/2,O],[O,v/2]),2),k=E[0],S=E[1];return new iv(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=qv(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=lv({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(Vx.ribbon,(function(){return new rw({style:y})})).update(y)},e.prototype.getHandleClassName=function(t){return"".concat(Vx.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=qv(this.attributes,"handle"),i=_e(this.selection,2),o=i[0],a=i[1],s=Me(Me({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?Gx:Ab,u=this;this.handlesGroup.selectAll(Vx.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(Vx.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=_e(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 iv(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=_e([Math.max(e,i),Math.max(n,o)],2),s=a[0],c=a[1];return this.cacheHandleBBox=new iv(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=_e(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=_e(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=qv(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Vx.indicator,(function(){return new Xx({})})).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(Me(Me({},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=_e([n.value,c.value],2),u=l[0],f=l[1],d=(u+f)/2;e.push(Me(Me({},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=_e(["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=qv(this.attributes,"tick"),s=qv(this.attributes,"label"),c=s.align,l=lv(Me({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Uv(a,"tick"),Uv(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=Me(Me(Me({},l),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(Vx.label,(function(){return new Px({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=_e([0,0,0],3),l=c[0],u=c[2],f=null!=i?i:o;return e?(u=f,"positive"===n?"right"===a?(l=f,u=f):"bottom"===a&&(l=u):"negative"===n&&("top"===a||"left"===a)&&(l=o)):"positive"===n&&("right"===a||"bottom"===a&&(l=o+s)),{offset:l,spacing:r,tickLength:u}},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=_e(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}),Zy(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){Ky(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=_e(this.selection,2),o=i[0],a=i[1],s=_e([t,e],2),c=s[0],l=s[1];n&&(c+=o,l+=a);var u=this.range;r=_e(function(t,e,n,r){var i,o=_e(t,2),a=o[0],s=o[1],c=_e(e,2),l=c[0],u=c[1],f=_e(n,2),d=f[0],h=f[1],p=_e([l,u],2),g=p[0],m=p[1],y=m-g;return g>m&&(g=(i=_e([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 H(e)?Nv(.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?Zx(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,e){var n=this.range,r=n.min,i=n.max,o=_e(this.ribbon.node().getPosition(),2),a=o[0],s=o[1],c=this.ifHorizontal(a,s),l=this.ifHorizontal.apply(this,Te([],_e(mv(t)),!1))-c;return L(this.getOffset(l,!0),r,i)},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.dispatchSelection=function(){var t=new ip("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},e.prototype.dispatchIndicated=function(t,e){var n=new ip("indicate",{detail:{value:t,range:e}});this.dispatchEvent(n)},e}(Qv);function ow(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 aw={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function sw(t){var e;void 0===t&&(t="");var n=ow(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)]=Me({flex:1},aw),e[".".concat(n.VALUE)]=Me({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},aw),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 cw=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=ow(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:sw(o)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return we(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=Oe(t,["name","color","index"]),l=Me({name:i,color:a,index:null!=s?s:e},c);return gn(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=gn(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=ow(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,Te([],_e(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=_e(e,2),r=n[0],i=n[1];Te([t],_e(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=_e(l,2),n=e[0],i=e[1],a=_e(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=_e(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=_e(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=_e([+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 iv(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}(Qv),lw=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[lp.BOUNDS_CHANGED,lp.INSERTED,lp.REMOVED],n.$margin=Gv(0),n.$padding=Gv(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 we(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=Gv(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=Gv(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=_e(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new iv(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=_e(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],c=_e(this.$margin,4),l=c[0],u=c[3];return new iv(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:Ov,grid:Ev},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}(Vp);function uw(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 xc()([[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=Ss(t,e),i=Ss(e,n),o=Ss(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 xc()(u)}const fw=zm((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=Oe(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=Mr(b,"background"),{padding:w}=x,M=Oe(x,["padding"]),O=Mr(b,"connector"),{points:E=[]}=O,k=Oe(O,["points"]),S=[[+u,+f],[+c,+l]];let A;A=v?xm(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",v).call(Em,Object.assign({transform:a,transformOrigin:s},b)).node():xm(t).maybeAppend("text","text").style("zIndex",0).style("text",d).call(Em,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const _=xm(t).maybeAppend("background","rect").style("zIndex",-1).call(Em,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(Em,h?M:{}).node(),T=uw(_,S,E,y),P=g&&new ab({id:"startMarker",style:Object.assign({x:0,y:0},Mr(b,"startMarker"))}),C=m&&new ab({id:"endMarker",style:Object.assign({x:0,y:0},Mr(b,"endMarker"))});xm(t).maybeAppend("connector","path").style("zIndex",0).style("d",T).style("markerStart",P).style("markerEnd",C).call(Em,p?k:{})})),dw=(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 xm(new fw).style("x",f).style("y",d).call(Em,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(Em,u).call(Em,t).node()}};dw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hw=zm((t=>{const e=Oe(t.attributes,["class","x","y","transform"]),n=Mr(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=xm(t).maybeAppend("marker",(()=>new ab({}))).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);xm(t).maybeAppend("text","text").style("x",a).style("y",s).call(Em,e)})),pw=(t,e)=>{const n=Oe(t,[]);return(t,e,r)=>{const{color:i}=r,o=Oe(r,["color"]),{color:a=i,text:s=""}=e,c={text:String(s),stroke:a,fill:a},[[l,u]]=t;return xm(new hw).call(Em,o).style("transform",`translate(${l},${u})`).call(Em,c).call(Em,n).node()}};pw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const gw=(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 xm(new Jp).style("x",f).style("y",d).call(Em,i).style("transformOrigin","center center").style("transform",`${l}rotate(${c}deg)`).style("coordCenter",n.getCenter()).call(Em,u).call(Em,t).node()}};gw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const mw=zm((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;xm(t).maybeAppend("connect-path",(()=>o.createElement("path",{}))).style("d",n).call(Em,i),xm(t).maybeAppend("area-path",(()=>o.createElement("path",{}))).style("d",e).call(Em,r)})),yw=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=(t=>!Number.isNaN(t)&&null!=t),connect:o=!1}=t,a=Oe(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=Xc(s),m=Pm(s,e),y=r&&d?Sm(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=Mr(v,"connect"),M=!!x.length,O=t=>xm(c.createElement("path",{})).style("d",t||"").call(Em,v).node();if(Zc(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=wc().curve(Mc),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 kc(n())},delete t.lineX0,t.lineEndAngle=function(){return kc(r())},delete t.lineX1,t.lineInnerRadius=function(){return kc(i())},delete t.lineY0,t.lineOuterRadius=function(){return kc(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(Ec(t)):e()._curve},t}().angle(((t,n)=>_s(Es(r[n],e)))).outerRadius(((t,n)=>Ss(r[n],e))).innerRadius(((t,n)=>Ss(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)):xm(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?wc().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):wc().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)):xm(new mw).style("areaStyle",v).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};yw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const vw=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Zc(n)?Rc:yc;return yw(Object.assign({curve:i},t),e)(...r)}};vw.props=Object.assign(Object.assign({},yw.props),{defaultMarker:"square"});const bw=(t,e)=>{const n=Oe(t,[]),{coordinate:r}=e;return(...t)=>{const i=Zc(r)?Lc:Xc(r)?Hc:$c;return yw(Object.assign({curve:i},n),e)(...t)}};bw.props=Object.assign(Object.assign({},yw.props),{defaultMarker:"smooth"});const xw=(t,e)=>(...n)=>yw(Object.assign({curve:Yc},t),e)(...n);xw.props=Object.assign(Object.assign({},yw.props),{defaultMarker:"hvh"});const ww=(t,e)=>(...n)=>yw(Object.assign({curve:qc},t),e)(...n);ww.props=Object.assign(Object.assign({},yw.props),{defaultMarker:"vh"});const Mw=(t,e)=>(...n)=>yw(Object.assign({curve:Uc},t),e)(...n);Mw.props=Object.assign(Object.assign({},yw.props),{defaultMarker:"hv"});const Ow=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>Uy(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};Ow.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ew=(t,e)=>{const n=Oe(t,[]),{document:r}=e;return(t,e,i)=>{const{color:o}=i,a=Oe(i,["color"]),{color:s=o,transform:c}=e,[l,u]=t,f=ac();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]),xm(r.createElement("path",{})).call(Em,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(Em,n).node()}};function kw(t,e,n,r){const i=ac();if(Zc(n)){const o=n.getCenter(),a=Ss(t,o),s=(Ss(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),km(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return Xc(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)}Ew.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Sw=(t,e)=>{const{cornerRatio:n=1/3}=t,r=Oe(t,["cornerRatio"]),{coordinate:i,document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Oe(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,d]=t,h=kw(f,d,i,n);return xm(o.createElement("path",{})).call(Em,c).style("d",h.toString()).style("stroke",l).style("transform",u).call(Em,r).node()}};Sw.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Aw=(t,e)=>{const n=Oe(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Oe(o,["color"]),{color:c=a,transform:l}=e,[u,f]=t,d=ac();if(d.moveTo(u[0],u[1]),Zc(r)){const t=r.getCenter();d.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{km(d,u,f,Cs(u,f),Ss(u,f)/2)}return xm(i.createElement("path",{})).call(Em,s).style("d",d.toString()).style("stroke",c).style("transform",l).call(Em,n).node()}};function _w(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 Tw(t={}){return[..._w(t),{name:"title",scale:"identity"}]}function Pw(){return[{type:Xr,channel:"color"},{type:ci,channel:["x","y"]}]}function Cw(){return[{type:Xr,channel:"x"},{type:ci,channel:["y"]}]}function Nw(t={}){return _w(t)}function Lw(){return[{type:ti}]}function jw(t,e){return t.getBandWidth(t.invert(e))}function Rw(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?jw(a,r[e]):0,l=h?jw(s,i[e]):0,g=p&&o?(jw(c,o[e])/2+ +o[e])*n:0,[m,y]=t;return[m+u*n+g,y+f*l]}:t=>t}function Iw(t){return parseFloat(t)/100}function Bw(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?Iw(e)*a:+e,"string"==typeof n?Iw(n)*s:+n]]}))]}Aw.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Dw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Oe(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?Iw(d)*m:d,h="string"==typeof h?Iw(h)*y:h;const v=p-Number(d)/2,b=g-Number(h)/2;return xm(r.createElement("image",{})).call(Em,s).style("x",v).style("y",b).style("src",l).style("stroke",c).style("transform",f).call(Em,t).style("width",d).style("height",h).node()}};function Fw(t,e){const n=ac();if(Zc(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>Ss(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?km(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)}Dw.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const zw=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Oe(o,["color"]),{color:c=a,transform:l}=i,u=Fw(e,n);return xm(r.createElement("path",{})).call(Em,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(Em,t).node()}};function Gw(t,e){const[n,r,i,o]=t,a=ac();if(Zc(e)){const t=e.getCenter(),s=Ss(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),km(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),km(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}zw.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ww=(t,e)=>{const n=Oe(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Oe(o,["color"]),{color:c=a,transform:l}=e,u=Gw(t,r);return xm(i.createElement("path",{})).call(Em,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(Em,n).node()}};function $w(t,e){const n=ac();if(Zc(e)){const r=e.getCenter(),[i,o]=r,a=As(Es(t[0],r)),s=As(Es(t[1],r)),c=Ss(r,t[2]),l=Ss(r,t[3]),u=Ss(r,t[8]),f=Ss(r,t[10]),d=Ss(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}Ww.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Hw=(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=Oe(o,["color","fill","stroke"]),d=$w(e,n);return xm(r.createElement("path",{})).call(Em,f).style("d",d.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Em,t).node()}};function Vw(t,e,n=4){const r=ac();if(!Zc(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=Ss(i,t[3]),c=Ss(i,t[8]),l=Ss(i,t[10]),u=As(Es(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}Hw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Yw=(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=Oe(o,["color","fill","stroke"]),d=Vw(e,n,4);return xm(r.createElement("path",{})).call(Em,f).style("d",d.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Em,t).node()}};Yw.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const qw=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=Oe(t,["arrow","arrowSize"]),{coordinate:o,document:a}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=Oe(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},Mr(i,"arrow"))):null,p=function(t,e){if(!Zc(e))return xc().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return pc()({startAngle:0,endAngle:2*Math.PI,outerRadius:Ss(t[0],n),innerRadius:Ss(t[1],n)})}(t,o),g=function(t,e){if(!Zc(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,e.transform);return xm(a.createElement("path",{})).call(Em,u).style("d",p).style("stroke",f).style("lineWidth",d).style("transform",g).style("markerEnd",h).call(Em,i).node()}};function Uw(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}qw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Xw=(t,e)=>{const{offset:n=0,offset1:r=n,offset2:i=n,connectLength1:o,endMarker:a=!0}=t,s=Oe(t,["offset","offset1","offset2","connectLength1","endMarker"]),{coordinate:c}=e;return(t,e,n)=>{const{color:l,connectLength1:u}=n,f=Oe(n,["color","connectLength1"]),{color:d,transform:h}=e,p=function(t,e,n,r,i=0){const[[o,a],[s,c]]=e;if(Xc(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=Mr(Object.assign(Object.assign({},s),n),"endMarker");return xm(new Xp).call(Em,f).style("d",function(t){return xc().x((t=>t[0])).y((t=>t[1]))(t)}(p)).style("stroke",d||l).style("transform",h).style("markerEnd",a?new ab({className:"marker",style:Object.assign(Object.assign({},g),{symbol:Uw})}):null).call(Em,s).node()}};function Zw(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function Kw(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=kr(n.x,l),s=kr(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 Qw(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=_m(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:d,endAngle:h}=l,p="inside"===t?(d+h)/2:h,g=tM(p,a,s),m=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?Jw(c,p,i):Cs(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},m),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function Jw(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function tM(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function eM(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=_m(r,e,[i,o]),{startAngle:f,endAngle:d}=u,h=r.getCenter(),p=(f+d)/2,g={textAlign:"center",textBaseline:"middle",rotate:tM(p,a,s)},{innerRadius:m,outerRadius:y}=u,v=m+(y-m)*c+l,[b,x]=Jw(h,p,v);return Object.assign({x:b,y:x},g)}function nM(t){return void 0===t?null:t}function rM(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:nM(o[0]),y:nM(o[1])}}function iM(t,e,n,r){const{bounds:i}=n;if(1===i.length)return rM(0,0,n);return(Kc(r)?Qw:el(r)?eM:Kw)(t,e,n,r)}function oM(t,e,n){const r=_m(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function aM(t,e,n){const r=_m(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function sM(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=aM(e,n,r),h=Math.sin(d)>0?1:-1,p=tM(d,i,o),g={textAlign:h>0||Kc(r)?"start":"end",textBaseline:"middle",rotate:p},m=oM(e,n,r),y=m+(s?c:a),[[v,b],[x,w],[M,O]]=function(t,e,n,r,i){const[o,a]=Jw(t,e,n),[s,c]=Jw(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)}Xw.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var cM=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=ar(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=As(Es(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:iM,bottomLeft:iM,bottomRight:iM,inside:iM,left:iM,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?rM(0,0,n):(Kc(r)?Qw:el(r)?sM:Kw)(t,e,n,r)},right:iM,spider:function(t,e,n,r){if(!el(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=Oe(sM(0,e,n,r),[]),c=r.getCenter(),l=oM(e,n,r),u=aM(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(!el(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=Oe(sM(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if(el(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=_s([c-u[0],l-u[1]]),p=Math.sin(h)>0?1:-1,[g,m]=Jw(u,h,d);return s.x=g+(o+a)*p,s.y=m,s},top:iM,topLeft:iM,topRight:iM});function lM(t,e,n,r,i){const{position:o}=e,{render:a}=i,s=function(t,e){return void 0!==t?t:el(e)?"inside":Xc(e)?"right":"top"}(o,n),c=r[a?"htmlLabel":"inside"===s?"innerLabel":"label"],l=Object.assign({},c,e),u=cM[Zw(s)];if(!u)throw new Error(`Unknown position: ${s}`);return Object.assign(Object.assign({},c),u(s,t,l,n,i))}const uM=(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=Oe(o,["text","x","y","transform","transformOrigin","className"]),h=lM(e,o,n,r,t),{rotate:p=0,transform:g=""}=h,m=Oe(h,["rotate","transform"]);return xm(new fw).call(Em,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(Em,d).node()}};uM.props={defaultMarker:"point"};const fM=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=Oe(t,["arrow","colorAttribute"]),{coordinate:o,document:a}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=Oe(n,["color","stroke"]),{d:u,color:f=s}=e,[d,h]=o.getSize();return xm(a.createElement("path",{})).call(Em,l).style("d","function"==typeof u?u({width:d,height:h}):u).style(r,f).call(Em,i).node()}};fM.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dM=(t,e)=>fM(Object.assign({colorAttribute:"fill"},t),e);dM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hM=(t,e)=>fM(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);hM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const pM=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:o}=r,{color:a}=i,s=Oe(i,["color"]),{color:c=a}=r,[l,...u]=e,f=ac();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),xm(n.createElement("path",{})).call(Em,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(Em,t).node()}};function gM(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}pM.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},gM(3);const yM=function(t,e=((...t)=>`${t[0]}`),n=16){const r=gM(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 vM(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=yM(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 bM=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:o,blur:a,useGradientOpacity:s}=t,c=Oe(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=sr(t,(t=>t[2])),v=or(t,(t=>t[2])),b=p&&g?vM(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 xm(f.createElement("image",{})).call(Em,d).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas).style("transform",h).call(Em,c).node()}};bM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xM=(t,e)=>{const{render:n}=t,r=Oe(t,["render"]);return t=>{const[[i,o]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:o}),e)}};function wM(t,e){return t.getBandWidth(t.invert(e))}xM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const MM={rect:jm,hollow:Rm,funnel:Bm,pyramid:Fm},OM=()=>(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=wM(l,i[t]),n=e*(u?wM(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]};OM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:MM,channels:[...Tw({shapes:Object.keys(MM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Lw(),{type:En},{type:Zr}],postInference:[...Cw()],interaction:{shareTooltip:!0}};const EM={rect:jm,hollow:Rm},kM=()=>(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]};kM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:EM,channels:[...Tw({shapes:Object.keys(EM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Lw(),{type:En}],postInference:[...Cw()],interaction:{shareTooltip:!0}};const SM={line:$m,smooth:Hm,hv:Vm,vh:Ym,hvh:qm,trail:Xm},AM=(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(Wn(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]},_M=(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}))]},TM=()=>(t,e,n,r)=>(Jc(r)?_M:AM)(t,e,n,r);TM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:SM,channels:[...Tw({shapes:Object.keys(SM)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Lw(),{type:hi},{type:ei}],postInference:[...Cw(),{type:Xr,channel:"color"},{type:ci,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const PM={hollow:Ty,hollowDiamond:Ay,hollowHexagon:_y,hollowSquare:Py,hollowTriangleDown:Ny,hollowTriangle:Cy,hollowBowtie:Sy,hollowCircle:Ry,point:$y,plus:Wy,diamond:Dy,square:Hy,triangle:Yy,hexagon:Fy,cross:By,bowtie:Iy,hyphen:zy,line:Gy,tick:Vy,triangleDown:qy,circle:jy},CM=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=Rw(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))]))]};CM.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:PM,channels:[...Tw({shapes:Object.keys(PM)}),{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:[...Lw(),{type:Zr},{type:Kr}],postInference:[{type:Jr},...Pw()]};const NM={text:dw,badge:pw,tag:gw},LM=t=>{const{cartesian:e=!1}=t;return e?Bw:(e,n,r,i)=>{const{x:o,y:a}=r,s=Rw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};LM.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:NM,channels:[...Tw({shapes:Object.keys(NM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize",scale:"identity"},{name:"rotate",scale:"identity"}],preInference:[...Lw(),{type:di},{type:ui}],postInference:[...Pw()]};const jM={cell:jm,hollow:Rm},RM=()=>(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]};RM.props={defaultShape:"cell",defaultLabelShape:"label",shape:jM,composite:!1,channels:[...Tw({shapes:Object.keys(jM)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Lw(),{type:Zr},{type:Kr},{type:li}],postInference:[...Pw()]};const IM={area:vw,smooth:bw,hvh:xw,vh:ww,hv:Mw},BM=()=>(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(Wn(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]};BM.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:IM,channels:[...Tw({shapes:Object.keys(IM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Lw(),{type:ei},{type:En},{type:li}],postInference:[...Cw()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const DM={link:Ow,arc:Aw,smooth:Ew,vhv:Sw},FM=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=Rw(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]};FM.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:DM,channels:[...Tw({shapes:Object.keys(DM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Lw(),{type:ii},{type:oi}],postInference:[...Pw()]};const zM={image:Dw},GM=t=>{const{cartesian:e}=t;return e?Bw:(e,n,r,i)=>{const{x:o,y:a}=r,s=Rw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};GM.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:zM,channels:[...Tw({shapes:Object.keys(zM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Lw(),{type:di},{type:ui}],postInference:[...Pw()]};const WM={polygon:zw,ribbon:Ww},$M=()=>(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]};$M.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:WM,channels:[...Tw({shapes:Object.keys(WM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Lw()],postInference:[...Pw()]};const HM={box:Hw,violin:Yw},VM=()=>(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]};VM.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:HM,channels:[...Tw({shapes:Object.keys(HM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Lw(),{type:Zr}],postInference:[...Cw()],interaction:{shareTooltip:!0}};const YM={vector:Uy},qM=()=>(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]};qM.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:YM,channels:[...Tw({shapes:Object.keys(YM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Lw()],postInference:[...Pw()]};const UM={line:qw},XM=t=>(e,n,r,i)=>{const{y:o}=r,a=Rw(n,r,Z({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]};XM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:UM,channels:[...Nw({shapes:Object.keys(UM)}),{name:"y",required:!0}],preInference:[...Lw(),{type:ni}],postInference:[]};const ZM={line:qw},KM=t=>(e,n,r,i)=>{const{x:o}=r,a=Rw(n,r,Z({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]};KM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:ZM,channels:[...Nw({shapes:Object.keys(ZM)}),{name:"x",required:!0}],preInference:[...Lw(),{type:ri}],postInference:[]};const QM={connector:Xw},JM=(...t)=>FM(...t);function tO(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 eO(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=tO("x",e,i,r.x),s=tO("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]}}JM.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:QM,channels:[...Nw({shapes:Object.keys(QM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Lw()],postInference:[]};const nO={range:jm},rO=()=>eO();rO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:nO,channels:[...Nw({shapes:Object.keys(nO)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Lw()],postInference:[]};const iO={range:jm},oO=()=>eO({extendY:!0});oO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:iO,channels:[...Nw({shapes:Object.keys(iO)}),{name:"x",required:!0}],preInference:[...Lw(),{type:ai}],postInference:[]};const aO={range:jm},sO=()=>eO({extendX:!0});sO.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:aO,channels:[...Nw({shapes:Object.keys(aO)}),{name:"y",required:!0}],preInference:[...Lw(),{type:si}],postInference:[]};const cO={path:dM,hollow:hM},lO=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];function uO(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 fO(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=hO)):void 0===e&&(e=dO);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(gO)}function dO(t){return t.children}function hO(t){return Array.isArray(t)?t[1]:null}function pO(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function gO(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 yO(t){return null==t?null:vO(t)}function vO(t){if("function"!=typeof t)throw new Error;return t}function bO(){return 0}function xO(t){return function(){return t}}function wO(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 MO(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}lO.props={defaultShape:"path",defaultLabelShape:"label",shape:cO,composite:!1,channels:[...Tw({shapes:Object.keys(cO)}),{name:"d",scale:"identity"}],preInference:[...Lw()],postInference:[]},mO.prototype=fO.prototype={constructor:mO,count:function(){return this.eachAfter(uO)},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 fO(this).eachBefore(pO)},[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 OO={depth:-1},EO={},kO={};function SO(t){return t.id}function AO(t){return t.parentId}function _O(){var t,e=SO,n=AO;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;PO(t,e-1)&&!PO(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(TO),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(TO(t)),d.push(kO));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)?EO: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===EO)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===kO&&1===s.children.length;)s=s.children[0],--i;for(let t=d.length-1;t>=0&&(l=d[t]).data===kO;--t)l.data=null}if(s.parent=OO,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(gO),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=yO(t),r):e},r.parentId=function(t){return arguments.length?(n=yO(t),r):n},r.path=function(e){return arguments.length?(t=yO(e),r):t},r}function TO(t){let e=t.length;if(e<2)return"";for(;--e>1&&!PO(t,e););return t.slice(0,e)}function PO(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function CO(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 NO=(1+Math.sqrt(5))/2;function LO(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?MO(a,n,r,i,M?r+=l*u/M:o):CO(a,n,r,M?n+=c*u/M:i,o),M-=u,b=x}return y}var jO=function t(e){function n(t,n,r,i,o){LO(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(NO);function RO(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 IO(t,e,n,r,i){(1&t.depth?CO:MO)(t,e,n,r,i)}var BO=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?MO(s,n,r,i,h?r+=(o-r)*s.value/h:o):CO(s,n,r,h?n+=(i-n)*s.value/h:i,o),h-=s.value}else t._squarify=a=LO(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(NO);function DO(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],DO(n,n.path)}))}function FO(t){const e=J(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach((t=>{FO(t)}))}function zO(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:RO,treemapDice:MO,treemapSlice:CO,treemapSliceDice:IO,treemapSquarify:jO,treemapResquarify:BO},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?_O().path(e)(t):_O()(t):fO(t)}(t,e.path);w(t)?FO(o):DO(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=jO,e=!1,n=1,r=1,i=[0],o=bO,a=bO,s=bO,c=bO,l=bO;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(wO),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=vO(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:xO(+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:xO(+t),u):a},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:xO(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"==typeof t?t:xO(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:xO(+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 GO=t=>{const{cartesian:e}=t;return e?Bw:(e,n,r,i)=>{const{x:o,y:a}=r,s=Rw(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};GO.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:xM},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Lw(),{type:di},{type:ui},{type:fi}]};const WO=(t,e)=>ke(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=Oe(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 Z({},{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}))}));WO.props={};const $O={density:pM},HO=()=>(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]};HO.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:$O,channels:[...Tw({shapes:Object.keys($O)}),{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:[...Lw(),{type:En},{type:Zr}],postInference:[...Cw()],interaction:{shareTooltip:!0}};const VO={heatmap:bM},YO=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]}))]]};YO.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:VO,channels:[...Tw({shapes:Object.keys(VO)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Lw(),{type:Zr},{type:Kr}],postInference:[...Pw()]};const qO=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];qO.props={};const UO=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];UO.props={};const XO=t=>new Qo(t);XO.props={};const ZO=t=>new ma(t);ZO.props={};const KO=t=>new Xo(t);KO.props={};const QO=t=>new fa(t);QO.props={};const JO=t=>new ya(t);JO.props={};const tE=t=>new za(t);tE.props={};const eE=t=>new Oa(t);eE.props={};const nE=t=>new ba(t);nE.props={};const rE=t=>new wa(t);rE.props={};const iE=t=>new Sa(t);iE.props={};const oE=t=>new Ea(t);oE.props={};const aE=t=>new xa(t);aE.props={};const sE=t=>new $a(t);sE.props={};const cE=t=>new ta(t);function lE({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"}}}cE.props={};const uE=lE({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}),fE=t=>Z({},uE,t);fE.props={};const dE=t=>Z({},fE(),{category10:"category10",category20:"category20"},t);dE.props={};const hE=lE({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"#141414",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}),pE=t=>Z({},hE,{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),gE=t=>Object.assign({},pE(),{category10:"category10",category20:"category20"},t);gE.props={};const mE=lE({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}),yE=t=>Z({},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 vE(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)]}yE.props={};var bE,xE=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function wE(t){if(!(e=xE.exec(t)))throw new Error("invalid format: "+t);var e;return new ME({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 ME(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 OE(t,e){var n=vE(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")}wE.prototype=ME.prototype,ME.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 EE={"%":(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)=>OE(100*t,e),r:OE,s:function(t,e){var n=vE(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(bE=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")+vE(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function kE(t){return t}var SE,AE,_E=Array.prototype.map,TE=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function PE(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?kE:(e=_E.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?kE:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(_E.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=wE(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"):EE[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=EE[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?TE[8+bE/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=wE(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=vE(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=TE[8+r/3];return function(t){return n(i*t)+o}}}}function CE(t,e,n){return t.querySelector(e)?xm(t).select(e):xm(t).append(n)}function NE(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function LE(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)}SE=PE({thousands:",",grouping:[3],currency:["$",""]}),AE=SE.format;class jE extends lw{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 RE extends jE{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function IE(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function BE(t){return"vertical"===t||t===-Math.PI/2}function DE(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 FE(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=Oe(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 zE(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function GE(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function WE(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]=Bn(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(Zc(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 ma({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(!tl(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new ma({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new ma({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return Zc(s)||Xc(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:Kc(s)&&"center"===a||Xc(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||Xc(s)&&g(a)?1-l:l,label:f(d(Om(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(Om(e),n,r)),id:String(n)}}))}function $E(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 HE(t,e,n){return!function(t){return Zc(t)&&Xc(t)}(e)&&!Jc(e)&&(void 0===t?!!n.getTicks:t)}function VE(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${yr(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:BE(o)?10:0,tick:"center"!==r&&void 0}):a}const YE=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?AE(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)}},qE=YE((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=Oe(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=VE(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]=GE(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]=nl(r),[f,d]=rl(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=Zc(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=WE(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:NE(u),labelOverlap:$E(p,k),grid:HE(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 Px({className:"axis",style:FE(C)})}})),UE=YE((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=Oe(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=WE(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]=nl(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]=rl(i),[h,p]=GE(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=FE(Z({},w,M,x,Object.assign(Object.assign({type:"arc",data:y,titleText:NE(d),grid:h},p),l)));return new Px({style:nt(O,["transform"])})}}));qE.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},UE.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const XE=t=>(...e)=>{const n=qE(Object.assign({},{crossPadding:50},t))(...e);return zE(n,t),n};XE.props=Object.assign(Object.assign({},qE.props),{defaultPosition:"bottom"});const ZE=t=>(...e)=>{const n=qE(Object.assign({},{crossPadding:10},t))(...e);return zE(n,t),n};function KE(t,e,n,r){const{radar:i}=t,[o]=r,a=o.getOptions().name,[s,c]=rl(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))})}ZE.props=Object.assign(Object.assign({},qE.props),{defaultPosition:"left"});const QE=t=>{const{important:e={}}=t,n=Oe(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return qE(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({},KE(t,i,o,a)),e)}))(r)}};function JE(t,e){const{scales:n,library:r,markState:i}=e,[o,a]=function(t,e){const n=IE(t,"shape"),r=IE(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=Oe(e,["d","fill","lineWidth","path","stroke","color"]);const l=Oy.get(t)||Oy.get("point");return(...t)=>new Xp({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 IE(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 tk(t){const e=IE(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function ek(t,e){const{labelFormatter:n=(t=>`${t}`)}=t,{scales:r,theme:i}=e,o=function(t,e){const n=IE(t,"size");return n instanceof fa?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:JE(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:tk(r)},s="string"==typeof n?AE(n):n,c=IE(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)})))})}QE.props=Object.assign(Object.assign({},qE.props),{defaultPosition:"center"});const nk=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,cols:c,itemMarker:l}=t,u=Oe(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}=DE(t,e,n);return{width:i,height:o}}(r,t,nk),h=LE(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:NE(s)}),ek(t,e)),{legendCategory:g={}}=i,m=FE(Object.assign({},g,p,u)),y=new RE({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},h),{subOptions:m})});return y.appendChild(new Yx({className:"legend-category",style:m})),y}};function rk(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 ik(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],Nr(e)];return[n,r]}function ok(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:[Bf(e).toString()]})),r}(s,c),[u,f]=ik(l),[d,h]=ik([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof ta))));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 ak(t,e,n,r,i,o){const a=IE(t,"color"),s=function(t,e,n){const{size:r}=e,i=DE(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 wa){const{range:t}=a.getOptions(),[e,n]=ik(a);return a instanceof Ea||a instanceof Sa?rk(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 ok(s,a,IE(t,"size"),IE(t,"opacity"),e,o)}nk.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const sk=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,style:c,crossPadding:l,padding:u}=t,f=Oe(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=LE(o,n),{legendContinuous:y={}}=a,v=FE(Object.assign({},y,Object.assign(Object.assign({titleText:NE(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>AE(e)(t.label):e},ak(r,l,i,t,sk,a)),c),f)),b=new jE({style:Object.assign(Object.assign({x:d,y:h,width:p,height:g},m),{subOptions:v})});return b.appendChild(new iw({className:"legend-continuous",style:v})),b}};sk.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const ck=t=>(...e)=>sk(Object.assign({},{block:!0},t))(...e);ck.props=Object.assign(Object.assign({},sk.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const lk=t=>e=>{const{scales:n}=e,r=IE(n,"size");return sk(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};lk.props=Object.assign(Object.assign({},sk.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const uk=t=>lk(Object.assign({},{block:!0},t));function fk(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"}}}uk.props=Object.assign(Object.assign({},sk.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const dk=(hk={render(t,e){const{width:n,title:r,subtitle:i,spacing:o=2,align:a="left",x:s,y:c}=t,l=Oe(t,["width","title","subtitle","spacing","align","x","y"]);e.style.transform=`translate(${s}, ${c})`;const u=Mr(l,"title"),f=Mr(l,"subtitle"),d=CE(e,".title","text").attr("className","title").call(Em,Object.assign(Object.assign(Object.assign({},fk(0,0,n,a)),{fontSize:14,textBaseline:"top",text:r}),u)).node().getLocalBounds();CE(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({},fk(0,d.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),f))}))}},class extends $p{constructor(t){super(t),this.descriptor=hk}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(Z({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var hk;const pk=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new dk({style:Z({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};function gk(t){return!!t.getBandWidth}function mk(t,e,n){if(!gk(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))}(Nn(s,e)+o,0,i.length-1);return i[c]}function yk(t,e,n){if(!e)return t.getOptions().domain;if(!gk(t)){const r=qn(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 vk(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[yk(a,[l[0],u[0]]),yk(s,[l[1],u[1]])]}function bk(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}pk.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const xk=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:o}=t,a=Oe(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?AE(n):n,v="horizontal"===e,b=Xc(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 _b({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:wk(t,r)},i),a))})}};function wk(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)).map((([t])=>{const{encode:n,slider:r}=t;if((null==r?void 0:r.x)&&0===Object.keys(r.x).length){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"])}xk.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const Mk=t=>xk(Object.assign(Object.assign({},t),{orientation:"horizontal"}));Mk.props=Object.assign(Object.assign({},xk.props),{defaultPosition:"bottom"});const Ok=t=>xk(Object.assign(Object.assign({},t),{orientation:"vertical"}));Ok.props=Object.assign(Object.assign({},xk.props),{defaultPosition:"left"});const Ek=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=Oe(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 Tb({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}))})}};Ek.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const kk=t=>Ek(Object.assign(Object.assign({},t),{orientation:"horizontal"}));kk.props=Object.assign(Object.assign({},Ek.props),{defaultPosition:"bottom"});const Sk=t=>Ek(Object.assign(Object.assign({},t),{orientation:"vertical"}));Sk.props=Object.assign(Object.assign({},Ek.props),{defaultPosition:"left"});const Ak=t=>()=>new Vp;Ak.props={};const _k=(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]=Xc(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))}},Tk=(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]=Xc(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))}},Pk=(t,e)=>{const n=1e-4,{coordinate:r}=e;return eg({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:Of.NUMBER}),(e,i,o)=>{const[a]=e;return Zc(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=_m(r,d,[h,p]),{innerRadius:m,outerRadius:y}=g,v=pc().cornerRadius(s).padAngle(c*Math.PI/180),b=new Xp({}),x=t=>(b.attr({d:v(t)}),yd(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]=Xc(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)}},Ck=(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]=Xc(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))}},Nk=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))};Nk.props={};const Lk=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))};Lk.props={};const jk={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},Rk={[nu.CIRCLE]:["cx","cy","r"],[nu.ELLIPSE]:["cx","cy","rx","ry"],[nu.RECT]:["x","y","width","height"],[nu.IMAGE]:["x","y","width","height"],[nu.LINE]:["x1","y1","x2","y2"],[nu.POLYLINE]:["points"],[nu.POLYGON]:["points"]};function Ik(t,e,n=!1){const r={};for(const i of e){const e=t.style[i];e?r[i]=e:n&&(r[i]=jk[i])}return r}const Bk=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function Dk(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function Fk(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 zk(t,e){const[n,r,i,o]=Dk(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(Fk([t,o,e,l]))}f-=t,u+=1}return c}function Gk(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function Wk(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function $k(t){const e=yd(t);if(e&&!function(t){return!Wk(t,"m")||!Wk(t,"M")}(e))return e}function Hk(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=$k(e),s=$k(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;Gk(e,t);let o=Bk;if(t.nodeName===nu.GROUP){const[n,i,o,a]=Dk(t),[s,c,l,u]=Dk(e);r=`translate(${n-s}, ${i-c}) scale(${o/l}, ${a/u})`}else o=o.concat(Rk[t.nodeName]||[]);const a=[Object.assign({transform:null!=r?r:"none"},Ik(t,o,!0)),Object.assign({transform:null!=i?i:"none"},Ik(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 Xp({style:Object.assign(Object.assign({},Ik(t,Bk)),{d:e})});return Gk(r,t),r}(t,a),l=[Object.assign({},Ik(e,Bk)),Object.assign({},Ik(n,Bk))];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;br(c,n),c.style.d=t,c.style.transform="none"},c.style.transform="none",t}return null}const Vk=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:zk}(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 Hk(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)=>Hk(e,new Xp({style:Object.assign({d:i[r]},Ik(t,Bk))}),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)=>Hk(t,t,new Xp({style:{d:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,o,i)}return null};Vk.props={};const Yk=(t,e)=>{const n=1e-4;eg({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:Of.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!Zc(r))return _k(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=pc().cornerRadius(u).padAngle(f*Math.PI/180),b=_m(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}};Yk.props={};const qk=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))},Uk=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))},Xk=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))};Xk.props={};const Zk=(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 Xp({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 _k(t,e)([f],r,i)};Zk.props={};const Kk=(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 Xp({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 Pk(t,e)([f],r,i)};Kk.props={};const Qk="main-layer",Jk="label-layer",tS="element",eS="view",nS="plot",rS="component",iS="label",oS="area";function aS(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 sS(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 cS(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&&Lp(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&&Lp(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 lS(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&&Lp(i)&&a){var m=_e(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&&Lp(o)&&s){var b=_e(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 uS(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&&Lp(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&&Lp(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 fS(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&&Lp(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&&Lp(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 dS(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=_e(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 hS=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.name="canvas-path-generator",e}return we(e,t),e.prototype.init=function(){var t,e=((t={})[nu.CIRCLE]=aS,t[nu.ELLIPSE]=sS,t[nu.RECT]=dS,t[nu.LINE]=cS,t[nu.POLYLINE]=fS,t[nu.POLYGON]=uS,t[nu.PATH]=lS,t[nu.TEXT]=void 0,t[nu.GROUP]=void 0,t[nu.IMAGE]=void 0,t[nu.HTML]=void 0,t[nu.MESH]=void 0,t);this.context.pathGeneratorFactory=e},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(ou),pS=Vt(),gS=Vt(),mS=Vt(),yS=ut(),vS=function(){function t(){var t=this;this.isHit=function(e,n,r,i){var o=t.context.pointInPathPickerFactory[e.nodeName];if(o){var a=mt(yS,r),s=ie(gS,Zt(mS,n[0],n[1],0),a);if(o(e,new Cu(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 ke(i,void 0,void 0,(function(){return Se(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=Zt(pS,a,s,0),l=t.elementsFromBBox(c[0],c[1],c[0],c[1]),u=[];try{for(var f=Ae(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=gh(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 bS(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=Il(o,s,e.x,e.y),b=_e(bh(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 xS(t,e,n,r){return t/(n*n)+e/(r*r)}function wS(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=_e(bh(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?xS(E,k,c+O,l+O)<=1:w?xS(E,k,c,l)<=1:!!M&&(xS(E,k,c-O,l-O)>=1&&xS(E,k,c+O,l+O)<=1)}function MS(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function OS(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 Il(l.x,l.y,a,s)<=o/2}function ES(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&&Vl(t,e,n,r,o,a)<=i/2}function kS(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++){if(ES(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(ES(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}var SS=1e-6;function AS(t){return Math.abs(t)<SS?0:t<0?-1:1}function _S(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 TS(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(_S(a,s,[e,n]))return!0;AS(a[1]-n)>0!=AS(s[1]-n)>0&&AS(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function PS(t,e,n){for(var r=!1,i=0;i<t.length;i++){if(r=TS(t[i],e,n))break}return r}function CS(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!(!_e(bh(void 0===d?"auto":d,r.fill,r.stroke),2)[1]&&!n||!l)&&ES(i,o,a,s,l+f,e.x,e.y)}function NS(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=_e(bh(g,(null==b?void 0:b.length)&&d,f),2),w=x[0],M=x[1],O=od(t),E=!1;return w||n?E=y?r(t,e):PS(b,e.x,e.y)||PS(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||MS(d.x-a,d.y-a,d.width+e,d.height+e,n,r))switch(c.command){case"L":case"Z":if(o=ES(f[0],f[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(o=tu(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=Xl(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=Ze(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=Xl(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 LS(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=_e(bh(void 0===f?"auto":f,o,i),2),h=d[0],p=!1;return(d[1]||n)&&(p=kS(u.points,s+l,e.x,e.y,!0)),p||!h&&!n||(p=TS(u.points,e.x,e.y)),p}function jS(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!(!_e(bh(void 0===l?"auto":l,r.fill,r.stroke),2)[1]&&!n||!o)&&kS(c.points,o+s,e.x,e.y,!1)}function RS(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=_e(bh(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=_e(i,4),l=c[0],u=c[1],f=c[2],d=c[3];return ES(t+l,e,t+n-u,e,o,a,s)||ES(t+n,e+u,t+n,e+r-f,o,a,s)||ES(t+n-f,e+r,t+d,e+r,o,a,s)||ES(t,e+r-d,t,e+l,o,a,s)||OS(t+n-u,e+u,u,Math.PI,Math.PI,o,a,s)||OS(t+n-f,e+r-f,f,0,Math.PI,o,a,s)||OS(t+d,e+r-d,d,Math.PI,Math.PI,o,a,s)||OS(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?MS(p-k,m-k,y+k,v+k,e.x,e.y):w?MS(p,m,y,v,e.x,e.y):!!M&&function(t,e,n,r,i,o,a){var s=i/2;return MS(t-s,e-s,n,i,o,a)||MS(t+n-s,e-s,i,r,o,a)||MS(t+s,e+r-s,n,i,o,a)||MS(t-s,e+s,i,r,o,a)}(p,m,y,v,O,e.x,e.y)}function IS(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[nu.IMAGE].render(y,Me(Me({},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 BS=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.name="canvas-picker",e}return we(e,t),e.prototype.init=function(){var t,e=((t={})[nu.CIRCLE]=bS,t[nu.ELLIPSE]=wS,t[nu.RECT]=RS,t[nu.LINE]=CS,t[nu.POLYLINE]=jS,t[nu.POLYGON]=LS,t[nu.PATH]=NS,t[nu.TEXT]=function(){return!0},t[nu.GROUP]=null,t[nu.IMAGE]=IS,t[nu.HTML]=null,t[nu.MESH]=null,t);this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new vS)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(ou),DS=function(){function t(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=ut(),this.dprMatrix=ut(),this.tmpMat4=ut(),this.vec3a=Vt(),this.vec3b=Vt(),this.vec3c=Vt(),this.vec3d=Vt()}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(lp.UNMOUNTED,d),f.addEventListener(lp.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(lp.UNMOUNTED,d),f.removeEventListener(lp.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(Et(r.dprMatrix,[e,e,1]),vt(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)p(s.root,t);else{var a=r.safeMergeAABB.apply(r,Te([r.mergeDirtyAABBs(r.renderQueue)],_e(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new ku;return o.setMinMax([e,n,0],[r,i,0]),o}))),!1));if(r.removedRBushNodeAABBs=[],ku.isEmpty(a))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(a),l=c.x,d=c.y,h=c.width,g=c.height,m=ie(r.vec3a,[l,d,0],r.vpMatrix),y=ie(r.vec3b,[l+h,d,0],r.vpMatrix),v=ie(r.vec3c,[l,d+g,0],r.vpMatrix),b=ie(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 ip(jp.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)&ap.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!==nu.LINE&&t.nodeName!==nu.PATH&&t.nodeName!==nu.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 ku;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=_e(t.getMin(),2),n=e[0],r=e[1],i=_e(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 ku);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?(dt(this.tmpMat4,e.getLocalTransform()),vt(this.tmpMat4,n,this.tmpMat4),vt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(dt(this.tmpMat4,e.getWorldTransform()),vt(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 ku;return t.forEach((function(t){n.add(t)})),n},t.tag="CanvasRenderer",t}(),FS=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=!v(a)&&!a.isNone,S=!v(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===nu.PATH||P===nu.LINE||P===nu.POLYLINE||A||C);k&&(t.globalAlpha=l*f,N||zS(n,t,T),this.fill(t,n,a,s,r,i,o),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"),zS(n,t,!0),C&&(this.stroke(t,n,d,r,i,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,_,!0))),this.stroke(t,n,d,r,i,o))},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.prototype.fill=function(t,e,n,r,i,o,a){var s=this;Array.isArray(n)?n.forEach((function(n){t.fillStyle=s.getColor(n,e,t),r?t.fill(r):t.fill()})):(Rf(n)&&(t.fillStyle=this.getPattern(n,e,t,i,o,a)),r?t.fill(r):t.fill())},t.prototype.stroke=function(t,e,n,r,i,o){var a=this;Array.isArray(n)?n.forEach((function(n){t.strokeStyle=a.getColor(n,e,t),t.stroke()})):(Rf(n)&&(t.strokeStyle=this.getPattern(n,e,t,r,i,o)),t.stroke())},t.prototype.getPattern=function(t,e,n,r,i,o){var a,s;if("rect"===t.image.nodeName){var c=t.image.parsedStyle,l=c.width,u=c.height;s=r.contextService.getDPR();var f=r.config.offscreenCanvas;(a=o.offscreenCanvasCreator.getOrCreateCanvas(f)).width=l*s,a.height=u*s;var d=o.offscreenCanvasCreator.getOrCreateContext(f),h=[];t.image.forEach((function(t){i.renderDisplayObject(t,d,r,h,o)})),h.forEach((function(){d.restore()}))}return this.imagePool.getOrCreatePatternSync(t,n,a,s,e.getGeometryBounds().min,(function(){e.renderable.dirty=!0,r.renderingService.dirtify()}))},t.prototype.getColor=function(t,e,n){var r;if(t.type===Yu.LinearGradient||t.type===Yu.RadialGradient){var i=e.getGeometryBounds(),o=i&&2*i.halfExtents[0]||1,a=i&&2*i.halfExtents[1]||1,s=i&&i.min||[0,0];r=this.imagePool.getOrCreateGradient(Me(Me({type:t.type},t.value),{min:s,width:o,height:a}),n)}return r},t}();function zS(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)}var GS=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){zS(n,t,!v(f)&&d>0);try{t.drawImage(r,o,s,h,p)}catch(t){}}},t}(),WS=function(){function 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.fillOpacity,O=void 0===M?1:M,E=a.strokeOpacity,k=void 0===E?1:E,S=a.opacity,A=void 0===S?1:S,_=a.metrics,T=a.x,P=void 0===T?0:T,C=a.y,N=void 0===C?0:C,L=a.dx,j=a.dy,R=a.shadowColor,I=a.shadowBlur,B=_.font,D=_.lines,F=_.height,z=_.lineHeight,G=_.lineMetrics;t.font=B,t.lineWidth=c,t.textAlign="middle"===u?"center":u;var W=d;o.enableCSSParsing||"alphabetic"!==W||(W="bottom"),t.lineJoin=p,v(m)||(t.miterLimit=m);var $=N;"middle"===d?$+=-F/2-z/2:"bottom"===d||"alphabetic"===d||"ideographic"===d?$+=-F:"top"!==d&&"hanging"!==d||($+=-z);var H=P+(L||0);$+=j||0,1===D.length&&("bottom"===W?(W="middle",$-=.5*F):"top"===W&&(W="middle",$+=.5*F)),t.textBaseline=W,zS(n,t,!v(R)&&I>0);for(var V=0;V<D.length;V++){var Y=c/2+H;$+=z,v(x)||x.isNone||!c||this.drawLetterSpacing(t,D[V],G[V],u,Y,$,b,O,k,A,!0),v(w)||this.drawLetterSpacing(t,D[V],G[V],u,Y,$,b,O,k,A)}},t.prototype.drawLetterSpacing=function(t,e,n,r,i,o,a,s,c,l,u){if(void 0===u&&(u=!1),0!==a){var f=t.textAlign;t.textAlign="left";var d=i;"center"===r||"middle"===r?d=i-n.width/2:"right"!==r&&"end"!==r||(d=i-n.width);for(var h=Array.from(e),p=t.measureText(e).width,g=0,m=0;m<h.length;++m){var y=h[m];u?this.strokeText(t,y,d,o,c):this.fillText(t,y,d,o,s,l),d+=p-(g=t.measureText(e.substring(m+1)).width)+a,p=g}t.textAlign=f}else u?this.strokeText(t,e,i,o,c):this.fillText(t,e,i,o,s,l)},t.prototype.fillText=function(t,e,n,r,i,o){var a,s=!v(i)&&1!==i;s&&(a=t.globalAlpha,t.globalAlpha=i*o),t.fillText(e,n,r),s&&(t.globalAlpha=a)},t.prototype.strokeText=function(t,e,n,r,i){var o,a=!v(i)&&1!==i;a&&(o=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),a&&(t.globalAlpha=o)},t}();!function(t){function e(){return null!==t&&t.apply(this,arguments)||this}we(e,t)}(FS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}we(e,t)}(FS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}we(e,t)}(FS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}we(e,t)}(FS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}we(e,t)}(FS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}we(e,t)}(FS),function(t){function e(){return null!==t&&t.apply(this,arguments)||this}we(e,t)}(FS);var $S=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 we(e,t),e.prototype.init=function(){var t,e=Me({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new FS(n),i=((t={})[nu.CIRCLE]=r,t[nu.ELLIPSE]=r,t[nu.RECT]=r,t[nu.IMAGE]=new GS(n),t[nu.TEXT]=new WS,t[nu.LINE]=r,t[nu.POLYLINE]=r,t[nu.POLYGON]=r,t[nu.PATH]=r,t[nu.GROUP]=void 0,t[nu.HTML]=void 0,t[nu.MESH]=void 0,t);this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new DS(e))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(ou),HS=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}(),VS=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.name="dom-interaction",e}return we(e,t),e.prototype.init=function(){this.addRenderingPlugin(new HS)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ou),YS=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===nu.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===nu.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),c.delete(n))}},d=function(t){var e=t.target;if(e.nodeName===nu.HTML){var n=t.attrName;r.updateAttribute(n,e)}},h=function(t){var e=t.target;if(e.nodeName===nu.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(jp.RESIZE,p),s.addEventListener(lp.MOUNTED,u),s.addEventListener(lp.UNMOUNTED,f),s.addEventListener(lp.ATTR_MODIFIED,d),s.addEventListener(lp.BOUNDS_CHANGED,h)})),a.hooks.endFrame.tap(t.tag,(function(){r.$camera&&o.renderReasons.has(Jh.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),a.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(jp.RESIZE,p),s.removeEventListener(lp.MOUNTED,u),s.removeEventListener(lp.UNMOUNTED,f),s.removeEventListener(lp.ATTR_MODIFIED,d),s.removeEventListener(lp.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="";If(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="";If(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}(),qS=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.name="html-renderer",e}return we(e,t),e.prototype.init=function(){this.addRenderingPlugin(new YS)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ou),US=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):dh&&(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?Gh(_d(u),new Gp({})):pt(ut()),f&&xt(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===Yu.LinearGradient){var h=function(t,e,n,r){var i=hu(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===Yu.RadialGradient){var v=function(t,e,n,r,i,o){var a=r.value,s=i.value;r.unit===Ru.kPercentage&&(a=r.value/100*e),i.unit===Ru.kPercentage&&(s=i.value/100*n);var c=Math.max(en([0,0],[a,s]),en([0,n],[a,s]),en([e,n],[a,s]),en([e,0],[a,s]));return o&&(o instanceof cf?c=o.value:o instanceof Ju&&("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(en([0,0],[a,s]),en([0,n],[a,s]),en([e,n],[a,s]),en([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===Ru.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}(),XS=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===nu.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===nu.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(lp.MOUNTED,s),o.addEventListener(lp.ATTR_MODIFIED,c)})),n.hooks.destroy.tap(t.tag,(function(){o.removeEventListener(lp.MOUNTED,s),o.removeEventListener(lp.ATTR_MODIFIED,c)}))},t.tag="LoadImage",t}(),ZS=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.name="image-loader",e}return we(e,t),e.prototype.init=function(){this.context.imagePool=new US(this.context.config),this.addRenderingPlugin(new XS)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(ou),KS=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||dh&&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){dh&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(Jh.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={}),ke(this,void 0,void 0,(function(){var e,n;return Se(this,(function(r){return e=t.type,n=t.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]}))}))},t}(),QS=function(t){function e(){var e=t.apply(this,Te([],_e(arguments),!1))||this;return e.name="canvas-context-register",e}return we(e,t),e.prototype.init=function(){this.context.ContextService=KS},e.prototype.destroy=function(){delete this.context.ContextService},e}(ou),JS=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new QS),n.registerPlugin(new ZS),n.registerPlugin(new hS),n.registerPlugin(new $S),n.registerPlugin(new VS),n.registerPlugin(new BS),n.registerPlugin(new qS),n}return we(e,t),e}(au),tA=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 ke(n,void 0,void 0,(function(){var n,o,d,h,p,g;return Se(this,(function(m){switch(m.label){case 0:if(!s){if(n=t.timeStamp-c,o=en([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}(),eA=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="dragndrop",n}return we(e,t),e.prototype.init=function(){this.addRenderingPlugin(new tA(Me({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}(ou),nA=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}(),rA=nA;const iA={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"},oA=[["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"]]]]];function aA(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):po}function sA(t){return t instanceof Float32Array||t instanceof Array}var 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},lA=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 uA(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var 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},dA=function(t,e,n,r,i){var o,a,s=fA(t,2),c=s[0],l=s[1],u=ct();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},hA=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=new ma({range:[e,e+r]}),a=new ma({range:[n,n+i]});return{transform:function(t){var e=hA(t,2),n=e[0],r=e[1];return[o.map(n),a.map(r)]},untransform:function(t){var e=hA(t,2),n=e[0],r=e[1];return[o.invert(n),a.invert(r)]}}},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},mA=function(t,e,n,r,i){return(0,gA(t,1)[0])(e,n,r,i)},yA=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},vA=function(t,e,n,r,i){return yA(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},xA=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 ma({range:[c,l]}),f=new ma({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=uA(Math.atan2(o,i),a,s);return[f.invert(l),u.invert(c)]}}},wA=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},MA=function(t,e,n,r,i){return{transform:function(t){var e=wA(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=wA(t,2),n=e[0];return[e[1],n]}}},OA=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},EA=function(t,e,n,r,i){var o,a,s=OA(t,2),c=s[0],l=s[1],u=ct();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},kA=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},SA=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))},AA=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return EA.apply(void 0,SA([[-1,-1]],kA(e),!1))},_A=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return EA.apply(void 0,SA([[-1,1]],kA(e),!1))},TA=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return EA.apply(void 0,SA([[1,-1]],kA(e),!1))},PA=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},CA=function(t,e,n,r,i){var o=PA(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}(ct(),o)},NA=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},LA=function(t,e,n,r,i){var o=NA(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 ma({range:[c,c+.99*l]}),d=new ma({range:[a,s]}),h=i/r,p=h>1?1:h,g=h>1?1/h:1;return{transform:function(t){var e=NA(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=NA(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=uA(Math.atan2(o,i)+Math.floor(c/l)*Math.PI*2,a,s),m=c-u*h;return[d.invert(h),f.invert(m)]}}},jA=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},RA=function(t,e,n,r,i){var o=jA(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new ma({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new ya({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}}},IA=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 BA(t){return 1/Math.tan(t)}var DA=function(t,e,n,r,i){var o=BA(IA(t,1)[0]);return{transform:function(t){var e=IA(t,2),n=e[0],r=e[1];return[n+r*o,r]},untransform:function(t){var e=IA(t,2),n=e[0],r=e[1];return[n-r*o,r]}}},FA=function(t,e,n,r,i){var o=BA(IA(t,1)[0]);return{transform:function(t){var e=IA(t,2),n=e[0];return[n,e[1]+n*o]},untransform:function(t){var e=IA(t,2),n=e[0];return[n,e[1]-n*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};function GA(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 WA(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 $A(t,e,n){return n?new ma({range:[0,1],domain:[0,e]}).map(t):t}var HA=function(t,e,n,r,i){var o=zA(t,3),a=o[0],s=o[1],c=o[2],l=$A(a,r,void 0!==c&&c);return{transform:function(t){var e=zA(t,2),n=e[0],r=e[1];return[GA(n,l,s,0,1),r]},untransform:function(t){var e=zA(t,2),n=e[0],r=e[1];return[WA(n,l,s,0,1),r]}}},VA=function(t,e,n,r,i){var o=zA(t,3),a=o[0],s=o[1],c=o[2],l=$A(a,i,void 0!==c&&c);return{transform:function(t){var e=zA(t,2);return[e[0],GA(e[1],l,s,0,1)]},untransform:function(t){var e=zA(t,2);return[e[0],WA(e[1],l,s,0,1)]}}},YA=function(t,e,n,r,i){var o=zA(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,d=$A(a,r,f),h=$A(s,i,f);return{transform:function(t){var e=zA(t,2),n=e[0],r=e[1];return[GA(n,d,c,0,1),GA(r,h,l,0,1)]},untransform:function(t){var e=zA(t,2),n=e[0],r=e[1];return[WA(n,d,c,0,1),WA(r,h,l,0,1)]}}},qA=function(t,e,n,r,i){var o=zA(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,d=new ma({range:[0,r]}),h=new ma({range:[0,i]}),p=f?a:d.map(a),g=f?s:h.map(s);return{transform:function(t){var e=zA(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=GA(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=zA(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=WA(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)]}}},UA=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,o,a){var s=new ma({range:[e,e+i]}),c=new ma({range:[n,n+o]}),l=new ma({range:[r,r+a]});return{transform:function(t){var e=UA(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=UA(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},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,o,a){var s=ZA(t,3),c=s[0],l=s[1],u=s[2];return Ot(ut(),[c,l,u])},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,o,a){return{transform:function(t){var e=QA(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=QA(t,3),n=e[0];return[e[1],n,e[2]]}}},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},e_=function(t,e,n,r,i,o,a){var s=t_(t,3),c=s[0],l=s[1],u=s[2];return Et(ut(),[c,l,u])},n_=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},r_=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))},i_=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:pA,translate:dA,custom:mA,matrix:vA,polar:xA,transpose:MA,scale:EA,"shear.x":DA,"shear.y":FA,reflect:AA,"reflect.x":_A,"reflect.y":TA,rotate:CA,helix:LA,parallel:RA,fisheye:YA,"fisheye.x":HA,"fisheye.y":VA,"fisheye.circular":qA},this.update(t)}return t.prototype.update=function(t){this.options=fo({},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:r_(r_([],n_(n),!1),[r_([],n_(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?r_([],n_(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,lA([],cA(o),!1))}return n}}(t):t)};try{for(var c=i_(r),l=c.next();!l.done;l=c.next()){var u=n_(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(r_([],n_(d),!1),g,m,y,v);if(sA(b))o.push(b);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(b)||po,"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 aA.apply(void 0,r_([],n_(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n,r,i=ct();return e&&t.reverse(),t.forEach((function(t){return lt(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 st(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 oe(e,e,i),[e[0],e[1]]}},t}(),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},s_=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))},c_=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.")},l_=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:XA,translate3D:KA,scale3D:e_,transpose3D:JA},this.update(t)}return t.prototype.update=function(t){this.options=fo({},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:s_(s_([],a_(n),!1),[s_([],a_(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?s_([],a_(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,lA([],cA(o),!1))}return n}}(t):t)};try{for(var c=c_(r),l=c.next();!l.done;l=c.next()){var u=a_(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(s_([],a_(d),!1),g,m,y,v,b,x);if(sA(w))o.push(w);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(w)||po,!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 aA.apply(void 0,s_([],a_(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=ut();return e&&t.reverse(),t.forEach((function(t){return Wt(n,n,t)})),e&&mt(n,ft(n)),function(t){var e=[t[0],t[1],t[2],1];return ue(e,e,n),[e[0],e[1],e[2]]}},t}();function u_(t){return(e,...n)=>Z({},t(e,...n),e)}function f_(t){return(e,...n)=>Z({},e,t(e,...n))}function d_(t,e){if(!t)return e;if(Array.isArray(t))return t;const{value:n=e}=t,r=Oe(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}const h_=()=>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=Oe(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:d_(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})}))};h_.props={};const p_=()=>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=Oe(r,["data"]),g=d_(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};p_.props={};const g_=()=>t=>{const{children:e}=t,n=Oe(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:c=[]}=n,l=Oe(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=Oe(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:d_(e,r),scale:Z({},i,n),encode:Z({},s,f),transform:[...c,...d],axis:!(!l||!o)&&Z({},o,l),legend:!(!u||!a)&&Z({},a,u)},h)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};g_.props={};const m_=({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=Oe(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})]})]};m_.props={};class y_{constructor(t){this.$value=t}static of(t){return new y_(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const v_=u_((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=Wn(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_=u_((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))?[Bn(a)]:[Array.from(new Set(a)),"ordinal"]})();return{encode:{color:i},scale:{color:Z({},o,{domain:c,type:l})},legend:{color:Z({title:s},a)}}})),x_=u_((()=>({animate:{enterType:"fadeIn"}}))),w_=f_((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),M_=f_((()=>({type:"cell"}))),O_=f_((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]}}})),E_=f_(((t,e=k_,n=A_,r=__,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=Pr(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?or(_,(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=Oe(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:T_(N,n)(c,j),y:T_(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:Z(L,E,R),axis:Z({},A,I),legend:!1},P),i)}))}))}}}));function k_(t){const{points:e}=t;return Ps(e)}function S_(t,e){return e.length?Z({title:!1,tick:null,label:null},t):Z({title:!1,tick:null,label:null,grid:null},t)}function A_(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return S_(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return Z({title:s,grid:c},t)}}function __(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return S_(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return Z({title:o,grid:a},t)}}function T_(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const P_=()=>t=>[y_.of(t).call(M_).call(b_).call(x_).call(v_).call(w_).call(O_).call(E_).value()];P_.props={};const C_=u_((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),N_=f_((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=Pr(t),y=t.map((({points:t})=>Ps(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=Oe(m,["scale","key","encode","axis","interaction"]),k=null===(y=null==b?void 0:b.y)||void 0===y?void 0:y.guide,S={x:j_(null===(v=null==b?void 0:b.x)||void 0===v?void 0:v.guide)(g,e),y:R_(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:Z({x:{facet:!1},y:{facet:!1}},b),axis:Z({x:{tickCount:5},y:{tickCount:5}},M,S),legend:!1,encode:Z({},w,{x:l,y:p}),interaction:Z({},O,{legendFilter:!1})},E)}))}))}}})),L_=f_((t=>{const{encode:e}=t,n=Oe(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=Oe(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 j_(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return S_(t,n)}}function R_(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return S_(t,n)}}const I_=()=>t=>[y_.of(t).call(M_).call(b_).call(N_).call(L_).call(x_).call(w_).call(C_).value()],B_=u_((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),D_=u_((t=>({coordinate:{type:"polar"}}))),F_=t=>{const{encode:e}=t,n=Oe(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function z_(t){return t=>null}function G_(t){const{points:e}=t,[n,r,i,o]=e,a=Ss(n,o),s=Es(n,o),c=Ts(s,Es(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[d,h]=i,p=_s(s)+c/2,g=u*l;return[d+g*Math.sin(p)-f/2,h-g*Math.cos(p)-f/2,f,f]}const W_=()=>t=>[y_.of(t).call(M_).call(F_).call(b_).call(D_).call(O_).call(E_,G_,z_,z_,{frame:!1}).call(x_).call(w_).call(B_).value()];function $_(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 H_=()=>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=Z({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]=$_(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 V_(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 Y_(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=WL(o,(t=>"element"===t.className));const c=function(t){return WL(t,(t=>"component"===t.className))}(o),l=function(t){return WL(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:V_(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 q_(){return(t,e,n)=>{const{container:r,view:i}=t,o=Y_(iA.CLICK,i,n,(t=>1===t.detail)),a=Y_(iA.DBLCLICK,i,n,(t=>2===t.detail)),s=Y_(iA.POINTER_TAP,i,n),c=Y_(iA.POINTER_DOWN,i,n),l=Y_(iA.POINTER_UP,i,n),u=Y_(iA.POINTER_OVER,i,n),f=Y_(iA.POINTER_OUT,i,n),d=Y_(iA.POINTER_MOVE,i,n),h=Y_(iA.POINTER_ENTER,i,n),p=Y_(iA.POINTER_LEAVE,i,n),g=Y_(iA.POINTER_UPOUTSIDE,i,n),m=Y_(iA.DRAG_START,i,n),y=Y_(iA.DRAG,i,n),v=Y_(iA.DRAG_END,i,n),b=Y_(iA.DRAG_ENTER,i,n),x=Y_(iA.DRAG_LEAVE,i,n),w=Y_(iA.DRAG_OVER,i,n),M=Y_(iA.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 U_(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":QE,"component.axisLinear":qE,"component.axisArc":UE,"component.legendContinuousBlock":ck,"component.legendContinuousBlockSize":uk,"component.legendContinuousSize":lk,"interaction.event":q_,"composition.mark":m_,"composition.view":g_,"shape.label.label":uM}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||vr(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=Oe(t,["type"]);n||vr("Plot type is required!");const o=r(n);return null==o?void 0:o(i,e)},r]}function X_(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||vr("Cannot find library document")}function Z_(t,e){const{coordinate:n={}}=t,r=Oe(t,["coordinate"]),{type:i,transform:o=[]}=n,a=Oe(n,["type","transform"]);if(!i)return Object.assign(Object.assign({},r),{coordinates:o});const[,s]=U_("coordinate",e),{transform:c=!1}=s(i).props||{};if(c)throw new Error(`Unknown coordinate: ${i}.`);return Object.assign(Object.assign({},r),{coordinates:[Object.assign({type:i},a),...o]})}function K_(t,e){return t.filter((t=>t.type===e))}function Q_(t){return K_(t,"polar").length>0}function J_(t){return K_(t,"transpose").length%2==1}function tT(t){return K_(t,"theta").length>0}function eT(t){return K_(t,"radial").length>0}function nT(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}H_.props={},q_.props={reapplyWhenUpdate:!0};var rT=nT("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),iT=nT("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),oT=nT("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),aT=nT("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),sT=nT("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),cT=nT("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),lT=nT("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),uT=nT("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),fT=nT("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),dT=nT("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),hT=nT("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function pT(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function gT(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function mT(){}var yT=.7,vT=1/yT,bT="\\s*([+-]?\\d+)\\s*",xT="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",wT="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",MT=/^#([0-9a-f]{3,8})$/,OT=new RegExp(`^rgb\\(${bT},${bT},${bT}\\)$`),ET=new RegExp(`^rgb\\(${wT},${wT},${wT}\\)$`),kT=new RegExp(`^rgba\\(${bT},${bT},${bT},${xT}\\)$`),ST=new RegExp(`^rgba\\(${wT},${wT},${wT},${xT}\\)$`),AT=new RegExp(`^hsl\\(${xT},${wT},${wT}\\)$`),_T=new RegExp(`^hsla\\(${xT},${wT},${wT},${xT}\\)$`),TT={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 PT(){return this.rgb().formatHex()}function CT(){return this.rgb().formatRgb()}function NT(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=MT.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?LT(e):3===n?new BT(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?jT(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?jT(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=OT.exec(t))?new BT(e[1],e[2],e[3],1):(e=ET.exec(t))?new BT(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=kT.exec(t))?jT(e[1],e[2],e[3],e[4]):(e=ST.exec(t))?jT(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=AT.exec(t))?$T(e[1],e[2]/100,e[3]/100,1):(e=_T.exec(t))?$T(e[1],e[2]/100,e[3]/100,e[4]):TT.hasOwnProperty(t)?LT(TT[t]):"transparent"===t?new BT(NaN,NaN,NaN,0):null}function LT(t){return new BT(t>>16&255,t>>8&255,255&t,1)}function jT(t,e,n,r){return r<=0&&(t=e=n=NaN),new BT(t,e,n,r)}function RT(t){return t instanceof mT||(t=NT(t)),t?new BT((t=t.rgb()).r,t.g,t.b,t.opacity):new BT}function IT(t,e,n,r){return 1===arguments.length?RT(t):new BT(t,e,n,null==r?1:r)}function BT(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function DT(){return`#${WT(this.r)}${WT(this.g)}${WT(this.b)}`}function FT(){const t=zT(this.opacity);return`${1===t?"rgb(":"rgba("}${GT(this.r)}, ${GT(this.g)}, ${GT(this.b)}${1===t?")":`, ${t})`}`}function zT(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function GT(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function WT(t){return((t=GT(t))<16?"0":"")+t.toString(16)}function $T(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new VT(t,e,n,r)}function HT(t){if(t instanceof VT)return new VT(t.h,t.s,t.l,t.opacity);if(t instanceof mT||(t=NT(t)),!t)return new VT;if(t instanceof VT)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 VT(a,s,c,t.opacity)}function VT(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function YT(t){return(t=(t||0)%360)<0?t+360:t}function qT(t){return Math.max(0,Math.min(1,t||0))}function UT(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}pT(mT,NT,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:PT,formatHex:PT,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return HT(this).formatHsl()},formatRgb:CT,toString:CT}),pT(BT,IT,gT(mT,{brighter(t){return t=null==t?vT:Math.pow(vT,t),new BT(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?yT:Math.pow(yT,t),new BT(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new BT(GT(this.r),GT(this.g),GT(this.b),zT(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:DT,formatHex:DT,formatHex8:function(){return`#${WT(this.r)}${WT(this.g)}${WT(this.b)}${WT(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:FT,toString:FT})),pT(VT,(function(t,e,n,r){return 1===arguments.length?HT(t):new VT(t,e,n,null==r?1:r)}),gT(mT,{brighter(t){return t=null==t?vT:Math.pow(vT,t),new VT(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?yT:Math.pow(yT,t),new VT(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 BT(UT(t>=240?t-240:t+120,i,r),UT(t,i,r),UT(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new VT(YT(this.h),qT(this.s),qT(this.l),zT(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=zT(this.opacity);return`${1===t?"hsl(":"hsla("}${YT(this.h)}, ${100*qT(this.s)}%, ${100*qT(this.l)}%${1===t?")":`, ${t})`}`}}));const XT=Math.PI/180,ZT=180/Math.PI;var KT=-.14861,QT=1.78277,JT=-.29227,tP=-.90649,eP=1.97294,nP=eP*tP,rP=eP*QT,iP=QT*JT-tP*KT;function oP(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof aP)return new aP(t.h,t.s,t.l,t.opacity);t instanceof BT||(t=RT(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(iP*r+nP*e-rP*n)/(iP+nP-rP),o=r-i,a=(eP*(n-i)-JT*o)/tP,s=Math.sqrt(a*a+o*o)/(eP*i*(1-i)),c=s?Math.atan2(a,o)*ZT-120:NaN;return new aP(c<0?c+360:c,s,i,t.opacity)}(t):new aP(t,e,n,null==r?1:r)}function aP(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}pT(aP,oP,gT(mT,{brighter(t){return t=null==t?vT:Math.pow(vT,t),new aP(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?yT:Math.pow(yT,t),new aP(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*XT,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new BT(255*(e+n*(KT*r+QT*i)),255*(e+n*(JT*r+tP*i)),255*(e+n*(eP*r)),this.opacity)}}));var sP=t=>()=>t;function cP(t,e){return function(n){return t+n*e}}function lP(t){return 1==(t=+t)?uP: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):sP(isNaN(e)?n:e)}}function uP(t,e){var n=e-t;return n?cP(t,n):sP(isNaN(t)?e:t)}!function t(e){var n=lP(e);function r(t,e){var r=n((t=IT(t)).r,(e=IT(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=uP(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 fP,dP=(fP=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=IT(t[e]),i[e]=n.r||0,o[e]=n.g||0,a[e]=n.b||0;return i=fP(i),o=fP(o),a=fP(a),n.opacity=1,function(t){return n.r=i(t),n.g=o(t),n.b=a(t),n+""}});function hP(t){return function e(n){function r(e,r){var i=t((e=oP(e)).h,(r=oP(r)).h),o=uP(e.s,r.s),a=uP(e.l,r.l),s=uP(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)}hP((function(t,e){var n=e-t;return n?cP(t,n>180||n<-180?n-360*Math.round(n/360):n):sP(isNaN(t)?e:t)}));var pP=hP(uP),gP=t=>dP(t[t.length-1]),mP=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(nT),yP=gP(mP),vP=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(nT),bP=gP(vP),xP=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(nT),wP=gP(xP),MP=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(nT),OP=gP(MP),EP=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(nT),kP=gP(EP),SP=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(nT),AP=gP(SP),_P=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(nT),TP=gP(_P),PP=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(nT),CP=gP(PP),NP=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(nT),LP=gP(NP),jP=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(nT),RP=gP(jP),IP=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(nT),BP=gP(IP),DP=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(nT),FP=gP(DP),zP=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(nT),GP=gP(zP),WP=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(nT),$P=gP(WP),HP=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(nT),VP=gP(HP),YP=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(nT),qP=gP(YP),UP=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(nT),XP=gP(UP),ZP=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(nT),KP=gP(ZP),QP=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(nT),JP=gP(QP),tC=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(nT),eC=gP(tC),nC=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(nT),rC=gP(nC),iC=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(nT),oC=gP(iC),aC=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(nT),sC=gP(aC),cC=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(nT),lC=gP(cC),uC=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(nT),fC=gP(uC),dC=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(nT),hC=gP(dC),pC=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(nT),gC=gP(pC);var mC=pP(oP(300,.5,0),oP(-240,.5,1)),yC=pP(oP(-100,.75,.35),oP(80,1.5,.8)),vC=pP(oP(260,.75,.35),oP(80,1.5,.8)),bC=oP();var xC=IT(),wC=Math.PI/3,MC=2*Math.PI/3;function OC(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var EC=OC(nT("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),kC=OC(nT("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),SC=OC(nT("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),AC=OC(nT("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),_C=Object.freeze({__proto__:null,schemeCategory10:rT,schemeAccent:iT,schemeDark2:oT,schemeObservable10:aT,schemePaired:sT,schemePastel1:cT,schemePastel2:lT,schemeSet1:uT,schemeSet2:fT,schemeSet3:dT,schemeTableau10:hT,interpolateBrBG:yP,schemeBrBG:mP,interpolatePRGn:bP,schemePRGn:vP,interpolatePiYG:wP,schemePiYG:xP,interpolatePuOr:OP,schemePuOr:MP,interpolateRdBu:kP,schemeRdBu:EP,interpolateRdGy:AP,schemeRdGy:SP,interpolateRdYlBu:TP,schemeRdYlBu:_P,interpolateRdYlGn:CP,schemeRdYlGn:PP,interpolateSpectral:LP,schemeSpectral:NP,interpolateBuGn:RP,schemeBuGn:jP,interpolateBuPu:BP,schemeBuPu:IP,interpolateGnBu:FP,schemeGnBu:DP,interpolateOrRd:GP,schemeOrRd:zP,interpolatePuBuGn:$P,schemePuBuGn:WP,interpolatePuBu:VP,schemePuBu:HP,interpolatePuRd:qP,schemePuRd:YP,interpolateRdPu:XP,schemeRdPu:UP,interpolateYlGnBu:KP,schemeYlGnBu:ZP,interpolateYlGn:JP,schemeYlGn:QP,interpolateYlOrBr:eC,schemeYlOrBr:tC,interpolateYlOrRd:rC,schemeYlOrRd:nC,interpolateBlues:oC,schemeBlues:iC,interpolateGreens:sC,schemeGreens:aC,interpolateGreys:lC,schemeGreys:cC,interpolatePurples:fC,schemePurples:uC,interpolateReds:hC,schemeReds:dC,interpolateOranges:gC,schemeOranges:pC,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:mC,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return bC.h=360*t-100,bC.s=1.5-1.5*e,bC.l=.8-.9*e,bC+""},interpolateWarm:yC,interpolateCool:vC,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,xC.r=255*(e=Math.sin(t))*e,xC.g=255*(e=Math.sin(t+wC))*e,xC.b=255*(e=Math.sin(t+MC))*e,xC+""},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:EC,interpolateMagma:kC,interpolateInferno:SC,interpolatePlasma:AC});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 VC(t,Sr)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return zC(t,s);if(void 0!==i)return $C([i])?zC(t,s):HC(e)?"time":GC(t,o,a);return $C(e)?zC(t,s):HC(e)?"time":GC(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 WC(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)xr(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 WC(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)xr(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(IC({type:t}))return function(t,e,n){const r=t.map(Number),i=new ma({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 BC({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=Fo,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?tT(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=_C[`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:DC(s,t,e,n,l,i,o),expectedDomain:c,guide:a,name:t,type:s})}function PC(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 CC(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=or(i)+1,a=`${e}${o}`;t[a]=r,r.getOptions().key=a}else t[e]=r}return t}function NC(t,e){const[n]=U_("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[gr,gr];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 LC(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));RC(e,"x"),RC(e,"y")}function jC(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 RC(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(IC)?Bn(r):n.every(BC)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function IC(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function BC(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function DC(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=FC(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?[Cr(e),Nr(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 FC(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function FC(t,e,n,r,i){const[o]=U_("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=_C[`scheme${r}`],o=_C[`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 zC(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function GC(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function WC(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 $C(t){return VC(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function HC(t){return VC(t,(t=>t instanceof Date))}function VC(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"},qC={threshold:"threshold",quantize:"quantize",quantile:"quantile"},UC={ordinal:"ordinal",band:"band",point:"point"},XC={constant:"constant"};function ZC(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=U_("component",n),a=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=U_("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?J_(n)?`${e}Y`:`${e}X`:"y"===t?J_(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[...JC(n),...eN(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=Z({},...e),{guide:m,field:y}=g,v=Array.isArray(m)?m:[m];for(const n of v){const[o,g]=iN(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 KC(t,e,n,r,i){const[o]=U_("component",r),{scaleInstances:a,scale:s,bbox:c}=t,l={bbox:c,library:r};return o(Oe(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:a,theme:n,value:l,scale:s})}function QC(t,e){const n=["left","right","bottom","top"],r=$n(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=pr(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=or(t,(t=>t.size)),r=or(t,(t=>t.order)),i=or(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function JC(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=$n(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(...jr(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,tN(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 oA)for(const{option:r,combination:i}of n)if(e.some((t=>Q(s(t),s(r)))))return[t,i];return null})).filter(xr);return c}function tN(t){const{type:e}=t;return"string"!=typeof e?null:e in YC?"continuous":e in UC?"discrete":e in qC?"distribution":e in XC?"constant":null}function eN(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return K_(t,"helix").length>0}(e)||tT(e))return null;if(J_(e)&&(Q_(e)||eT(e)))return null;if(n.startsWith("x"))return Q_(e)?["axisArc",[t]]:eT(e)?["axisLinear",[t]]:[J_(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return Q_(e)?["axisLinear",[t]]:eT(e)?["axisArc",[t]]:[J_(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(function(t){return K_(t,"radar").length>0}(e))return["axisRadar",[t]];if(!Q_(e))return["axisY",[t]]}return null})).filter(xr)}function nN(t){const e=K_(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=K_(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 rN(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]=nN(i);return["center",(a-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return K_(t,"parallel").length>0}(i))return J_(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=nN(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:Q_(i)||eT(i)?["center",null]:"axisX"===t&&function(t){return K_(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return K_(t,"reflectY").length>0}(i)?["top",null]:e}function iN(t,e,n,r,i,o,a){const[s]=nN(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?rN(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&Q_(a)&&"center"===r.position?["center","vertical"]:c}function oN(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")?uN:s.startsWith("group")?aN:s.startsWith("legendContinuous")?fN:"legendCategory"===s?dN:s.startsWith("slider")?lN:"title"===s?cN:s.startsWith("scrollbar")?sN:()=>{})(t,e,n,r,i,o)}function aN(t,e,n,r,i,o){const{children:a}=t,s=or(a,(t=>t.crossPadding));a.forEach((t=>t.crossPadding=s)),a.forEach((t=>oN(t,e,n,r,i,o)));const c=or(a,(t=>t.size));t.size=c,a.forEach((t=>t.size=c))}function sN(t,e,n,r,i,o){const{trackSize:a=6}=Z({},i.scrollbar,t);t.size=a}function cN(t,e,n,r,i,o){const a=Z({},i.title,t),{title:s,subtitle:c,spacing:l=0}=a,u=Oe(a,["title","subtitle","spacing"]);if(s){const e=vN(s,Mr(u,"title"));t.size=e.height}if(c){const e=vN(c,Mr(u,"subtitle"));t.size+=l+e.height}}function lN(t,e,n,r,i,o){const{trackSize:a,handleIconSize:s}=(()=>{const{slider:e}=i;return Z({},e,t)})(),c=Math.max(a,2.4*s);t.size=c}function uN(t,e,n,r,i,o){t.transform=t.transform||[{type:"hide"}];const a="left"===r||"right"===r,s=mN(t,r,i),{tickLength:c=0,labelSpacing:l=0,titleSpacing:u=0,labelAutoRotate:f}=s,d=Oe(s,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),h=hN(t,o),p=pN(d,h),g=c+l;if(p&&p.length){const r=or(p,(t=>t.width)),i=or(p,(t=>t.height));if(a)t.size=r+g;else{const{tickFilter:o,labelTransform:a}=t;!function(t,e,n,r,i){const o=pr(e,(t=>t.width));if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=yN(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}(h,p,e,n,o)||a||!1===f||null===f?t.size=i+g:(t.labelTransform="rotate(90)",t.size=r+g)}}else t.size=c;const m=gN(d);m&&(t.size+=a?u+m.width:u+m.height)}function fN(t,e,n,r,i,o){const a=(()=>{const{legendContinuous:e}=i;return Z({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=a,l=Oe(a,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=Mr(l,"ribbon"),{size:d}=f,h=Mr(l,"handleIcon"),{size:p}=h,g=Math.max(d,2.4*p);t.size=g;const m=pN(l,hN(t,o));if(m){const e=u?"width":"height",n=or(m,(t=>t[e]));t.size+=n+s}const y=gN(l);y&&(u?t.size=Math.max(t.size,y.width):t.size+=c+y.height)}function dN(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 Z({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=Oe(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=gN(p),M=pN(p,hN(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,Z(t,{cols:v(r),gridRow:o})})():"number"==typeof g?(()=>{const e=Math.ceil(M.length/g),n=or(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 hN(t,e){const[n]=U_("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 pN(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=Oe(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=function(t,e,n){const r=yN(t,n),i=r.map((t=>"number"==typeof t?Om(t):t)),o=e?"string"==typeof e?AE(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(o)}(e,r,i),c=Mr(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)=>vN(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 gN(t){const{title:e}=t,n=Oe(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=Mr(n,"title"),{direction:i,transform:o}=r,a=Array.isArray(e)?e.join(","):e;if("string"!=typeof a)return null;return vN(a,Object.assign(Object.assign({},r),{transform:o||("vertical"===i?"rotate(-90)":"")}))}function mN(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${yr(e)}`]:s}=n;return Z({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function yN(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function vN(t,e){const n=function(t){return t instanceof Gp?t:new Jp({style:{text:`${t}`}})}(t),r=Oe(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function bN(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(!Q_(i)&&!eT(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=>mN(t,"axisArc"===t.type?"arc":"linear",n))),s=or(a,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=o.flatMap(((t,e)=>pN(a[e],hN(t,r)))).filter(xr),l=or(c,(t=>t.height))+s,u=o.flatMap(((t,e)=>gN(a[e]))).filter((t=>null!==t)),f=0===u.length?0:or(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=xN(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=xN(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 xN(t,e,n,r,i,o,a){const s=Wn(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${yr(Zw(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=or(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(oN(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=sr(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=QC(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 wN({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,kn,a,x],right:[t-v,y,v,u,"horizontal",!1,kn],bottom:[m,e-b,f,b,"vertical",!1,kn,a,x],left:[0,y,m,u,"horizontal",!0,kn],"top-left":[m,0,f,y,"vertical",!0,kn],"top-right":[m,0,f,y,"vertical",!0,kn],"bottom-left":[m,e-b,f,b,"vertical",!1,kn],"bottom-right":[m,e-b,f,b,"vertical",!1,kn],center:w,inner:w,outer:w}}function MN(t,e,n,r){const[i,o]=Lr(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return Jc(t)&&Zc(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):Zc(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):Jc(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]=nl(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]=nl(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 ON(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-pr(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},Z(i,{layout:{justifyContent:o}}),r+=a[t]}}}function EN(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=Oe(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function kN(t,e,n){return ke(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=U_("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=Oe(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:a=[]}=o,s=[Oe(o,["transform"]),...a].map(i),c=yield function(t){return t.reduce(((t,e)=>n=>ke(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),gr)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?Pr(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function SN(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 AN(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=Tr(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return xr(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 _N(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=Tr(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]=U_("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:IN(n)})}(o),s=Tr(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function PN(t,e,n){const{tooltip:r={}}=e;return Ar(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:Sr(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 CN(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(Ar(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(Sr(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:c=(t=>t)}=e,l="string"==typeof c?AE(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);Sr(t)?n[o]=t:n[o]={value:t}}return n}return e},{title:s,items:c=[]}=o,l=Oe(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 NN(t,e,n){const{encode:r}=e,i=Oe(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=Oe(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 LN(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",...Object.keys(r)])):["x","y"];return Z(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 jN(t,e,n){const{animate:r}=e;return r||void 0===r||Z(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function RN(t,e,n){return ke(this,void 0,void 0,(function*(){const r={library:n},[i,o]=yield function(t,e,n){return ke(this,void 0,void 0,(function*(){const{library:r}=n,[i]=U_("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[EN,kN,SN,AN,_N,TN,NN,jN,LN,PN,...o.map(i),...s.map(i),...a.map(i),CN];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]}))}(t,e,r),{encode:a,scale:s,data:c,tooltip:l}=o;if(!1===Array.isArray(c))return null;const{channels:u}=e,f=Vn(Object.entries(a).filter((([,t])=>xr(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=u.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),d=u.filter((t=>{const{name:e,required:n}=t;if(f.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:a}=t;return f.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const l=e.some((t=>t.visual)),u=e.some((t=>t.constant)),f=s[t]||{},{independent:d=!1,key:h=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=Oe(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:a})}}))}));return[o,Object.assign(Object.assign({},e),{index:i,channels:d,tooltip:l})]}))}function IN(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function BN(t,e,n,r){var i;return ke(this,void 0,void 0,(function*(){const[o]=U_("composition",n),[a]=U_("interaction",n),s=new Set(Object.keys(n).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(xr)),c=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(xr)),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,i]=e?$N(e,t,n):yield zN(t,n);g.set(r,t),p.push(r);const o=i.flatMap(h).map((t=>Z_(t,n)));if(y.push(...o),o.every(f)){const t=yield Promise.all(o.map((t=>GN(t,n))));LC(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];m.set(n,r)}}}else{const e=h(u(t)?t:yield iL(t,n));Array.isArray(e)?y.push(...e):"function"==typeof e&&v.push(e())}}r.emitter.emit(iA.BEFORE_PAINT);const b=new Map,x=new Map,M=[];e.selectAll(cL(eS)).data(p,(t=>t.key)).join((t=>t.append("g").attr("className",eS).attr("id",(t=>t.key)).call(DN).each((function(t,e,i){HN(t,xm(i),M,n,r),b.set(t,i)}))),(t=>t.call(DN).each((function(t,e,i){HN(t,xm(i),M,n,r),x.set(t,i)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const O=(t,e,i)=>Array.from(t.entries()).map((([o,a])=>{const s=i||new Map,c=g.get(o),l=function(t,e,n,r){const i=function(t){const[,e]=U_("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(n),o=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,a=rL(e),s=a.map(i).filter(o).map((t=>t[0]));return(e,i,o)=>ke(this,void 0,void 0,(function*(){const a=[],[c,l]=yield zN(e,n);HN(c,t,a,n,r);for(const o of s.filter((t=>t!==i)))FN(o,t,e,c,n,r);for(const e of l)BN(e,t,n,r);return o(),{options:e,view:c}}))}(xm(a),c,n,r);return{view:o,container:a,options:c,setState:(t,e=(t=>t))=>s.set(t,e),update:(n,r)=>ke(this,void 0,void 0,(function*(){const i=mr(Array.from(s.values()))(c);return yield l(i,n,(()=>{w(r)&&e(t,r,s)}))}))}})),E=(t=x,e,n)=>{var i;const o=O(t,E,n);for(const t of o){const{options:n,container:s}=t,c=s.nameInteraction;let l=rL(n);e&&(l=l.filter((t=>e.includes(t[0]))));for(const e of l){const[n,s]=e,l=c.get(n);if(l&&(null===(i=l.destroy)||void 0===i||i.call(l)),s){const e=WN(t.view,n,s,a)(t,o,r.emitter);c.set(n,{destroy:e})}}}},k=O(b,E);for(const t of k){const{options:e}=t,n=new Map;t.container.nameInteraction=n;for(const i of rL(e)){const[e,o]=i;if(o){const i=WN(t.view,e,o,a)(t,k,r.emitter);n.set(e,{destroy:i})}}}E();const{width:S,height:A}=t,_=[];for(const t of v){const i=new Promise((i=>ke(this,void 0,void 0,(function*(){for(const i of t){const t=Object.assign({width:S,height:A},i);yield BN(t,e,n,r)}i()}))));_.push(i)}r.views=p,null===(i=r.animations)||void 0===i||i.forEach((t=>null==t?void 0:t.cancel())),r.animations=M,r.emitter.emit(iA.AFTER_PAINT);const T=M.filter(xr).map(JN).map((t=>t.finished));return Promise.all([...T,..._])}))}function DN(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function FN(t,e,n,r,i,o){var a;const[s]=U_("interaction",i),c=e.node().nameInteraction,l=rL(n).find((([e])=>e===t)),u=c.get(t);if(!u)return;if(null===(a=u.destroy)||void 0===a||a.call(u),!l[1])return;const f=WN(r,t,l[1],s),d={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},h=f(d,[],o.emitter);c.set(t,{destroy:h})}function zN(t,e){return ke(this,void 0,void 0,(function*(){const n=yield function(t,e){return ke(this,void 0,void 0,(function*(){const[n,r]=U_("mark",e),i=new Set(Object.keys(e).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(xr)),{marks:o}=t,a=[],s=[],c=[...o],{width:l,height:u}=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),f={options:t,width:l,height:u};for(;c.length;){const[t]=c.splice(0,1),o=yield iL(t,e),{type:l=vr("G2Mark type is required."),key:u}=o;if(i.has(l))s.push(o);else{const{props:t={}}=r(l),{composite:e=!0}=t;if(e){const{data:t}=o,e=Object.assign(Object.assign({},o),{data:t?Array.isArray(t)?t:t.value:t}),r=yield n(e,f),i=Array.isArray(r)?r:[r];c.unshift(...i.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else a.push(o)}}return Object.assign(Object.assign({},t),{marks:a,components:s})}))}(t,e),r=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=Oe(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)=>Z(t,e)),{}),u=[n,...s].reduce(((t,e)=>Z(t,e)),{}),f=[...c,r].reduce(((t,e)=>Z(t,e)),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:l,interaction:u,style:f})}(n);t.interaction=r.interaction,t.coordinate=r.coordinate,t.marks=[...r.marks,...r.components];const i=Z_(r,e);return $N(yield GN(i,e),i,e)}))}function GN(t,e){return ke(this,void 0,void 0,(function*(){const[n]=U_("theme",e),[,r]=U_("mark",e),{theme:i,marks:o,coordinates:a=[]}=t,s=n(nL(i)),c=new Map;for(const t of o){const{type:n}=t,{props:i={}}=r(n),o=yield RN(t,i,e);if(o){const[t,e]=o;c.set(t,e)}}const l=Wn(Array.from(c.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of l.values()){const n=t.reduce(((t,{scale:e})=>Z(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],o=Array.from(new Set(i.map((t=>t.field)).filter(xr))),c=Z({guide:{title:0===o.length?void 0:o},field:o[0]},n),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},TC(l,u,c,a,s,e)),{key:r});t.forEach((t=>t.scale=f))}return c}))}function WN(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(Z(o,Object.assign({type:e},n)))}function $N(t,e,n){const[r]=U_("mark",n),[i]=U_("theme",n),[o]=U_("labelTransform",n),{key:a,frame:s=!1,theme:c,clip:l,style:u={},labelTransform:f=[]}=e,d=i(nL(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=jC(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=Z({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:nt(t,i)});o.push(e)}}}return o}(h,e),g=function(t){return t.map((t=>{const e=Z(t,t.style);return delete e.style,e}))}(ZC(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=bN(g,e,d,n),y=function(t,e,n){const[r]=U_("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 l_(p):new o_(p)}(m,e,n),v=s?Z({mainLineWidth:1,mainStroke:"#000"},u):u;!function(t,e,n){const r=Wn(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:wN({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:wN({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:wN({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]=Lr(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));a.length&&MN(a,e,o,i),s.length&&ON(n,0,o)}}(QC(g),y,m),function(t){const e=t.find((({type:t})=>"axisZ"===t));if(e){const n=t.find((({type:t})=>"axisX"===t));n.plane="xy";const r=t.find((({type:t})=>"axisY"===t));r.plane="xy",e.plane="yz",e.origin=[n.bbox.x,n.bbox.y,0],e.eulerAngles=[0,-90,0],e.bbox.x=n.bbox.x,e.bbox.y=n.bbox.y,t.push(Object.assign(Object.assign({},n),{plane:"xz",showLabel:!1,showTitle:!1,origin:[n.bbox.x,n.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},r),{plane:"yz",showLabel:!1,showTitle:!1,origin:[r.bbox.x+r.bbox.width,r.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},e),{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=NC(t,n);r.push(i),"y"===e&&i.update(Object.assign(Object.assign({},i.getOptions()),{xScale:b.x})),CC(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=Tr(d,(t=>NC(t,n)));CC(b,h);const p=PC(u,h),g=r(e),[v,w,M]=VN(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:mr(f.map(o))},x]}function HN(t,e,n,r,i){return ke(this,void 0,void 0,(function*(){const{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=Oe(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),w=b.map((t=>Or(Object.assign({},a.view,f),t))),M=["a","margin","padding","inset"].map((t=>Mr(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)}(xm(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(cL(oS)).data(x.filter((t=>xr(w[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",oS).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 $n(o,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const C=e.selectAll(cL(rS)).data(o,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",rS).append((t=>KC(Z({animate:P,scale:h},t),l,a,r,c)))),(t=>t.transition((function(t,e,n){const{preserve:i=!1}=t;if(i)return;const o=KC(Z({animate:P,scale:h},t),l,a,r,c),{attributes:s}=o,[u]=n.childNodes;return u.update(s,!1)})))).transitions();n.push(...C.flat().filter(xr));const N=e.selectAll(cL(nS)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",nS).call(oL).call(sL,Array.from(c.keys())).call(lL,d)),(t=>t.call(sL,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):oL(t))).call(lL,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,i),h=QN(o,a,t,r),p=tL(o,a,t,r),g=eL(o,a,t,r),m=qN(e,f,l,"element"),y=f.selectAll(cL(tS)).selectFacetAll(m).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(d).attr("className",tS).attr("markType",u).transition((function(t,e,n){return h(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=wr((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){UN(i,e,n);const o=d(t,r),a=p(t,[i],[o]);return null!==a||(i.nodeName===o.nodeName&&"g"!==o.nodeName?br(i,o):(i.parentNode.replaceChild(o,i),o.className=tS,o.markType=u,o.__data__=i.__data__)),a})).attr("markType",u).attr("className",tS)}))),(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",tS).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new wm(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new wm([],n.__toData__,n.parentNode).append(d).attr("className",tS).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...y.flat())}!function(t,e,n,r,i){const[o]=U_("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(cL(Jk)).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]=U_("shape",r),{data:a}=t,{data:s,defaultLabelShape:c}=e,l=s.map((t=>t.points)),{theme:u,coordinate:f}=n,d=Object.assign(Object.assign({},i),{document:X_(i),theme:u,coordinate:f});return t=>{const{index:e,points:n}=t,r=a[e],{formatter:i=(t=>`${t}`),transform:s,style:f,render:h}=t,p=Oe(t,["formatter","transform","style","render"]),g=Tr(Object.assign(Object.assign({},p),f),(t=>YN(t,r,e,a))),{shape:m=c,text:y}=g,v=Oe(g,["shape","text"]),b="string"==typeof i?AE(i):i,x=Object.assign(Object.assign({},v),{text:b(y,r,e,a),datum:r}),w=Object.assign({type:`label.${m}`,render:h},v);return o(w,d)(n,x,ZN(u,"label",m,"label"),l)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(cL(tS)).nodes().filter((t=>!t.__removed__));return a.flatMap(((t,e)=>{const n=Oe(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=xm(c).selectAll(cL(iS)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",iS)),(t=>t.each((function(t,e,n){br(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),h=Wn(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;mr(n.map(o))(e,g)}s&&s(d,g)}(t,e,0,r,i)}))}function VN([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])=>xr(t)&&xr(e)))&&(r.push(o),i.push(a))}return[r,i]}function YN(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"!=typeof t?t:Sr(e)&&void 0!==e[t]?e[t]:t}function qN(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 UN(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,i){const[o]=U_("shape",r),{data:a}=t,{defaultShape:s,data:c,shape:l}=e,u=c.map((t=>t.points)),{theme:f,coordinate:d}=n,{type:h,style:p={}}=t,g=Object.assign(Object.assign({},i),{document:X_(i),coordinate:d,theme:f});return e=>{const{shape:n=s}=p,{shape:r=n,points:i,seriesIndex:c,index:d}=e,m=Oe(e,["shape","points","seriesIndex","index"]),y=Object.assign(Object.assign({},m),{index:d}),v=c?c.map((t=>a[t])):a[d],b=c||d,x=Tr(p,(t=>YN(t,v,b,a)));return(l[r]?l[r](x,g):o(Object.assign(Object.assign({},x),{type:aL(t,r)}),g))(i,y,ZN(f,h,r,s),u)}}function ZN(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 KN(t,e,n,r,i){var o,a;const[,s]=U_("shape",i),[c]=U_("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(aL(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,Z(g,{delay:o,duration:a,easing:s}));return Array.isArray(u)?u:[u]}}function QN(t,e,n,r){return KN("enter",t,e,n,r)}function JN(t){return t.finished.then((()=>{t.cancel()})),t}function tL(t,e,n,r){return KN("update",t,e,n,r)}function eL(t,e,n,r){return KN("exit",t,e,n,r)}function nL(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=Oe(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function rL(t){const{interaction:e={}}=t;return Object.entries(Z({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function iL(t,e){return ke(this,void 0,void 0,(function*(){const n={library:e},{data:r}=t,i=Oe(t,["data"]);if(null==r)return t;const[,{data:o}]=yield kN(0,{data:r},n);return Object.assign({data:o},i)}))}function oL(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 aL(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function sL(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(cL(Qk)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",Qk).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(cL(Jk)).node()||t.append("g").attr("className",Jk).style("zIndex",0)}function cL(...t){return t.map((t=>`.${t}`)).join("")}function lL(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 Qp({style:{x:r+i,y:n+o,width:a,height:s}})}))}function uL(t){const e=Z({},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=Z({},e[o]);e[o]=a,n.set(a,t),r.set(a,o),i.push(a)}}return e}function fL(t,e){const n=new JS;return n.registerPlugin(new eA),new hg({width:t,height:e,container:document.createElement("div"),renderer:n})}function dL(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480,depth:a=0}=t,s=uL(t),{canvas:c=fL(i,o),emitter:l=new rA,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(iA.BEFORE_RENDER);const h=xm(c.document.documentElement);return c.ready.then((()=>BN(Object.assign(Object.assign({},s),{width:i,height:o,depth:a}),h,u,e))).then((()=>{if(a){const[t,e]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(t,e,-a/2)}c.requestAnimationFrame((()=>{l.emit(iA.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=c.getConfig().container)?document.getElementById(p):p;var p}function hL(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(!function(t){const e=t.getRoot().querySelectorAll(`.${eS}`);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 pL={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function gL(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:pL[e]}function mL(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>mL(t,e,n,r)))}function yL(t){mL(t,"visibility","hidden",!0)}function vL(t){mL(t,"visibility","visible",!0)}function bL(t){return xm(t).selectAll(`.${tS}`).nodes().filter((t=>!t.__removed__))}function xL(t,e){return wL(t,e).flatMap((({container:t})=>bL(t)))}function wL(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function ML(t){return xm(t).select(`.${nS}`).node()}function OL(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new ku;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function EL(t,e){const{offsetX:n,offsetY:r}=e,i=OL(t),{min:[o,a],max:[s,c]}=i;return n<o||n>s||(r<a||r>c)?null:[n-o,r-a]}function kL(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 SL(t){return t=>t.__data__.color}function AL(t){return t=>t.__data__.x}function _L(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[PL(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(PL(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=gL(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 PL(t,e){return`${t},${e}`}function CL(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[PL(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=PL(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 NL(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 LL(t){var{link:e=!1,valueof:n=((t,e)=>t),coordinate:r}=t,i=Oe(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=qn(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=ac(),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=Tr(i,(t=>n(t,c))),{fill:g=c.getAttribute("fill")}=p,m=Oe(p,["fill"]),y=new Xp({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 jL(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(Zc(n)){const{points:i}=t.__data__,[o,a]=Xc(n)?Am(i):i,s=n.getCenter(),c=Es(o,s),l=Es(a,s),u=As(c)+Ts(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return Xc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function RL(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=Oe(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(!gk(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(!gk(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 Nm(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=Oe(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=Tr(a,(e=>o(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,lineWidth:d=0}=e,h=Oe(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(gk)})()?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 IL(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 BL(t){IL(t,t.cursor)}function DL(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function FL(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function zL(t,e=!1){const n=m(t,(t=>!!t)).map(((t,e)=>[0===e?"M":"L",...t]));return e&&n.push(["Z"]),n}function GL(t){return t.querySelectorAll(".element")}function WL(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}function $L(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=Wn(d,r),g=NL(d,n),[m,y]=LL(Object.assign({elements:d,valueof:g,link:i,coordinate:c},Mr(u.active,"link"))),[v,b,x]=RL(Object.assign({document:t.ownerDocument,scale:s,coordinate:c,background:o,valueof:g},Mr(u.active,"background"))),w=Z(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 jL(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=DL(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 HL(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,o=Oe(t,["delay","createGroup","background","link"]);return(t,a,s)=>{const{container:c,view:l,options:u}=t,{scale:f,coordinate:d}=l;return $L(ML(c),Object.assign({elements:bL,datum:_L(l),groupKey:n?n(l):void 0,coordinate:d,scale:f,state:CL(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:s},o))}}function VL(t){return HL(Object.assign(Object.assign({},t),{createGroup:AL}))}function YL(t){return HL(Object.assign(Object.assign({},t),{createGroup:SL}))}function qL(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=Wn(d,r),g=NL(d,n),[m,y]=LL(Object.assign({link:i,elements:d,valueof:g,coordinate:a},Mr(u.selected,"link"))),[v,b]=RL(Object.assign({document:t.ownerDocument,background:s,coordinate:a,scale:c,valueof:g},Mr(u.selected,"background"))),x=Z(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 jL(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=DL(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 UL(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=Oe(t,["createGroup","background","link"]);return(t,o,a)=>{const{container:s,view:c,options:l}=t,{coordinate:u,scale:f}=c;return qL(ML(s),Object.assign({elements:bL,datum:_L(c),groupKey:e?e(c):void 0,coordinate:u,scale:f,state:CL(l,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:a},i))}}function XL(t){return UL(Object.assign(Object.assign({},t),{createGroup:AL}))}function ZL(t){return UL(Object.assign(Object.assign({},t),{createGroup:SL}))}function KL(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=(t=>`${t}`)}=t,o=Oe(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=qn(y.map((t=>g[t]))),b=ML(s),x=s.getElementsByClassName(tS),w=Wn(s.getElementsByClassName(iS),(t=>t.__data__.key.split("-")[0])),M=new Up({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},Mr(o,"rule"))}),O=new Jp({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},Mr(o,"label"))});M.append(O),b.appendChild(M);const E=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return v[Ln(v,i)]},k=(t,e)=>{M.setAttribute("x1",t[0]),M.setAttribute("x2",t[0]),O.setAttribute("text",i(e))};let S;const A=rt((t=>{const e=EL(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[An((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=>{ke(this,void 0,void 0,(function*(){const{x:e}=f,n=E(d,e,t);k(t,n),l("chartIndex",(t=>{const e=Z({},t),r=e.marks.find((t=>"line"===t.type)),i=or(Hn(y,(t=>or(t,(t=>+p[t]))/sr(t,(t=>+p[t]))),(t=>m[t])).values());Z(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[An((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 QL({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=ML(s),l=rt((t=>{const e=EL(c,t);if(!e)return a("fisheye"),void o();a("fisheye",(t=>{const n=Z({},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 JL(t,e){if(e)return"string"==typeof e?document.querySelector(e):e;return t.ownerDocument.defaultView.getContextService().getDomElement().parentElement}function tj(t,e,n,r,i,o,a,s={}){const c=new cw({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:Z({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(c.HTMLTooltipElement),c}function ej({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}){const d=JL(t,u),h=JL(t),p=a?h:t,g=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),m=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(h,d),{tooltipElement:y=tj(d,n,r,s,c,g,m,l)}=p,{items:v,title:b=""}=e;y.update(Object.assign({x:n,y:r,data:v,title:b,position:s,enterable:c},void 0!==i&&{content:i(o,{items:v,title:b})})),p.tooltipElement=y}function nj({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const o=JL(t),a=e?o:t,{tooltipElement:s}=a;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY)}function rj({root:t,single:e}){const n=JL(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0)}function ij(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function oj(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function aj(t,e=(t=>t)){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function sj(t,e,n,r=t.map((t=>t.__data__)),i={}){const o=t=>t instanceof Date?+t:t,a=aj(r.map((t=>t.title)),o).filter(xr),s=r.flatMap(((r,o)=>{const a=t[o],{items:s=[],title:c}=r,l=s.filter(xr),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=oj(a)||i.color,name:o}=t,s=Oe(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 Qo)&&!(t instanceof ta);if(s(r))return r.clone().invert(a);if(a&&r instanceof Qo&&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(ij);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:aj(s,(t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`))})}function cj(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=Oe(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=dr(g),v=dr(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=As(Es([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 Up({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 lj(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function uj(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function fj(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function dj(t,e){return void 0===t?e:t}function hj(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function pj(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,render:c,groupName:l,emitter:u,wait:f=50,leading:d=!0,trailing:h=!1,startX:p=0,startY:g=0,body:m=!0,single:y=!0,position:v,enterable:b,mount:x,bounding:w,theme:M,disableNative:O=!1,marker:E=!0,preserve:k=!1,style:S={},css:A={}}=e,_=Oe(e,["elements","sort","filter","scale","coordinate","crosshairs","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","disableNative","marker","preserve","style","css"]);const T=n(t),P=Xc(a),C=Zc(a),N=Z(S,_),{innerWidth:L,innerHeight:j,width:R,height:I,insetLeft:B,insetTop:D}=a.getOptions(),F=[],z=[];for(const t of T){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?F.push(t):(r||i)&&z.push(t)}const W=!!(P?o.y:o.x).getBandWidth&&z.length>0;F.sort(((t,e)=>{const n=P?0:1,r=t=>t.getBounds().min[n];return P?r(e)-r(t):r(t)-r(e)}));const $=t=>{const e=P?1:0,{min:n,max:r}=t.getLocalBounds();return qn([n[e],r[e]])};z.sort(((t,e)=>{const[n,r]=$(t),[i,o]=$(e),a=(n+r)/2,s=(i+o)/2;return P?s-a:a-s}));const H=new Map(F.map((t=>{const{__data__:e}=t,{seriesX:n}=e;return[t,[qn(n.map(((t,e)=>e)),(t=>n[+t])),n]]}))),{x:V}=o,Y=(null==V?void 0:V.getBandWidth)?V.getBandWidth()/2:0,q=t=>{const[e]=a.invert(t);return e-Y},U=(t,e,n)=>{const r=q(t),i=n.filter(xr),[o,a]=qn([i[0],i[i.length-1]]);if(!W&&(r<o||r>a)&&!(o===a))return null;const s=An((t=>n[+t])).center;return e[s(e,r)]},X=(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]})))},K=rt((e=>{const n=EL(t,e);if(!n)return;const f=OL(t),d=f.min[0],h=f.min[1],O=[n[0]-p,n[1]-g];if(!O)return;const k=((t,e)=>{const n=t[P?1:0],r=e.filter((t=>{const[e,r]=$(t);return n>=e&&n<=r}));if(!W||r.length>0)return r;const i=An((t=>{const[e,n]=$(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(xr)})(O,z),S=[],_=[];for(const t of F){const[e,n]=H.get(t),r=U(O,e,n);if(null!==r){S.push(t);const e=X(t,r),{x:n,y:i}=e,o=a.map([(n||0)+Y,i||0]);_.push([Object.assign(Object.assign({},e),{element:t}),o])}}const T=Array.from(new Set(_.map((t=>t[0].x)))),G=T[cr(T,(t=>Math.abs(t-q(O))))],V=_.filter((t=>t[0].x===G)),Z=[...V.map((t=>t[0])),...k.map((t=>t.__data__))],K=[...S,...k],J=sj(K,o,l,Z,M);if(r&&J.items.sort(((t,e)=>r(t)-r(e))),i&&(J.items=J.items.filter(i)),0===K.length||hj(J))Q(e);else{if(m&&ej({root:t,data:J,x:n[0]+d,y:n[1]+h,render:c,event:e,single:y,position:v,enterable:b,mount:x,bounding:w,css:A}),s){const e=V.map((t=>t[1])),n=Mr(N,"crosshairs");cj(t,e,Object.assign(Object.assign({},n),{plotWidth:L,plotHeight:j,mainWidth:R,mainHeight:I,insetLeft:B,insetTop:D,startX:p,startY:g,transposed:P,polar:C}))}if(E){const e=Mr(N,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const i=e.filter((t=>{const[{x:e,y:n}]=t;return xr(e)&&xr(n)})).map((t=>{const[{color:e,element:i},o]=t,a=e||i.style.fill||i.style.stroke||r.color;return new Wp({style:Object.assign({cx:o[0],cy:o[1],fill:a,r:4,stroke:"#fff",lineWidth:2},n)})}));for(const e of i)t.appendChild(e);t.markers=i}(t,{data:V,style:e,theme:M})}u.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:{x:mk(o.x,q(O),!0)}}}))}}),f,{leading:d,trailing:h}),Q=e=>{nj({root:t,single:y,emitter:u,event:e}),s&&lj(t),E&&uj(t)},J=()=>{rj({root:t,single:y}),s&&lj(t),E&&uj(t)},tt=({nativeEvent:e,data:n})=>{if(e)return;const{x:r}=n.data,{x:i}=o,s=i.map(r),[c,l]=a.map([s,.5]),{min:[u,f]}=t.getRenderBounds();K({offsetX:c+u,offsetY:l+f})},et=()=>{nj({root:t,single:y,emitter:u,nativeEvent:!1})},nt=()=>{at(),J()},it=()=>{ot()},ot=()=>{O||(t.addEventListener("pointerenter",K),t.addEventListener("pointermove",K),t.addEventListener("pointerleave",Q))},at=()=>{O||(t.removeEventListener("pointerenter",K),t.removeEventListener("pointermove",K),t.removeEventListener("pointerleave",Q))};return ot(),u.on("tooltip:show",tt),u.on("tooltip:hide",et),u.on("tooltip:disable",nt),u.on("tooltip:enable",it),()=>{at(),u.off("tooltip:show",tt),u.off("tooltip:hide",et),u.off("tooltip:disable",nt),u.off("tooltip:enable",it),k?nj({root:t,single:y,emitter:u,nativeEvent:!1}):J()}}function gj(t,{elements:e,scale:n,render:r,groupName:i,sort:o,filter:a,emitter:s,wait:c=50,leading:l=!0,trailing:u=!1,groupKey:f=(t=>t),single:d=!0,position:h,enterable:p,datum:g,view:m,mount:y,bounding:v,theme:b,shared:x=!1,body:w=!0,disableNative:M=!1,preserve:O=!1,css:E={}}){const k=e(t),S=Wn(k,f),A=rt((e=>{const{target:c}=e,l=WL(c,(t=>!!t.classList&&t.classList.includes("element")));if(!l)return void nj({root:t,single:d,emitter:s,event:e});const u=f(l),g=S.get(u);if(!g)return;const M=1!==g.length||x?sj(g,n,i,void 0,b):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(xr).map((e=>{var{color:n=oj(t)}=e,r=Oe(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(ij);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(g[0]);if(o&&M.items.sort(((t,e)=>o(t)-o(e))),a&&(M.items=M.items.filter(a)),hj(M))return void nj({root:t,single:d,emitter:s,event:e});const{offsetX:O,offsetY:k}=e;w&&ej({root:t,data:M,x:O,y:k,render:r,event:e,single:d,position:h,enterable:p,mount:y,bounding:v,css:E}),s.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:V_(l,m)}}))}),c,{leading:l,trailing:u}),_=e=>{nj({root:t,single:d,emitter:s,event:e})},T=()=>{M||(t.addEventListener("pointermove",A),t.addEventListener("pointerleave",_))},P=()=>{M||(t.removeEventListener("pointermove",A),t.removeEventListener("pointerleave",_))},C=({nativeEvent:t,data:e})=>{if(t)return;const n=DL(k,e.data,g);if(!n)return;const r=n.getBBox(),{x:i,y:o,width:a,height:s}=r;A({target:n,offsetX:i+a/2,offsetY:o+s/2})},N=({nativeEvent:e}={})=>{e||nj({root:t,single:d,emitter:s,nativeEvent:!1})};return s.on("tooltip:show",C),s.on("tooltip:hide",N),s.on("tooltip:enable",(()=>{T()})),s.on("tooltip:disable",(()=>{P(),rj({root:t,single:d})})),T(),()=>{P(),s.off("tooltip:show",C),s.off("tooltip:hide",N),O?nj({root:t,single:d,emitter:s,nativeEvent:!1}):rj({root:t,single:d})}}function mj(t){const{shared:e,crosshairs:n,series:r,name:i,item:o=(()=>({})),facet:a=!1}=t,s=Oe(t,["shared","crosshairs","series","name","item","facet"]);return(t,i,c)=>{const{container:l,view:u}=t,{scale:f,markState:d,coordinate:h,theme:p}=u,g=fj(d,"seriesTooltip"),m=fj(d,"crosshairs"),y=ML(l),v=dj(r,g);if(v&&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}))}(d)&&!a)return pj(y,Object.assign(Object.assign({},s),{theme:p,elements:bL,scale:f,coordinate:h,crosshairs:dj(n,m),item:o,emitter:c}));if(v&&a){const e=i.filter((e=>e!==t&&e.options.parentKey===t.options.key)),r=xL(t,i),a=e[0].view.scale,l=y.getBounds(),u=l.min[0],f=l.min[1];return Object.assign(a,{facet:!0}),pj(y.parentNode.parentNode,Object.assign(Object.assign({},s),{theme:p,elements:()=>r,scale:a,coordinate:h,crosshairs:dj(n,m),item:o,startX:u,startY:f,emitter:c}))}return gj(y,Object.assign(Object.assign({},s),{datum:_L(u),elements:bL,scale:f,coordinate:h,groupKey:e?t=>t.__data__.x:void 0,item:o,emitter:c,view:u,theme:p,shared:e}))}}HL.props={reapplyWhenUpdate:!0},VL.props={reapplyWhenUpdate:!0},YL.props={reapplyWhenUpdate:!0},UL.props={reapplyWhenUpdate:!0},XL.props={reapplyWhenUpdate:!0},ZL.props={reapplyWhenUpdate:!0},KL.props={reapplyWhenUpdate:!0},mj.props={reapplyWhenUpdate:!0};const yj="legend-category",vj="legend-continuous",bj="items-item",xj="legend-category-item-marker",wj="legend-category-item-label";function Mj(t){return t.getElementsByClassName(xj)[0]}function Oj(t){return t.getElementsByClassName(wj)[0]}function Ej(t){return t.getElementsByClassName(bj)}function kj(t){return t.getElementsByClassName(yj)}function Sj(t){return t.getElementsByClassName(vj)}function Aj(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function _j(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){return ke(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 Z({},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 Tj(t,e){for(const n of t)_j(n,Object.assign(Object.assign({},e),{facet:!0}))}function Pj(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),o=i.length>0,a=t=>Aj(t).scales.map((t=>t.name)),s=[...kj(r),...Sj(r)],c=s.flatMap(a),l=rt(o?Tj:_j,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=Aj(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===yj?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:Mr(d,"marker")},p={unselected:Mr(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=()=>{IL(t,"pointer")},r=()=>{BL(t)},c=t=>ke(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=>ke(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=>ke(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:Ej,marker:Mj,label:Oj,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 Cj(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=kj(r),s=bL(r),c=t=>Aj(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=CL(o,["active","inactive"]),f=NL(s,_L(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=Ej(t),o=l(r),a=Wn(s,(t=>o.invert(t.__data__[r]))),{state:h={}}=t.attributes,{inactive:p={}}=h,{setState:g,removeState:m}=TL(u,f),y={inactive:Mr(p,"marker")},v={inactive:Mr(p,"label")},{setState:b,removeState:x}=TL(y),{setState:w,removeState:M}=TL(v),O=t=>{for(const e of i){const n=Mj(e),r=Oj(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 Nj(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function Lj(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function jj(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const Rj=zm((t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:c=10,document:l}=e,u=Oe(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=Mr(Er(u,"handleNW","handleNE"),"handleN"),{render:p=d}=h,g=Oe(h,["render"]),m=Mr(u,"handleE"),{render:y=d}=m,v=Oe(m,["render"]),b=Mr(Er(u,"handleSE","handleSW"),"handleS"),{render:x=d}=b,w=Oe(b,["render"]),M=Mr(u,"handleW"),{render:O=d}=M,E=Oe(M,["render"]),k=Mr(u,"handleNW"),{render:S=d}=k,A=Oe(k,["render"]),_=Mr(u,"handleNE"),{render:T=d}=_,P=Oe(_,["render"]),C=Mr(u,"handleSE"),{render:N=d}=C,L=Oe(C,["render"]),j=Mr(u,"handleSW"),{render:R=d}=j,I=Oe(j,["render"]),B=t=>()=>{const e=zm((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=xm(t).attr("className",a).style("transform",`translate(${n}, ${r})`).style("draggable",!0);D.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(jj,Object.assign(Object.assign({width:i,height:o},Er(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(jj,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(jj,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(jj,w),D.maybeAppend("handle-w",B(O)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(jj,E),D.maybeAppend("handle-nw",B(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(jj,A),D.maybeAppend("handle-ne",B(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(jj,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(jj,L),D.maybeAppend("handle-sw",B(R)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(jj,I)}));function Ij(t,e){var{brushed:n=(()=>{}),brushended:r=(()=>{}),brushcreated:i=(()=>{}),brushstarted:o=(()=>{}),brushupdated:a=(()=>{}),extent:s=Lj(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=Oe(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;IL(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 Xp({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:d,pointerEvents:"none"})}),v=new Rj({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 Rj({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]=kL(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=kL(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=kL(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)?IL(t,"move"):j(n)&&IL(t,N[n.id].cursor):IL(t,"crosshair")},G=()=>{IL(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),IL(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 Bj(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 Dj(t,e,n){return Bj(t,e,n).map((t=>t.options))}function Fj(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=Oe(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=NL(y,o),w=Mr(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;Nj([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 Qp({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=Ij(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=vk(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=vk(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=vk(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=bk(o,r),c=bk(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 zj(t){var{facet:e,brushKey:n}=t,r=Oe(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:c}=t,l=ML(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 Fj(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>xL(t,i),datum:_L(wL(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:CL(wL(t,i).map((t=>t.options)),f),emitter:o,scale:d,coordinate:h,selectedHandles:void 0},u),r))}const p=Fj(l,Object.assign(Object.assign({elements:bL,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return Bj(t,e,n).map((t=>ML(t.container)))}(t,i,n),datum:_L([s,...Bj(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:CL([c,...Dj(t,i,n)],f),emitter:o,scale:d,coordinate:h,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function Gj(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function Wj(t){return zj(Object.assign(Object.assign({},t),{brushRegion:Gj,selectedHandles:["handle-e","handle-w"]}))}function $j(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function Hj(t){return zj(Object.assign(Object.assign({},t),{brushRegion:$j,selectedHandles:["handle-n","handle-s"]}))}const Vj="axis",Yj="axis-line",qj="axis-main-group",Uj="axis-hot-area";function Xj(t){return t.getElementsByClassName(Vj)}function Zj(t){return t.getElementsByClassName(Yj)[0]}function Kj(t){return function(t){return t.getElementsByClassName(qj)[0]}(t).getLocalBounds()}function Qj(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=Oe(e,["cross","offsetX","offsetY"]);const a=Kj(t),s=Zj(t),[c]=s.getLocalBounds().min,[l,u]=a.min,[f,d]=a.max,h=2*(f-l);return{brushRegion:$j,hotZone:new Qp({className:Uj,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 Jj(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=Oe(e,["offsetY","offsetX","cross"]);const a=Kj(t),s=Zj(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,d]=a.max,h=d-u;return{brushRegion:Gj,hotZone:new Qp({className:Uj,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 tR(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=ML(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=Oe(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),m=NL(p,a),{setState:y,removeState:v}=TL(u,m),b=new Map,x=Mr(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(yk(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)?Jj:Qj,{hotZone:r,brushRegion:i,extent:a}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=Ij(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:bL,axes:Xj,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:_L(o),state:CL(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function eR(t){var{hideX:e=!0,hideY:n=!0}=t,r=Oe(t,["hideX","hideY"]);return(t,i,o)=>{const{container:a,view:s,options:c,update:l,setState:u}=t,f=ML(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=Mr(Oe(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=Ij(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 vk(t,e,n,r,i,o)},filter:(t,r)=>ke(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=>Z({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 nR(t){return eR(Object.assign(Object.assign({hideX:!0},t),{brushRegion:Gj}))}function rR(t){return eR(Object.assign(Object.assign({hideY:!0},t),{brushRegion:$j}))}const iR="slider";function oR(t,e,n,r=!1,i="x",o="y"){const{marks:a}=t,s=a.map((t=>{var a,s;return Z({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 aR(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return yk(e,[mk(e,o(r),!0),mk(e,o(i),!1)])}function sR(t){return[t[0],t[t.length-1]]}function cR({initDomain:t={},className:e=iR,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=Xc(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=sR(C.x),r=sR(C.y)]=e;return h?[yk(k,n,m),yk(S,r,b)]:[yk(S,r,b),yk(k,n,m)]}const{value:n}=t.detail;return[aR(n,v[l],A&&"horizontal"===e),C[u]]},N=rt((e=>ke(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:[sR(t),sR(n)]}}))}g(t,(t=>Object.assign(Object.assign({},oR(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 ip("valuechange",{data:i,nativeEvent:!1}));const c=h?bk(a,k):bk(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 ip("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 lR="g2-scrollbar";function uR(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(lR).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 cR(Object.assign(Object.assign({},t),{initDomain:l,className:lR,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 fR(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 dR={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 hR(t){return"text"===t.nodeName&&!!t.isOverflowing()}function pR(t){var{offsetX:e=8,offsetY:n=8}=t,r=Oe(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=Mr(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!hR(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 Yp({className:"poptip",style:{innerHTML:fR("div",h,Object.assign(Object.assign({},dR),s)),x:f,y:d}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;hR(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()))}}}pR.props={reapplyWhenUpdate:!0};const gR={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function mR(t={}){const{originData:e=[],layout:n}=t,r=Oe(t,["originData","layout"]),i=Z({},gR,r),o=Mr(i,"breadCrumb"),a=Mr(i,"active");return t=>{const{update:r,setState:i,container:s,options:c}=t,l=function(t){return xm(t).select(`.${nS}`).node()}(s),u=c.marks[0],{state:f}=u,d=new Vp;l.appendChild(d);const h=(t,c)=>ke(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 Jp({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 Jp({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===ot(t)-1&&u.remove(),l}));c.forEach(((t,e)=>{if(e===ot(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(J(t,["style","path"]),J(t,["style","depth"]))}))}))}!function(t,e){[...kj(t),...Sj(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=J(t,["id"]);return e&&(e.match(`${o}/`)||o.match(e))})).map((t=>({value:0===t.height?J(t,["value"]):void 0,name:J(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=zO(t,l,{value:"value"})[0]}else r=e.filter((t=>1===t.depth));const i=[];return r.forEach((({path:t})=>{i.push(N(t))})),Z({},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"!==J(n,["markType"]))return;const r=J(n,["__data__","key"]),i=A(e,(t=>t.id===r));J(i,"height")&&h(J(i,"path"),J(i,"depth"))};l.addEventListener("click",p);const g=E(Object.assign(Object.assign({},f.active),f.inactive)),m=()=>{GL(l).forEach((t=>{const n=J(t,["style","cursor"]),r=A(e,(e=>e.id===J(t,["__data__","key"])));if("pointer"!==n&&(null==r?void 0:r.height)){t.style.cursor="pointer";const e=et(t.attributes,g);t.addEventListener("mouseenter",(()=>{t.attr(f.active)})),t.addEventListener("mouseleave",(()=>{t.attr(Z(e,f.inactive))}))}}))};return m(),l.addEventListener("mousemove",m),()=>{d.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",m)}}}const yR={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},vR="movePoint",bR=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")))},xR=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},wR=(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})),MR=t=>{const e=J(t,["__data__","y"]),n=J(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:o},childNodes:a}=t.parentNode,s=A(o,(({type:t})=>"normalizeY"===t)),c=J(i,["y","field"]),l=r[a.indexOf(t)][c];return(t,e=!1)=>s||e?t/(1-t)/(n/(1-n))*l:t},OR=(t,e)=>{const n=J(t,["__data__","seriesItems",e,"0","value"]),r=J(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:o,transform:a}}=t.parentNode,s=A(a,(({type:t})=>"normalizeY"===t)),c=J(o,["y","field"]),l=i[r][c];return t=>s?1===n?t:t/(1-t)/(n/(1-n))*l:t},ER=(t,e,n)=>{t.forEach(((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)}))},kR=(t,e,n,r)=>{const i=new Xp({style:n}),o=new Jp({style:r});return e.appendChild(o),t.appendChild(i),[i,o]},SR=(t,e)=>{if(!J(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},AR=(t,e,n)=>{const r=FL(t,e),i=FL(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function _R(t={}){const{selection:e=[],precision:n=2}=t,r=Oe(t,["selection","precision"]),i=Object.assign(Object.assign({},yR),r||{}),o=Mr(i,"path"),a=Mr(i,"label"),s=Mr(i,"point");return(t,r,i)=>{const{update:c,setState:l,container:u,view:f,options:{marks:d,coordinate:h}}=t,p=ML(u);let g,m=GL(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 Vp({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=J(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)=>ke(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=wR(c,a,s);return((t,e)=>{i.emit("element-point:moved",{nativeEvent:!0,data:{changeData:t,data:e}})})(c,l),Z({},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 Wp({name:vR,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),l=OR(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()),ER(E.childNodes,y,s);const[p,x]=kR(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]=AR(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=zL([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=zL([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=zL([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=()=>ke(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",M),u.removeEventListener("mouseup",S),H(x.attr("text")))return;const e=Number(x.attr("text")),n=SR(N,b);g=yield B(i,e,n,["line","area"]),x.remove(),p.remove(),T(t)}));u.addEventListener("mouseup",S)})),E.appendChild(c)})),ER(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=MR(t),c=new Wp({name:vR,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=SR(N,b),[f,d]=kR(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=zL([[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]=AR(R,[o,r],e),[l,u]=AR(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=FL(t,e[1]),o=FL(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=zL([[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=()=>ke(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",h),H(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",bR),t.addEventListener("mouseleave",xR)}));const P=t=>{const e=null==t?void 0:t.target;e&&(e.name===vR||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",bR),t.removeEventListener("mouseleave",xR)}))}}}var TR={},PR={};function CR(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function NR(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 LR(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function jR(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+LR(-t,6):t>9999?"+"+LR(t,6):LR(t,4)}(t.getUTCFullYear())+"-"+LR(t.getUTCMonth()+1,2)+"-"+LR(t.getUTCDate(),2)+(i?"T"+LR(e,2)+":"+LR(n,2)+":"+LR(r,2)+"."+LR(i,3)+"Z":r?"T"+LR(e,2)+":"+LR(n,2)+":"+LR(r,2)+"Z":n||e?"T"+LR(e,2)+":"+LR(n,2)+"Z":"")}function RR(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 PR;if(l)return l=!1,TR;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())!==PR;){for(var f=[];r!==TR&&r!==PR;)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?jR(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=CR(t);return function(r,i){return e(n(r),i,t)}}(t,e):CR(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=NR(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=NR(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function IR(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;BR&&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 BR=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),DR=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>ke(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return RR(r).parse(e,i?IR:gr)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};DR.props={};const FR=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 zR(t){return null!=t&&!Number.isNaN(t)}FR.props={};const GR=t=>{const{callback:e=zR}=t;return t=>t.filter(e)};GR.props={};const WR=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};WR.props={};const $R=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)))};$R.props={};const HR=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)),{})))};HR.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 YR=t=>{const{value:e}=t;return()=>e};YR.props={};const qR=t=>{const{callback:e=gr}=t;return t=>e(t)};qR.props={};const UR=t=>{const{callback:e=gr}=t;return t=>Array.isArray(t)?t.map(e):t};UR.props={};const XR=Math.PI/180,ZR=64,KR=2048;function QR(t){return t.text}function JR(){return"serif"}function tI(){return"normal"}function eI(t){return t.value}function nI(){return 90*~~(2*Math.random())}function rI(){return 1}function iI(){}function oI(t,e,n,r){if(e.sprite)return;const i=t.context,o=t.ratio;i.clearRect(0,0,(ZR<<5)/o,KR/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*XR),r=Math.cos(e.rotate*XR),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>=ZR<<5&&(a=0,s+=c,c=0),s+l>=KR)break;i.translate((a+(t>>1))/o,(s+(l>>1))/o),e.rotate&&i.rotate(e.rotate*XR),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,(ZR<<5)/o,KR/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)*(ZR<<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 aI(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 sI(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 cI(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function lI(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function uI(){return document.createElement("canvas")}function fI(t){return"function"==typeof t?t:function(){return t}}const dI={archimedean:cI,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 hI(){let t=[256,256],e=QR,n=JR,r=eI,i=tI,o=nI,a=rI,s=cI,c=Math.random,l=iI,u=[],f=null,d=1/0;const h=tI,p=uI,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&&aI(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=(ZR<<5)/e,t.height=KR/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",n.textBaseline="middle",{context:n,ratio:e}}(p()),b=g.board?g.board:lI((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=h.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,oI(v,e,M,O),e.hasText&&m(b,e,E)&&(l.call(null,"word",{cloud:g,word:e}),w.push(e),E?g.hasImage||sI(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=lI((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=fI(t)},g.font=function(t){n=fI(t)},g.fontWeight=function(t){i=fI(t)},g.rotate=function(t){o=fI(t)},g.spiral=function(t){s=dI[t]||t},g.fontSize=function(t){r=fI(t)},g.padding=function(t){a=fI(t)},g.random=function(t){c=fI(t)},g.on=function(t){l=fI(t)},g}const pI={fontSize:[20,60],font:"Impact",padding:2,rotate:function(){return 30*(~~(6*Math.random())-3)}};function gI(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 mI=t=>e=>ke(void 0,void 0,void 0,(function*(){const n=Object.assign({},pI,t),r=hI();var i,o;yield(i=r,o=n,{set(t,e,n){if(void 0===o[t])return this;const r=e?e.call(null,o[t]):o[t];return n?n.call(null,r):"function"==typeof i[t]?i[t](r):i[t]=r,this},setAsync(t,e,n){return ke(this,void 0,void 0,(function*(){if(void 0===o[t])return this;const r=e?yield e.call(null,o[t]):o[t];return n?n.call(null,r):"function"==typeof i[t]?i[t](r):i[t]=r,this}))}}).set("fontSize",(t=>{const n=e.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,[sr(n),or(n)])})).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").setAsync("imageMask",gI,r.createMask),r.words([...e]);const a=r.start(),[s,c]=n.size,l=[{x:0,y:0},{x:s,y:c}],{_bounds:u=l,_tags:f,hasImage:d}=a,h=f.map((t=>{var{x:e,y:n,font:r}=t,i=Oe(t,["x","y","font"]);return Object.assign(Object.assign({},i),{x:e+s/2,y:n+c/2,fontFamily:r})})),[{x:p,y:g},{x:m,y:y}]=u,v={text:"",value:0,opacity:0,fontSize:0};return h.push(Object.assign(Object.assign({},v),{x:d?0:p,y:d?0:g}),Object.assign(Object.assign({},v),{x:d?s:m,y:d?c:y})),h}));function yI(t){return"string"==typeof t?e=>e[t]:t}mI.props={};const vI=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=yI(s),l=yI(a),u=Hn(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)),{}))}))};vI.props={};const bI=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};bI.props={};var xI={exports:{}},wI={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}}(wI),function(t){var e=Math.log(2),n=t.exports,r=wI.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)}}}(xI);var MI=xI.exports;const OI=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(Wn(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=MI.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})}))}};OI.props={};const EI=()=>t=>(console.log("G2 data section:",t),t);function kI(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function SI(t,e){const[n,r]=t,[i,o]=e;return n>=i[0]&&n<=o[0]&&r>=i[1]&&r<=o[1]}EI.props={};const AI=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{vL(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]}(kI(e),kI(t.getLocalBounds()))));r?yL(t):n.push(t)})),t}};function _I([t,e],[n,r]){return r>t&&e>n}function TI(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function PI(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 CI=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]=TI(),[s,c]=TI(),[l,u]=TI(),[f,d]=TI();for(const e of t){const{min:t,max:n}=PI(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)=>kn(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])&&!_I(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 NI(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function LI(t,e,n){return.2126*NI(t)+.7152*NI(e)+.0722*NI(n)}function jI(t,e){const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=LI(n,r,i),l=LI(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function RI(t,e){const n=ar(e,(e=>jI(t,function(t){return"object"==typeof t?t:Bf(t)}(e))));return e[n]}const II=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;jI(t.parsedStyle.fill,r)<e&&t.attr("fill",RI(r,n))})),t)},BI=()=>t=>(t.forEach((t=>{vL(t);const e=t.attr("bounds"),n=function(t,e){const[n,r]=t;return!(SI(n,e)&&SI(r,e))}(kI(t.getLocalBounds()),e);n&&yL(t)})),t),DI=()=>(t,{canvas:e})=>{const{width:n,height:r}=e.getConfig();return t.forEach((t=>{vL(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 FI(){return{"data.fetch":DR,"data.inline":YR,"data.sortBy":VR,"data.sort":WR,"data.filter":GR,"data.pick":$R,"data.rename":HR,"data.fold":FR,"data.slice":bI,"data.custom":qR,"data.map":UR,"data.join":vI,"data.kde":OI,"data.log":EI,"data.wordCloud":mI,"transform.stackY":Hr,"transform.binX":Bs,"transform.bin":Is,"transform.dodgeX":pi,"transform.jitter":Ya,"transform.jitterX":qa,"transform.jitterY":Ua,"transform.symmetryY":Xa,"transform.diffY":Za,"transform.stackEnter":gi,"transform.normalizeY":mi,"transform.select":es,"transform.selectX":ns,"transform.selectY":rs,"transform.groupX":gs,"transform.groupY":ms,"transform.groupColor":ys,"transform.group":ps,"transform.sortX":xs,"transform.sortY":Ms,"transform.sortColor":ws,"transform.flexX":Os,"transform.pack":Ls,"transform.sample":Fs,"transform.filter":zs,"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":OM,"mark.rect":kM,"mark.line":TM,"mark.point":CM,"mark.text":LM,"mark.cell":RM,"mark.area":BM,"mark.link":FM,"mark.image":GM,"mark.polygon":$M,"mark.box":VM,"mark.vector":qM,"mark.lineX":KM,"mark.lineY":XM,"mark.connector":JM,"mark.range":rO,"mark.rangeX":oO,"mark.rangeY":sO,"mark.path":lO,"mark.shape":GO,"mark.density":HO,"mark.heatmap":YO,"mark.wordCloud":WO,"palette.category10":qO,"palette.category20":UO,"scale.linear":ZO,"scale.ordinal":KO,"scale.band":XO,"scale.identity":QO,"scale.point":JO,"scale.time":tE,"scale.log":eE,"scale.pow":nE,"scale.sqrt":aE,"scale.threshold":rE,"scale.quantile":iE,"scale.quantize":oE,"scale.sequential":sE,"scale.constant":cE,"theme.classic":dE,"theme.classicDark":gE,"theme.academy":yE,"theme.light":fE,"theme.dark":pE,"component.axisX":XE,"component.axisY":ZE,"component.legendCategory":nk,"component.legendContinuous":sk,"component.legends":Ak,"component.title":pk,"component.sliderX":Mk,"component.sliderY":Ok,"component.scrollbarX":kk,"component.scrollbarY":Sk,"animation.scaleInX":_k,"animation.scaleOutX":Tk,"animation.scaleInY":Pk,"animation.scaleOutY":Ck,"animation.waveIn":Yk,"animation.fadeIn":Nk,"animation.fadeOut":Lk,"animation.zoomIn":qk,"animation.zoomOut":Uk,"animation.pathIn":Xk,"animation.morphing":Vk,"animation.growInX":Zk,"animation.growInY":Kk,"interaction.elementHighlight":HL,"interaction.elementHighlightByX":VL,"interaction.elementHighlightByColor":YL,"interaction.elementSelect":UL,"interaction.elementSelectByX":XL,"interaction.elementSelectByColor":ZL,"interaction.fisheye":QL,"interaction.chartIndex":KL,"interaction.tooltip":mj,"interaction.legendFilter":Pj,"interaction.legendHighlight":Cj,"interaction.brushHighlight":zj,"interaction.brushXHighlight":Wj,"interaction.brushYHighlight":Hj,"interaction.brushAxisHighlight":tR,"interaction.brushFilter":eR,"interaction.brushXFilter":nR,"interaction.brushYFilter":rR,"interaction.sliderFilter":cR,"interaction.scrollbarFilter":uR,"interaction.poptip":pR,"interaction.treemapDrillDown":mR,"interaction.elementPointMove":_R,"composition.spaceLayer":h_,"composition.spaceFlex":p_,"composition.facetRect":P_,"composition.repeatMatrix":I_,"composition.facetCircle":W_,"composition.timingKeyframe":H_,"labelTransform.overlapHide":AI,"labelTransform.overlapDodgeY":CI,"labelTransform.overflowHide":BI,"labelTransform.contrastReverse":II,"labelTransform.exceedAdjust":DI}}function zI(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const GI={};const WI=t=>t?parseInt(t):0;function $I(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 HI{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 $I(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return $I(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return $I(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"],YI="__remove__",qI="__callback__";function UI(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function XI(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||WI(e.width),r=t.clientHeight||WI(e.height);return{width:n-(WI(e.paddingLeft)+WI(e.paddingRight)),height:r-(WI(e.paddingTop)+WI(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 ZI(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,UI(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===qI)e.children=t.value;else{const i=UI(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}function KI(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 QI(t,e,n){if("function"==typeof t){const e=new HI;return e.value=t,e.type=qI,e}const{type:r,children:i}=t,o=Oe(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 JI(t,e){const{type:n,children:r}=e,i=Oe(e,["type","children"]);t.type===n||void 0===n?_r(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function tB(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=QI(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 eB(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function nB(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 rB(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 iB(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(Sr(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 oB(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function aB(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function sB(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?eB(e,n,r):"array"===t?nB(e,n,r):"object"===t?rB(e,n,r):"node"===t?oB(e,n,r):"container"===t?aB(e,n,r):"mix"===t&&iB(e,n)}return e}}function cB(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const lB={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"}},uB=Object.assign(Object.assign({},lB),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),fB=Object.assign(Object.assign({},lB),{labelTransform:{type:"array"}});let dB=class extends HI{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()&&vL(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&yL(t)}};dB=Ee([sB(fB)],dB);let hB=class extends HI{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)}};hB=Ee([sB(uB)],hB);const pB="G2_CHART_KEY";class gB extends dB{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:o}=t;super(Oe(t,["container","canvas","renderer","plugins","lib"]),"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 JS,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[YI]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new rA,this._context={library:Object.assign(Object.assign({},o),GI),emitter:this._emitter,canvas:n},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)=>dL(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 ZI(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,KI(t,e,n,r,i)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){JI(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 tB(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(iA.BEFORE_CLEAR),this._reset(),hL(0,this._context,!1),this.emit(iA.AFTER_CLEAR)}destroy(){this.options();this.emit(iA.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),hL(0,this._context,!0),this._container[YI]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(iA.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=XI(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(iA.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(iA.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(iA.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(iA.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 hB{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 dB{constructor(){super({},e)}};return n=Ee([sB(cB(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))sB(cB(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=pB}=t,{width:n,height:r,depth:i}=XI(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}=XI(this.options(),this._container);this._plugins.push(new eA),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new hg({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 mB=zI(gB,Object.assign({},FI()));t.AREA_CLASS_NAME=oS,t.Academy=yE,t.Bin=Is,t.BinX=Bs,t.COMPONENT_CLASS_NAME=rS,t.Chart=mB,t.ChartEvent=iA,t.Classic=dE,t.ClassicDark=gE,t.Dark=pE,t.DiffY=Za,t.DodgeX=pi,t.ELEMENT_CLASS_NAME=tS,t.Filter=zs,t.FlexX=Os,t.Group=ps,t.GroupColor=ys,t.GroupX=gs,t.GroupY=ms,t.Jitter=Ya,t.JitterX=qa,t.JitterY=Ua,t.LABEL_CLASS_NAME=iS,t.LABEL_LAYER_CLASS_NAME=Jk,t.Light=fE,t.LinearAxis=qE,t.MAIN_LAYER_CLASS_NAME=Qk,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=ai,t.MaybeDefaultY=si,t.MaybeFunctionAttribute=fi,t.MaybeGradient=hi,t.MaybeIdentityX=oi,t.MaybeIdentityY=ii,t.MaybeKey=ti,t.MaybeSeries=ei,t.MaybeSize=Jr,t.MaybeStackY=Yr,t.MaybeTitle=Xr,t.MaybeTooltip=ci,t.MaybeTuple=di,t.MaybeTupleX=ri,t.MaybeTupleY=ni,t.MaybeVisualPosition=ui,t.MaybeZeroPadding=li,t.MaybeZeroX=Zr,t.MaybeZeroY=Kr,t.MaybeZeroY1=En,t.MaybeZeroZ=Qr,t.NormalizeY=mi,t.PLOT_CLASS_NAME=nS,t.Pack=Ls,t.Runtime=gB,t.Sample=Fs,t.Select=es,t.SelectX=ns,t.SelectY=rs,t.Selection=wm,t.SortColor=ws,t.SortX=xs,t.SortY=Ms,t.StackEnter=gi,t.StackY=Hr,t.SymmetryY=Xa,t.VIEW_CLASS_NAME=eS,t.corelib=FI,t.extend=zI,t.register=function(t,e){Object.assign(GI,{[t]:e})},t.render=dL,t.renderToMountedElement=function(t,e={},n=(()=>{}),r=(t=>{throw t})){var i;const{width:o=640,height:a=480}=t,s=uL(t),{group:c=new Vp,emitter:l=new rA,library:u}=e;(null==c?void 0:c.parentElement)||vr("renderToMountedElement can't render chart to unmounted group.");const f=xm(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(iA.BEFORE_RENDER),BN(Object.assign(Object.assign({},s),{width:o,height:a}),f,u,e).then((()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame((()=>{l.emit(iA.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),c},t.select=xm,Object.defineProperty(t,"__esModule",{value:!0})}));
|