@next-bricks/ai 1.12.0 → 1.13.0

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.
Files changed (35) hide show
  1. package/dist/bricks.json +1 -1
  2. package/dist/chunks/2159.d5f94a2b.js +2 -0
  3. package/dist/chunks/2159.d5f94a2b.js.map +1 -0
  4. package/dist/chunks/3680.a8cbb247.js +2 -0
  5. package/dist/chunks/3680.a8cbb247.js.map +1 -0
  6. package/dist/chunks/6645.f1ac9b65.js +2 -0
  7. package/dist/chunks/6645.f1ac9b65.js.map +1 -0
  8. package/dist/chunks/774.2a729ed1.js +2 -0
  9. package/dist/chunks/774.2a729ed1.js.map +1 -0
  10. package/dist/chunks/8035.aa4b47d2.js +2 -0
  11. package/dist/chunks/8035.aa4b47d2.js.map +1 -0
  12. package/dist/chunks/{9251.9ea61cce.js → 9251.cfa8f7ee.js} +2 -2
  13. package/dist/chunks/9251.cfa8f7ee.js.map +1 -0
  14. package/dist/chunks/{chat-view.aba622ce.js → chat-view.8f3d8244.js} +2 -2
  15. package/dist/chunks/chat-view.8f3d8244.js.map +1 -0
  16. package/dist/chunks/main.533bfdde.js +2 -0
  17. package/dist/chunks/main.533bfdde.js.map +1 -0
  18. package/dist/index.853c071a.js +2 -0
  19. package/dist/index.853c071a.js.map +1 -0
  20. package/dist-types/chat-view/components/MessageItem/Markdown/CodeBlock/Chart/index.d.ts +12 -0
  21. package/dist-types/chat-view/components/MessageItem/Markdown/CodeBlock/CustomComponent.d.ts +7 -0
  22. package/dist-types/chat-view/components/MessageItem/Markdown/CodeBlock/Table/index.d.ts +14 -0
  23. package/package.json +2 -2
  24. package/dist/chunks/4741.d4ae195b.js +0 -2
  25. package/dist/chunks/4741.d4ae195b.js.map +0 -1
  26. package/dist/chunks/7904.1bebf9f1.js +0 -2
  27. package/dist/chunks/7904.1bebf9f1.js.map +0 -1
  28. package/dist/chunks/9251.9ea61cce.js.map +0 -1
  29. package/dist/chunks/chat-view.aba622ce.js.map +0 -1
  30. package/dist/chunks/main.a8c08791.js +0 -2
  31. package/dist/chunks/main.a8c08791.js.map +0 -1
  32. package/dist/index.980a1db2.js +0 -2
  33. package/dist/index.980a1db2.js.map +0 -1
  34. package/dist-types/chat-view/components/MessageItem/Markdown/CodeBlock/InstanceList/Table.d.ts +0 -11
  35. package/dist-types/chat-view/components/MessageItem/Markdown/CodeBlock/InstanceList/index.d.ts +0 -8
@@ -0,0 +1,2 @@
1
+ (self.webpackChunk_next_bricks_ai=self.webpackChunk_next_bricks_ai||[]).push([[6645],{3976:function(t,e){!function(t){"use strict";function e(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{value:(t=t&&r>=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(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||0<e--)&&!(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 r(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))[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function i(t){return a(t,"Function")}var o={}.toString,a=function(t,e){return o.call(t)==="[object "+e+"]"},s=function(t){return Array.isArray?Array.isArray(t):a(t,"Array")},c=function(t){if("object"!=typeof(e=t)||null===e||!a(t,"Object"))return!1;var e;if(null===Object.getPrototypeOf(t))return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n},l=function(t){return a(t,"Number")},u=Object.values?function(t){return Object.values(t)}:function(t){var e,n=[],r=t,o=function(e,r){i(t)&&"prototype"===r||n.push(e)};if(r)if(s(r))for(var a=0,c=r.length;a<c&&!1!==o(r[a],a);a++);else if(e=typeof r,null!==r&&"object"==e||"function"==e)for(var l in r)if(r.hasOwnProperty(l)&&!1===o(r[l],l))break;return n};function f(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r+=1)!function t(e,n,r,i){for(var o in r=r||0,i=i||5,n){var a;n.hasOwnProperty(o)&&(null!==(a=n[o])&&c(a)?(c(e[o])||(e[o]={}),r<i?t(e[o],a,r+1,i):e[o]=n[o]):s(a)?(e[o]=[],e[o]=e[o].concat(a)):void 0!==a&&(e[o]=a))}}(t,e[r]);return t}function h(t){return t}!function(t,e){var n;if(i(t))return(n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o,a=e?e.apply(this,r):r[0],s=n.cache;return s.has(a)?s.get(a):(o=t.apply(this,r),s.set(a,o),o)}).cache=new Map;throw new TypeError("Expected a function")}((function(t,e){var n=(e=void 0===e?{}:e).fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle;return e=e.fontVariant,(d=d||document.createElement("canvas").getContext("2d")).font=[o,e,i,n+"px",r].join(" "),d.measureText(a(t,"String")?t:"").width}),(function(t,e){return function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}([t],u(e=void 0===e?{}:e)).join("")}));var d,p="undefined"!=typeof Float32Array?Float32Array:Array;function g(){var t=new p(9);return p!=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)});function y(){var t=new p(16);return p!=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 m(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):h}function v(t){return t instanceof Float32Array||t instanceof Array}function b(t,e,n){for(;t<e;)t+=2*Math.PI;for(;n<t;)t-=2*Math.PI;return t}function x(t,e,r,i,o){var a=(t=n(t,2))[0];return a=[a,t=t[1]],(t=g())[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=a[0],t[7]=a[1],t[8]=1,t}function O(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function w(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}T=new p(3),p!=Float32Array&&(T[0]=0,T[1]=0,T[2]=0),T=new p(4),p!=Float32Array&&(T[0]=0,T[1]=0,T[2]=0,T[3]=0);const M=Math.sqrt(50),E=Math.sqrt(10),k=Math.sqrt(2);function S(t,e,n){return n=(e=(e-t)/Math.max(0,n))/10**(t=Math.floor(Math.log(e)/Math.LN10)),0<=t?(n>=M?10:n>=E?5:n>=k?2:1)*10**t:-(10**-t)/(n>=M?10:n>=E?5:n>=k?2:1)}const P=(t,e,n=5)=>{let r,i=0,o=(t=[t,e]).length-1,a=t[i],s=t[o];return s<a&&([a,s]=[s,a],[i,o]=[o,i]),0<(r=S(a,s,n))?(a=Math.floor(a/r)*r,s=Math.ceil(s/r)*r,r=S(a,s,n)):r<0&&(a=Math.ceil(a*r)/r,s=Math.floor(s*r)/r,r=S(a,s,n)),0<r?(t[i]=Math.floor(a/r)*r,t[o]=Math.ceil(s/r)*r):r<0&&(t[i]=Math.ceil(a*r)/r,t[o]=Math.floor(s*r)/r),t};function _(t){return null!=t&&!Number.isNaN(t)}function A(t,e){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();var[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},n.prototype.initRange=function(){var e=this.options.interpolator;this.options.range=t(e)},n.prototype.composeOutput=function(t,n){var r,{domain:i,interpolator:o,round:a}=this.getOptions(),i=e(i.map(t)),a=a?(r=o,t=>(t=r(t),l(t)?Math.round(t):t)):o;this.output=O(a,i,n,t)},n.prototype.invert=void 0}}var j,T={exports:{}},C={exports:{}},N=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||0<=t.length&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))},L=Array.prototype.concat,R=Array.prototype.slice,I=C.exports=function(t){for(var e=[],n=0,r=t.length;n<r;n++){var i=t[n];N(i)?e=L.call(e,R.call(i)):e.push(i)}return e},z=(I.wrap=function(t){return function(){return t(I(arguments))}},{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]}),D=C.exports,B=Object.hasOwnProperty,F=Object.create(null);for(j in z)B.call(z,j)&&(F[z[j]]=j);var W=T.exports={to:{},get:{}};function $(t,e,n){return Math.min(Math.max(e,t),n)}function G(t){return(t=Math.round(t).toString(16).toUpperCase()).length<2?"0"+t:t}W.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=W.get.hsl(t),n="hsl";break;case"hwb":e=W.get.hwb(t),n="hwb";break;default:e=W.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},W.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,2+o),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);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]:B.call(z,e[1])?((i=z[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]=$(i[n],0,255);return i[3]=$(i[3],0,1),i},W.get.hsl=function(t){var e;return(t=t&&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*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,$(parseFloat(t[2]),0,100),$(parseFloat(t[3]),0,100),$(isNaN(e)?1:e,0,1)]):null},W.get.hwb=function(t){var e;return(t=t&&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*)?\)$/))?(e=parseFloat(t[4]),[(parseFloat(t[1])%360+360)%360,$(parseFloat(t[2]),0,100),$(parseFloat(t[3]),0,100),$(isNaN(e)?1:e,0,1)]):null},W.to.hex=function(){var t=D(arguments);return"#"+G(t[0])+G(t[1])+G(t[2])+(t[3]<1?G(Math.round(255*t[3])):"")},W.to.rgb=function(){var t=D(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]+")"},W.to.rgb.percent=function(){var t=D(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]+")"},W.to.hsl=function(){var t=D(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},W.to.hwb=function(){var t=D(arguments),e="";return 4<=t.length&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},W.to.keyword=function(t){return F[t.slice(0,3)]};var H=T.exports;function V(t,e,n){let r=n;return r<0&&(r+=1),1<r&&--r,r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function q(t){var e,n,r;return(t=H.get(t))?(({model:t,value:e}=t),"rgb"===t?e:"hsl"===t?(e=(t=e)[0]/360,n=t[1]/100,r=t[2]/100,t=t[3],0==n?[255*r,255*r,255*r,t]:[255*V(n=2*r-(r=r<.5?r*(1+n):r+n-r*n),r,e+1/3),255*V(n,r,e),255*V(n,r,e-1/3),t]):null):null}const X=(t,e)=>n=>t*(1-n)+e*n,Y=(t,e)=>{if("number"==typeof t&&"number"==typeof e)return X(t,e);if("string"!=typeof t||"string"!=typeof e)return()=>t;{var n=t,r=e;const i=q(n),o=q(r);return null===i||null===o?i?()=>n:()=>r:t=>{var e=new Array(4);for(let a=0;a<4;a+=1){var n=i[a],r=o[a];e[a]=n*(1-t)+r*t}var[a,s,c,l]=e;return`rgba(${Math.round(a)}, ${Math.round(s)}, ${Math.round(c)}, ${l})`}}},U=(t,e)=>{const n=X(t,e);return t=>Math.round(n(t))};function K({map:t,initKey:e},n){return e=e(n),t.has(e)?t.get(e):n}function Z(t){return"object"==typeof t?t.valueOf():t}class J extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Z,null!==t)for(var[e,n]of t)this.set(e,n)}get(t){return super.get(K({map:this.map,initKey:this.initKey},t))}has(t){return super.has(K({map:this.map,initKey:this.initKey},t))}set(t,e){return super.set(([{map:t,initKey:n},r]=[{map:this.map,initKey:this.initKey},t],n=n(r),t.has(n)?t.get(n):(t.set(n,r),r)),e);var n,r}delete(t){return super.delete(([{map:t,initKey:e},n]=[{map:this.map,initKey:this.initKey},t],e=e(n),t.has(e)&&(n=t.get(e),t.delete(e)),n));var e,n}}class Q{constructor(t){this.options=f({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=f({},this.options,t),this.rescale(t)}rescale(t){}}const tt=Symbol("defaultUnknown");function et(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function nt(t){var{value:t,from:e,to:n,mapper:r,notFoundReturn:i}=t;let o=r.get(t);if(void 0===o){if(i!==tt)return i;o=e.push(t)-1,r.set(t,o)}return n[o%n.length]}function rt(t){return t instanceof Date?t=>""+t:"object"==typeof t?t=>JSON.stringify(t):t=>t}class it extends Q{getDefaultOptions(){return{domain:[],range:[],unknown:tt}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&et(this.domainIndexMap,this.getDomain(),this.domainKey),nt({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&et(this.rangeIndexMap,this.getRange(),this.rangeKey),nt({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){var[e]=this.options.domain,[n]=this.options.range;this.domainKey=rt(e),this.rangeKey=rt(n),this.rangeIndexMap?(t&&!t.range||this.rangeIndexMap.clear(),t&&!t.domain&&!t.compare||(this.domainIndexMap.clear(),this.sortedDomain=void 0)):(this.rangeIndexMap=new Map,this.domainIndexMap=new Map)}clone(){return new it(this.options)}getRange(){return this.options.range}getDomain(){var t,e;return this.sortedDomain||(({domain:t,compare:e}=this.options),this.sortedDomain=e?[...t].sort(e):t),this.sortedDomain}}class ot extends it{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:tt,flex:[]}}constructor(t){super(t)}clone(){return new ot(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(){var{padding:t,paddingInner:e}=this.options;return 0<t?t:e}getPaddingOuter(){var{padding:t,paddingOuter:e}=this.options;return 0<t?t:e}rescale(){super.rescale();var{align:t,domain:e,range:n,round:r,flex:i}=this.options,{adjustedRange:t,valueBandWidth:n,valueStep:r}=function(t){var e=t.domain;if(0===(e=e.length))return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null!=(n=t.flex)&&n.length)return function(t){const{domain:e,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=t;var c,l=e.length,u=0<(u=(t=l)-(c=o).length)?[...c,...new Array(u).fill(1)]:u<0?c.slice(0,t):c,[t,c]=n;const f=(g=(c-=t)/(2/l*r+1-1/l*i))*i/l;g-=l*f;const h=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(u),d=g/h.reduce(((t,e)=>t+e));u=new J(e.map(((t,e)=>(e=h[e]*d,[t,a?Math.floor(e):e]))));var p=new J(e.map(((t,e)=>(e=h[e]*d+f,[t,a?Math.floor(e):e])))),g=Array.from(p.values()).reduce(((t,e)=>t+e));t+=(c-(g-g/l*i))*s;let y=a?Math.round(t):t;var m=new Array(l);for(let t=0;t<l;t+=1){m[t]=(v=y,Math.round(1e12*v)/1e12);var v=e[t];y+=p.get(v)}return{valueBandWidth:u,valueStep:p,adjustedRange:m}}(t);var{range:n,paddingOuter:t,paddingInner:r,round:i,align:o}=t;let a,s,c=n[0];return n=n[1]-c,a=n/Math.max(1,2*t+(e-r)),i&&(a=Math.floor(a)),c+=(n-a*(e-r))*o,s=a*(1-r),i&&(c=Math.round(c),s=Math.round(s)),t=new Array(e).fill(0).map(((t,e)=>c+e*a)),{valueStep:a,valueBandWidth:s,adjustedRange:t}}({align:t,range:n,round:r,flex:i,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=r,this.valueBandWidth=n,this.adjustedRange=t}}const at=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&0<n)return[o];let s=S(o,a,n);if(0===s||!Number.isFinite(s))return[];if(0<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}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},st=(t,e,n)=>{var[t,r]=t,[e,i]=e;let o,a;return O(a=t<r?(o=w(t,r),n(e,i)):(o=w(r,t),n(i,e)),o)},ct=(t,e,n)=>{const r=Math.min(t.length,e.length)-1,i=new Array(r),o=new Array(r);var 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]=w(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{var n=function(t,e,n,r,i){let o=1,a=r||t.length;for(var s=t=>t;o<a;){var c=Math.floor((o+a)/2);s(t[c])>e?a=c:o=c+1}return o}(t,e,0,r)-1,a=i[n];return O(o[n],a)(e)}},lt=(t,e,n,r)=>(2<Math.min(t.length,e.length)?ct:st)(t,e,r?U:n);class ut extends Q{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:X,tickCount:5}}map(t){return _(t)?this.output(t):this.options.unknown}invert(t){return _(t)?this.input(t):this.options.unknown}nice(){var t,e,n,r;this.options.nice&&([t,e,n,...r]=this.getTickMethodOptions(),this.options.domain=this.chooseNice()(t,e,n,...r))}getTicks(){var t=this.options.tickMethod,[e,n,r,...i]=this.getTickMethodOptions();return t(e,n,r,...i)}getTickMethodOptions(){var{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return P}rescale(){this.nice();var[t,e]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,e,this.chooseClamp(e))}chooseClamp(t){var{clamp:e,range:n}=this.options,n=(t=this.options.domain.map(t),Math.min(t.length,n.length));if(e){e=t[0];const r=(t=t[n-1])<e?t:e,i=t<e?e:t;return t=>Math.min(Math.max(r,t),i)}return h}composeOutput(t,e){var{domain:n,range:r,round:i,interpolate:o}=this.options,n=lt(n.map(t),r,o,i);this.output=O(n,e,t)}composeInput(t,e,n){var{domain:r,range:i}=this.options,i=lt(i,r.map(t),X);this.input=O(e,n,i)}}class ft extends ut{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:Y,tickMethod:at,tickCount:5}}chooseTransforms(){return[h,h]}clone(){return new ft(this.options)}}class ht extends ot{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:tt,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new ht(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}function dt(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}C=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var pt,gt,yt=dt(T=["January","February","March","April","May","June","July","August","September","October","November","December"],3);!function(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,a=i[r];for(o in a)t[o]=a[o]}}({},{dayNamesShort:dt(C,3),dayNames:C,monthNamesShort:yt,monthNames:T,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][3<t%10?0:(t-t%10!=10?1:0)*t%10]}});let mt=pt=class extends ft{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:h,tickMethod:at,tickCount:5}}constructor(t){super(t)}clone(){return new pt(this.options)}};mt=pt=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;0<=s;s--)(i=t[s])&&(a=(o<3?i(a):3<o?i(e,n,a):i(e,n))||a);return 3<o&&a&&Object.defineProperty(e,n,a),a}([A((function(t){return[t(0),t(1)]}),(t=>{var[t,e]=t;return O(X(0,1),w(t,e))}))],mt);let vt=gt=class extends ft{getDefaultOptions(){return{domain:[0,.5,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:h,tickMethod:at,tickCount:5}}constructor(t){super(t)}clone(){return new gt(this.options)}};function bt(t,e,r,i,o){var a=new ft({range:[e,e+i]}),s=new ft({range:[r,r+o]});return{transform:function(t){var e=(t=n(t,2))[0];return t=t[1],[a.map(e),s.map(t)]},untransform:function(t){var e=(t=n(t,2))[0];return t=t[1],[a.invert(e),s.invert(t)]}}}function xt(t,e,r,i,o){return(0,n(t,1)[0])(e,r,i,o)}function Ot(t,e,r,i,o){return n(t,1)[0]}function wt(t,e,r,i,o){var a=(t=n(t,4))[0],s=t[1],c=t[2],l=(t=t[3],new ft({range:[c,t]})),u=new ft({range:[a,s]}),f=1<(c=o/i)?1:c,h=1<c?1/c:1;return{transform:function(t){var e=(t=n(t,2))[0];return t=t[1],e=u.map(e),[(t=l.map(t))*Math.cos(e)*f*.5+.5,t*Math.sin(e)*h*.5+.5]},untransform:function(t){var e=(t=n(t,2))[0],r=(t=t[1],e=2*(e-.5)/f,t=2*(t-.5)/h,Math.sqrt(Math.pow(e,2)+Math.pow(t,2)));return t=b(Math.atan2(t,e),a,s),[u.invert(t),l.invert(r)]}}}function Mt(t,e,r,i,o){return{transform:function(t){var e=(t=n(t,2))[0];return[t[1],e]},untransform:function(t){var e=(t=n(t,2))[0];return[t[1],e]}}}function Et(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return jt.apply(void 0,r([[-1,-1]],n(e),!1))}function kt(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return jt.apply(void 0,r([[-1,1]],n(e),!1))}function St(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return jt.apply(void 0,r([[1,-1]],n(e),!1))}function Pt(t,e,r,i,o){t=n(t,1)[0];var a,s=g();return a=Math.sin(t),t=Math.cos(t),s[0]=t,s[1]=a,s[2]=0,s[3]=-a,s[4]=t,s[5]=0,s[6]=0,s[7]=0,s[8]=1,s}function _t(t,e,r,i,o){var a=(t=n(t,4))[0],s=t[1],c=t[2],l=(t[3]-c)/(+s/(2*Math.PI)+1),u=l/(2*Math.PI),f=new ft({range:[c,c+.99*l]}),h=new ft({range:[a,s]}),d=1<(t=o/i)?1:t,p=1<t?1/t:1;return{transform:function(t){var e=(t=n(t,2))[0];return t=t[1],e=h.map(e),t=f.map(t),[Math.cos(e)*(u*e+t)*d*.5+.5,Math.sin(e)*(u*e+t)*p*.5+.5]},untransform:function(t){var e=(t=n(t,2))[0],r=(t=t[1],e=2*(e-.5)/d,t=2*(t-.5)/p,Math.sqrt(Math.pow(e,2)+Math.pow(t,2)));return t=b(Math.atan2(t,e)+Math.floor(r/l)*Math.PI*2,a,s),e=r-u*t,[h.invert(t),f.invert(e)]}}}function At(t,e,r,i,o){var a=(t=n(t,4))[0],s=t[1],c=t[2],l=(t=t[3],new ft({range:[c,t]}));return{transform:function(t){for(var e=[],n=t.length,r=new ht({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);o=l.map(o),e.push(c,o)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(l.invert(r))}return e}}}vt=gt=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;0<=s;s--)(i=t[s])&&(a=(o<3?i(a):3<o?i(e,n,a):i(e,n))||a);return 3<o&&a&&Object.defineProperty(e,n,a),a}([A((function(t){return[t(0),t(.5),t(1)]}),(t=>{const[e,n,r]=t,i=O(X(0,.5),w(e,n)),o=O(X(.5,1),w(n,r));return t=>(e>r?t<n?o:i:t<n?i:o)(t)}))],vt);var jt=function(t,e,r,i,o){var a=(t=n(t,2))[0];return a=[a,t=t[1]],(t=g())[0]=a[0],t[1]=0,t[2]=0,t[3]=0,t[4]=a[1],t[5]=0,t[6]=0,t[7]=0,t[8]=1,t};function Tt(t){return 1/Math.tan(t)}function Ct(t,e,r,i,o){var a=Tt(n(t,1)[0]);return{transform:function(t){return[(t=n(t,2))[0]+(t=t[1])*a,t]},untransform:function(t){return[(t=n(t,2))[0]-(t=t[1])*a,t]}}}function Nt(t,e,r,i,o){var a=Tt(n(t,1)[0]);return{transform:function(t){var e=(t=n(t,2))[0];return[e,t[1]+e*a]},untransform:function(t){var e=(t=n(t,2))[0];return[e,t[1]-e*a]}}}function Lt(t,e,n,r,i){var o=t<e;return i=(o?e-r:i-e)||i-r,(r=o?-1:1)*i*(n+1)/(n+i/((t-e)*r))+e}function Rt(t,e,n,r,i){var o=t<e;return(i=(o?e-r:i-e)||i-r)/(i*(n+1)/(t-e)-n*(o?-1:1))+e}function It(t,e,n){return n?new ft({range:[0,1],domain:[0,e]}).map(t):t}function zt(t,e,r,i,o){var a=(t=n(t,3))[0],s=t[1],c=It(a,i,void 0!==(t=t[2])&&t);return{transform:function(t){var e=(t=n(t,2))[0];return t=t[1],[Lt(e,c,s,0,1),t]},untransform:function(t){var e=(t=n(t,2))[0];return t=t[1],[Rt(e,c,s,0,1),t]}}}function Dt(t,e,r,i,o){var a=(t=n(t,3))[0],s=t[1],c=It(a,o,void 0!==(t=t[2])&&t);return{transform:function(t){return[(t=n(t,2))[0],Lt(t[1],c,s,0,1)]},untransform:function(t){return[(t=n(t,2))[0],Rt(t[1],c,s,0,1)]}}}function Bt(t,e,r,i,o){var a=(t=n(t,5))[0],s=t[1],c=t[2],l=t[3],u=It(a,i,t=void 0!==(t=t[4])&&t),f=It(s,o,t);return{transform:function(t){var e=(t=n(t,2))[0];return t=t[1],[Lt(e,u,c,0,1),Lt(t,f,l,0,1)]},untransform:function(t){var e=(t=n(t,2))[0];return t=t[1],[Rt(e,u,c,0,1),Rt(t,f,l,0,1)]}}}function Ft(t,e,r,i,o){var a=(t=n(t,5))[0],s=t[1],c=t[2],l=t[3],u=(t=void 0!==(t=t[4])&&t,new ft({range:[0,i]})),f=new ft({range:[0,o]}),h=t?a:u.map(a),d=t?s:f.map(s);return{transform:function(t){var e=(t=n(t,2))[0],r=(t=t[1],u.map(e)-h),i=f.map(t)-d,o=Math.sqrt(r*r+i*i);return c<o?[e,t]:(e=Lt(o,0,l,0,c),t=Math.atan2(i,r),o=h+e*Math.cos(t),i=d+e*Math.sin(t),[u.invert(o),f.invert(i)])},untransform:function(t){var e=(t=n(t,2))[0],r=(t=t[1],u.map(e)-h),i=f.map(t)-d,o=Math.sqrt(r*r+i*i);return c<o?[e,t]:(e=Rt(o,0,l,0,c),t=Math.atan2(i,r),o=h+e*Math.cos(t),i=d+e*Math.sin(t),[u.invert(o),f.invert(i)])}}}function Wt(t,e,r,i,o,a,s){var c=new ft({range:[e,e+o]}),l=new ft({range:[r,r+a]}),u=new ft({range:[i,i+s]});return{transform:function(t){var e=(t=n(t,3))[0],r=t[1];return t=t[2],[c.map(e),l.map(r),u.map(t)]},untransform:function(t){var e=(t=n(t,3))[0],r=t[1];return t=t[2],[c.invert(e),l.invert(r),u.invert(t)]}}}function $t(t,e,r,i,o,a,s){var c,l=(t=n(t,3))[0];return l=[l,t[1],t=t[2]],(c=y())[0]=1,c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=1,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=1,c[11]=0,c[12]=l[0],c[13]=l[1],c[14]=l[2],c[15]=1,c}function Gt(t,e,r,i,o,a,s){return{transform:function(t){var e=(t=n(t,3))[0];return[t[1],e,t[2]]},untransform:function(t){var e=(t=n(t,3))[0];return[t[1],e,t[2]]}}}function Ht(t,e,r,i,o,a,s){var c,l=(t=n(t,3))[0];return l=[l,t[1],t=t[2]],(c=y())[0]=l[0],c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[5]=l[1],c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[10]=l[2],c[11]=0,c[12]=0,c[13]=0,c[14]=0,c[15]=1,c}function Vt(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:bt,translate:x,custom:xt,matrix:Ot,polar:wt,transpose:Mt,scale:jt,"shear.x":Ct,"shear.y":Nt,reflect:Et,"reflect.x":kt,"reflect.y":St,rotate:Pt,helix:_t,parallel:At,fisheye:Bt,"fisheye.x":zt,"fisheye.y":Dt,"fisheye.circular":Ft},this.update(t)}function qt(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:Wt,translate3D:$t,scale3D:Ht,transpose3D:Gt},this.update(t)}Vt.prototype.update=function(t){this.options=f({},this.options,t),this.recoordinate()},Vt.prototype.clone=function(){return new Vt(this.options)},Vt.prototype.getOptions=function(){return this.options},Vt.prototype.clear=function(){this.update({transformations:[]})},Vt.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},Vt.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},Vt.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=this.options.transformations;return this.update({transformations:r(r([],n(i),!1),[r([],n(t),!1)],!1)}),this},Vt.prototype.map=function(t){return this.output(t)},Vt.prototype.invert=function(t){return this.input(t)},Vt.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},Vt.prototype.compose=function(t){function i(t,e){var i;u.push((e=void 0===e||e)?(i=t,function(t){for(var e=[],o=0;o<t.length-1;o+=2){var a=[t[o],t[o+1]];a=i(a),e.push.apply(e,r([],n(a),!1))}return e}):t)}var o,a,s=(t=void 0!==t&&t)?r([],n(this.options.transformations),!1).reverse():this.options.transformations,c=t?function(t){return t.untransform}:function(t){return t.transform},l=[],u=[];try{for(var f=e(s),d=f.next();!d.done;d=f.next()){var p,g,y,b,x,O,w=n(d.value),M=w[0],E=w.slice(1),k=this.transformers[M];k&&(g=(p=this.options).x,y=p.y,b=p.width,x=p.height,v(O=k(r([],n(E),!1),g,y,b,x))?l.push(O):(l.length&&(i(this.createMatrixTransform(l,t)),l.splice(0,l.length)),i(c(O)||h,"parallel"!==M)))}}catch(t){o={error:t}}finally{try{d&&!d.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}return l.length&&i(this.createMatrixTransform(l,t)),m.apply(void 0,r([],n(u),!1))},Vt.prototype.createMatrixTransform=function(t,e){var n,r,i,o,a,s,c,l,u,f,h,d,y=g();return e&&t.reverse(),t.forEach((function(t){return 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=e[8],n[0]),h=n[1],d=n[2],p=n[3],g=n[4],y=n[5],m=n[6],v=n[7];return n=n[8],t[0]=f*r+h*a+d*l,t[1]=f*i+h*s+d*u,t[2]=f*o+h*c+d*e,t[3]=p*r+g*a+y*l,t[4]=p*i+g*s+y*u,t[5]=p*o+g*c+y*e,t[6]=m*r+v*a+n*l,t[7]=m*i+v*s+n*u,t[8]=m*o+v*c+n*e,t}(y,y,t)})),e&&(e=t=y,(d=new p(9))[0]=e[0],d[1]=e[1],d[2]=e[2],d[3]=e[3],d[4]=e[4],d[5]=e[5],d[6]=e[6],d[7]=e[7],d[8]=e[8],d=(e=d)[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],h=d*(l=(e=e[8])*o-a*c)+n*(u=-e*i+a*s)+r*(f=c*i-o*s))&&(t[0]=l*(h=1/h),t[1]=(-e*n+r*c)*h,t[2]=(a*n-r*o)*h,t[3]=u*h,t[4]=(e*d-r*s)*h,t[5]=(-a*d+r*i)*h,t[6]=f*h,t[7]=(-c*d+n*s)*h,t[8]=(o*d-n*i)*h),function(t){var e,n,r,i,o;return t=[t[0],t[1],1],r=y,i=(n=e=t)[0],o=n[1],n=n[2],e[0]=i*r[0]+o*r[3]+n*r[6],e[1]=i*r[1]+o*r[4]+n*r[7],e[2]=i*r[2]+o*r[5]+n*r[8],[t[0],t[1]]}},C=Vt,qt.prototype.update=function(t){this.options=f({},this.options,t),this.recoordinate()},qt.prototype.clone=function(){return new qt(this.options)},qt.prototype.getOptions=function(){return this.options},qt.prototype.clear=function(){this.update({transformations:[]})},qt.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},qt.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]},qt.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=this.options.transformations;return this.update({transformations:r(r([],n(i),!1),[r([],n(t),!1)],!1)}),this},qt.prototype.map=function(t){return this.output(t)},qt.prototype.invert=function(t){return this.input(t)},qt.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},qt.prototype.compose=function(t){function i(t,e){var i;u.push((e=void 0===e||e)?(i=t,function(t){for(var e=[],o=0;o<t.length-1;o+=3){var a=[t[o],t[o+1],t[o+2]];a=i(a),e.push.apply(e,r([],n(a),!1))}return e}):t)}var o,a,s=(t=void 0!==t&&t)?r([],n(this.options.transformations),!1).reverse():this.options.transformations,c=t?function(t){return t.untransform}:function(t){return t.transform},l=[],u=[];try{for(var f=e(s),d=f.next();!d.done;d=f.next()){var p,g,y,b,x,O,w,M,E=n(d.value),k=E[0],S=E.slice(1),P=this.transformers[k];P&&(g=(p=this.options).x,y=p.y,b=p.z,x=p.width,O=p.height,w=p.depth,v(M=P(r([],n(S),!1),g,y,b,x,O,w))?l.push(M):(l.length&&(i(this.createMatrixTransform(l,t)),l.splice(0,l.length)),i(c(M)||h,!0)))}}catch(t){o={error:t}}finally{try{d&&!d.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}return l.length&&i(this.createMatrixTransform(l,t)),m.apply(void 0,r([],n(u),!1))},qt.prototype.createMatrixTransform=function(t,e){var n,r,i,o,a,s,c,l,u,f,h,d,g,m,v,b,x,O,w,M,E,k,S,P,_,A,j,T,C=y();return e&&t.reverse(),t.forEach((function(t){return function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],y=e[13],m=e[14],v=(e=e[15],n[0]),b=n[1],x=n[2],O=n[3];return t[0]=v*r+b*s+x*f+O*g,t[1]=v*i+b*c+x*h+O*y,t[2]=v*o+b*l+x*d+O*m,t[3]=v*a+b*u+x*p+O*e,v=n[4],b=n[5],x=n[6],O=n[7],t[4]=v*r+b*s+x*f+O*g,t[5]=v*i+b*c+x*h+O*y,t[6]=v*o+b*l+x*d+O*m,t[7]=v*a+b*u+x*p+O*e,v=n[8],b=n[9],x=n[10],O=n[11],t[8]=v*r+b*s+x*f+O*g,t[9]=v*i+b*c+x*h+O*y,t[10]=v*o+b*l+x*d+O*m,t[11]=v*a+b*u+x*p+O*e,v=n[12],b=n[13],x=n[14],O=n[15],t[12]=v*r+b*s+x*f+O*g,t[13]=v*i+b*c+x*h+O*y,t[14]=v*o+b*l+x*d+O*m,t[15]=v*a+b*u+x*p+O*e,t}(C,C,t)})),e&&(e=t=C,(T=new p(16))[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=(e=T)[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],f=e[10],h=e[11],d=e[12],g=e[13],m=e[14],j=(v=T*a-n*o)*(A=f*(e=e[15])-h*m)-(b=T*s-r*o)*(_=u*e-h*g)+(x=T*c-i*o)*(P=u*m-f*g)+(O=n*s-r*a)*(S=l*e-h*d)-(w=n*c-i*a)*(k=l*m-f*d)+(M=r*c-i*s)*(E=l*g-u*d))&&(t[0]=(a*A-s*_+c*P)*(j=1/j),t[1]=(r*_-n*A-i*P)*j,t[2]=(g*M-m*w+e*O)*j,t[3]=(f*w-u*M-h*O)*j,t[4]=(s*S-o*A-c*k)*j,t[5]=(T*A-r*S+i*k)*j,t[6]=(m*x-d*M-e*b)*j,t[7]=(l*M-f*x+h*b)*j,t[8]=(o*_-a*S+c*E)*j,t[9]=(n*S-T*_-i*E)*j,t[10]=(d*w-g*x+e*v)*j,t[11]=(u*x-l*w-h*v)*j,t[12]=(a*k-o*P-s*E)*j,t[13]=(T*P-n*k+r*E)*j,t[14]=(g*b-d*O-m*v)*j,t[15]=(l*O-u*b+f*v)*j),function(t){var e,n,r,i,o,a;return t=[t[0],t[1],t[2],1],r=C,i=(n=e=t)[0],o=n[1],a=n[2],n=n[3],e[0]=r[0]*i+r[4]*o+r[8]*a+r[12]*n,e[1]=r[1]*i+r[5]*o+r[9]*a+r[13]*n,e[2]=r[2]*i+r[6]*o+r[10]*a+r[14]*n,e[3]=r[3]*i+r[7]*o+r[11]*a+r[15]*n,[t[0],t[1],t[2]]}},yt=qt,t.Coordinate=C,t.Coordinate3D=yt,Object.defineProperty(t,"__esModule",{value:!0})}(e)},8715:t=>{"use strict";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 h,d=u.length;for(l=0;l<d;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(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];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},6645:(t,e,n)=>{"use strict";n.d(e,{t1:()=>m$});var r={};n.r(r),n.d(r,{add:()=>Ce,adjoint:()=>Zt,clone:()=>Ht,copy:()=>Vt,create:()=>Gt,determinant:()=>Jt,equals:()=>ze,exactEquals:()=>Ie,frob:()=>Te,fromQuat:()=>be,fromQuat2:()=>de,fromRotation:()=>ce,fromRotationTranslation:()=>he,fromRotationTranslationScale:()=>me,fromRotationTranslationScaleOrigin:()=>ve,fromScaling:()=>se,fromTranslation:()=>ae,fromValues:()=>qt,fromXRotation:()=>le,fromYRotation:()=>ue,fromZRotation:()=>fe,frustum:()=>xe,getRotation:()=>ye,getScaling:()=>ge,getTranslation:()=>pe,identity:()=>Yt,invert:()=>Kt,lookAt:()=>_e,mul:()=>De,multiply:()=>Qt,multiplyScalar:()=>Le,multiplyScalarAndAdd:()=>Re,ortho:()=>Se,orthoNO:()=>ke,orthoZO:()=>Pe,perspective:()=>we,perspectiveFromFieldOfView:()=>Ee,perspectiveNO:()=>Oe,perspectiveZO:()=>Me,rotate:()=>ne,rotateX:()=>re,rotateY:()=>ie,rotateZ:()=>oe,scale:()=>ee,set:()=>Xt,str:()=>je,sub:()=>Be,subtract:()=>Ne,targetTo:()=>Ae,translate:()=>te,transpose:()=>Ut});var i={};n.r(i),n.d(i,{geoAlbers:()=>QT,geoAlbersUsa:()=>tC,geoAzimuthalEqualArea:()=>iC,geoAzimuthalEqualAreaRaw:()=>rC,geoAzimuthalEquidistant:()=>aC,geoAzimuthalEquidistantRaw:()=>oC,geoConicConformal:()=>hC,geoConicConformalRaw:()=>fC,geoConicEqualArea:()=>JT,geoConicEqualAreaRaw:()=>ZT,geoConicEquidistant:()=>yC,geoConicEquidistantRaw:()=>gC,geoEqualEarth:()=>MC,geoEqualEarthRaw:()=>wC,geoEquirectangular:()=>pC,geoEquirectangularRaw:()=>dC,geoGnomonic:()=>kC,geoGnomonicRaw:()=>EC,geoIdentity:()=>SC,geoMercator:()=>cC,geoMercatorRaw:()=>sC,geoNaturalEarth1:()=>_C,geoNaturalEarth1Raw:()=>PC,geoOrthographic:()=>jC,geoOrthographicRaw:()=>AC,geoProjection:()=>YT,geoProjectionMutator:()=>UT,geoStereographic:()=>CC,geoStereographicRaw:()=>TC,geoTransverseMercator:()=>LC,geoTransverseMercatorRaw:()=>NC});var o={};n.r(o),n.d(o,{frequency:()=>FL,id:()=>WL,name:()=>$L,weight:()=>BL});var a={};n.r(a),n.d(a,{area:()=>UI,bottom:()=>rz,bottomLeft:()=>rz,bottomRight:()=>rz,inside:()=>rz,left:()=>rz,outside:()=>sz,right:()=>rz,spider:()=>lz,surround:()=>fz,top:()=>rz,topLeft:()=>rz,topRight:()=>rz});var s={};n.r(s),n.d(s,{interpolateBlues:()=>dB,interpolateBrBG:()=>kD,interpolateBuGn:()=>GD,interpolateBuPu:()=>VD,interpolateCividis:()=>EB,interpolateCool:()=>WB,interpolateCubehelixDefault:()=>BB,interpolateGnBu:()=>XD,interpolateGreens:()=>gB,interpolateGreys:()=>mB,interpolateInferno:()=>JB,interpolateMagma:()=>ZB,interpolateOrRd:()=>UD,interpolateOranges:()=>MB,interpolatePRGn:()=>PD,interpolatePiYG:()=>AD,interpolatePlasma:()=>QB,interpolatePuBu:()=>QD,interpolatePuBuGn:()=>ZD,interpolatePuOr:()=>TD,interpolatePuRd:()=>eB,interpolatePurples:()=>bB,interpolateRainbow:()=>GB,interpolateRdBu:()=>ND,interpolateRdGy:()=>RD,interpolateRdPu:()=>rB,interpolateRdYlBu:()=>zD,interpolateRdYlGn:()=>BD,interpolateReds:()=>OB,interpolateSinebow:()=>XB,interpolateSpectral:()=>WD,interpolateTurbo:()=>YB,interpolateViridis:()=>KB,interpolateWarm:()=>FB,interpolateYlGn:()=>sB,interpolateYlGnBu:()=>oB,interpolateYlOrBr:()=>lB,interpolateYlOrRd:()=>fB,schemeAccent:()=>Sz,schemeBlues:()=>hB,schemeBrBG:()=>ED,schemeBuGn:()=>$D,schemeBuPu:()=>HD,schemeCategory10:()=>kz,schemeDark2:()=>Pz,schemeGnBu:()=>qD,schemeGreens:()=>pB,schemeGreys:()=>yB,schemeObservable10:()=>_z,schemeOrRd:()=>YD,schemeOranges:()=>wB,schemePRGn:()=>SD,schemePaired:()=>Az,schemePastel1:()=>jz,schemePastel2:()=>Tz,schemePiYG:()=>_D,schemePuBu:()=>JD,schemePuBuGn:()=>KD,schemePuOr:()=>jD,schemePuRd:()=>tB,schemePurples:()=>vB,schemeRdBu:()=>CD,schemeRdGy:()=>LD,schemeRdPu:()=>nB,schemeRdYlBu:()=>ID,schemeRdYlGn:()=>DD,schemeReds:()=>xB,schemeSet1:()=>Cz,schemeSet2:()=>Nz,schemeSet3:()=>Lz,schemeSpectral:()=>FD,schemeTableau10:()=>Rz,schemeYlGn:()=>aB,schemeYlGnBu:()=>iB,schemeYlOrBr:()=>cB,schemeYlOrRd:()=>uB});const c=()=>[["cartesian"]];c.props={};const l=(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},u=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=l(t);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",e,n,r,i]]};u.props={};const f=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];f.props={transform:!0};const h=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=((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],...u({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};h.props={};const d=()=>[["parallel",0,1,0,1]];d.props={};const p=({focusX:t=0,focusY:e=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",t,e,n,r,i]];p.props={transform:!0};const g=(t={})=>{const e={startAngle:-Math.PI/2,endAngle:3*Math.PI/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},e),t)},y=t=>{const{startAngle:e,endAngle:n,innerRadius:r,outerRadius:i}=g(t);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...u({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};y.props={};const m=t=>{const{startAngle:e=-Math.PI/2,endAngle:n=3*Math.PI/2,innerRadius:r=0,outerRadius:i=1}=t;return[["parallel",0,1,0,1],...u({startAngle:e,endAngle:n,innerRadius:r,outerRadius:i})]};m.props={};const v=({value:t})=>e=>e.map((()=>t));v.props={};const b=({value:t})=>e=>e.map((e=>e[t]));b.props={};const x=({value:t})=>e=>e.map(t);x.props={};const O=({value:t})=>()=>t;O.props={};var w={}.toString;const M=function(t,e){return w.call(t)==="[object "+e+"]"},E=function(t){return Array.isArray?Array.isArray(t):M(t,"Array")},k=function(t){return"object"==typeof t&&null!==t},S=function(t){if(!k(t)||!M(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 P(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 _(t,e,n,r){for(var i in n=n||0,r=r||5,e)if(P(e,i)){var o=e[i];null!==o&&S(o)?(S(t[i])||(t[i]={}),n<r?_(t[i],o,n+1,r):t[i]=e[i]):E(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}const A=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)_(t,e[r]);return t};function j(t,e){if(null!==t)return{type:"column",value:t,field:e}}function T(t,e){const n=j(t,e);return Object.assign(Object.assign({},n),{inferred:!0})}function C(t,e){if(null!==t)return{type:"column",value:t,field:e,visual:!0}}function N(t,e){const n=j(t,e);return Object.assign(Object.assign({},n),{constant:!1})}function L(t,e){const n=[];for(const r of t)n[r]=e;return n}function R(t,e){const n=t[e];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function I(t,...e){for(const n of e){if("string"!=typeof n)return[n,null];{const[e,r]=R(t,n);if(null!==e)return[e,r]}}return[null,null]}function z(t){return!(t instanceof Date)&&"object"==typeof t}const D=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;return void 0!==r?[t,e]:[t,A({},e,{encode:{y1:T(L(t,0))}})]};D.props={};const B=()=>(t,e)=>{const{encode:n}=e,{x:r}=n;return void 0!==r?[t,e]:[t,A({},e,{encode:{x:T(L(t,0))},scale:{x:{guide:null}}})]};function F(t){return function(){return t}}B.props={};const W=Math.abs,$=Math.atan2,G=Math.cos,H=Math.max,V=Math.min,q=Math.sin,X=Math.sqrt,Y=1e-12,U=Math.PI,K=U/2,Z=2*U;function J(t){return t>=1?K:t<=-1?-K:Math.asin(t)}const Q=Math.PI,tt=2*Q,et=1e-6,nt=tt-et;function rt(t){this._+=t[0];for(let e=1,n=t.length;e<n;++e)this._+=arguments[e]+t[e]}class it{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==t?rt:function(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return rt;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>et)if(Math.abs(u*s-c*l)>et&&i){let h=n-o,d=r-a,p=s*s+c*c,g=h*h+d*d,y=Math.sqrt(p),m=Math.sqrt(f),v=i*Math.tan((Q-Math.acos((p+f-g)/(2*y*m)))/2),b=v/m,x=v/y;Math.abs(b-1)>et&&this._append`L${t+b*l},${e+b*u}`,this._append`A${i},${i},0,0,${+(u*h>l*d)},${this._x1=t+x*s},${this._y1=e+x*c}`}else this._append`L${this._x1=t},${this._y1=e}`}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)>et||Math.abs(this._y1-l)>et)&&this._append`L${c},${l}`,n&&(f<0&&(f=f%tt+tt),f>nt?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>et&&this._append`A${n},${n},0,${+(f>=Q)},${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 ot(){return new it}function at(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 it(e)}function st(t){return t.innerRadius}function ct(t){return t.outerRadius}function lt(t){return t.startAngle}function ut(t){return t.endAngle}function ft(t){return t&&t.padAngle}function ht(t,e,n,r,i,o,a){var s=t-n,c=e-r,l=(a?o:-o)/X(s*s+c*c),u=l*c,f=-l*s,h=t+u,d=e+f,p=n+u,g=r+f,y=(h+p)/2,m=(d+g)/2,v=p-h,b=g-d,x=v*v+b*b,O=i-o,w=h*g-p*d,M=(b<0?-1:1)*X(H(0,O*O*x-w*w)),E=(w*b-v*M)/x,k=(-w*v-b*M)/x,S=(w*b+v*M)/x,P=(-w*v+b*M)/x,_=E-y,A=k-m,j=S-y,T=P-m;return _*_+A*A>j*j+T*T&&(E=S,k=P),{cx:E,cy:k,x01:-u,y01:-f,x11:E*(i/O-1),y11:k*(i/O-1)}}function dt(){var t=st,e=ct,n=F(0),r=null,i=lt,o=ut,a=ft,s=null,c=at(l);function l(){var l,u,f,h=+t.apply(this,arguments),d=+e.apply(this,arguments),p=i.apply(this,arguments)-K,g=o.apply(this,arguments)-K,y=W(g-p),m=g>p;if(s||(s=l=c()),d<h&&(u=d,d=h,h=u),d>Y)if(y>Z-Y)s.moveTo(d*G(p),d*q(p)),s.arc(0,0,d,p,g,!m),h>Y&&(s.moveTo(h*G(g),h*q(g)),s.arc(0,0,h,g,p,m));else{var v,b,x=p,O=g,w=p,M=g,E=y,k=y,S=a.apply(this,arguments)/2,P=S>Y&&(r?+r.apply(this,arguments):X(h*h+d*d)),_=V(W(d-h)/2,+n.apply(this,arguments)),A=_,j=_;if(P>Y){var T=J(P/h*q(S)),C=J(P/d*q(S));(E-=2*T)>Y?(w+=T*=m?1:-1,M-=T):(E=0,w=M=(p+g)/2),(k-=2*C)>Y?(x+=C*=m?1:-1,O-=C):(k=0,x=O=(p+g)/2)}var N=d*G(x),L=d*q(x),R=h*G(M),I=h*q(M);if(_>Y){var z,D=d*G(O),B=d*q(O),F=h*G(w),H=h*q(w);if(y<U)if(z=function(t,e,n,r,i,o,a,s){var c=n-t,l=r-e,u=a-i,f=s-o,h=f*c-u*l;if(!(h*h<Y))return[t+(h=(u*(e-o)-f*(t-i))/h)*c,e+h*l]}(N,L,F,H,D,B,R,I)){var Q=N-z[0],tt=L-z[1],et=D-z[0],nt=B-z[1],rt=1/q(((f=(Q*et+tt*nt)/(X(Q*Q+tt*tt)*X(et*et+nt*nt)))>1?0:f<-1?U:Math.acos(f))/2),it=X(z[0]*z[0]+z[1]*z[1]);A=V(_,(h-it)/(rt-1)),j=V(_,(d-it)/(rt+1))}else A=j=0}k>Y?j>Y?(v=ht(F,H,N,L,d,j,m),b=ht(D,B,R,I,d,j,m),s.moveTo(v.cx+v.x01,v.cy+v.y01),j<_?s.arc(v.cx,v.cy,j,$(v.y01,v.x01),$(b.y01,b.x01),!m):(s.arc(v.cx,v.cy,j,$(v.y01,v.x01),$(v.y11,v.x11),!m),s.arc(0,0,d,$(v.cy+v.y11,v.cx+v.x11),$(b.cy+b.y11,b.cx+b.x11),!m),s.arc(b.cx,b.cy,j,$(b.y11,b.x11),$(b.y01,b.x01),!m))):(s.moveTo(N,L),s.arc(0,0,d,x,O,!m)):s.moveTo(N,L),h>Y&&E>Y?A>Y?(v=ht(R,I,D,B,h,-A,m),b=ht(N,L,F,H,h,-A,m),s.lineTo(v.cx+v.x01,v.cy+v.y01),A<_?s.arc(v.cx,v.cy,A,$(v.y01,v.x01),$(b.y01,b.x01),!m):(s.arc(v.cx,v.cy,A,$(v.y01,v.x01),$(v.y11,v.x11),!m),s.arc(0,0,h,$(v.cy+v.y11,v.cx+v.x11),$(b.cy+b.y11,b.cx+b.x11),m),s.arc(b.cx,b.cy,A,$(b.y11,b.x11),$(b.y01,b.x01),!m))):s.arc(0,0,h,M,w,m):s.lineTo(R,I)}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-U/2;return[G(r)*n,q(r)*n]},l.innerRadius=function(e){return arguments.length?(t="function"==typeof e?e:F(+e),l):t},l.outerRadius=function(t){return arguments.length?(e="function"==typeof t?t:F(+t),l):e},l.cornerRadius=function(t){return arguments.length?(n="function"==typeof t?t:F(+t),l):n},l.padRadius=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:F(+t),l):r},l.startAngle=function(t){return arguments.length?(i="function"==typeof t?t:F(+t),l):i},l.endAngle=function(t){return arguments.length?(o="function"==typeof t?t:F(+t),l):o},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:F(+t),l):a},l.context=function(t){return arguments.length?(s=null==t?null:t,l):s},l}function pt(t){const{transformations:e}=t.getOptions();return e.map((([t])=>t)).filter((t=>"transpose"===t)).length%2!=0}function gt(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"polar"===t))}function yt(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"reflect"===t))&&e.some((([t])=>t.startsWith("transpose")))}function mt(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"helix"===t))}function vt(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"parallel"===t))}function bt(t){const{transformations:e}=t.getOptions();return e.some((([t])=>"fisheye"===t))}function xt(t){return mt(t)||gt(t)}function Ot(t){const{transformations:e}=t.getOptions(),[,,,n,r]=e.find((t=>"polar"===t[0]));return[+n,+r]}function wt(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]}ot.prototype=it.prototype;var Mt=n(5608);const Et=n(8715);var kt=1e-6,St="undefined"!=typeof Float32Array?Float32Array:Array;function Pt(){var t=new St(3);return St!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function _t(t){var e=new St(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function At(t){var e=t[0],n=t[1],r=t[2];return Math.hypot(e,n,r)}function jt(t,e,n){var r=new St(3);return r[0]=t,r[1]=e,r[2]=n,r}function Tt(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Ct(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function Nt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Lt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Rt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function It(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 zt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Dt(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 Bt(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 Ft(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)<=kt*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=kt*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=kt*Math.max(1,Math.abs(i),Math.abs(s))}Math.random,Math.PI,Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Wt=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)},$t=At;function Gt(){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 Ht(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 Vt(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 qt(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g){var y=new St(16);return y[0]=t,y[1]=e,y[2]=n,y[3]=r,y[4]=i,y[5]=o,y[6]=a,y[7]=s,y[8]=c,y[9]=l,y[10]=u,y[11]=f,y[12]=h,y[13]=d,y[14]=p,y[15]=g,y}function Xt(t,e,n,r,i,o,a,s,c,l,u,f,h,d,p,g,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=f,t[11]=h,t[12]=d,t[13]=p,t[14]=g,t[15]=y,t}function Yt(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Ut(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 Kt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],y=e[14],m=e[15],v=n*s-r*a,b=n*c-i*a,x=n*l-o*a,O=r*c-i*s,w=r*l-o*s,M=i*l-o*c,E=u*g-f*p,k=u*y-h*p,S=u*m-d*p,P=f*y-h*g,_=f*m-d*g,A=h*m-d*y,j=v*A-b*_+x*P+O*S-w*k+M*E;return j?(j=1/j,t[0]=(s*A-c*_+l*P)*j,t[1]=(i*_-r*A-o*P)*j,t[2]=(g*M-y*w+m*O)*j,t[3]=(h*w-f*M-d*O)*j,t[4]=(c*S-a*A-l*k)*j,t[5]=(n*A-i*S+o*k)*j,t[6]=(y*x-p*M-m*b)*j,t[7]=(u*M-h*x+d*b)*j,t[8]=(a*_-s*S+l*E)*j,t[9]=(r*S-n*_-o*E)*j,t[10]=(p*w-g*x+m*v)*j,t[11]=(f*x-u*w-d*v)*j,t[12]=(s*k-a*P-c*E)*j,t[13]=(n*P-r*k+i*E)*j,t[14]=(g*b-p*O-y*v)*j,t[15]=(u*O-f*b+h*v)*j,t):null}function Zt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=e[9],h=e[10],d=e[11],p=e[12],g=e[13],y=e[14],m=e[15];return t[0]=s*(h*m-d*y)-f*(c*m-l*y)+g*(c*d-l*h),t[1]=-(r*(h*m-d*y)-f*(i*m-o*y)+g*(i*d-o*h)),t[2]=r*(c*m-l*y)-s*(i*m-o*y)+g*(i*l-o*c),t[3]=-(r*(c*d-l*h)-s*(i*d-o*h)+f*(i*l-o*c)),t[4]=-(a*(h*m-d*y)-u*(c*m-l*y)+p*(c*d-l*h)),t[5]=n*(h*m-d*y)-u*(i*m-o*y)+p*(i*d-o*h),t[6]=-(n*(c*m-l*y)-a*(i*m-o*y)+p*(i*l-o*c)),t[7]=n*(c*d-l*h)-a*(i*d-o*h)+u*(i*l-o*c),t[8]=a*(f*m-d*g)-u*(s*m-l*g)+p*(s*d-l*f),t[9]=-(n*(f*m-d*g)-u*(r*m-o*g)+p*(r*d-o*f)),t[10]=n*(s*m-l*g)-a*(r*m-o*g)+p*(r*l-o*s),t[11]=-(n*(s*d-l*f)-a*(r*d-o*f)+u*(r*l-o*s)),t[12]=-(a*(f*y-h*g)-u*(s*y-c*g)+p*(s*h-c*f)),t[13]=n*(f*y-h*g)-u*(r*y-i*g)+p*(r*h-i*f),t[14]=-(n*(s*y-c*g)-a*(r*y-i*g)+p*(r*c-i*s)),t[15]=n*(s*h-c*f)-a*(r*h-i*f)+u*(r*c-i*s),t}function Jt(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],c=t[7],l=t[8],u=t[9],f=t[10],h=t[11],d=t[12],p=t[13],g=t[14],y=t[15];return(e*a-n*o)*(f*y-h*g)-(e*s-r*o)*(u*y-h*p)+(e*c-i*o)*(u*g-f*p)+(n*s-r*a)*(l*y-h*d)-(n*c-i*a)*(l*g-f*d)+(r*c-i*s)*(l*p-u*d)}function Qt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],g=e[12],y=e[13],m=e[14],v=e[15],b=n[0],x=n[1],O=n[2],w=n[3];return t[0]=b*r+x*s+O*f+w*g,t[1]=b*i+x*c+O*h+w*y,t[2]=b*o+x*l+O*d+w*m,t[3]=b*a+x*u+O*p+w*v,b=n[4],x=n[5],O=n[6],w=n[7],t[4]=b*r+x*s+O*f+w*g,t[5]=b*i+x*c+O*h+w*y,t[6]=b*o+x*l+O*d+w*m,t[7]=b*a+x*u+O*p+w*v,b=n[8],x=n[9],O=n[10],w=n[11],t[8]=b*r+x*s+O*f+w*g,t[9]=b*i+x*c+O*h+w*y,t[10]=b*o+x*l+O*d+w*m,t[11]=b*a+x*u+O*p+w*v,b=n[12],x=n[13],O=n[14],w=n[15],t[12]=b*r+x*s+O*f+w*g,t[13]=b*i+x*c+O*h+w*y,t[14]=b*o+x*l+O*d+w*m,t[15]=b*a+x*u+O*p+w*v,t}function te(t,e,n){var r,i,o,a,s,c,l,u,f,h,d,p,g=n[0],y=n[1],m=n[2];return e===t?(t[12]=e[0]*g+e[4]*y+e[8]*m+e[12],t[13]=e[1]*g+e[5]*y+e[9]*m+e[13],t[14]=e[2]*g+e[6]*y+e[10]*m+e[14],t[15]=e[3]*g+e[7]*y+e[11]*m+e[15]):(r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],c=e[5],l=e[6],u=e[7],f=e[8],h=e[9],d=e[10],p=e[11],t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=u,t[8]=f,t[9]=h,t[10]=d,t[11]=p,t[12]=r*g+s*y+f*m+e[12],t[13]=i*g+c*y+h*m+e[13],t[14]=o*g+l*y+d*m+e[14],t[15]=a*g+u*y+p*m+e[15]),t}function ee(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 ne(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p,g,y,m,v,b,x,O,w,M,E,k,S,P,_=r[0],A=r[1],j=r[2],T=Math.hypot(_,A,j);return T<kt?null:(_*=T=1/T,A*=T,j*=T,i=Math.sin(n),a=1-(o=Math.cos(n)),s=e[0],c=e[1],l=e[2],u=e[3],f=e[4],h=e[5],d=e[6],p=e[7],g=e[8],y=e[9],m=e[10],v=e[11],b=_*_*a+o,x=A*_*a+j*i,O=j*_*a-A*i,w=_*A*a-j*i,M=A*A*a+o,E=j*A*a+_*i,k=_*j*a+A*i,S=A*j*a-_*i,P=j*j*a+o,t[0]=s*b+f*x+g*O,t[1]=c*b+h*x+y*O,t[2]=l*b+d*x+m*O,t[3]=u*b+p*x+v*O,t[4]=s*w+f*M+g*E,t[5]=c*w+h*M+y*E,t[6]=l*w+d*M+m*E,t[7]=u*w+p*M+v*E,t[8]=s*k+f*S+g*P,t[9]=c*k+h*S+y*P,t[10]=l*k+d*S+m*P,t[11]=u*k+p*S+v*P,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function re(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+l*r,t[5]=a*i+u*r,t[6]=s*i+f*r,t[7]=c*i+h*r,t[8]=l*i-o*r,t[9]=u*i-a*r,t[10]=f*i-s*r,t[11]=h*i-c*r,t}function ie(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[8],u=e[9],f=e[10],h=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-l*r,t[1]=a*i-u*r,t[2]=s*i-f*r,t[3]=c*i-h*r,t[8]=o*r+l*i,t[9]=a*r+u*i,t[10]=s*r+f*i,t[11]=c*r+h*i,t}function oe(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],c=e[3],l=e[4],u=e[5],f=e[6],h=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+l*r,t[1]=a*i+u*r,t[2]=s*i+f*r,t[3]=c*i+h*r,t[4]=l*i-o*r,t[5]=u*i-a*r,t[6]=f*i-s*r,t[7]=h*i-c*r,t}function ae(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 se(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 ce(t,e,n){var r,i,o,a=n[0],s=n[1],c=n[2],l=Math.hypot(a,s,c);return l<kt?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 le(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 ue(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 fe(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 he(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,c=i+i,l=o+o,u=r*s,f=r*c,h=r*l,d=i*c,p=i*l,g=o*l,y=a*s,m=a*c,v=a*l;return t[0]=1-(d+g),t[1]=f+v,t[2]=h-m,t[3]=0,t[4]=f-v,t[5]=1-(u+g),t[6]=p+y,t[7]=0,t[8]=h+m,t[9]=p-y,t[10]=1-(u+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function de(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)),he(t,e,n),t}function pe(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function ge(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 ye(t,e){var n=new St(3);ge(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,c=e[2]*o,l=e[4]*r,u=e[5]*i,f=e[6]*o,h=e[8]*r,d=e[9]*i,p=e[10]*o,g=a+u+p,y=0;return g>0?(y=2*Math.sqrt(g+1),t[3]=.25*y,t[0]=(f-d)/y,t[1]=(h-c)/y,t[2]=(s-l)/y):a>u&&a>p?(y=2*Math.sqrt(1+a-u-p),t[3]=(f-d)/y,t[0]=.25*y,t[1]=(s+l)/y,t[2]=(h+c)/y):u>p?(y=2*Math.sqrt(1+u-a-p),t[3]=(h-c)/y,t[0]=(s+l)/y,t[1]=.25*y,t[2]=(f+d)/y):(y=2*Math.sqrt(1+p-a-u),t[3]=(s-l)/y,t[0]=(h+c)/y,t[1]=(f+d)/y,t[2]=.25*y),t}function me(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],c=i+i,l=o+o,u=a+a,f=i*c,h=i*l,d=i*u,p=o*l,g=o*u,y=a*u,m=s*c,v=s*l,b=s*u,x=r[0],O=r[1],w=r[2];return t[0]=(1-(p+y))*x,t[1]=(h+b)*x,t[2]=(d-v)*x,t[3]=0,t[4]=(h-b)*O,t[5]=(1-(f+y))*O,t[6]=(g+m)*O,t[7]=0,t[8]=(d+v)*w,t[9]=(g-m)*w,t[10]=(1-(f+p))*w,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function ve(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],c=e[3],l=o+o,u=a+a,f=s+s,h=o*l,d=o*u,p=o*f,g=a*u,y=a*f,m=s*f,v=c*l,b=c*u,x=c*f,O=r[0],w=r[1],M=r[2],E=i[0],k=i[1],S=i[2],P=(1-(g+m))*O,_=(d+x)*O,A=(p-b)*O,j=(d-x)*w,T=(1-(h+m))*w,C=(y+v)*w,N=(p+b)*M,L=(y-v)*M,R=(1-(h+g))*M;return t[0]=P,t[1]=_,t[2]=A,t[3]=0,t[4]=j,t[5]=T,t[6]=C,t[7]=0,t[8]=N,t[9]=L,t[10]=R,t[11]=0,t[12]=n[0]+E-(P*E+j*k+N*S),t[13]=n[1]+k-(_*E+T*k+L*S),t[14]=n[2]+S-(A*E+C*k+R*S),t[15]=1,t}function be(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,c=i+i,l=n*a,u=r*a,f=r*s,h=i*a,d=i*s,p=i*c,g=o*a,y=o*s,m=o*c;return t[0]=1-f-p,t[1]=u+m,t[2]=h-y,t[3]=0,t[4]=u-m,t[5]=1-l-p,t[6]=d+g,t[7]=0,t[8]=h+y,t[9]=d-g,t[10]=1-l-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function xe(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}function Oe(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}Pt();var we=Oe;function Me(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}function Ee(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}function ke(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 Se=ke;function Pe(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 _e(t,e,n,r){var i,o,a,s,c,l,u,f,h,d,p=e[0],g=e[1],y=e[2],m=r[0],v=r[1],b=r[2],x=n[0],O=n[1],w=n[2];return Math.abs(p-x)<kt&&Math.abs(g-O)<kt&&Math.abs(y-w)<kt?Yt(t):(u=p-x,f=g-O,h=y-w,i=v*(h*=d=1/Math.hypot(u,f,h))-b*(f*=d),o=b*(u*=d)-m*h,a=m*f-v*u,(d=Math.hypot(i,o,a))?(i*=d=1/d,o*=d,a*=d):(i=0,o=0,a=0),s=f*a-h*o,c=h*i-u*a,l=u*o-f*i,(d=Math.hypot(s,c,l))?(s*=d=1/d,c*=d,l*=d):(s=0,c=0,l=0),t[0]=i,t[1]=s,t[2]=u,t[3]=0,t[4]=o,t[5]=c,t[6]=f,t[7]=0,t[8]=a,t[9]=l,t[10]=h,t[11]=0,t[12]=-(i*p+o*g+a*y),t[13]=-(s*p+c*g+l*y),t[14]=-(u*p+f*g+h*y),t[15]=1,t)}function Ae(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],c=r[1],l=r[2],u=i-n[0],f=o-n[1],h=a-n[2],d=u*u+f*f+h*h;d>0&&(u*=d=1/Math.sqrt(d),f*=d,h*=d);var p=c*h-l*f,g=l*u-s*h,y=s*f-c*u;return(d=p*p+g*g+y*y)>0&&(p*=d=1/Math.sqrt(d),g*=d,y*=d),t[0]=p,t[1]=g,t[2]=y,t[3]=0,t[4]=f*y-h*g,t[5]=h*p-u*y,t[6]=u*g-f*p,t[7]=0,t[8]=u,t[9]=f,t[10]=h,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t}function je(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]+")"}function Te(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])}function Ce(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function Ne(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Le(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}function Re(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}function Ie(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]}function ze(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],c=t[6],l=t[7],u=t[8],f=t[9],h=t[10],d=t[11],p=t[12],g=t[13],y=t[14],m=t[15],v=e[0],b=e[1],x=e[2],O=e[3],w=e[4],M=e[5],E=e[6],k=e[7],S=e[8],P=e[9],_=e[10],A=e[11],j=e[12],T=e[13],C=e[14],N=e[15];return Math.abs(n-v)<=kt*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(r-b)<=kt*Math.max(1,Math.abs(r),Math.abs(b))&&Math.abs(i-x)<=kt*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(o-O)<=kt*Math.max(1,Math.abs(o),Math.abs(O))&&Math.abs(a-w)<=kt*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-M)<=kt*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(c-E)<=kt*Math.max(1,Math.abs(c),Math.abs(E))&&Math.abs(l-k)<=kt*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(u-S)<=kt*Math.max(1,Math.abs(u),Math.abs(S))&&Math.abs(f-P)<=kt*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(h-_)<=kt*Math.max(1,Math.abs(h),Math.abs(_))&&Math.abs(d-A)<=kt*Math.max(1,Math.abs(d),Math.abs(A))&&Math.abs(p-j)<=kt*Math.max(1,Math.abs(p),Math.abs(j))&&Math.abs(g-T)<=kt*Math.max(1,Math.abs(g),Math.abs(T))&&Math.abs(y-C)<=kt*Math.max(1,Math.abs(y),Math.abs(C))&&Math.abs(m-N)<=kt*Math.max(1,Math.abs(m),Math.abs(N))}var De=Qt,Be=Ne;function Fe(){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}function We(){var t=new St(4);return St!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function $e(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 Ge(){var t=new St(4);return St!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function He(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 Ve(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 qe(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 Xe(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}We();var Ye,Ue=function(t,e,n,r){var i=new St(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},Ke=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Ze=Ve,Je=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};Pt(),jt(1,0,0),jt(0,1,0),Ge(),Ge(),Fe(),Ye=new St(2),St!=Float32Array&&(Ye[0]=0,Ye[1]=0);const Qe=function(t){return M(t,"Number")};function tn(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}const en=function(t){return null==t},nn=function(t){return M(t,"String")},rn=function(t,e,n){return t<e?e:t>n?n:t};var on={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function an(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return on[e]===t.length-1&&"achlmqstvz".includes(e)}))}function sn(t){return an(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function cn(t){return sn(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}var ln={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function un(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=on[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,on[n]))),on[n]););}function fn(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 hn(t){return t>=48&&t<=57}function dn(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)),hn(e)||46===e){if(46!==e){if(a=48===e,o+=1,e=r.charCodeAt(o),a&&o<n&&e&&hn(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;o<n&&hn(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(l=!0,o+=1;hn(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&&hn(r.charCodeAt(o))))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;o<n&&hn(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 pn(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 gn(t){for(var e=t.pathValue,n=t.max;t.index<n&&pn(e.charCodeAt(t.index));)t.index+=1}function yn(t){var e,n=t.max,r=t.pathValue,i=t.index,o=r.charCodeAt(i),a=on[r[i].toLowerCase()];if(t.segmentStart=i,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}}(o))if(t.index+=1,gn(t),t.data=[],a){for(;;){for(var s=a;s>0;s-=1){if(97!=(32|o)||3!==s&&4!==s?dn(t):fn(t),t.err.length)return;t.data.push(t.param),gn(t),t.index<n&&44===r.charCodeAt(t.index)&&(t.index+=1,gn(t))}if(t.index>=t.max)break;if(!((e=r.charCodeAt(t.index))>=48&&e<=57||43===e||45===e||46===e))break}un(t)}else un(t);else t.err='[path-util]: Invalid path value "'+r[i]+'" is not a path command'}var mn=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 vn(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),c=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)c=["L",t[1],i];else if("V"===n)c=["L",r,t[1]];else if("S"===n){var l=2*r-o,u=2*i-a;e.x1=l,e.y1=u,c=["C",l,u].concat(s)}else if("T"===n){var f=2*r-e.qx,h=2*i-e.qy;e.qx=f,e.qy=h,c=["Q",f,h].concat(s)}else if("Q"===n){var d=s[0],p=s[1];e.qx=d,e.qy=p}return c}function bn(t){if(cn(t))return[].concat(t);for(var e=function(t){if(sn(t))return[].concat(t);var e=function(t){if(an(t))return[].concat(t);var e=new mn(t);for(gn(e);e.index<e.max&&!e.err.length;)yn(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}))}(t),n=(0,Mt.Cl)({},ln),r=0;r<e.length;r+=1){e[r]=vn(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 xn(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function On(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=xn([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 wn(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 Mn(t,e,n,r,i,o,a,s,c,l){var u=Math.abs,f=Math.sin,h=Math.cos,d=Math.sqrt,p=Math.PI,g=u(n),y=u(r),m=(i%360+360)%360*(p/180);if(t===s&&e===c)return{x:t,y:e};if(0===g||0===y)return On(t,e,s,c,l).point;var v=(t-s)/2,b=(e-c)/2,x={x:h(m)*v+f(m)*b,y:-f(m)*v+h(m)*b},O=Math.pow(x.x,2)/Math.pow(g,2)+Math.pow(x.y,2)/Math.pow(y,2);O>1&&(g*=d(O),y*=d(O));var w=(Math.pow(g,2)*Math.pow(y,2)-Math.pow(g,2)*Math.pow(x.y,2)-Math.pow(y,2)*Math.pow(x.x,2))/(Math.pow(g,2)*Math.pow(x.y,2)+Math.pow(y,2)*Math.pow(x.x,2)),M=(o!==a?1:-1)*d(w=w<0?0:w),E=M*(g*x.y/y),k=M*(-y*x.x/g),S=h(m)*E-f(m)*k+(t+s)/2,P=f(m)*E+h(m)*k+(e+c)/2,_={x:(x.x-E)/g,y:(x.y-k)/y},A=wn({x:1,y:0},_),j=wn(_,{x:(-x.x-E)/g,y:(-x.y-k)/y});!a&&j>0?j-=2*p:a&&j<0&&(j+=2*p);var T=A+(j%=2*p)*l,C=g*h(T),N=y*f(T);return{x:h(m)*C-f(m)*N+S,y:f(m)*C+h(m)*N+P}}function En(t,e,n,r,i,o,a,s,c,l,u){var f,h=u.bbox,d=void 0===h||h,p=u.length,g=void 0===p||p,y=u.sampleSize,m=void 0===y?30:y,v="number"==typeof l,b=t,x=e,O=0,w=[b,x,O],M=[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<=m;S+=1){if(b=(f=Mn(t,e,n,r,i,o,a,s,c,S/m)).x,x=f.y,d&&k.push({x:b,y:x}),g&&(O+=tn(M,[b,x])),M=[b,x],v&&O>=l&&l>w[2]){var P=(O-l)/(O-w[2]);E={x:M[0]*(1-P)+w[0]*P,y:M[1]*(1-P)+w[1]*P}}w=[b,x,O]}return v&&l>=O&&(E={x:s,y:c}),{length:O,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 kn(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,h=void 0===f||f,d=l.length,p=void 0===d||d,g=l.sampleSize,y=void 0===g?10:g,m="number"==typeof c,v=t,b=e,x=0,O=[v,b,x],w=[v,b],M={x:0,y:0},E=[{x:v,y:b}];m&&c<=0&&(M={x:v,y:b});for(var k=0;k<=y;k+=1){if(v=(u=kn(t,e,n,r,i,o,a,s,k/y)).x,b=u.y,h&&E.push({x:v,y:b}),p&&(x+=tn(w,[v,b])),w=[v,b],m&&x>=c&&c>O[2]){var S=(x-c)/(x-O[2]);M={x:w[0]*(1-S)+O[0]*S,y:w[1]*(1-S)+O[1]*S}}O=[v,b,x]}return m&&c>=x&&(M={x:a,y:s}),{length:x,point:M,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 Pn(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 _n(t,e,n,r,i,o,a,s){var c,l=s.bbox,u=void 0===l||l,f=s.length,h=void 0===f||f,d=s.sampleSize,p=void 0===d?10:d,g="number"==typeof a,y=t,m=e,v=0,b=[y,m,v],x=[y,m],O={x:0,y:0},w=[{x:y,y:m}];g&&a<=0&&(O={x:y,y:m});for(var M=0;M<=p;M+=1){if(y=(c=Pn(t,e,n,r,i,o,M/p)).x,m=c.y,u&&w.push({x:y,y:m}),h&&(v+=tn(x,[y,m])),x=[y,m],g&&v>=a&&a>b[2]){var E=(v-a)/(v-b[2]);O={x:x[0]*(1-E)+b[0]*E,y:x[1]*(1-E)+b[1]*E}}b=[y,m,v]}return g&&a>=v&&(O={x:i,y:o}),{length:v,point:O,min:{x:Math.min.apply(null,w.map((function(t){return t.x}))),y:Math.min.apply(null,w.map((function(t){return t.y})))},max:{x:Math.max.apply(null,w.map((function(t){return t.x}))),y:Math.max.apply(null,w.map((function(t){return t.y})))}}}function An(t,e,n){for(var r,i,o,a,s,c,l,u,f,h=bn(t),d="number"==typeof e,p=[],g=0,y=0,m=0,v=0,b=[],x=[],O=0,w={x:0,y:0},M=w,E=w,k=w,S=0,P=0,_=h.length;P<_;P+=1)p=(l="M"===(u=(f=h[P])[0]))?p:[g,y].concat(f.slice(1)),l?(M=w={x:m=f[1],y:v=f[2]},O=0,d&&e<.001&&(k=w)):"L"===u?(O=(r=On(p[0],p[1],p[2],p[3],(e||0)-S)).length,w=r.min,M=r.max,E=r.point):"A"===u?(O=(i=En(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-S,n||{})).length,w=i.min,M=i.max,E=i.point):"C"===u?(O=(o=Sn(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-S,n||{})).length,w=o.min,M=o.max,E=o.point):"Q"===u?(O=(a=_n(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-S,n||{})).length,w=a.min,M=a.max,E=a.point):"Z"===u&&(O=(s=On((p=[g,y,m,v])[0],p[1],p[2],p[3],(e||0)-S)).length,w=s.min,M=s.max,E=s.point),d&&S<e&&S+O>=e&&(k=E),x.push(M),b.push(w),S+=O,g=(c="Z"!==u?f.slice(-2):[m,v])[0],y=c[1];return d&&e>=S&&(k={x:g,y}),{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})))}}}const jn=function(t){if(E(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},Tn=function(t){if(E(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])};var Cn=1e-5;function Nn(t,e,n){return void 0===n&&(n=Cn),Math.abs(t-e)<n}const Ln=function(t,e){return(t%e+e)%e};function Rn(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)}}function In(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function zn(t,e,n,r,i,o,a,s,c,l){var u,f,h,d,p,g=t,y=e,m=n,v=r,b=s,x=c,O=120*Math.PI/180,w=Math.PI/180*(+i||0),M=[];if(l)f=l[0],h=l[1],d=l[2],p=l[3];else{g=(u=In(g,y,-w)).x,y=u.y;var E=(g-(b=(u=In(b,x,-w)).x))/2,k=(y-(x=u.y))/2,S=E*E/(m*m)+k*k/(v*v);S>1&&(m*=S=Math.sqrt(S),v*=S);var P=m*m,_=v*v,A=(o===a?-1:1)*Math.sqrt(Math.abs((P*_-P*k*k-_*E*E)/(P*k*k+_*E*E)));d=A*m*k/v+(g+b)/2,p=A*-v*E/m+(y+x)/2,f=Math.asin(((y-p)/v*Math.pow(10,9)>>0)/Math.pow(10,9)),h=Math.asin(((x-p)/v*Math.pow(10,9)>>0)/Math.pow(10,9)),f=g<d?Math.PI-f:f,h=b<d?Math.PI-h:h,f<0&&(f=2*Math.PI+f),h<0&&(h=2*Math.PI+h),a&&f>h&&(f-=2*Math.PI),!a&&h>f&&(h-=2*Math.PI)}var j=h-f;if(Math.abs(j)>O){var T=h,C=b,N=x;h=f+O*(a&&h>f?1:-1),M=zn(b=d+m*Math.cos(h),x=p+v*Math.sin(h),m,v,i,0,a,C,N,[h,T,d,p])}j=h-f;var L=Math.cos(f),R=Math.sin(f),I=Math.cos(h),z=Math.sin(h),D=Math.tan(j/4),B=4/3*m*D,F=4/3*v*D,W=[g,y],$=[g+B*R,y-F*L],G=[b+B*z,x-F*I],H=[b,x];if($[0]=2*W[0]-$[0],$[1]=2*W[1]-$[1],l)return $.concat(G,H,M);for(var V=[],q=0,X=(M=$.concat(G,H,M)).length;q<X;q+=1)V[q]=q%2?In(M[q-1],M[q],w).y:In(M[q],M[q+1],w).x;return V}var Dn=function(t,e,n,r){var i=xn([t,e],[n,r],.5);return(0,Mt.fX)((0,Mt.fX)([],i,!0),[n,r,n,r],!1)};function Bn(t,e){var n,r=t[0],i=t.slice(1).map(Number),o=i[0],a=i[1],s=e.x1,c=e.y1,l=e.x,u=e.y;switch("TQ".includes(r)||(e.qx=null,e.qy=null),r){case"M":return e.x=o,e.y=a,t;case"A":return n=[s,c].concat(i),["C"].concat(zn(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=o,e.qy=a,n=[s,c].concat(i),["C"].concat(function(t,e,n,r,i,o){var a=1/3,s=2/3;return[a*t+s*n,a*e+s*r,a*i+s*n,a*o+s*r,i,o]}(n[0],n[1],n[2],n[3],n[4],n[5]));case"L":return["C"].concat(Dn(s,c,o,a));case"Z":return s===l&&c===u?["C",s,c,l,u,l,u]:["C"].concat(Dn(s,c,l,u))}return t}function Fn(t,e){if(void 0===e&&(e=!1),function(t){return cn(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=bn(t),a=(0,Mt.Cl)({},ln),s=[],c="",l=o.length,u=[],f=0;f<l;f+=1){o[f]&&(c=o[f][0]),s[f]=c;var h=Bn(o[f],a);o[f]=h,Rn(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 Wn(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=xn(n,r,e),s=xn(r,i,e),c=xn(i,o,e),l=xn(a,s,e),u=xn(s,c,e),f=xn(l,u,e);return[["C"].concat(a,l,f),["C"].concat(u,c,o)]}(r):[t,t]:[t],l:i}}))}function $n(t,e,n){var r=Wn(t),i=Wn(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,c=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,u=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/c||0,f=n||Math.max(o,a),h=[l,u],d=[f-o,f-a],p=0,g=[r,i].map((function(t,e){return t.l===f?t.map((function(t){return t.s})):t.map((function(t,n){return p=n&&d[e]&&t.l>=h[e],d[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return g[0].length===g[1].length?g:$n(g[0],g[1],f)}function Gn(t){return function(t){var e=0,n=0,r=0;return Fn(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,e){var n=t.length-1,r=[],i=0,o=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a,s=i+o;return 0===o||t[s]&&"M"===t[s][0]?(a=t[s],["M"].concat(a.slice(-2))):(s>=e&&(s-=n),t[s])}))}))}(t);return o.forEach((function(o,a){t.slice(1).forEach((function(r,o){i+=tn(t[(a+o)%n].slice(-2),e[o%n].slice(-2))})),r[a]=i,i=0})),o[r.indexOf(Math.min.apply(null,r))]}const Vn=function(t){return void 0===t},qn=function(t){return M(t,"Boolean")},Xn=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e};function Yn(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Un(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Kn(){}var Zn=.7,Jn=1/Zn,Qn="\\s*([+-]?\\d+)\\s*",tr="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",er="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",nr=/^#([0-9a-f]{3,8})$/,rr=new RegExp("^rgb\\("+[Qn,Qn,Qn]+"\\)$"),ir=new RegExp("^rgb\\("+[er,er,er]+"\\)$"),or=new RegExp("^rgba\\("+[Qn,Qn,Qn,tr]+"\\)$"),ar=new RegExp("^rgba\\("+[er,er,er,tr]+"\\)$"),sr=new RegExp("^hsl\\("+[tr,er,er]+"\\)$"),cr=new RegExp("^hsla\\("+[tr,er,er,tr]+"\\)$"),lr={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 ur(){return this.rgb().formatHex()}function fr(){return this.rgb().formatRgb()}function hr(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=nr.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?dr(e):3===n?new gr(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?pr(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?pr(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=rr.exec(t))?new gr(e[1],e[2],e[3],1):(e=ir.exec(t))?new gr(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=or.exec(t))?pr(e[1],e[2],e[3],e[4]):(e=ar.exec(t))?pr(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=sr.exec(t))?br(e[1],e[2]/100,e[3]/100,1):(e=cr.exec(t))?br(e[1],e[2]/100,e[3]/100,e[4]):lr.hasOwnProperty(t)?dr(lr[t]):"transparent"===t?new gr(NaN,NaN,NaN,0):null}function dr(t){return new gr(t>>16&255,t>>8&255,255&t,1)}function pr(t,e,n,r){return r<=0&&(t=e=n=NaN),new gr(t,e,n,r)}function gr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function yr(){return"#"+vr(this.r)+vr(this.g)+vr(this.b)}function mr(){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 vr(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function br(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Or(t,e,n,r)}function xr(t){if(t instanceof Or)return new Or(t.h,t.s,t.l,t.opacity);if(t instanceof Kn||(t=hr(t)),!t)return new Or;if(t instanceof Or)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 Or(a,s,c,t.opacity)}function Or(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function wr(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 Mr(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Er(t,e){var n=Math.min.apply(Math,(0,Mt.fX)([],(0,Mt.zs)(t),!1)),r=Math.min.apply(Math,(0,Mt.fX)([],(0,Mt.zs)(e),!1));return{x:n,y:r,width:Math.max.apply(Math,(0,Mt.fX)([],(0,Mt.zs)(t),!1))-n,height:Math.max.apply(Math,(0,Mt.fX)([],(0,Mt.zs)(e),!1))-r}}function kr(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Sr(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function Pr(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 h=s+f;o<a?o<h&&h<a&&u.push(h):a<h&&h<o&&u.push(h)}for(f=0;f<u.length;f++){var d=kr(t,0,n,r,i,u[f]);d<c&&(c=d),d>l&&(l=d)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),g=1/0,y=-1/0,m=[o,a];for(f=2*-Math.PI;f<=2*Math.PI;f+=Math.PI){var v=p+f;o<a?o<v&&v<a&&m.push(v):a<v&&v<o&&m.push(v)}for(f=0;f<m.length;f++){var b=Sr(0,e,n,r,i,m[f]);b<g&&(g=b),b>y&&(y=b)}return{x:c,y:g,width:l-c,height:y-g}}Yn(Kn,hr,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:ur,formatHex:ur,formatHsl:function(){return xr(this).formatHsl()},formatRgb:fr,toString:fr}),Yn(gr,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof Kn||(i=hr(i)),i?new gr((i=i.rgb()).r,i.g,i.b,i.opacity):new gr):new gr(t,e,n,null==r?1:r);var i}),Un(Kn,{brighter:function(t){return t=null==t?Jn:Math.pow(Jn,t),new gr(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Zn:Math.pow(Zn,t),new gr(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:yr,formatHex:yr,formatRgb:mr,toString:mr})),Yn(Or,(function(t,e,n,r){return 1===arguments.length?xr(t):new Or(t,e,n,null==r?1:r)}),Un(Kn,{brighter:function(t){return t=null==t?Jn:Math.pow(Jn,t),new Or(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Zn:Math.pow(Zn,t),new Or(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 gr(wr(t>=240?t-240:t+120,i,r),wr(t,i,r),wr(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 _r=1e-4;function Ar(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,h=0;h<=l;h++){var d=h*u,p=[i.apply(void 0,(0,Mt.fX)([],(0,Mt.zs)(t.concat([d])),!1)),i.apply(void 0,(0,Mt.fX)([],(0,Mt.zs)(e.concat([d])),!1))];(v=Mr(c[0],c[1],p[0],p[1]))<s&&(a=d,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]}}for(s=1/0,h=0;h<32&&!(f<_r);h++){var y=a-f,m=a+f,v=(p=[i.apply(void 0,(0,Mt.fX)([],(0,Mt.zs)(t.concat([y])),!1)),i.apply(void 0,(0,Mt.fX)([],(0,Mt.zs)(e.concat([y])),!1))],Mr(c[0],c[1],p[0],p[1]));if(y>=0&&v<s)a=y,s=v;else{var b=[i.apply(void 0,(0,Mt.fX)([],(0,Mt.zs)(t.concat([m])),!1)),i.apply(void 0,(0,Mt.fX)([],(0,Mt.zs)(e.concat([m])),!1))],x=Mr(c[0],c[1],b[0],b[1]);m<=1&&x<s?(a=m,s=x):f*=.5}}return{x:i.apply(void 0,(0,Mt.fX)([],(0,Mt.zs)(t.concat([a])),!1)),y:i.apply(void 0,(0,Mt.fX)([],(0,Mt.zs)(e.concat([a])),!1))}}function jr(t,e,n,r){return Mr(t,e,n,r)}function Tr(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Cr(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 Nr(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(Nn(s,0))Nn(c,0)||(i=-l/c)>=0&&i<=1&&u.push(i);else{var f=c*c-4*s*l;Nn(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 Lr(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],u=Nr(t,n,i,a),f=Nr(e,r,o,s),h=0;h<u.length;h++)c.push(Cr(t,n,i,a,u[h]));for(h=0;h<f.length;h++)l.push(Cr(e,r,o,s,f[h]));return Er(c,l)}function Rr(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 Ar([t,n,i,a],[e,r,o,s],c,l,Cr,u)}(t,e,n,r,i,o,a,s,c,l,u);return Mr(f.x,f.y,c,l)}function Ir(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function zr(t,e,n){var r=t+n-2*e;if(Nn(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function Dr(t,e,n,r,i,o){var a=zr(t,n,i)[0],s=zr(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(Ir(t,n,i,a)),void 0!==s&&l.push(Ir(e,r,o,s)),Er(c,l)}function Br(t,e,n,r,i,o,a,s){var c=function(t,e,n,r,i,o,a,s){return Ar([t,n,i],[e,r,o],a,s,Ir)}(t,e,n,r,i,o,a,s);return Mr(c.x,c.y,a,s)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self&&self;var Fr={exports:{}};Fr.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 h=t[r],d=i,p=o;for(n(t,i,r),a(t[o],h)>0&&n(t,i,o);d<p;){for(n(t,d,p),d++,p--;a(t[d],h)<0;)d++;for(;a(t[p],h)>0;)p--}0===a(t[i],h)?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=m(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 h(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(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 y(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(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(!y(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;y(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(!y(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(y(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=m([]),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=m(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=m([])).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 h=u;h<=f;h+=c){var d=Math.min(h+c-1,f);i.children.push(this._build(t,h,d,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=d(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=m(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=m([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),h=f(c)+f(l);u<i?(i=u,r=a,o=h<o?h:o):u===i&&h<o&&(o=h,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=h(o)+h(a),u=e;u<n-e;u++){var f=t.children[u];c(o,t.leaf?i(f):f),l+=h(o)}for(var d=n-e-1;d>=e;d--){var p=t.children[d];c(a,t.leaf?i(p):p),l+=h(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}();var Wr,$r,Gr=Fr.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"}(Wr||(Wr={})),function(t){t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE"}($r||($r={}));var Hr=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}(),Vr=function(){function t(t){this.clipSpaceNearZ=$r.NEGATIVE_ONE,this.plugins=[],this.config=(0,Mt.Cl)({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 qr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Xr(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Yr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Ur(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Kr(t){return void 0===t?0:t>360||t<-360?t%360:t}function Zr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?_t(t):Qe(t)?jt(t,e,n):jt(t[0],t[1]||e,t[2]||n)}function Jr(t){return t*(Math.PI/180)}function Qr(t){return t*(180/Math.PI)}function ti(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=(0,Mt.zs)(ge(Pt(),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 ei(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=Qr(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var ni=Gt(),ri=Gt(),ii=We(),oi=[Pt(),Pt(),Pt()],ai=Pt();function si(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 ci,li=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){qr(this.center,t),qr(this.halfExtents,e),Xr(this.min,this.center,this.halfExtents),Yr(this.max,this.center,this.halfExtents)},t.prototype.setMinMax=function(t,e){Yr(this.center,e,t),Ur(this.center,this.center,.5),Xr(this.halfExtents,e,t),Ur(this.halfExtents,this.halfExtents,.5),qr(this.min,t),qr(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,h=i-c,d=i+c,p=o-l,g=o+l,y=e.center,m=y[0],v=y[1],b=y[2],x=e.halfExtents,O=x[0],w=x[1],M=x[2],E=m-O,k=m+O,S=v-w,P=v+w,_=b-M,A=b+M;E<u&&(u=E),k>f&&(f=k),S<h&&(h=S),P>d&&(d=P),_<p&&(p=_),A>g&&(g=A),n[0]=.5*(u+f),n[1]=.5*(h+d),n[2]=.5*(p+g),a[0]=.5*(f-u),a[1]=.5*(d-h),a[2]=.5*(g-p),this.min[0]=u,this.min[1]=h,this.min[2]=p,this.max[0]=f,this.max[1]=d,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],h=e[2],d=e[6],p=e[10],g=Math.abs(a),y=Math.abs(s),m=Math.abs(c),v=Math.abs(l),b=Math.abs(u),x=Math.abs(f),O=Math.abs(h),w=Math.abs(d),M=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]+h*i[0]+d*i[1]+p*i[2],r[0]=g*o[0]+y*o[1]+m*o[2],r[1]=v*o[0]+b*o[1]+x*o[2],r[2]=O*o[0]+w*o[1]+M*o[2],Xr(this.min,n,r),Yr(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=new t,r=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t}([0,0,0],this.getMin(),e.getMin()),i=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 n.setMinMax(r,i),n},t.prototype.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?qr([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?qr([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}(),ui=function(){function t(t,e){this.distance=t||0,this.normal=e||jt(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 zt(t,this.normal)-this.distance},t.prototype.normalize=function(){var t=1/$t(this.normal);Rt(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&&Dt(n,t,e,i),o},t}();!function(t){t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE"}(ci||(ci={}));var fi,hi,di,pi=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;e<6;e++)this.planes.push(new ui)}return t.prototype.extractFromVPMatrix=function(t){var e=(0,Mt.zs)(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],h=e[10],d=e[11],p=e[12],g=e[13],y=e[14],m=e[15];Ct(this.planes[0].normal,o-n,l-a,d-u),this.planes[0].distance=m-p,Ct(this.planes[1].normal,o+n,l+a,d+u),this.planes[1].distance=m+p,Ct(this.planes[2].normal,o+r,l+s,d+f),this.planes[2].distance=m+g,Ct(this.planes[3].normal,o-r,l-s,d-f),this.planes[3].distance=m-g,Ct(this.planes[4].normal,o-i,l-c,d-h),this.planes[4].distance=m-y,Ct(this.planes[5].normal,o+i,l+c,d+h),this.planes[5].distance=m+y,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),gi=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}(),yi=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}(),mi="Method not implemented.",vi="Use document.documentElement instead.";!function(t){t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING"}(fi||(fi={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC"}(hi||(hi={})),function(t){t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE"}(di||(di={}));var bi,xi,Oi,wi,Mi,Ei="updated",ki=2e-4,Si=function(){function t(){this.clipSpaceNearZ=$r.NEGATIVE_ONE,this.eventEmitter=new Et,this.matrix=Gt(),this.right=jt(1,0,0),this.up=jt(0,1,0),this.forward=jt(0,0,1),this.position=jt(0,0,1),this.focalPoint=jt(0,0,0),this.distanceVector=jt(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=Gt(),this.projectionMatrixInverse=Gt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=fi.EXPLORING,this.trackingMode=hi.DEFAULT,this.projectionMode=di.PERSPECTIVE,this.frustum=new pi,this.orthoMatrix=Gt()}return t.prototype.isOrtho=function(){return this.projectionMode===di.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===fi.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===fi.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!==fi.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 Kt(Gt(),this.matrix)},t.prototype.getWorldTransform=function(){return this.matrix},t.prototype.jitterProjectionMatrix=function(t,e){var n=ae(Gt(),[t,e,0]);this.jitteredProjectionMatrix=Qt(Gt(),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===di.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===di.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===di.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===di.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===di.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===di.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=jt(a.x-r,a.y-i,0),c=zt(s,this.right)/At(this.right),l=zt(s,this.up)/At(this.up);return this.pan(-c,-l),this},t.prototype.setPerspective=function(t,e,n,r){var i;this.projectionMode=di.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(Jr(.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),h=(n+e)/(n-e),d=(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]=h,t[9]=d,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===$r.ZERO),ee(this.projectionMatrix,this.projectionMatrix,jt(1,-1,1)),Kt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},t.prototype.setOrthographic=function(t,e,n,r,i,o){var a;this.projectionMode=di.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,h=l+s,d=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,y=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h=(f+=g*this.view.offsetX)+g*this.view.width,p=(d-=y*this.view.offsetY)-y*this.view.height}return this.clipSpaceNearZ===$r.NEGATIVE_ONE?Se(this.projectionMatrix,f,h,p,d,i,o):Pe(this.projectionMatrix,f,h,p,d,i,o),ee(this.projectionMatrix,this.projectionMatrix,jt(1,-1,1)),Kt(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=Zr(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=jt(0,1,0);if(this.focalPoint=Zr(t,e,n),this.trackingMode===hi.CINEMATIC){var i=Lt(Pt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=At(i),a=Qr(Math.asin(e/o)),s=90+Qr(Math.atan2(n,t)),c=Gt();ie(c,c,Jr(s)),re(c,c,Jr(a)),r=Bt(Pt(),[0,1,0],c)}return Kt(this.matrix,_e(Gt(),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<ki&&(this.distance=ki),this.dollyingStep=this.distance/100;var e=Pt();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=Kr(t),this.computeMatrix(),this._getAxes(),this.type===fi.ORBITING||this.type===fi.EXPLORING?this._getPosition():this.type===fi.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getAzimuth=function(){return this.azimuth},t.prototype.setElevation=function(t){return this.elevation=Kr(t),this.computeMatrix(),this._getAxes(),this.type===fi.ORBITING||this.type===fi.EXPLORING?this._getPosition():this.type===fi.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},t.prototype.getElevation=function(){return this.elevation},t.prototype.setRoll=function(t){return this.roll=Kr(t),this.computeMatrix(),this._getAxes(),this.type===fi.ORBITING||this.type===fi.EXPLORING?this._getPosition():this.type===fi.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=He(Ge(),[0,0,1],Jr(this.roll));Yt(this.matrix);var e=He(Ge(),[1,0,0],Jr((this.rotateWorld&&this.type!==fi.TRACKING||this.type===fi.TRACKING?1:-1)*this.elevation)),n=He(Ge(),[0,1,0],Jr((this.rotateWorld&&this.type!==fi.TRACKING||this.type===fi.TRACKING?1:-1)*this.azimuth)),r=Ve(Ge(),n,e);r=Ve(Ge(),r,t);var i=be(Gt(),r);this.type===fi.ORBITING||this.type===fi.EXPLORING?(te(this.matrix,this.matrix,this.focalPoint),Qt(this.matrix,this.matrix,i),te(this.matrix,this.matrix,[0,0,this.distance])):this.type===fi.TRACKING&&(te(this.matrix,this.matrix,this.position),Qt(this.matrix,this.matrix,i))},t.prototype._setPosition=function(t,e,n){this.position=Zr(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(){Tt(this.right,Zr($e(We(),[1,0,0,0],this.matrix))),Tt(this.up,Zr($e(We(),[0,1,0,0],this.matrix))),Tt(this.forward,Zr($e(We(),[0,0,1,0],this.matrix))),It(this.right,this.right),It(this.up,this.up),It(this.forward,this.forward)},t.prototype._getAngles=function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=At(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===fi.TRACKING||this.rotateWorld?(this.elevation=Qr(Math.asin(e/r)),this.azimuth=Qr(Math.atan2(-t,-n))):(this.elevation=-Qr(Math.asin(e/r)),this.azimuth=-Qr(Math.atan2(-t,-n)))},t.prototype._getPosition=function(){Tt(this.position,Zr($e(We(),[0,0,0,1],this.matrix))),this._getDistance()},t.prototype._getFocalPoint=function(){!function(t,e,n){var r=e[0],i=e[1],o=e[2];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]}(this.distanceVector,[0,0,-this.distance],function(t,e){return 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}(Fe(),this.matrix)),Nt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},t.prototype._getDistance=function(){this.distanceVector=Lt(Pt(),this.focalPoint,this.position),this.distance=At(this.distanceVector),this.dollyingStep=this.distance/100},t.prototype._getOrthoMatrix=function(){if(this.projectionMode===di.ORTHOGRAPHIC){var t=this.position,e=He(Ge(),[0,0,1],-this.roll*Math.PI/180);ve(this.orthoMatrix,e,jt((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),jt(this.zoom,this.zoom,1),t)}},t.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=Qt(Gt(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Ei)}},t.prototype.rotate=function(t,e,n){throw new Error(mi)},t.prototype.pan=function(t,e){throw new Error(mi)},t.prototype.dolly=function(t){throw new Error(mi)},t.prototype.createLandmark=function(t,e){throw new Error(mi)},t.prototype.gotoLandmark=function(t,e){throw new Error(mi)},t.prototype.cancelLandmarkAnimation=function(){throw new Error(mi)},t}();function Pi(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(Pi.Cache||Map),n}Pi.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"}(bi||(bi={})),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"}(xi||(xi={})),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"}(Oi||(Oi={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(wi||(wi={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Mi||(Mi={}));var _i,Ai=[{name:"em",unit_type:bi.kEms},{name:"px",unit_type:bi.kPixels},{name:"deg",unit_type:bi.kDegrees},{name:"rad",unit_type:bi.kRadians},{name:"grad",unit_type:bi.kGradians},{name:"ms",unit_type:bi.kMilliseconds},{name:"s",unit_type:bi.kSeconds},{name:"rem",unit_type:bi.kRems},{name:"turn",unit_type:bi.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"}(_i||(_i={}));var ji,Ti=function(t){var e=1;switch(t){case bi.kPixels:case bi.kDegrees:case bi.kSeconds:break;case bi.kMilliseconds:e=.001;break;case bi.kRadians:e=180/Math.PI;break;case bi.kGradians:e=.9;break;case bi.kTurns:e=360}return e},Ci=function(t){switch(t){case bi.kNumber:case bi.kInteger:return"";case bi.kPercentage:return"%";case bi.kEms:return"em";case bi.kRems:return"rem";case bi.kPixels:return"px";case bi.kDegrees:return"deg";case bi.kRadians:return"rad";case bi.kGradians:return"grad";case bi.kMilliseconds:return"ms";case bi.kSeconds:return"s";case bi.kTurns:return"turn"}return""},Ni=function(){function t(){}return t.isAngle=function(t){return t===bi.kDegrees||t===bi.kRadians||t===bi.kGradians||t===bi.kTurns},t.isLength=function(t){return t>=bi.kEms&&t<bi.kDegrees},t.isRelativeUnit=function(t){return t===bi.kPercentage||t===bi.kEms||t===bi.kRems},t.isTime=function(t){return t===bi.kSeconds||t===bi.kMilliseconds},t.prototype.toString=function(){return this.buildCSSText(wi.kNo,Mi.kNo,"")},t.prototype.isNumericValue=function(){return this.getType()>=_i.kUnitType&&this.getType()<=_i.kClampType},t}(),Li=function(t){function e(e){var n=t.call(this)||this;return n.colorSpace=e,n}return(0,Mt.C6)(e,t),e.prototype.getType=function(){return _i.kColorType},e.prototype.to=function(t){return this},e}(Ni);!function(t){t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient"}(ji||(ji={}));var Ri=function(t){function e(e,n){var r=t.call(this)||this;return r.type=e,r.value=n,r}return(0,Mt.C6)(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 _i.kColorType},e}(Ni),Ii=function(t){function e(e){var n=t.call(this)||this;return n.value=e,n}return(0,Mt.C6)(e,t),e.prototype.clone=function(){return new e(this.value)},e.prototype.getType=function(){return _i.kKeywordType},e.prototype.buildCSSText=function(t,e,n){return n+this.value},e}(Ni),zi=Pi((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),Di=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function Bi(t){return"function"==typeof t}var Fi={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Wi=Pi((function(t){var e=zi(t),n=Fi[e];return(null==n?void 0:n.alias)||e})),$i=function(t){return function(t){switch(t){case xi.kUNumber:return bi.kNumber;case xi.kULength:return bi.kPixels;case xi.kUPercent:return bi.kPercentage;case xi.kUTime:return bi.kSeconds;case xi.kUAngle:return bi.kDegrees;default:return bi.kUnknown}}(function(t){switch(t){case bi.kNumber:case bi.kInteger:return xi.kUNumber;case bi.kPercentage:return xi.kUPercent;case bi.kPixels:return xi.kULength;case bi.kMilliseconds:case bi.kSeconds:return xi.kUTime;case bi.kDegrees:case bi.kRadians:case bi.kGradians:case bi.kTurns:return xi.kUAngle;default:return xi.kUOther}}(t))},Gi=function(t){function e(e,n){void 0===n&&(n=bi.kNumber);var r,i,o=t.call(this)||this;return r="string"==typeof n?(i=n)?"number"===i?bi.kNumber:"percent"===i||"%"===i?bi.kPercentage:function(t){return Ai.find((function(e){return e.name===t})).unit_type}(i):bi.kUnknown:n,o.unit=r,o.value=e,o}return(0,Mt.C6)(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 _i.kUnitType},e.prototype.convertTo=function(t){if(this.unit===t)return new e(this.value,this.unit);var n=$i(this.unit);if(n!==$i(t)||n===bi.kUnknown)return null;var r=Ti(this.unit)/Ti(t);return new e(this.value*r,t)},e.prototype.buildCSSText=function(t,e,n){var r;switch(this.unit){case bi.kUnknown:break;case bi.kInteger:r=Number(this.value).toFixed(0);break;case bi.kNumber:case bi.kPercentage:case bi.kEms:case bi.kRems:case bi.kPixels:case bi.kDegrees:case bi.kRadians:case bi.kGradians:case bi.kMilliseconds:case bi.kSeconds:case bi.kTurns:var i=this.value,o=Ci(this.unit);if(i<-999999||i>999999){var a=Ci(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?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}(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+r},e}(Ni),Hi=new Gi(0,"px");new Gi(1,"px");var Vi,qi,Xi=new Gi(0,"deg"),Yi=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(0,Mt.C6)(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}(Li),Ui=new Ii("unset"),Ki=new Ii("initial"),Zi=new Ii("inherit"),Ji={"":Ui,unset:Ui,initial:Ki,inherit:Zi},Qi=function(t){return Ji[t]||(Ji[t]=new Ii(t)),Ji[t]},to=new Yi(0,0,0,0,!0),eo=new Yi(0,0,0,0),no=Pi((function(t,e,n,r){return new Yi(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),ro=function(t,e){return void 0===e&&(e=bi.kNumber),new Gi(t,e)};new Gi(50,"%"),function(t){t[t.Standard=0]="Standard"}(Vi||(Vi={})),function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"}(qi||(qi={}));var io,oo={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new yi(0,0,0,0)};function ao(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>"}(io||(io={}));var so=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(){return i("linear-gradient",t.linearGradient,a)||i("repeating-linear-gradient",t.repeatingLinearGradient,a)||i("radial-gradient",t.radialGradient,s)||i("repeating-radial-gradient",t.repeatingRadialGradient,s)||i("conic-gradient",t.conicGradient,s)}function i(e,r,i){return o(r,(function(r){var o=i();return o&&(v(t.comma)||n("Missing comma before color stops")),{type:e,orientation:o,colorStops:h(d)}}))}function o(e,r){var i=v(e);if(i){v(t.startCall)||n("Missing (");var o=r(i);return v(t.endCall)||n("Missing )"),o}}function a(){return m("directional",t.sideOrCorner,1)||m("angular",t.angleValue,1)}function s(){var n,r,i=c();return i&&((n=[]).push(i),r=e,v(t.comma)&&((i=c())?n.push(i):e=r)),n}function c(){var t,e=function(){var t=m("shape",/^(circle)/i,0);return t&&(t.style=y()||l()),t}()||((t=m("shape",/^(ellipse)/i,0))&&(t.style=g()||l()),t);if(e)e.at=u();else{var n=l();if(n){e=n;var r=u();r&&(e.at=r)}else{var i=f();i&&(e={type:"default-radial",at:i})}}return e}function l(){return m("extent-keyword",t.extentKeywords,1)}function u(){if(m("position",/^at/,0)){var t=f();return t||n("Missing positioning value"),t}}function f(){var t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function h(e){var r=e(),i=[];if(r)for(i.push(r);v(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function d(){var e=m("hex",t.hexColor,1)||o(t.rgbaColor,(function(){return{type:"rgba",value:h(p)}}))||o(t.rgbColor,(function(){return{type:"rgb",value:h(p)}}))||m("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=g(),e}function p(){return v(t.number)[1]}function g(){return m("%",t.percentageValue,1)||m("position-keyword",t.positionKeywords,1)||y()}function y(){return m("px",t.pixelValue,1)||m("em",t.emValue,1)}function m(t,e,n){var r=v(e);if(r)return{type:t,value:r[n]}}function v(t){var n=/^[\n\r\t\s]+/.exec(e);n&&b(n[0].length);var r=t.exec(e);return r&&b(r[0].length),r}function b(t){e=e.substring(t)}return function(t){return e=t,i=h(r),e.length>0&&n("Invalid input not EOF"),i;var i}}(),co=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,lo=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,uo=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,fo=/[\d.]+:(#[^\s]+|[^\)]+\))/gi,ho={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},po=Pi((function(t){var e;return e="angular"===t.type?Number(t.value):ho[t.value]||0,ro(e,"deg")})),go=Pi((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:ro(e,r),cy:ro(n,i)}})),yo=Pi((function(t){var e;if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return so(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(!en(c)&&!en(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:ro(Number(t.length.value),"%"),color:ao(t)}}));if("linear-gradient"===e)return new Ri(ji.LinearGradient,{angle:n?po(n):Xi,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o=go(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?Qi(f):ro(f,u)}return new Ri(ji.RadialGradient,{cx:a,cy:s,size:c,steps:i})}}));var n=t[0];if("("===t[1]||"("===t[2])if("l"===n){var r=co.exec(t);if(r){var i=(null===(e=r[2].match(fo))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return[new Ri(ji.LinearGradient,{angle:ro(parseFloat(r[1]),"deg"),steps:i.map((function(t){var e=(0,Mt.zs)(t,2),n=e[0],r=e[1];return{offset:ro(100*Number(n),"%"),color:r}}))})]}}else if("r"===n){var o=function(t){var e,n=lo.exec(t);if(n){var r=(null===(e=n[4].match(fo))||void 0===e?void 0:e.map((function(t){return t.split(":")})))||[];return{cx:ro(50,"%"),cy:ro(50,"%"),steps:r.map((function(t){var e=(0,Mt.zs)(t,2),n=e[0],r=e[1];return{offset:ro(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!nn(o))return[new Ri(ji.RadialGradient,o)];t=o}}else if("p"===n)return function(t){var e=uo.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 mo(t){return t&&!!t.image}function vo(t){return t&&!en(t.r)&&!en(t.g)&&!en(t.b)}var bo=Pi((function(t){if(mo(t))return(0,Mt.Cl)({repetition:"repeat"},t);if(en(t)&&(t=""),"transparent"===t)return eo;if("currentColor"===t)t="black";else if("none"===t)return to;var e=yo(t);if(e)return e;var n=hr(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),no.apply(void 0,(0,Mt.fX)([],(0,Mt.zs)(r),!1))}));function xo(t,e){if(vo(t)&&vo(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(rn(e[n],0,255));return e[3]=rn(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Oo(t,e){if(en(e))return ro(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return ro(Number(e),"px");if("deg".search(t)>=0)return ro(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 ro(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var wo=function(t){return Oo(new RegExp("px","g"),t)},Mo=Pi(wo);Pi((function(t){return Oo(new RegExp("%","g"),t)}));var Eo=function(t){return Qe(t)||isFinite(Number(t))?ro(Number(t)||0,"px"):Oo(new RegExp("px|%|em|rem","g"),t)},ko=Pi(Eo),So=function(t){return Oo(new RegExp("deg|rad|grad|turn","g"),t)},Po=Pi(So);function _o(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,c=$i(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(a=l.value,s=u.value,o=Ci(t.unit)):(Gi.isLength(t.unit)||Gi.isLength(e.unit))&&(a=Co(t,i,n),s=Co(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Ao(t){var e=0;return t.unit===bi.kDegrees?e=t.value:t.unit===bi.kRadians?e=Qr(Number(t.value)):t.unit===bi.kTurns&&(e=360*Number(t.value)),e}function jo(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):nn(t)?n=t.split(" ").map((function(t){return Number(t)})):Qe(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 To(t){return nn(t)?t.split(" ").map((function(t){return ko(t)})):t.map((function(t){return ko(t.toString())}))}function Co(t,e,n,r){if(void 0===r&&(r=!1),t.unit===bi.kPixels)return Number(t.value);if(t.unit===bi.kPercentage&&n){var i=n.nodeName===Wr.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var No=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Lo(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,No.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Oo(/deg|rad|grad|turn|px|%/g,t)||bo(t)}))}),n.lastIndex===t.length)return r}return[]}function Ro(t){return t.toString()}var Io=function(t){return"number"==typeof t?ro(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?ro(Number(t)):ro(0)},zo=Pi(Io);function Do(t,e){return[t,e,Ro]}function Bo(t,e){return function(n,r){return[n,r,function(n){return Ro(rn(n,t,e))}]}}function Fo(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Wo(t){return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=An(t.parsedStyle.d.absolutePath,void 0,(0,Mt.Cl)((0,Mt.Cl)({},undefined),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function $o(t){return 0===t.parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=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+=Mr(r[0],r[1],i[0],i[1])}return e}(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength}function Go(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ho(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)||Nn(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 Vo(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Pi((function(t){return nn(t)?t.split(" ").map(zo):t.map(zo)}));var qo=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)},Xo=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var c=Jr(r=Ln(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},h=Math.pow(f.x,2)/Math.pow(e,2)+Math.pow(f.y,2)/Math.pow(n,2);h>1&&(e=Math.sqrt(h)*e,n=Math.sqrt(h)*n);var d=(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));d=d<0?0:d;var p=(i!==o?1:-1)*Math.sqrt(d),g=p*(e*f.y/n),y=p*(-n*f.x/e),m={x:Math.cos(c)*g-Math.sin(c)*y+(t.x+a.x)/2,y:Math.sin(c)*g+Math.cos(c)*y+(t.y+a.y)/2},v={x:(f.x-g)/e,y:(f.y-y)/n},b=qo({x:1,y:0},v),x=qo(v,{x:(-f.x-g)/e,y:(-f.y-y)/n});!o&&x>0?x-=2*Math.PI:o&&x<0&&(x+=2*Math.PI);var O=b+(x%=2*Math.PI)*s,w=e*Math.cos(O),M=n*Math.sin(O);return{x:Math.cos(c)*w-Math.sin(c)*M+m.x,y:Math.sin(c)*w+Math.cos(c)*M+m.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:O,ellipticalArcCenter:m,resultantRx:e,resultantRy:n}};function Yo(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=Xo({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),h=Xo({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),d=h.x-f.x,p=h.y-f.y,g=Math.sqrt(d*d+p*p);return{x:-d/g,y:-p/g}}function Uo(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ko(t,e){return Uo(t)*Uo(e)?(t[0]*e[0]+t[1]*e[1])/(Uo(t)*Uo(e)):1}function Zo(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Ko(t,e))}function Jo(t,e){var n=e[1],r=e[2],i=Ln(Jr(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,h=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(c-u)/2,d=f*f/(n*n)+h*h/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(h*h)+r*r*(f*f),g=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(g*=-1),isNaN(g)&&(g=0);var y=r?g*n*h/r:0,m=n?g*-r*f/n:0,v=(s+l)/2+Math.cos(i)*y-Math.sin(i)*m,b=(c+u)/2+Math.sin(i)*y+Math.cos(i)*m,x=[(f-y)/n,(h-m)/r],O=[(-1*f-y)/n,(-1*h-m)/r],w=Zo([1,0],x),M=Zo(x,O);return Ko(x,O)<=-1&&(M=Math.PI),Ko(x,O)>=1&&(M=0),0===a&&M>0&&(M-=2*Math.PI),1===a&&M<0&&(M+=2*Math.PI),{cx:v,cy:b,rx:Go(t,[l,u])?0:n,ry:Go(t,[l,u])?0:r,startAngle:w,endAngle:w+M,xRotation:i,arcFlag:o,sweepFlag:a}}function Qo(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 ta(t,e){void 0===e&&(e=t.getLocalTransform());var n,r,i,o=[];switch(t.nodeName){case Wr.LINE:var a=t.parsedStyle,s=a.x1,c=void 0===s?0:s,l=a.y1,u=void 0===l?0:l,f=a.x2,h=void 0===f?0:f,d=a.y2;o=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(c,u,h,void 0===d?0:d);break;case Wr.CIRCLE:var p=t.parsedStyle,g=p.r,y=void 0===g?0:g,m=p.cx,v=void 0===m?0:m,b=p.cy;o=Qo(y,y,v,void 0===b?0:b);break;case Wr.ELLIPSE:var x=t.parsedStyle,O=x.rx,w=void 0===O?0:O,M=x.ry,E=void 0===M?0:M,k=x.cx,S=(v=void 0===k?0:k,x.cy);o=Qo(w,E,v,void 0===S?0:S);break;case Wr.POLYLINE:case Wr.POLYGON:n=t.parsedStyle.points.points,r=t.nodeName===Wr.POLYGON,i=n.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]})),r&&i.push(["Z"]),o=i;break;case Wr.RECT:var P=t.parsedStyle,_=P.width,A=void 0===_?0:_,j=P.height,T=void 0===j?0:j,C=P.x,N=void 0===C?0:C,L=P.y,R=void 0===L?0:L,I=P.radius,z=I&&I.some((function(t){return 0!==t}));o=function(t,e,n,r,i){if(i){var o=(0,Mt.zs)(i,4),a=o[0],s=o[1],c=o[2],l=o[3],u=t>0?1:-1,f=e>0?1:-1,h=u+f!==0?1:0;return[["M",u*a+n,r],["L",t-u*s+n,r],s?["A",s,s,0,0,h,t+n,f*s+r]:null,["L",t+n,e-f*c+r],c?["A",c,c,0,0,h,t+n-u*c,e+r]:null,["L",n+u*l,e+r],l?["A",l,l,0,0,h,n,e+r-f*l]:null,["L",n,f*a+r],a?["A",a,a,0,0,h,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"]]}(A,T,N,R,z&&I.map((function(t){return rn(t,0,Math.min(Math.abs(A)/2,Math.abs(T)/2))})));break;case Wr.PATH:var D=t.parsedStyle.d.absolutePath;o=(0,Mt.fX)([],(0,Mt.zs)(D),!1)}if(o.length)return function(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=jt(e[1],e[2],0);n&&Bt(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=jt(e[1],e[2],0),a=jt(e[3],e[4],0),s=jt(e[5],e[6],0);n&&(Bt(o,o,n),Bt(a,a,n),Bt(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=jt(e[6],e[7],0);n&&Bt(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=jt(e[1],e[2],0),a=jt(e[3],e[4],0),n&&(Bt(o,o,n),Bt(a,a,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}"));return t+r}),"")}(o,0,e)}var ea=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=bn(t)}catch(n){e=bn(""),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&&Go(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=Jo(n,c);u.arcParams=f}if("Z"===l)n=i,r=t[o+1];else{var h=c.length;n=[c[h-2],c[h-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),u.currentPoint=n,e[o]&&Go(n,e[o].currentPoint)&&(e[o].prePoint=u.prePoint);var d=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=d;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=Vo((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 y=[c[1],c[2]],m=[c[3],c[4]];u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-m[0],n[1]-m[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[y[0]-m[0],y[1]-m[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[m[0]-y[0],m[1]-y[1]])}else if("S"===l){var v;y=Vo((v=e[s-1]).currentPoint,p),m=[c[1],c[2]],"C"===v.command?(u.command="C",u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-m[0],n[1]-m[1]]):(u.command="SQ",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-m[0],n[1]-m[1]])}else if("A"===l){var b=Yo(u,0),x=b.x,O=b.y,w=Yo(u,1,!1),M=w.x,E=w.y;u.startTangent=[x,O],u.endTangent=[M,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=Dr(c[0],c[1],s[1],s[2],s[3],s[4]);break;case"C":l=Lr(c[0],c[1],s[1],s[2],s[3],s[4],s[5],s[6]);break;case"A":var u=g.arcParams;l=Pr(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))}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=jn(n),h=jn(r),d=Tn(n),p=Tn(r);if(0===i.length)return{x:f,y:h,width:d-f,height:p-h};for(o=0;o<i.length;o++){var g;(a=(g=i[o]).currentPoint)[0]===f?f-=Ho(g,0).xExtra:a[0]===d&&(d+=Ho(g,0).xExtra),a[1]===h?h-=Ho(g,0).yExtra:a[1]===p&&(p+=Ho(g,0).yExtra)}return{x:f,y:h,width:d-f,height:p-h}}(a),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}}},na=Pi(ea);function ra(t){return nn(t)?na(t):ea(t)}function ia(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Fn(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Fn(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=$n(r,i));var a,s,c=Gn(o[0])!==Gn(o[1])?(s=(a=o[0]).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))})))):o[0].map((function(t){return Array.isArray(t)?[].concat(t):t}));return[c,Hn(o[1],c),function(t){return t}]}function oa(t,e){var n;return n=nn(t)?t.split(" ").map((function(t){var e=(0,Mt.zs)(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]})):t,{points:n,totalLength:0,segments:[]}}function aa(t,e){return[t.points,e.points,function(t){return t}]}var sa=null;function ca(t){return function(e){var n=0;return t.map((function(t){return t===sa?e[n++]:t}))}}function la(t){return t}var ua={matrix:["NNNNNN",[sa,sa,0,0,sa,sa,0,0,0,0,1,0,sa,sa,0,1],la],matrix3d:["NNNNNNNNNNNNNNNN",la],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",ca([sa,sa,new Gi(1)]),la],scalex:["N",ca([sa,new Gi(1),new Gi(1)]),ca([sa,new Gi(1)])],scaley:["N",ca([new Gi(1),sa,new Gi(1)]),ca([new Gi(1),sa])],scalez:["N",ca([new Gi(1),new Gi(1),sa])],scale3d:["NNN",la],skew:["Aa",null,la],skewx:["A",null,ca([sa,Xi])],skewy:["A",null,ca([Xi,sa])],translate:["Tt",ca([sa,sa,Hi]),la],translatex:["T",ca([sa,Hi,Hi]),ca([sa,Hi])],translatey:["T",ca([Hi,sa,Hi]),ca([Hi,sa])],translatez:["L",ca([Hi,Hi,sa])],translate3d:["TTL",la]};function fa(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=ua[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,h=s[u],d=c[u];if(void 0===(f=h?{A:function(t){return"0"===t.trim()?Xi:Po(t)},N:zo,T:ko,L:Mo}[d.toUpperCase()](h):{a:Xi,n:l[0],t:Hi}[d]))return[];l.push(f)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function ha(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=ua[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,h=s[u],d=c[u];if(void 0===(f=h?{A:function(t){return"0"===t.trim()?Xi:So(t)},N:Io,T:Eo,L:wo}[d.toUpperCase()](h):{a:Xi,n:l[0],t:Hi}[d]))return[];l.push(f)}if(r.push({t:o,d:l}),n.lastIndex===t.length)return r}return[]}function da(t){var e,n,r,i;switch(t.t){case"rotatex":return i=Jr(Ao(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=Jr(Ao(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=Jr(Ao(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=Jr(Ao(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=Jr(Ao(t.d[0])),f=Jr(Ao(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=Jr(Ao(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=Jr(Ao(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=Co(t.d[0],0,null)||0,n=Co(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Co(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=Co(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=Co(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Co(t.d[0],0,null)||0,n=Co(t.d[1],0,null)||0,r=Co(t.d[2],0,null)||0,1];case"perspective":var h=Co(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,h?-1/h: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 pa(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 ga(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}(ni,t))return!1;if(Vt(ri,ni),ri[3]=0,ri[7]=0,ri[11]=0,ri[15]=1,Math.abs(Jt(ri))<1e-8)return!1;var a,s,c=ni[3],l=ni[7],u=ni[11],f=ni[12],h=ni[13],d=ni[14],p=ni[15];if(0!==c||0!==l||0!==u){if(ii[0]=c,ii[1]=l,ii[2]=u,ii[3]=p,!Kt(ri,ri))return!1;Ut(ri,ri),$e(i,ii,ri)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=h,e[2]=d,s=ni,(a=oi)[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]=At(oi[0]),It(oi[0],oi[0]),r[0]=zt(oi[0],oi[1]),si(oi[1],oi[1],oi[0],1,-r[0]),n[1]=At(oi[1]),It(oi[1],oi[1]),r[0]/=n[1],r[1]=zt(oi[0],oi[2]),si(oi[2],oi[2],oi[0],1,-r[1]),r[2]=zt(oi[1],oi[2]),si(oi[2],oi[2],oi[1],1,-r[2]),n[2]=At(oi[2]),It(oi[2],oi[2]),r[1]/=n[2],r[2]/=n[2],function(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],c=n[2];t[0]=i*c-o*s,t[1]=o*a-r*c,t[2]=r*s-i*a}(ai,oi[1],oi[2]),zt(oi[0],ai)<0)for(var g=0;g<3;g++)n[g]*=-1,oi[g][0]*=-1,oi[g][1]*=-1,oi[g][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+oi[0][0]-oi[1][1]-oi[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-oi[0][0]+oi[1][1]-oi[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-oi[0][0]-oi[1][1]+oi[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+oi[0][0]+oi[1][1]+oi[2][2],0)),oi[2][1]>oi[1][2]&&(o[0]=-o[0]),oi[0][2]>oi[2][0]&&(o[1]=-o[1]),oi[1][0]>oi[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(da).reduce(pa)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var ya=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],h=i[3],d=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];d[0][0]=1-2*(u*u+f*f),d[0][1]=2*(l*u-f*h),d[0][2]=2*(l*f+u*h),d[1][0]=2*(l*u+f*h),d[1][1]=1-2*(l*l+f*f),d[1][2]=2*(u*f-l*h),d[2][0]=2*(l*f-u*h),d[2][1]=2*(u*f+l*h),d[2][2]=1-2*(l*l+u*u),a=t(a,d);var p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];for(r[2]&&(p[2][1]=r[2],a=t(a,p)),r[1]&&(p[2][1]=0,p[2][0]=r[0],a=t(a,p)),r[0]&&(p[2][0]=0,p[1][0]=r[0],a=t(a,p)),s=0;s<3;s++)for(c=0;c<3;c++)a[s][c]*=n[s];return function(t){return 0==t[0][2]&&0==t[0][3]&&0==t[1][2]&&0==t[1][3]&&0==t[2][0]&&0==t[2][1]&&1==t[2][2]&&0==t[2][3]&&0==t[3][2]&&1==t[3][3]}(a)?[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 ma(t){return t.toFixed(6).replace(".000000","")}function va(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=ga(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=ga(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),i=[];if(1===(r=rn(r,-1,1)))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 ya(t[0],t[1],t[2],e,t[4]).map(ma).join(",")}])}function ba(t){return t.replace(/[xy]/,"")}function xa(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Oa(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?ro(a):ro(a,t.unit)}))})},o=0;o<t.length;o++)i(o)}var a,s,c=[],l=[],u=[];if(t.length!==e.length)c=[(v=va(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];else for(o=0;o<t.length;o++){var f=t[o].t,h=e[o].t,d=t[o].d,p=e[o].d,g=ua[f],y=ua[h],m=void 0;if(s=h,"perspective"===(a=f)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var v=va([t[o]],[e[o]]);c.push(v[0]),l.push(v[1]),u.push(["matrix",[v[2]]])}else{if(f===h)m=f;else if(g[2]&&y[2]&&ba(f)===ba(h))m=ba(f),d=g[2](d),p=y[2](p);else{if(!g[1]||!y[1]||xa(f)!==xa(h)){c=[(v=va(t,e))[0]],l=[v[1]],u=[["matrix",[v[2]]]];break}m=xa(f),d=g[1](d),p=y[1](p)}for(var b=[],x=[],O=[],w=0;w<d.length;w++)v=_o(d[w],p[w],n,!1,w),b[w]=v[0],x[w]=v[1],O.push(v[2]);c.push(b),l.push(x),u.push([m,O])}}if(r){var M=c;c=l,l=M}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 wa=Pi((function(t){if(nn(t)){if("text-anchor"===t)return[ro(0,"px"),ro(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:[ko(Ea(e[0])),ko(Ea(e[1]))]}return[ro(t[0]||0,"px"),ro(t[1]||0,"px")]})),Ma=function(t){if(nn(t)){if("text-anchor"===t)return[ro(0,"px"),ro(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:[Eo(Ea(e[0])),Eo(Ea(e[1]))]}return[ro(t[0]||0,"px"),ro(t[1]||0,"px")]};function Ea(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var ka=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:io.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:io.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:io.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:io.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:io.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:io.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:io.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:io.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:io.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:io.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:io.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:io.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:io.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:io.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:io.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:io.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:io.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:io.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:io.FILTER},{n:"clipPath",syntax:io.DEFINED_PATH},{n:"textPath",syntax:io.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:io.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:io.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:io.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:io.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:io.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:io.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:io.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:io.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:io.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:io.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:io.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:io.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:io.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:io.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:io.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:io.COORDINATE},{n:"y1",int:!0,l:!0,syntax:io.COORDINATE},{n:"z1",int:!0,l:!0,syntax:io.COORDINATE},{n:"x2",int:!0,l:!0,syntax:io.COORDINATE},{n:"y2",int:!0,l:!0,syntax:io.COORDINATE},{n:"z2",int:!0,l:!0,syntax:io.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:io.PATH,p:50},{n:"points",int:!0,l:!0,syntax:io.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:io.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:io.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:io.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:io.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:io.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:io.NUMBER,d:function(t){return t===Wr.PATH||t===Wr.POLYGON||t===Wr.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:io.MARKER},{n:"markerEnd",syntax:io.MARKER},{n:"markerMid",syntax:io.MARKER},{n:"markerStartOffset",syntax:io.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:io.LENGTH,l:!0,int:!0,d:"0"}],Sa=ka.filter((function(t){return!!t.l})).map((function(t){return t.n})),Pa={},_a=new WeakMap,Aa=function(){function t(t){var e=this;this.runtime=t,ka.forEach((function(t){e.registerMetadata(t)}))}return t.prototype.registerMetadata=function(t){(0,Mt.fX)([t.n],(0,Mt.zs)(t.a||[]),!1).forEach((function(e){Pa[e]=t}))},t.prototype.unregisterMetadata=function(t){delete Pa[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=Pa[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),h=t.parsedStyle.clipPath,d=t.parsedStyle.offsetPath;t.parsedStyle=Object.assign(t.parsedStyle,e);var p=!!n.forceUpdateGeometry;if(!p)for(var g=0;g<Sa.length;g++)if(Sa[g]in e){p=!0;break}e.fill&&(t.parsedStyle.fill=bo(e.fill)),e.stroke&&(t.parsedStyle.stroke=bo(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=bo(e.shadowColor)),e.filter&&(t.parsedStyle.filter=Lo(e.filter)),en(e.radius)||(t.parsedStyle.radius=jo(e.radius,4)),en(e.lineDash)||(t.parsedStyle.lineDash=jo(e.lineDash,2)),e.points&&(t.parsedStyle.points=oa(e.points)),""===e.d&&(t.parsedStyle.d=(0,Mt.Cl)({},oo)),e.d&&(t.parsedStyle.d=ra(e.d)),e.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:e.textTransform},t,null),Vn(e.clipPath)||this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",h,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",d,e.offsetPath,t,this.runtime),e.transform&&(t.parsedStyle.transform=fa(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=wa(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)),en(e.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(t,f),en(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=Pa[t],o=e;if((""===e||en(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)o=Qi(e);else if(i){var a=i.k,s=i.syntax,c=s&&this.getPropertySyntax(s);a&&a.indexOf(e)>-1?o=Qi(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=Pa[t],o="g-root"===n.id,a=e;if(i){var s=i.syntax,c=i.inh,l=i.d;if(e instanceof Ii){var u=e.value;if("unset"===u&&(u=c&&!o?"inherit":"initial"),"initial"===u)en(l)||(e=this.parseProperty(t,Bi(l)?l(n.nodeName):l,n,r));else if("inherit"===u){var f=this.tryToResolveProperty(n,t,{inherited:!0});return en(f)?void this.addUnresolveProperty(n,t):f}}var h=s&&this.getPropertySyntax(s);if(h&&h.calculator){var d=n.parsedStyle[t];a=h.calculator(t,d,e,n,this.runtime)}else a=e instanceof Ii?e.value:e}return a},t.prototype.postProcessProperty=function(t,e,n){var r=Pa[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=_a.get(t);n||(_a.set(t,[]),n=_a.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=_a.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=_a.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),_a.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 li),r.renderBounds||(r.renderBounds=new li);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,h=o.hwidth,d=void 0===h?0:h,p=o.hheight,g=void 0===p?0:p,y=o.hdepth,m=void 0===y?0:y,v=[Math.abs(d),Math.abs(g),m],b=i,x=b.stroke,O=b.lineWidth,w=void 0===O?1:O,M=b.increasedLineWidthForHitTesting,E=void 0===M?0:M,k=b.shadowType,S=void 0===k?"outer":k,P=b.shadowColor,_=b.filter,A=void 0===_?[]:_,j=b.transformOrigin,T=[s,l,f];r.contentBounds.update(T,v);var C=e===Wr.POLYLINE||e===Wr.POLYGON||e===Wr.PATH?Math.SQRT2:.5;if(x&&!x.isNone){var N=((w||0)+(E||0))*C;v[0]+=N,v[1]+=N}if(r.renderBounds.update(T,v),P&&S&&"inner"!==S){var L=r.renderBounds,R=L.min,I=L.max,z=i,D=z.shadowBlur||0,B=z.shadowOffsetX||0,F=z.shadowOffsetY||0,W=R[0]-D+B,$=I[0]+D+B,G=R[1]-D+F,H=I[1]+D+F;R[0]=Math.min(R[0],W),I[0]=Math.max(I[0],$),R[1]=Math.min(R[1],G),I[1]=Math.max(I[1],H),r.renderBounds.setMinMax(R,I)}A.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,Yr(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,h=u[0]+s+o,d=l[1]-s+a,p=u[1]+s+a;l[0]=Math.min(l[0],f),u[0]=Math.max(u[0],h),l[1]=Math.min(l[1],d),u[1]=Math.max(u[1],p),r.renderBounds.setMinMax(l,u)}})),t.geometry.dirty=!1;var V=g<0,q=(d<0?-1:1)*(j?Co(j[0],0,t,!0):0),X=(V?-1:1)*(j?Co(j[1],1,t,!0):0);(q||X)&&t.setOrigin(q,X)}},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===Wr.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===Wr.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))},t.prototype.isPropertyInheritable=function(t){var e=Pa[t];return!!e&&e.inh},t}(),ja=function(){function t(){this.parser=Po,this.parserUnmemoize=So,this.parserWithCSSDisabled=null,this.mixer=Do}return t.prototype.calculator=function(t,e,n,r){return Ao(n)},t}(),Ta=function(){function t(){}return t.prototype.calculator=function(t,e,n,r,i){return n instanceof Ii&&(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}(),Ca=function(){function t(){this.parser=bo,this.parserWithCSSDisabled=bo,this.mixer=xo}return t.prototype.calculator=function(t,e,n,r){return n instanceof Ii?"none"===n.value?to:eo:n},t}(),Na=function(){function t(){this.parser=Lo}return t.prototype.calculator=function(t,e,n){return n instanceof Ii?[]:n},t}();function La(t){var e=t.parsedStyle.fontSize;return en(e)?null:e}var Ra=function(){function t(){this.parser=ko,this.parserUnmemoize=Eo,this.parserWithCSSDisabled=null,this.mixer=Do}return t.prototype.calculator=function(t,e,n,r,i){var o;if(Qe(n))return n;if(!Gi.isRelativeUnit(n.unit))return n.value;var a=i.styleValueRegistry;if(n.unit===bi.kPercentage)return 0;if(n.unit===bi.kEms){if(r.parentNode){if(s=La(r.parentNode))return s*n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}if(n.unit===bi.kRems){if(null===(o=null==r?void 0:r.ownerDocument)||void 0===o?void 0:o.documentElement){var s;if(s=La(r.ownerDocument.documentElement))return s*n.value;a.addUnresolveProperty(r,t)}else a.addUnresolveProperty(r,t);return 0}},t}(),Ia=function(){function t(){this.mixer=Fo}return t.prototype.parser=function(t){var e=To(Qe(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}(),za=function(){function t(){this.mixer=Fo}return t.prototype.parser=function(t){var e=To(Qe(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}(),Da=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){n instanceof Ii&&(n=null);var i=null==n?void 0:n.cloneNode(!0);return i&&(i.style.isMarker=!0),i},t}(),Ba=function(){function t(){this.mixer=Do,this.parser=zo,this.parserUnmemoize=Io,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),Fa=function(){function t(){this.parser=zo,this.parserUnmemoize=Io,this.parserWithCSSDisabled=null,this.mixer=Bo(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===Wr.LINE||i===Wr.PATH||i===Wr.POLYLINE){var o=n.getPoint(r);o&&t.setLocalPosition(o.x,o.y)}}},t}(),Wa=function(){function t(){this.parser=zo,this.parserUnmemoize=Io,this.parserWithCSSDisabled=null,this.mixer=Bo(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),$a=function(){function t(){this.parser=ra,this.parserWithCSSDisabled=ra,this.mixer=ia}return t.prototype.calculator=function(t,e,n){return n instanceof Ii&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new yi(0,0,0,0)}:n},t}(),Ga=function(){this.parser=oa,this.mixer=aa},Ha=function(t){function e(){var e=t.apply(this,(0,Mt.fX)([],(0,Mt.zs)(arguments),!1))||this;return e.mixer=Bo(0,1/0),e}return(0,Mt.C6)(e,t),e}(Ra),Va=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Ii?"unset"===n.value?"":n.value:"".concat(n)},t.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},t}(),qa=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}(),Xa={},Ya=0,Ua="undefined"!=typeof window&&void 0!==window.document;function Ka(t){return!!t.getAttribute}function Za(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 Ja(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 Qa(t,e){if(Ua)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var ts={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},es="object"==typeof performance&&performance.now?performance:Date;function ns(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 rs=1,is="object"==typeof self&&self.self==self?self:"object"==typeof n.g&&n.g.global==n.g?n.g:{},os=Date.now(),as={},ss=Date.now(),cs=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-ss,r=n>16?0:16-n,i=rs++;return as[i]=t,Object.keys(as).length>1||setTimeout((function(){ss=e;var t=as;as={},Object.keys(t).forEach((function(e){return t[e](is.performance&&"function"==typeof is.performance.now?is.performance.now():Date.now()-os)}))}),r),i},ls=function(t){delete as[t]},us=function(t){return"string"!=typeof t?cs:""===t?is.requestAnimationFrame:is[t+"RequestAnimationFrame"]},fs=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!!us(t)})),hs=us(fs),ds=function(t){return"string"!=typeof t?ls:""===t?is.cancelAnimationFrame:is[t+"CancelAnimationFrame"]||is[t+"CancelRequestAnimationFrame"]}(fs);is.requestAnimationFrame=hs,is.cancelAnimationFrame=ds;var ps=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,(0,Mt.fX)([],(0,Mt.zs)(t),!1))})))},t}(),gs=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(0,Mt.sH)(this,void 0,void 0,(function(){var e,n,r;return(0,Mt.YH)(this,(function(i){switch(i.label){case 0:return this.callbacks.length?[4,(r=this.callbacks)[0].apply(r,(0,Mt.fX)([],(0,Mt.zs)(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}(),ys=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}(),ms=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}(),vs=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],bs=/([\"\'])[^\'\"]+\1/;function xs(t,e,n){return Yt(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var Os=1e-5,ws=Gt(),Ms=Gt();function Es(t,e){if(t.length){var n=Yt(ws);t.forEach((function(t){var e=t.t,i=t.d;if("scale"===e){var o=(null==i?void 0:i.map((function(t){return Math.max(t.value,Os)})))||[1,1];se(Ms,[o[0],o[1],1])}else if("scalex"===e)o=(null==i?void 0:i.map((function(t){return Math.max(t.value,Os)})))||[1],se(Ms,[o[0],1,1]);else if("scaley"===e)o=(null==i?void 0:i.map((function(t){return Math.max(t.value,Os)})))||[1],se(Ms,[1,o[0],1]);else if("scalez"===e)o=(null==i?void 0:i.map((function(t){return Math.max(t.value,Os)})))||[1],se(Ms,[1,1,o[0]]);else if("scale3d"===e)o=(null==i?void 0:i.map((function(t){return Math.max(t.value,Os)})))||[1,1,1],se(Ms,[o[0],o[1],o[2]]);else if("translate"===e)ae(Ms,[(a=i||[Hi,Hi])[0].value,a[1].value,0]);else if("translatex"===e)ae(Ms,[(a=i||[Hi])[0].value,0,0]);else if("translatey"===e)ae(Ms,[0,(a=i||[Hi])[0].value,0]);else if("translatez"===e)ae(Ms,[0,0,(a=i||[Hi])[0].value]);else if("translate3d"===e){var a;ae(Ms,[(a=i||[Hi,Hi,Hi])[0].value,a[1].value,a[2].value])}else if("rotate"===e)fe(Ms,Jr(Ao((s=i||[Xi])[0])));else if("rotatex"===e)le(Ms,Jr(Ao((s=i||[Xi])[0])));else if("rotatey"===e)ue(Ms,Jr(Ao((s=i||[Xi])[0])));else if("rotatez"===e)fe(Ms,Jr(Ao((s=i||[Xi])[0])));else if("rotate3d"===e){var s;ce(Ms,Jr(Ao((s=i||[Hi,Hi,Hi,Xi])[3])),[s[0].value,s[1].value,s[2].value])}else if("skew"===e){var c=(null==i?void 0:i.map((function(t){return t.value})))||[0,0];xs(Ms,Jr(c[0]),Jr(c[1]))}else if("skewx"===e)c=(null==i?void 0:i.map((function(t){return t.value})))||[0],xs(Ms,Jr(c[0]),0);else if("skewy"===e)c=(null==i?void 0:i.map((function(t){return t.value})))||[0],xs(Ms,0,Jr(c[0]));else if("matrix"===e){var l=(0,Mt.zs)(i.map((function(t){return t.value})),6),u=l[0],f=l[1],h=l[2],d=l[3],p=l[4],g=l[5];Xt(Ms,u,f,0,0,h,d,0,0,0,0,1,0,p,g,0,1)}else"matrix3d"===e&&Xt.apply(r,(0,Mt.fX)([Ms],(0,Mt.zs)(i.map((function(t){return t.value}))),!1));De(n,n,Ms)})),e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var ks,Ss=function(){function t(){this.parser=fa,this.parserUnmemoize=ha,this.parserWithCSSDisabled=ha,this.mixer=Oa}return t.prototype.calculator=function(t,e,n,r){return n instanceof Ii?[]:n},t.prototype.postProcessor=function(t){Es(t.parsedStyle.transform,t)},t}(),Ps=function(){function t(){this.parser=wa,this.parserUnmemoize=Ma}return t.prototype.postProcessor=function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===bi.kPixels&&e[1].unit===bi.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()},t}(),_s=function(){function t(){this.parser=zo,this.parserUnmemoize=Io}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=qi.Z_INDEX_CHANGED)}},t}(),As=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}(),js=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}(),Ts=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}(),Cs=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}(),Ns=function(){function t(){}return t.prototype.update=function(t){if(t.points&&E(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,(0,Mt.fX)([],(0,Mt.zs)(e.map((function(t){return t[0]}))),!1)),r=Math.max.apply(Math,(0,Mt.fX)([],(0,Mt.zs)(e.map((function(t){return t[0]}))),!1)),i=Math.min.apply(Math,(0,Mt.fX)([],(0,Mt.zs)(e.map((function(t){return t[1]}))),!1)),o=Math.max.apply(Math,(0,Mt.fX)([],(0,Mt.zs)(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}(),Ls=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&&!nn(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}(),Rs=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 cc.enableCSSParsing?n&&o&&a&&s&&c&&r&&i&&!en(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,h=void 0===f?0:f,d=t.dy,p=void 0===d?0:d,g=t.x,y=void 0===g?0:g,m=t.y,v=void 0===m?0:m;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 O=x.width,w=x.height,M=x.lineHeight,E=x.fontProperties,k=O/2,S=w/2,P=y+k;"center"===a||"middle"===a?P+=c/2-k:"right"!==a&&"end"!==a||(P+=c-2*k);var _=v-S;return"middle"===u?_+=S:"top"===u||"hanging"===u?_+=2*S:"alphabetic"===u?_+=this.globalRuntime.enableCSSParsing?M-E.ascent:0:"bottom"!==u&&"ideographic"!==u||(_+=0),h&&(P+=h),p&&(_+=p),{cx:P,cy:_,hwidth:k,hheight:S}},t}(),Is=function(){function t(){}return t.prototype.update=function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}},t}(),zs=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 gi,this.page=new gi,this.canvas=new gi,this.viewport=new gi,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(mi)},t}(),Ds=function(t){function e(){var e=t.apply(this,(0,Mt.fX)([],(0,Mt.zs)(arguments),!1))||this;return e.client=new gi,e.movement=new gi,e.offset=new gi,e.global=new gi,e.screen=new gi,e}return(0,Mt.C6)(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(mi)},e}(zs),Bs=function(t){function e(){var e=t.apply(this,(0,Mt.fX)([],(0,Mt.zs)(arguments),!1))||this;return e.width=0,e.height=0,e.isPrimary=!1,e}return(0,Mt.C6)(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}(Ds),Fs=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Mt.C6)(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(Ds),Ws=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(0,Mt.C6)(e,t),e}(zs),$s=function(){function t(){this.emitter=new Et}return t.prototype.on=function(t,e,n){return this.addEventListener(t,e,n),this},t.prototype.addEventListener=function(t,e,n){var r=qn(n)&&n||Xn(n)&&n.capture,i=Xn(n)&&n.once,o=Bi(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var c=(0,Mt.zs)(t.split(":"),2),l=c[0];t=c[1],s=l,a=!0}if(t=r?"".concat(t,"capture"):t,e=Bi(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,(0,Mt.fX)([],(0,Mt.zs)(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=qn(n)&&n||Xn(n)&&n.capture,i=Bi(e)?void 0:e;return t=r?"".concat(t,"capture"):t,e=Bi(e)?e:null==e?void 0:e.handleEvent,this.emitter.off(t,e,i),this},t.prototype.emit=function(t,e){this.dispatchEvent(new Ws(t,e))},t.prototype.dispatchEvent=function(t,e){var n,r,i;if(void 0===e&&(e=!1),!function(t){return!!t.type}(t))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}(),Gs=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(0,Mt.C6)(e,t),e.isNode=function(t){return!!t.childNodes},Object.defineProperty(e.prototype,"textContent",{get:function(){var t,e,n="";this.nodeName===Wr.TEXT&&(n+=this.style.text);try{for(var r=(0,Mt.Ju)(this.childNodes),i=r.next();!i.done;i=r.next()){var o=i.value;o.nodeName===Wr.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===Wr.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(mi)},e.prototype.lookupNamespaceURI=function(t){throw new Error(mi)},e.prototype.lookupPrefix=function(t){throw new Error(mi)},e.prototype.normalize=function(){throw new Error(mi)},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],h=s[l+u];if(h!==f){var d=f.parentNode.childNodes;return d.indexOf(f)<d.indexOf(h)?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}($s),Hs=function(){function t(t,e){var n=this;this.globalRuntime=t,this.context=e,this.emitter=new Et,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=Gt(),this.tmpVec3=Pt(),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=es.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);)i.currentTarget=l,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?n.notifyTarget(i,"touchendoutside"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||(o=2===i.button,n.notifyTarget(i,o?"rightupoutside":"mouseupoutside")),Gs.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"),Gs.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&&Gs.isNode(o)&&o.parentNode;f&&f!==(Gs.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(Gs.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var h=n.clonePointerEvent(e,"pointerenter");for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==o&&h.target!==(Gs.isNode(n.rootTarget)&&n.rootTarget.parentNode);)h.currentTarget=h.target,n.notifyTarget(h),r&&n.notifyTarget(h,"mouseenter"),Gs.isNode(h.target)&&(h.target=h.target.parentNode);n.freeEvent(h)}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!==(Gs.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),r&&n.notifyTarget(a,"mouseleave"),Gs.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!==(Gs.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),i&&n.notifyTarget(o,"mouseenter"),Gs.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"),Gs.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 gi(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 gi(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=Qt(this.tmpMatrix,c,s),u=Ct(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return Bt(u,u,l),new gi(u[0],u[1])},t.prototype.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=Qt(this.tmpMatrix,n,r),o=Ct(this.tmpVec3,t.x,t.y,0);Bt(this.tmpVec3,this.tmpVec3,i);var a=this.context.config,s=a.width,c=a.height;return new gi((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);for(t.eventPhase=t.BUBBLING_PHASE,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++)Gs.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=(0,Mt.Ju)(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(Bs);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(Fs);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(Fs);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(Bs);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=es.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||Gs.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},t.prototype.getCursor=function(t){for(var e=t;e;){var n=Ka(e)&&e.getAttribute("cursor");if(n)return n;e=Gs.isNode(e)&&e.parentNode}},t}(),Vs=function(){function t(){}return t.prototype.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t||cc.offscreenCanvas)this.canvas=t||cc.offscreenCanvas,this.context=this.canvas.getContext("2d",(0,Mt.Cl)({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",(0,Mt.Cl)({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",(0,Mt.Cl)({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"}(ks||(ks={}));var qs,Xs=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 ys,initAsync:new ps,dirtycheck:new ms,cull:new ms,beginFrame:new ys,beforeRender:new ys,render:new ys,afterRender:new ys,endFrame:new ys,destroy:new ys,pick:new gs,pickSync:new ms,pointerDown:new ys,pointerUp:new ys,pointerMove:new ys,pointerOut:new ys,pointerOver:new ys,pointerWheel:new ys,pointerCancel:new ys,click:new ys}}return t.prototype.init=function(t){var e=this,n=(0,Mt.Cl)((0,Mt.Cl)({},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(ks.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(ks.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!==qi.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;Za(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(Za)},t.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},t.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(ks.DISPLAY_OBJECT_CHANGED)},t}(),Ys=/\[\s*(.*)=(.*)\s*\]/,Us=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(Ys),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 en(n)?"":n.toString?n.toString():""},t}(),Ks=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(0,Mt.C6)(e,t),e.ADDITION=2,e.MODIFICATION=1,e.REMOVAL=3,e}(zs);function Zs(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"}(qs||(qs={}));var Js,Qs,tc,ec=new Ks(qs.REPARENT,null,"","","",0,"",""),nc=function(){function t(t){var e,n,r,i,o,a,s,c,l=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new Ws(qs.BOUNDS_CHANGED),this.rotate=(e=Ge(),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=jt(n,r,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var s=Ge();Xe(s,n[0],n[1],n[2]);var c=l.getRotation(t),u=l.getRotation(t.parentNode);Ke(e,u),qe(e,e),Ve(s,e,s),Ve(a.localRotation,s,c),Je(a.localRotation,a.localRotation),o&&l.dirtifyLocal(t,a)}else l.rotateLocal(t,n)}),this.rotateLocal=(c=Ge(),function(t,e,n,r,i){void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=!0),"number"==typeof e&&(e=jt(e,n,r));var o=t.transformable;Xe(c,e[0],e[1],e[2]),Ze(o.localRotation,o.localRotation,c),i&&l.dirtifyLocal(t,o)}),this.setEulerAngles=(n=Ge(),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=jt(e,r,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Xe(a.localRotation,e[0],e[1],e[2]);var s=l.getRotation(t.parentNode);Ke(n,qe(Ge(),s)),Ze(a.localRotation,a.localRotation,n),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=jt(e,n,r));var o=t.transformable;Ft(e,Pt())||(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,h=r*c-i*s,d=i*h-o*f,p=o*u-r*h,g=r*f-i*u,y=2*a;u*=y,f*=y,h*=y,d*=2,p*=2,g*=2,t[0]=s+u+d,t[1]=c+f+p,t[2]=l+h+g}(e,e,o.localRotation),Nt(o.localPosition,o.localPosition,e),i&&l.dirtifyLocal(t,o))},this.setPosition=(r=Gt(),i=Pt(),function(t,e,n){void 0===n&&(n=!0);var o=t.transformable;if(i[0]=e[0],i[1]=e[1],i[2]=e[2]||0,!Ft(l.getPosition(t),i)){if(Tt(o.position,i),null!==t.parentNode&&t.parentNode.transformable){var a=t.parentNode.transformable;Vt(r,a.worldTransform),Kt(r,r),Bt(o.localPosition,i,r)}else Tt(o.localPosition,i);n&&l.dirtifyLocal(t,o)}}),this.setLocalPosition=function(){var t=Pt();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,Ft(i.localPosition,t)||(Tt(i.localPosition,t),r&&l.dirtifyLocal(e,i))}}(),this.translate=(o=Pt(),a=Pt(),s=Pt(),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=Ct(a,e,n,r)),Ft(e,o)||(Nt(s,l.getPosition(t),e),l.setPosition(t,s,i))}),this.setRotation=function(){var t=Ge();return function(e,n,r,i,o,a){void 0===a&&(a=!0);var s=e.transformable;if("number"==typeof n&&(n=Ue(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var c=l.getRotation(e.parentNode);Ke(t,c),qe(t,t),Ve(s.localRotation,t,n),Je(s.localRotation,s.localRotation),a&&l.dirtifyLocal(e,s)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=Gt(),e=Pt(),n=Ue(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(ve(r.localTransform,r.localRotation,r.localPosition,jt(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=Yt(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),Qt(r.localTransform,r.localTransform,i)}var o=ve(t,n,e,r.localScale,r.origin);Qt(r.localTransform,r.localTransform,o)}else ve(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,en(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=qi.ADDED);var a=t.transformable;a&&this.dirtifyWorld(t,a),a.frozen&&this.unfreezeParentToRoot(t),i&&t.dispatchEvent(ec)},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=qi.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=jt(e,n,r));var o=t.transformable;Xe(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=t.transformable;(function(t,e,n){t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2]})(r.localScale,r.localScale,jt(e[0],e[1],e[2]||1)),n&&this.dirtifyLocal(t,r)},t.prototype.setLocalScale=function(t,e,n){void 0===n&&(n=!0);var r=t.transformable,i=jt(e[0],e[1],e[2]||r.localScale[2]);Ft(i,r.localScale)||(Tt(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=Ue(e,n,r,i));var a=t.transformable;Ke(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=t.transformable;!function(t,e){t[0]=e[0],t[1]=e[1]}(r.localSkew,e),this.dirtifyLocal(t,r)},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=(0,Mt.zs)(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;)Zs(n),n=n.parentNode;e&&t.forEach((function(t){Zs(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 Ks(qs.ATTR_MODIFIED,n,e,e,t,Ks.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))},t.prototype.getPosition=function(t){var e=t.transformable;return pe(e.position,this.getWorldTransform(t,e))},t.prototype.getRotation=function(t){var e=t.transformable;return ye(e.rotation,this.getWorldTransform(t,e))},t.prototype.getScale=function(t){var e=t.transformable;return ge(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=pe(Pt(),e),r=ye(Ge(),e),i=ge(Pt(),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(li.isEmpty(r))return null;var i=n||new li;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&&cc.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new li},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 li).update(r.center,r.halfExtents))})),o||(o=new li),e){var a=Ja(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=Gt();t.parentNode.transformable&&(e=Kt(Gt(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!li.isEmpty(n)){var r=new li;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},t.prototype.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);li.isEmpty(i)||(r=new li).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=(0,Mt.zs)(r.getMin(),2),s=a[0],c=a[1],l=(0,Mt.zs)(r.getMax(),2),u=l[0],f=l[1];return new yi(s+((null==o?void 0:o.left)||0),c+((null==o?void 0:o.top)||0),u-s,f-c)}return new yi((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?Qt(e.worldTransform,r.worldTransform,e.localTransform):Vt(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}(),rc={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]},ic=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,oc=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹓﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),ac=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),sc=function(){function t(t){var e=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!ac.exec(n)&&!oc.exec(t))},this.trimByKinsokuShorui=function(t){var e=(0,Mt.fX)([],(0,Mt.zs)(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=rc.MetricsString+rc.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(rc.BaselineSymbol).width),c=rc.HeightMultiplier*s;s=s*rc.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,h=0,d=0,p=!1;for(h=0;h<s;++h){for(var g=0;g<f;g+=4)if(255!==l[d+g]){p=!0;break}if(p)break;d+=f}for(n.ascent=s-h,d=u-f,p=!1,h=c;h>s;--h){for(g=0;g<f;g+=4)if(255!==l[d+g]){p=!0;break}if(p)break;d-=f}return n.descent=h-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,h=e.textAlign,d=void 0===h?"start":h,p=e.letterSpacing,g=void 0===p?0:p,y=e.textPath;e.textPathSide,e.textPathStartOffset;var m=e.leading,v=void 0===m?0:m,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=Qe(n)&&"".concat(n,"px")||"16px",h=i.split(","),d=h.length-1;d>=0;d--){var p=h[d].trim();!bs.test(p)&&vs.indexOf(p)<0&&(p='"'.concat(p,'"')),h[d]=p}return"".concat(a," ").concat(c," ").concat(u," ").concat(f," ").concat(h.join(","))}(e),x=this.measureFont(b,n);0===x.fontSize&&(x.fontSize=i,x.ascent=i);var O=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);O.font=b,e.isOverflowing=!1;var w=(a?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),M=new Array(w.length),E=0;if(!y){for(A=0;A<w.length;A++){var k=O.measureText(w[A]).width+(w[A].length-1)*g;M[A]=k,E=Math.max(E,k)}j=E+l;var S=s||x.fontSize+l,P=Math.max(S,x.fontSize+l)+(w.length-1)*(S+v),_=0;return"middle"===f?_=-P/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?_=-P:"top"!==f&&"hanging"!==f||(_=0),{font:b,width:j,height:P,lines:w,lineWidths:M,lineHeight:S+=v,maxLineWidth:E,fontProperties:x,lineMetrics:M.map((function(t,e){var n=0;return"center"===d||"middle"===d?n-=t/2:"right"!==d&&"end"!==d||(n-=t),new yi(n-l/2,_+e*S,t+l,S)}))}}y.getTotalLength();for(var A=0;A<w.length;A++)var j=O.measureText(w[A]).width+(w[A].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),h=o+s,d="";"ellipsis"===u?d="...":u&&"clip"!==u&&(d=u);for(var p=[],g=0,y=0,m={},v=function(t){return r.getFromCache(t,s,m,f)},b=Array.from(d).reduce((function(t,e){return t+v(e)}),0),x=Array.from(t),O=0;O<x.length;O++){var w=x[O],M=t[O-1],E=t[O+1],k=v(w);if(this.isNewline(w)){if(++g>=l){e.isOverflowing=!0;break}y=0,p[g]=""}else{if(y>0&&y+k>h){if(g+1>=l){if(e.isOverflowing=!0,b>0&&b<=h){for(var S=p[g].length,P=0,_=S,A=0;A<S;A++){var j=v(p[g][A]);if(P+j+b>h){_=A;break}P+=j}p[g]=(p[g]||"").slice(0,_)+d}break}if(y=0,p[++g]="",this.isBreakingSpace(w))continue;this.canBreakInLastChar(w)||(p=this.trimToBreakable(p),y=this.sumTextWidthByCache(p[g]||"",m)),this.shouldBreakByKinsokuShorui(w,E)&&(p=this.trimByKinsokuShorui(p),y+=v(M||""))}y+=k,p[g]=(p[g]||"")+w}}return p.join("\n")},t.prototype.isBreakingSpace=function(t){return"string"==typeof t&&rc.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},t.prototype.isNewline=function(t){return"string"==typeof t&&rc.Newlines.indexOf(t.charCodeAt(0))>=0},t.prototype.trimToBreakable=function(t){var e=(0,Mt.fX)([],(0,Mt.zs)(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||!ic.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(!ic.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}(),cc={},lc=(Qs=new Ls,tc=new Ns,(Js={})[Wr.CIRCLE]=new As,Js[Wr.ELLIPSE]=new js,Js[Wr.RECT]=Qs,Js[Wr.IMAGE]=Qs,Js[Wr.GROUP]=new Is,Js[Wr.LINE]=new Ts,Js[Wr.TEXT]=new Rs(cc),Js[Wr.POLYLINE]=tc,Js[Wr.POLYGON]=tc,Js[Wr.PATH]=new Cs,Js[Wr.HTML]=null,Js[Wr.MESH]=null,Js),uc=function(){var t,e=new Ca,n=new Ra;return(t={})[io.PERCENTAGE]=null,t[io.NUMBER]=new Ba,t[io.ANGLE]=new ja,t[io.DEFINED_PATH]=new Ta,t[io.PAINT]=e,t[io.COLOR]=e,t[io.FILTER]=new Na,t[io.LENGTH]=n,t[io.LENGTH_PERCENTAGE]=n,t[io.LENGTH_PERCENTAGE_12]=new Ia,t[io.LENGTH_PERCENTAGE_14]=new za,t[io.COORDINATE]=new Ra,t[io.OFFSET_DISTANCE]=new Fa,t[io.OPACITY_VALUE]=new Wa,t[io.PATH]=new $a,t[io.LIST_OF_POINTS]=new Ga,t[io.SHADOW_BLUR]=new Ha,t[io.TEXT]=new Va,t[io.TEXT_TRANSFORM]=new qa,t[io.TRANSFORM]=new Ss,t[io.TRANSFORM_ORIGIN]=new Ps,t[io.Z_INDEX]=new _s,t[io.MARKER]=new Da,t}();cc.CameraContribution=Si,cc.AnimationTimeline=null,cc.EasingFunction=null,cc.offscreenCanvasCreator=new Vs,cc.sceneGraphSelector=new Us,cc.sceneGraphService=new nc(cc),cc.textService=new sc(cc),cc.geometryUpdaterFactory=lc,cc.CSSPropertySyntaxFactory=uc,cc.styleValueRegistry=new Aa(cc),cc.layoutRegistry=null,cc.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},cc.enableCSSParsing=!1,cc.enableDataset=!1,cc.enableStyleSyntax=!0,cc.enableAttributeDashCased=!1,cc.enableSizeAttenuation=!1;var fc=0,hc=new Ks(qs.INSERTED,null,"","","",0,"",""),dc=new Ks(qs.REMOVED,null,"","","",0,"",""),pc=new Ws(qs.DESTROY),gc=function(t){function e(){var e=t.call(this)||this;return e.entity=fc++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},e.cullable={strategy:Vi.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=cc.enableCSSParsing?{opacity:Ui,fillOpacity:Ui,strokeOpacity:Ui,fill:Ui,stroke:Ui,transform:Ui,transformOrigin:Ui,visibility:Ui,pointerEvents:Ui,lineWidth:Ui,lineCap:Ui,lineJoin:Ui,increasedLineWidthForHitTesting:Ui,fontSize:Ui,fontFamily:Ui,fontStyle:Ui,fontWeight:Ui,fontVariant:Ui,textAlign:Ui,textBaseline:Ui,textTransform:Ui,zIndex:Ui,filter:Ui,shadowType:Ui}:null,e.parsedStyle={},e.attributes={},e}return(0,Mt.C6)(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(mi)},e.prototype.appendChild=function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return cc.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),this.isMutationObserved&&(hc.relatedNode=this,t.dispatchEvent(hc)),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 dc.relatedNode=this,t.dispatchEvent(dc),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),cc.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 cc.sceneGraphService.matches(t,this)},e.prototype.getElementById=function(t){return cc.sceneGraphService.querySelector("#".concat(t),this)},e.prototype.getElementsByName=function(t){return cc.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)},e.prototype.getElementsByClassName=function(t){return cc.sceneGraphService.querySelectorAll(".".concat(t),this)},e.prototype.getElementsByTagName=function(t){return cc.sceneGraphService.querySelectorAll(t,this)},e.prototype.querySelector=function(t){return cc.sceneGraphService.querySelector(t,this)},e.prototype.querySelectorAll=function(t){return cc.sceneGraphService.querySelectorAll(t,this)},e.prototype.closest=function(t){var e=this;do{if(cc.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=(0,Mt.zs)(e),o=i[0],a=i.slice(1);this.parentNode.appendChild(o,r),(t=o).after.apply(t,(0,Mt.fX)([],(0,Mt.zs)(a),!1))}},e.prototype.replaceWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.after.apply(this,(0,Mt.fX)([],(0,Mt.zs)(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,(0,Mt.fX)([],(0,Mt.zs)(t),!1))},e.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},e.prototype.destroy=function(){this.dispatchEvent(pc),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},e.prototype.getGeometryBounds=function(){return cc.sceneGraphService.getGeometryBounds(this)},e.prototype.getRenderBounds=function(){return cc.sceneGraphService.getBounds(this,!0)},e.prototype.getBounds=function(){return cc.sceneGraphService.getBounds(this)},e.prototype.getLocalBounds=function(){return cc.sceneGraphService.getLocalBounds(this)},e.prototype.getBoundingClientRect=function(){return cc.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 cc.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){if(cc.enableAttributeDashCased){var n=Wi(t);e=this.attributes[n]}return cc.enableCSSParsing&&en(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(mi)},e.prototype.getAttributeNode=function(t){throw new Error(mi)},e.prototype.getAttributeNodeNS=function(t,e){throw new Error(mi)},e.prototype.hasAttributeNS=function(t,e){throw new Error(mi)},e.prototype.removeAttributeNS=function(t,e){throw new Error(mi)},e.prototype.removeAttributeNode=function(t){throw new Error(mi)},e.prototype.setAttributeNS=function(t,e,n){throw new Error(mi)},e.prototype.setAttributeNode=function(t){throw new Error(mi)},e.prototype.setAttributeNodeNS=function(t){throw new Error(mi)},e.prototype.toggleAttribute=function(t,e){throw new Error(mi)},e}(Gs);function yc(t){return!!(null==t?void 0:t.nodeName)}var mc,vc=cc.globalThis.Proxy?cc.globalThis.Proxy:function(){},bc=new Ks(qs.ATTR_MODIFIED,null,null,null,null,Ks.MODIFICATION,null,null),xc={opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Oc={fill:to,stroke:to,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},wc=(0,Mt.fX)((0,Mt.fX)([],(0,Mt.zs)(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"]),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),Mc="data-",Ec=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||Wr.GROUP,cc.enableCSSParsing?(Object.assign(n.attributes,xc),Object.assign(n.parsedStyle,Oc,n.config.initialParsedStyle)):n.config.initialParsedStyle&&Object.assign(n.parsedStyle,n.config.initialParsedStyle),n.initAttributes(n.config.style),cc.enableDataset&&(n.dataset=new vc({},{get:function(t,e){var r="".concat(Mc).concat(Di(e));return void 0!==t[r]?t[r]:n.getAttribute(r)},set:function(t,e,r){return n.setAttribute("".concat(Mc).concat(Di(e)),r),!0}})),cc.enableStyleSyntax&&(n.style=new vc({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(0,Mt.C6)(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=(0,Mt.Cl)({},this.attributes);for(var r in n){var i=n[r];yc(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};cc.enableCSSParsing&&(n.usedAttributes=wc);var r=t;if(cc.enableAttributeDashCased)for(var i in r={},t)r[Wi(i)]=t[i];cc.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),cc.enableAttributeDashCased&&(e=Wi(e)),Vn(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];cc.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(bc.relatedNode=this,bc.prevValue=o,bc.newValue=e,bc.attrName=t,bc.prevParsedValue=a,bc.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(bc):(bc.target=this,this.ownerDocument.defaultView.dispatchEvent(bc,!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=(0,Mt.zs)(t.getMin(),2),n=e[0],r=e[1],i=(0,Mt.zs)(t.getMax(),2),o=i[0],a=i[1];return new yi(n,r,o-n,a-r)},e.prototype.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),cc.sceneGraphService.setOrigin(this,Zr(t,e,n)),this},e.prototype.getOrigin=function(){return cc.sceneGraphService.getOrigin(this)},e.prototype.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),cc.sceneGraphService.setPosition(this,Zr(t,e,n)),this},e.prototype.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),cc.sceneGraphService.setLocalPosition(this,Zr(t,e,n)),this},e.prototype.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),cc.sceneGraphService.translate(this,Zr(t,e,n)),this},e.prototype.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),cc.sceneGraphService.translateLocal(this,Zr(t,e,n)),this},e.prototype.getPosition=function(){return cc.sceneGraphService.getPosition(this)},e.prototype.getLocalPosition=function(){return cc.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=Zr(t,e=e||t,n=n||t)),cc.sceneGraphService.scaleLocal(this,t),this},e.prototype.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=Zr(t,e=e||t,n=n||t)),cc.sceneGraphService.setLocalScale(this,t),this},e.prototype.getLocalScale=function(){return cc.sceneGraphService.getLocalScale(this)},e.prototype.getScale=function(){return cc.sceneGraphService.getScale(this)},e.prototype.getEulerAngles=function(){return Qr((0,Mt.zs)(ti(Pt(),cc.sceneGraphService.getWorldTransform(this)),3)[2])},e.prototype.getLocalEulerAngles=function(){return Qr((0,Mt.zs)(ti(Pt(),cc.sceneGraphService.getLocalRotation(this)),3)[2])},e.prototype.setEulerAngles=function(t){return cc.sceneGraphService.setEulerAngles(this,0,0,t),this},e.prototype.setLocalEulerAngles=function(t){return cc.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},e.prototype.rotateLocal=function(t,e,n){return en(e)&&en(n)?cc.sceneGraphService.rotateLocal(this,0,0,t):cc.sceneGraphService.rotateLocal(this,t,e,n),this},e.prototype.rotate=function(t,e,n){return en(e)&&en(n)?cc.sceneGraphService.rotate(this,0,0,t):cc.sceneGraphService.rotate(this,t,e,n),this},e.prototype.setRotation=function(t,e,n,r){return cc.sceneGraphService.setRotation(this,t,e,n,r),this},e.prototype.setLocalRotation=function(t,e,n,r){return cc.sceneGraphService.setLocalRotation(this,t,e,n,r),this},e.prototype.setLocalSkew=function(t,e){return cc.sceneGraphService.setLocalSkew(this,t,e),this},e.prototype.getRotation=function(){return cc.sceneGraphService.getRotation(this)},e.prototype.getLocalRotation=function(){return cc.sceneGraphService.getLocalRotation(this)},e.prototype.getLocalSkew=function(){return cc.sceneGraphService.getLocalSkew(this)},e.prototype.getLocalTransform=function(){return cc.sceneGraphService.getLocalTransform(this)},e.prototype.getWorldTransform=function(){return cc.sceneGraphService.getWorldTransform(this)},e.prototype.setLocalTransform=function(t){return cc.sceneGraphService.setLocalTransform(this,t),this},e.prototype.resetLocalTransform=function(){cc.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 cc.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,(0,Mt.fX)([],(0,Mt.zs)(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,(0,Mt.fX)([],(0,Mt.zs)(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=(0,Mt.zs)(e,2),i=r[0],o=r[1];return i?Xn(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=(0,Mt.zs)(pe(Pt(),e),2),r=n[0],i=n[1],o=(0,Mt.zs)(ge(Pt(),e),2),a=o[0],s=o[1],c=ye(Ge(),e),l=(0,Mt.zs)(ti(Pt(),c),3),u=l[0],f=l[2];return function(t,e,n,r,i){var o,a,s,c,l,u,f,h=Math.cos(t),d=Math.sin(t);return o=r*h,a=i*d,s=-r*d,c=i*h,l=e,u=n,(f=new St(9))[0]=o,f[1]=a,f[2]=0,f[3]=s,f[4]=c,f[5]=0,f[6]=l,f[7]=u,f[8]=1,f}(u||f,r,i,a,s)},e.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},e.prototype.setMatrix=function(t){var e=(0,Mt.zs)(ei(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=(0,Mt.zs)(ei(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(){cc.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},e.prototype.hide=function(){cc.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}(gc),kc=function(t){function e(e){return void 0===e&&(e={}),t.call(this,(0,Mt.Cl)({type:Wr.CIRCLE},e))||this}return(0,Mt.C6)(e,t),e}(Ec),Sc=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=(0,Mt.Tt)(e,["style"]);return(n=t.call(this,(0,Mt.Cl)({style:(cc.enableCSSParsing,(0,Mt.Cl)({},r))},i))||this).isCustomElement=!0,n}return(0,Mt.C6)(e,t),e}(Ec),Pc=function(t){function e(e){return void 0===e&&(e={}),t.call(this,(0,Mt.Cl)({type:Wr.ELLIPSE},e))||this}return(0,Mt.C6)(e,t),e}(Ec),_c=function(t){function e(e){return void 0===e&&(e={}),t.call(this,(0,Mt.Cl)({type:Wr.GROUP},e))||this}return(0,Mt.C6)(e,t),e}(Ec),Ac=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=(0,Mt.Tt)(e,["style"]);return(n=t.call(this,(0,Mt.Cl)({type:Wr.HTML,style:cc.enableCSSParsing?(0,Mt.Cl)({x:"",y:"",width:"auto",height:"auto",innerHTML:""},r):(0,Mt.Cl)({},r)},i))||this).cullable.enable=!1,n}return(0,Mt.C6)(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 yi(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 li,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=Kt(Gt(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!li.isEmpty(e)){var n=new li;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},e}(Ec),jc=function(t){function e(e){return void 0===e&&(e={}),t.call(this,(0,Mt.Cl)({type:Wr.IMAGE},e))||this}return(0,Mt.C6)(e,t),e}(Ec),Tc=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=(0,Mt.Tt)(e,["style"]);(n=t.call(this,(0,Mt.Cl)({type:Wr.LINE,style:(0,Mt.Cl)({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&&yc(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),s&&yc(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return(0,Mt.C6)(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&&yc(r)&&(this.markerStartAngle=0,r.remove()),i&&yc(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&yc(r)&&(this.markerEndAngle=0,r.remove()),i&&yc(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},e.prototype.transformMarker=function(t){var e,n,r,i,o,a,s,c=this.parsedStyle,l=c.markerStart,u=c.markerEnd,f=c.markerStartOffset,h=c.markerEndOffset,d=c.x1,p=c.x2,g=c.y1,y=c.y2,m=t?l:u;m&&yc(m)&&(t?(i=d,o=g,n=p-d,r=y-g,a=f||0,s=this.markerStartAngle):(i=p,o=y,n=d-p,r=g-y,a=h||0,s=this.markerEndAngle),e=Math.atan2(r,n),m.setLocalEulerAngles(180*e/Math.PI+s),m.setLocalPosition(i+Math.cos(e)*a,o+Math.sin(e)*a))},e.prototype.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=Tr(n.x1,n.y1,n.x2,n.y2,t),i=r.x,o=r.y,a=Bt(Pt(),jt(i,o,0),e?this.getWorldTransform():this.getLocalTransform());return new gi(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 jr(t.x1,t.y1,t.x2,t.y2)},e}(Ec),Cc=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=(0,Mt.Tt)(e,["style"]);(n=t.call(this,(0,Mt.Cl)({type:Wr.PATH,style:cc.enableCSSParsing?(0,Mt.Cl)({d:"",miterLimit:""},r):(0,Mt.Cl)({},r),initialParsedStyle:cc.enableCSSParsing?null:{miterLimit:4,d:(0,Mt.Cl)({},oo)}},i))||this).markerStartAngle=0,n.markerEndAngle=0,n.markerMidList=[];var o=n.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&yc(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&yc(c)&&n.placeMarkerMid(c),s&&yc(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return(0,Mt.C6)(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&&yc(r)&&(this.markerStartAngle=0,r.remove()),i&&yc(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&yc(r)&&(this.markerEndAngle=0,r.remove()),i&&yc(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&&yc(a)){var s,c,l,u,f,h,d;if(t){var p=(0,Mt.zs)(this.getStartTangent(),2),g=p[0];u=(y=p[1])[0],f=y[1],c=g[0]-y[0],l=g[1]-y[1],h=i||0,d=this.markerStartAngle}else{var y,m=(0,Mt.zs)(this.getEndTangent(),2);g=m[0],u=(y=m[1])[0],f=y[1],c=g[0]-y[0],l=g[1]-y[1],h=o||0,d=this.markerEndAngle}s=Math.atan2(l,c),a.setLocalEulerAngles(180*s/Math.PI+d),a.setLocalPosition(u+Math.cos(s)*h,f+Math.sin(s)*h)}},e.prototype.placeMarkerMid=function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&yc(t))for(var n=1;n<e.length-1;n++){var r=(0,Mt.zs)(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 Wo(this)},e.prototype.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=function(t,e,n){return An(t,e,(0,Mt.Cl)((0,Mt.Cl)({},void 0),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,o=Bt(Pt(),jt(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new gi(o[0],o[1])},e.prototype.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Wo(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}(Ec),Nc=function(t){function e(e){void 0===e&&(e={});var n=this,r=e.style,i=(0,Mt.Tt)(e,["style"]);(n=t.call(this,(0,Mt.Cl)({type:Wr.POLYGON,style:cc.enableCSSParsing?(0,Mt.Cl)({points:"",miterLimit:"",isClosed:!0},r):(0,Mt.Cl)({},r),initialParsedStyle:cc.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&&yc(a)&&(n.markerStartAngle=a.getLocalEulerAngles(),n.appendChild(a)),c&&yc(c)&&n.placeMarkerMid(c),s&&yc(s)&&(n.markerEndAngle=s.getLocalEulerAngles(),n.appendChild(s)),n.transformMarker(!0),n.transformMarker(!1),n}return(0,Mt.C6)(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&&yc(r)&&(this.markerStartAngle=0,r.remove()),i&&yc(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&yc(r)&&(this.markerEndAngle=0,r.remove()),i&&yc(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&&yc(s)&&a){var c,l,u,f,h,d,p;if(f=a[0][0],h=a[0][1],t)l=a[1][0]-a[0][0],u=a[1][1]-a[0][1],d=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],h=a[g-1][1],l=a[g-2][0]-a[g-1][0],u=a[g-2][1]-a[g-1][1]),d=o||0,p=this.markerEndAngle}c=Math.atan2(u,l),s.setLocalEulerAngles(180*c/Math.PI+p),s.setLocalPosition(f+Math.cos(c)*d,h+Math.sin(c)*d)}},e.prototype.placeMarkerMid=function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&yc(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}(Ec),Lc=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=(0,Mt.Tt)(e,["style"]);return t.call(this,(0,Mt.Cl)({type:Wr.POLYLINE,style:cc.enableCSSParsing?(0,Mt.Cl)({points:"",miterLimit:"",isClosed:!1},n):(0,Mt.Cl)({},n),initialParsedStyle:cc.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r))||this}return(0,Mt.C6)(e,t),e.prototype.getTotalLength=function(){return $o(this)},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=jr(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=Tr(n[l][0],n[l][1],n[l+1][0],n[l+1][1],c),f=u.x,h=u.y,d=Bt(Pt(),jt(f,h,0),e?this.getWorldTransform():this.getLocalTransform());return new gi(d[0],d[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}(Nc),Rc=function(t){function e(e){return void 0===e&&(e={}),t.call(this,(0,Mt.Cl)({type:Wr.RECT},e))||this}return(0,Mt.C6)(e,t),e}(Ec),Ic=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=(0,Mt.Tt)(e,["style"]);return t.call(this,(0,Mt.Cl)({type:Wr.TEXT,style:cc.enableCSSParsing?(0,Mt.Cl)({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):(0,Mt.Cl)({fill:"black"},n)},r))||this}return(0,Mt.C6)(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}(Ec),zc=function(){function t(){this.registry={},this.define(Wr.CIRCLE,kc),this.define(Wr.ELLIPSE,Pc),this.define(Wr.RECT,Rc),this.define(Wr.IMAGE,jc),this.define(Wr.LINE,Tc),this.define(Wr.GROUP,_c),this.define(Wr.PATH,Cc),this.define(Wr.POLYGON,Nc),this.define(Wr.POLYLINE,Lc),this.define(Wr.TEXT,Ic),this.define(Wr.HTML,Ac)}return t.prototype.define=function(t,e){this.registry[t]=e},t.prototype.get=function(t){return this.registry[t]},t}(),Dc=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;cc.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},Bc=function(t){function e(){var e=t.call(this)||this;e.defaultView=null,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new cc.AnimationTimeline(e)}catch(t){}var n={};return ka.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=Bi(i)?i(Wr.GROUP):i)})),e.documentElement=new _c({id:"g-root",style:n}),e.documentElement.ownerDocument=e,e.documentElement.parentNode=e,e.childNodes=[e.documentElement],e}return(0,Mt.C6)(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?Ic:_c);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(mi)},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(0,Mt.sH)(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return(0,Mt.YH)(this,(function(h){switch(h.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=h.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(0,Mt.sH)(this,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,f;return(0,Mt.YH)(this,(function(h){switch(h.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=h.sent().picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),[2,f]}}))}))},e.prototype.appendChild=function(t,e){throw new Error(vi)},e.prototype.insertBefore=function(t,e){throw new Error(vi)},e.prototype.removeChild=function(t,e){throw new Error(vi)},e.prototype.replaceChild=function(t,e,n){throw new Error(vi)},e.prototype.append=function(){throw new Error(vi)},e.prototype.prepend=function(){throw new Error(vi)},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}(Gs),Fc=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 Ws(qs.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},t.tag="Culling",t}(),Wc=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Bs(null),this.rootWheelEvent=new Fs(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=(0,Mt.Ju)(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=(0,Mt.Ju)(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);n.autoPreventDefault&&o[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();try{for(var a=(0,Mt.Ju)(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=(0,Mt.Ju)(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=(0,Mt.Ju)(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||en(r)||en(i)){var s=this.context.eventService.client2Viewport(new gi(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=ts[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=es.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];Vn(i.button)&&(i.button=0),Vn(i.buttons)&&(i.buttons=1),Vn(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Vn(i.width)&&(i.width=i.radiusX||1),Vn(i.height)&&(i.height=i.radiusY||1),Vn(i.tiltX)&&(i.tiltX=0),Vn(i.tiltY)&&(i.tiltY=0),Vn(i.pointerType)&&(i.pointerType="touch"),Vn(i.pointerId)&&(i.pointerId=i.identifier||0),Vn(i.pressure)&&(i.pressure=i.force||.5),Vn(i.twist)&&(i.twist=0),Vn(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;Vn(o.isPrimary)&&(o.isPrimary=!0),Vn(o.width)&&(o.width=1),Vn(o.height)&&(o.height=1),Vn(o.tiltX)&&(o.tiltX=0),Vn(o.tiltY)&&(o.tiltY=0),Vn(o.pointerType)&&(o.pointerType="mouse"),Vn(o.pointerId)&&(o.pointerId=1),Vn(o.pressure)&&(o.pressure=.5),Vn(o.twist)&&(o.twist=0),Vn(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t.tag="Event",t}(),$c=[Wr.CIRCLE,Wr.ELLIPSE,Wr.IMAGE,Wr.RECT,Wr.LINE,Wr.POLYLINE,Wr.POLYGON,Wr.TEXT,Wr.PATH,Wr.HTML],Gc=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(li.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||ci.INDETERMINATE,a.planes),i.visible=i.visibilityPlaneMask!==ci.OUTSIDE,i.visible},t.prototype.computeVisibilityWithPlaneMask=function(t,e,n,r){if(n===ci.OUTSIDE||n===ci.INSIDE)return n;for(var i=ci.INSIDE,o=$c.indexOf(t.nodeName)>-1,a=0,s=r.length;a<s;++a){var c=1<<a;if(0!=(n&c)&&(!o||4!==a&&5!==a)){var l=r[a],u=l.normal,f=l.distance;if(zt(u,e.getPositiveFarPoint(r[a]))+f<0)return ci.OUTSIDE;zt(u,e.getNegativeFarPoint(r[a]))+f<0&&(i|=c)}}return i},t}(),Hc=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;cc.enableSizeAttenuation&&cc.styleValueRegistry.updateSizeAttenuation(e,s.getCamera().getZoom()),cc.enableCSSParsing&&cc.styleValueRegistry.recalc(e),cc.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),cc.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(t.tag,(function(){s.addEventListener(qs.MOUNTED,u),s.addEventListener(qs.UNMOUNTED,f),s.addEventListener(qs.ATTR_MODIFIED,c),s.addEventListener(qs.BOUNDS_CHANGED,l)})),i.hooks.destroy.tap(t.tag,(function(){s.removeEventListener(qs.MOUNTED,u),s.removeEventListener(qs.UNMOUNTED,f),s.removeEventListener(qs.ATTR_MODIFIED,c),s.removeEventListener(qs.BOUNDS_CHANGED,l),r.toSync.clear()}));var h=null!==(n=cc.globalThis.requestIdleCallback)&&void 0!==n?n:hs.bind(cc.globalThis);i.hooks.endFrame.tap(t.tag,(function(){r.isFirstTimeRendering?(r.isFirstTimeRendering=!1,r.syncing=!0,h((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 li),a.dirtyRenderBounds.update(o.center,o.halfExtents));var s=(0,Mt.zs)(o.getMin(),2),c=s[0],l=s[1],u=(0,Mt.zs)(o.getMax(),2),f=u[0],h=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=h}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"}(mc||(mc={}));var Vc=new Ws(qs.MOUNTED),qc=new Ws(qs.UNMOUNTED),Xc=new Ws(mc.BEFORE_RENDER),Yc=new Ws(mc.RERENDER),Uc=new Ws(mc.AFTER_RENDER),Kc=function(t){function e(e){var n=t.call(this)||this;n.Element=Ec,n.inited=!1,n.context={},n.document=new Bc,n.document.defaultView=n,n.customElements=new zc;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,h=e.document,d=e.requestAnimationFrame,p=e.cancelAnimationFrame,g=e.createImage,y=e.supportsPointerEvents,m=e.supportsTouchEvents,v=e.supportsCSSTransform,b=e.supportsMutipleCanvasesInOneContainer,x=e.useNativeClickEvent,O=e.alwaysTriggerPointerEventOnCanvas,w=e.isTouchEvent,M=e.isMouseEvent;b||function(t,e){if(t){var n="string"==typeof t?t:t.id||Ya++;Xa[n]&&Xa[n].destroy(),Xa[n]=e}}(r,n);var E=a,k=s,S=c;return i&&(S=(S=c||Ua&&window.devicePixelRatio||1)>=1?Math.ceil(S):1,E=a||function(t){var e=Qa(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/S,k=s||function(t){var e=Qa(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/S),o&&(cc.offscreenCanvas=o),n.devicePixelRatio=S,n.requestAnimationFrame=null!=d?d:hs.bind(cc.globalThis),n.cancelAnimationFrame=null!=p?p:ds.bind(cc.globalThis),n.supportsTouchEvents=null!=m?m:"ontouchstart"in cc.globalThis,n.supportsPointerEvents=null!=y?y:!!cc.globalThis.PointerEvent,n.isTouchEvent=null!=w?w:function(t){return n.supportsTouchEvents&&t instanceof cc.globalThis.TouchEvent},n.isMouseEvent=null!=M?M:function(t){return!cc.globalThis.MouseEvent||t instanceof cc.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof cc.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:h,supportsCSSTransform:v,useNativeClickEvent:x,alwaysTriggerPointerEventOnCanvas:O}),n.initDefaultCamera(E,k,l.clipSpaceNearZ),n.initRenderer(l,!0),n}return(0,Mt.C6)(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 cc.CameraContribution;i.clipSpaceNearZ=n,i.setType(fi.EXPLORING,hi.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(Ei,(function(){r.context.renderingContext.renderReasons.add(ks.CAMERA_CHANGED),cc.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){cc.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 Ws(mc.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 Ws(mc.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===di.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new Ws(mc.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(Xc),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(Yc)})),this.dispatchEvent(Uc)},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 Gr,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Wc,new Hc,new Fc([new Gc])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService((0,Mt.Cl)((0,Mt.Cl)({},cc),this.context)),this.context.renderingService=new Xs(cc,this.context),this.context.eventService=new Hs(cc,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 Ws(mc.READY))})):r.dispatchEvent(new Ws(mc.READY)),r.readyPromise&&r.resolveReadyPromise()):r.dispatchEvent(new Ws(mc.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(cc)}))},e.prototype.setRenderer=function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),(0,Mt.fX)([],(0,Mt.zs)(null==n?void 0:n.getPlugins()),!1).reverse().forEach((function(t){t.destroy(cc)})),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(qc):(qc.target=t,this.dispatchEvent(qc,!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(Vc):(Vc.target=t,this.dispatchEvent(Vc,!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}($s),Zc=function(t){function e(){var e=t.apply(this,(0,Mt.fX)([],(0,Mt.zs)(arguments),!1))||this;return e.landmarks=[],e}return(0,Mt.C6)(e,t),e.prototype.rotate=function(t,e,n){if(this.relElevation=Kr(e),this.relAzimuth=Kr(t),this.relRoll=Kr(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===fi.EXPLORING){var r=He(Ge(),[1,0,0],Jr((this.rotateWorld?1:-1)*this.relElevation)),i=He(Ge(),[0,1,0],Jr((this.rotateWorld?1:-1)*this.relAzimuth)),o=He(Ge(),[0,0,1],Jr(this.relRoll)),a=Ve(Ge(),i,r);a=Ve(Ge(),a,o);var s=be(Gt(),a);te(this.matrix,this.matrix,[0,0,-this.distance]),Qt(this.matrix,this.matrix,s),te(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===fi.ORBITING||this.type===fi.EXPLORING?this._getPosition():this.type===fi.TRACKING&&this._getFocalPoint(),this._update(),this},e.prototype.pan=function(t,e){var n=Zr(t,e,0),r=_t(this.position);return Nt(r,r,Rt(Pt(),this.right,n[0])),Nt(r,r,Rt(Pt(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},e.prototype.dolly=function(t){var e=this.forward,n=_t(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===fi.ORBITING||this.type===fi.EXPLORING?this._getDistance():this.type===fi.TRACKING&&Nt(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,h=new cc.CameraContribution;h.setType(this.type,void 0),h.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]),h.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]),h.setRoll(null!=u?u:this.roll),h.setZoom(null!=f?f:this.zoom);var d={name:t,matrix:Ht(h.getWorldTransform()),right:_t(h.right),up:_t(h.up),forward:_t(h.forward),position:_t(h.getPosition()),focalPoint:_t(h.getFocalPoint()),distanceVector:_t(h.getDistanceVector()),distance:h.getDistance(),dollyingStep:h.getDollyingStep(),azimuth:h.getAzimuth(),elevation:h.getElevation(),roll:h.getRoll(),relAzimuth:h.relAzimuth,relElevation:h.relElevation,relRoll:h.relRoll,zoom:h.getZoom()};return this.landmarks.push(d),d},e.prototype.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=nn(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=Qe(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,h=void 0===f?void 0:f,d=i.onframe,p=void 0===d?void 0:d;if(0===c)return this.syncFromLandmark(r),void(h&&h());this.cancelLandmarkAnimation();var g,y=r.position,m=r.focalPoint,v=r.zoom,b=r.roll,x=u||cc.EasingFunction(a),O=function(){n.setFocalPoint(m),n.setPosition(y),n.setRoll(b),n.setZoom(v),n.computeMatrix(),n.triggerUpdate(),h&&h()},w=function(t){void 0===g&&(g=t);var e=t-g;if(e>c)O();else{var r,i,o=x(e/c),a=Pt(),s=Pt();Dt(a,n.focalPoint,m,o),Dt(s,n.position,y,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),Wt(a,m)+Wt(s,y)<=.01&&null==v&&null==b?O():(n.computeMatrix(),n.triggerUpdate(),e<c&&(p&&p(o),n.landmarkAnimationID=n.canvas.requestAnimationFrame(w)))}};this.canvas.requestAnimationFrame(w)}},e.prototype.syncFromLandmark=function(t){this.matrix=Vt(this.matrix,t.matrix),this.right=Tt(this.right,t.right),this.up=Tt(this.up,t.up),this.forward=Tt(this.forward,t.forward),this.position=Tt(this.position,t.position),this.focalPoint=Tt(this.focalPoint,t.focalPoint),this.distanceVector=Tt(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}(Si);cc.CameraContribution=Zc;var Jc,Qc,tl=function(){function t(t,e){this.type=t,this.target=e,this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[]}return t.copy=function(e){var n=new t(e.type,e.target);return n.addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,n},t}(),el=0,nl=new WeakMap,rl=function(){function t(t,e,n){this.observer=t,this.target=e,this.options=n,this.transientObservedNodes=[]}return t.prototype.enqueue=function(t){var e,n,r=this.observer.records,i=r.length;if(r.length>0){var o=(n=r[i-1])===t?n:Qc&&function(t){return t===Qc||t===Jc}(n)?Qc:null;if(o)return void(r[i-1]=o)}else e=this.observer,sl.push(e),al||(al=!0,void 0!==cc.globalThis?cc.globalThis.setTimeout(cl):cl());r[i]=t},t.prototype.addListeners=function(){this.addListeners_(this.target)},t.prototype.addListeners_=function(t){var e=this.options;e.attributes&&t.addEventListener(qs.ATTR_MODIFIED,this,!0),e.childList&&t.addEventListener(qs.INSERTED,this,!0),(e.childList||e.subtree)&&t.addEventListener(qs.REMOVED,this,!0)},t.prototype.removeListeners=function(){this.removeListeners_(this.target)},t.prototype.removeListeners_=function(t){var e=this.options;e.attributes&&t.removeEventListener(qs.ATTR_MODIFIED,this,!0),e.childList&&t.removeEventListener(qs.INSERTED,this,!0),(e.childList||e.subtree)&&t.removeEventListener(qs.REMOVED,this,!0)},t.prototype.removeTransientObservers=function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=nl.get(t),n=0;n<e.length;n++)if(e[n]===this){e.splice(n,1);break}}),this)},t.prototype.handleEvent=function(t){var e,n;switch(t.stopImmediatePropagation(),t.type){case qs.ATTR_MODIFIED:var r=t.attrName,i=t.relatedNode.namespaceURI;n=t.target,(e=il("attributes",n)).attributeName=r,e.attributeNamespace=i;var o=t.attrChange===Ks.ADDITION?null:t.prevValue;ol(n,(function(t){var n;if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(r)||-1!==t.attributeFilter.indexOf(i)))return t.attributeOldValue?(n=o,Qc||((Qc=tl.copy(Jc)).oldValue=n,Qc)):e}));break;case qs.REMOVED:case qs.INSERTED:n=t.relatedNode;var a=t.target,s=void 0,c=void 0;t.type===qs.INSERTED?(s=[a],c=[]):(s=[],c=[a]);var l=a.previousSibling,u=a.nextSibling;(e=il("childList",n)).addedNodes=s,e.removedNodes=c,e.previousSibling=l,e.nextSibling=u,ol(n,(function(t){if(t.childList)return e}))}Jc=Qc=void 0},t}();function il(t,e){return Jc=new tl(t,e)}function ol(t,e){for(var n=t;n;n=n.parentNode){var r=nl.get(n);if(r)for(var i=0;i<r.length;i++){var o=r[i],a=o.options;if(n===t||a.subtree){var s=e(a);s&&o.enqueue(s)}}}}!function(){function t(t){this.callback=t,this.nodes=[],this.records=[],this.uid=el++}t.prototype.observe=function(t,e){if(!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,r=nl.get(t);r||nl.set(t,r=[]);for(var i=0;i<r.length;i++)if(r[i].observer===this){(n=r[i]).removeListeners(),n.options=e;break}n||(n=new rl(this,t,e),r.push(n),this.nodes.push(t)),n.addListeners()},t.prototype.disconnect=function(){var t=this;this.nodes.forEach((function(e){for(var n=nl.get(e),r=0;r<n.length;r++){var i=n[r];if(i.observer===t){i.removeListeners(),n.splice(r,1);break}}}),this),this.records=[]},t.prototype.takeRecords=function(){var t=this.records;return this.records=[],t}}();var al=!1,sl=[];function cl(){al=!1;var t=sl;sl=[],t.sort((function(t,e){return t.uid-e.uid}));var e=!1;t.forEach((function(t){var n=t.takeRecords();!function(t){t.nodes.forEach((function(e){var n=nl.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&cl()}var ll=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(0,Mt.C6)(e,t),e}(zs),ul=0,fl=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(ul++),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 ll(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(mi)},t.prototype.addEventListener=function(t,e,n){throw new Error(mi)},t.prototype.removeEventListener=function(t,e,n){throw new Error(mi)},t.prototype.dispatchEvent=function(t){throw new Error(mi)},t.prototype.commitStyles=function(){throw new Error(mi)},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 ll(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 ll(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},t}(),hl=.1,dl="function"==typeof Float32Array,pl=function(t,e){return 1-3*e+3*t},gl=function(t,e){return 3*e-6*t},yl=function(t){return 3*t},ml=function(t,e,n){return((pl(e,n)*t+gl(e,n))*t+yl(e))*t},vl=function(t,e,n){return 3*pl(e,n)*t*t+2*gl(e,n)*t+yl(e)},bl=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=dl?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=ml(o*hl,t,n);return function(o){return 0===o||1===o?o:ml(function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=hl;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*hl,s=vl(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=vl(e,n,r);if(0===o)return e;e-=(ml(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=ml(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+hl,t,n)}(o),e,r)}},xl=function(t){return Math.pow(t,2)},Ol=function(t){return Math.pow(t,3)},wl=function(t){return Math.pow(t,4)},Ml=function(t){return Math.pow(t,5)},El=function(t){return Math.pow(t,6)},kl=function(t){return 1-Math.cos(t*Math.PI/2)},Sl=function(t){return 1-Math.sqrt(1-t*t)},Pl=function(t){return t*t*(3*t-2)},_l=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)},Al=function(t,e){void 0===e&&(e=[]);var n=(0,Mt.zs)(e,2),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?.5:o,s=rn(Number(i),1,10),c=rn(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)},jl=function(t,e,n){void 0===e&&(e=[]);var r=(0,Mt.zs)(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=rn(o,.1,1e3),s=rn(s,.1,1e3),l=rn(l,.1,1e3),f=rn(f,.1,1e3);var h=Math.sqrt(s/o),d=l/(2*Math.sqrt(s*o)),p=d<1?h*Math.sqrt(1-d*d):0,g=d<1?(d*h-f)/p:-f+h,y=n?n*t/1e3:t;return y=d<1?Math.exp(-y*d*h)*(1*Math.cos(p*y)+g*Math.sin(p*y)):(1+g*y)*Math.exp(-y*h),0===t||1===t?t:1-y},Tl=function(t,e){void 0===e&&(e=[]);var n=(0,Mt.zs)(e,2),r=n[0],i=void 0===r?10:r;return("start"==n[1]?Math.ceil:Math.floor)(rn(t,0,1)*i)/i},Cl=function(t,e){void 0===e&&(e=[]);var n=(0,Mt.zs)(e,4),r=n[0],i=n[1],o=n[2],a=n[3];return bl(r,i,o,a)(t)},Nl=bl(.42,0,1,1),Ll=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},Rl=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}},Il=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}},zl={steps:Tl,"step-start":function(t){return Tl(t,[1,"start"])},"step-end":function(t){return Tl(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Cl,ease:function(t){return Cl(t,[.25,.1,.25,1])},in:Nl,out:Ll(Nl),"in-out":Rl(Nl),"out-in":Il(Nl),"in-quad":xl,"out-quad":Ll(xl),"in-out-quad":Rl(xl),"out-in-quad":Il(xl),"in-cubic":Ol,"out-cubic":Ll(Ol),"in-out-cubic":Rl(Ol),"out-in-cubic":Il(Ol),"in-quart":wl,"out-quart":Ll(wl),"in-out-quart":Rl(wl),"out-in-quart":Il(wl),"in-quint":Ml,"out-quint":Ll(Ml),"in-out-quint":Rl(Ml),"out-in-quint":Il(Ml),"in-expo":El,"out-expo":Ll(El),"in-out-expo":Rl(El),"out-in-expo":Il(El),"in-sine":kl,"out-sine":Ll(kl),"in-out-sine":Rl(kl),"out-in-sine":Il(kl),"in-circ":Sl,"out-circ":Ll(Sl),"in-out-circ":Rl(Sl),"out-in-circ":Il(Sl),"in-back":Pl,"out-back":Ll(Pl),"in-out-back":Rl(Pl),"out-in-back":Il(Pl),"in-bounce":_l,"out-bounce":Ll(_l),"in-out-bounce":Rl(_l),"out-in-bounce":Il(_l),"in-elastic":Al,"out-elastic":Ll(Al),"in-out-elastic":Rl(Al),"out-in-elastic":Il(Al),spring:jl,"spring-in":jl,"spring-out":Ll(jl),"spring-in-out":Rl(jl),"spring-out-in":Il(jl)},Dl=function(t){return zl[function(t){return(e=t,"-"===(e=e.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?e.substring(1):e).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim();var e}(t)]||zl.linear},Bl=function(t){return t},Fl=1,Wl=.5,$l=0;function Gl(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Hl="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Vl=new RegExp("cubic-bezier\\("+Hl+","+Hl+","+Hl+","+Hl+"\\)"),ql=/steps\(\s*(\d+)\s*\)/,Xl=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Yl(t){var e=Vl.exec(t);if(e)return bl.apply(void 0,(0,Mt.fX)([],(0,Mt.zs)(e.slice(1).map(Number)),!1));var n=ql.exec(t);if(n)return Gl(Number(n[1]),$l);var r=Xl.exec(t);return r?Gl(Number(r[1]),{start:Fl,middle:Wl,end:$l}[r[2]]):Dl(t)}function Ul(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Kl=function(t,e,n){return function(r){var i=Jl(t,e,r);return!cc.enableCSSParsing&&Qe(i)?i:n(i)}};function Zl(t,e,n,r){var i=Pa[t];if(i&&i.syntax&&i.int){var o=cc.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(cc.enableCSSParsing){var c=cc.styleValueRegistry.parseProperty(t,e,r,!1),l=cc.styleValueRegistry.parseProperty(t,n,r,!1);a=cc.styleValueRegistry.computeProperty(t,c,r,!1),s=cc.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 h=Kl.apply(void 0,(0,Mt.fX)([],(0,Mt.zs)(f),!1));return function(t){return 0===t?e:1===t?n:h(t)}}}}return Kl(!1,!0,(function(t){return t?n:e}))}function Jl(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(Jl(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var Ql=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Bl,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=Yl(t),this._easing=t},enumerable:!1,configurable:!0}),t}();function tu(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(en(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(!en(s)&&!en(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 eu="backwards|forwards|both|none".split("|"),nu="reverse|alternate|alternate-reverse".split("|");var ru=function(){function t(t,e,n){var r,i=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=function(t,e){return function(t,e){var n=new Ql;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===eu.indexOf(t[e]))return;if("direction"===e&&-1===nu.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}(t=function(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}(null!=t?t:{duration:"auto"}),e)}(n,!1),this.timing.effect=this,this.timing.activeDuration=(r=this.timing,Math.abs(function(t){var e;return 0===t.duration||0===t.iterations?0:("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(r)/(r.playbackRate||1))),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=tu(e,this.timing),this.interpolations=function(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(Ul(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Yl(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:Zl(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)Ul(n)&&t.setAttribute(n,null)}}(this.normalizedKeyframes,this.timing,this.target);var o=cc.globalThis.Proxy;this.computedTiming=o?new o(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?i.animation&&i.animation.currentTime||null:"currentIteration"===e?i.animation&&"running"===i.animation.playState?t.currentIteration||0:null:"progress"===e?i.animation&&"running"===i.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=function(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e<Math.min(n.delay,r)?1:e>=Math.min(n.delay+t+n.endDelay,r)?2:3}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0: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?1!==e&&(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||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),c=function(t,e,n,r){return 2===t&&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)}(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},t.prototype.getKeyframes=function(){return this.normalizedKeyframes},t.prototype.setKeyframes=function(t){this.normalizedKeyframes=tu(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 iu(t,e){return Number(t.id)-Number(e.id)}var ou=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(iu),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 ru(t,e,n),i=new fl(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(iu),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,(0,Mt.fX)([],(0,Mt.zs)(a),!1)),(i=this.pendingEffects).push.apply(i,(0,Mt.fX)([],(0,Mt.zs)(s),!1)),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,l]},t}();cc.EasingFunction=Yl,cc.AnimationTimeline=ou;class au extends Map{constructor(t,e=cu){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(su(this,t))}has(t){return super.has(su(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);return t.has(r)&&(n=t.get(r),t.delete(r)),n}(this,t))}}function su({_intern:t,_key:e},n){const r=e(n);return t.has(r)?t.get(r):n}function cu(t){return null!==t&&"object"==typeof t?t.valueOf():t}function lu(t){return t}function uu(t,...e){return pu(t,lu,lu,e)}function fu(t,...e){return pu(t,Array.from,lu,e)}function hu(t,e,...n){return pu(t,lu,e,n)}function du(t,e,...n){return pu(t,Array.from,e,n)}function pu(t,e,n,r){return function t(i,o){if(o>=r.length)return n(i);const a=new au,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)}Set;const gu=function(t){return en(t)?"":t.toString()},yu=function(t){var e=gu(t);return e.charAt(0).toLowerCase()+e.substring(1)};var mu=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))};function vu(t){return t}function bu(t){return t.reduce(((t,e)=>(n,...r)=>e(t(n,...r),...r)),vu)}function xu(t){return t.replace(/( |^)[a-z]/g,(t=>t.toUpperCase()))}function Ou(t=""){throw new Error(t)}function wu(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 Mu(t){return null!=t&&!Number.isNaN(t)}function Eu(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 ku(t,e){return Su(t,e)||{}}function Su(t,e){const n=Object.entries(t||{}).filter((([t])=>t.startsWith(e))).map((([t,n])=>[yu(t.replace(e,"").trim()),n])).filter((([t])=>!!t));return 0===n.length?null:Object.fromEntries(n)}function Pu(t,...e){return Object.fromEntries(Object.entries(t).filter((([t])=>e.every((e=>!t.startsWith(e))))))}function _u(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 Au(t){return!("object"!=typeof t||t instanceof Date||null===t||Array.isArray(t))}function ju(t){return null===t||!1===t}function Tu(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])?Tu(t[i],o,n,r+1):t[i]=o}return t}}function Cu(t){return new Nu([t],null,t,t.ownerDocument)}class Nu{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 Nu(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new Nu(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 Nu([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 Nu(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 Nu(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new Nu([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 Nu([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=uu(this._elements,(t=>n(t.__data__)));for(let f=0;f<t.length;f++){const h=t[f],d=e(h,f),p=n(h,f);if(c.has(d)){const t=c.get(d);t.__data__=h,t.__facet__=!1,i.push(t),o.delete(t),c.delete(d)}else if(l.has(d)){const t=l.get(d);t.__data__=h,t.__facet__=!0,i.push(t),l.delete(d)}else if(u.has(d)){const t=u.get(d);a.push([h,t]);for(const e of t)o.delete(e);u.delete(d)}else if(c.has(p)){const t=c.get(p);t.__toData__?t.__toData__.push(h):t.__toData__=[h],s.add(t),o.delete(t)}else r.push(h)}const f=[new Nu([],r,this._parent,this._document),new Nu(i,null,this._parent,this._document),new Nu(o,null,this._parent,this._document),new Nu([],a,this._parent,this._document),new Nu(s,null,this._parent,this._document)];return new Nu(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new Nu(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=Nu.registry[t];return e?new e:Ou(`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 Nu([],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 Lu([t,e],[n,r]){return[t-n,e-r]}function Ru([t,e],[n,r]){return[t+n,e+r]}function Iu([t,e],[n,r]){return Math.sqrt(Math.pow(t-n,2)+Math.pow(e-r,2))}function zu([t,e]){return Math.atan2(e,t)}function Du([t,e]){return zu([t,e])+Math.PI/2}function Bu(t,e){const n=zu(t),r=zu(e);return n<r?r-n:2*Math.PI-(n-r)}function Fu(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 Wu([t,e],[n,r]){return[(t+n)/2,(e+r)/2]}function $u(t,e,n){return Math.max(e,Math.min(t,n))}function Gu(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}Nu.registry={g:_c,rect:Rc,circle:kc,path:Cc,text:Ic,ellipse:Pc,image:jc,line:Tc,polygon:Nc,polyline:Lc,html:Ac};var Hu={}.toString;const Vu=function(t,e){return Hu.call(t)==="[object "+e+"]"},qu=function(t){return Vu(t,"Function")},Xu=function(t){return Array.isArray?Array.isArray(t):Vu(t,"Array")};Object.keys;const Yu=function(t){if(!function(t){return"object"==typeof t&&null!==t}(t)||!Vu(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};var Uu=Array.prototype;Uu.splice,Uu.indexOf,Array.prototype.splice,Object.prototype.hasOwnProperty;const Ku=function(t){return Vu(t,"Number")};Number.isInteger&&Number.isInteger,Math.PI,Math.PI;var Zu=Object.values?function(t){return Object.values(t)}:function(t){var e=[];return function(t,e){if(t)if(Xu(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e}(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}(t,(function(n,r){qu(t)&&"prototype"===r||e.push(n)})),e};const Ju=Zu;Object.prototype;function Qu(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&&Yu(o)?(Yu(t[i])||(t[i]={}),n<r?Qu(t[i],o,n+1,r):t[i]=e[i]):Xu(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}const tf=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)Qu(t,e[r]);return t},ef=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)},nf=function(t,e){if(!ef(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};Object.prototype.hasOwnProperty,Object.prototype.hasOwnProperty;const rf=function(t){return t},of=function(t){return null==t};function af(t){return of(t)?0:ef(t)?t.length:Object.keys(t).length}var sf;!function(t,e){if(!qu(t))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 a.set(o,s),s};n.cache=new Map}((function(t,e){void 0===e&&(e={});var n,r=e.fontSize,i=e.fontFamily,o=e.fontWeight,a=e.fontStyle,s=e.fontVariant;return sf||(sf=document.createElement("canvas").getContext("2d")),sf.font=[a,s,o,r+"px",i].join(" "),sf.measureText((n=t,Vu(n,"String")?t:"")).width}),(function(t,e){return void 0===e&&(e={}),(0,Mt.aN)([t],Ju(e)).join("")})),function(){function t(){this.map={}}t.prototype.has=function(t){return void 0!==this.map[t]},t.prototype.get=function(t,e){var n=this.map[t];return void 0===n?e:n},t.prototype.set=function(t,e){this.map[t]=e},t.prototype.clear=function(){this.map={}},t.prototype.delete=function(t){delete this.map[t]},t.prototype.size=function(){return Object.keys(this.map).length}}();class cf{constructor(t){this.options=tf({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=tf({},this.options,t),this.rescale(t)}rescale(t){}}function lf(t,e){return e-t?n=>(n-t)/(e-t):t=>.5}function uf(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}function ff(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}var hf=n(3269),df=n.n(hf);function pf(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 gf(t){const e=df().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*pf(a,o,e+1/3),255*pf(a,o,e),255*pf(a,o,e-1/3),i]}(r):null}const yf=(t,e)=>n=>t*(1-n)+e*n,mf=(t,e)=>"number"==typeof t&&"number"==typeof e?yf(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=gf(t),r=gf(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,vf=(t,e)=>{const n=yf(t,e);return t=>Math.round(n(t))};function bf(t){return!function(t){return void 0===t}(t)&&!function(t){return null===t}(t)&&!Number.isNaN(t)}const xf=Math.sqrt(50),Of=Math.sqrt(10),wf=Math.sqrt(2);function Mf(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>=xf?10:o>=Of?5:o>=wf?2:1)*10**i:-(10**-i)/(o>=xf?10:o>=Of?5:o>=wf?2:1)}function Ef(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>=xf?i*=10:o>=Of?i*=5:o>=wf&&(i*=2),e<t?-i:i}const kf=(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=Mf(s,c,n),i>0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=Mf(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=Mf(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},Sf=(t,e,n)=>{const[r,i]=t,[o,a]=e;let s,c;return r<i?(s=lf(r,i),c=n(o,a)):(s=lf(i,r),c=n(a,o)),uf(c,s)},Pf=(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]=lf(s[t],s[t+1]),o[t]=n(c[t],c[t+1]);return e=>{const n=ff(t,e,1,r)-1,a=i[n];return uf(o[n],a)(e)}},_f=(t,e,n,r)=>(Math.min(t.length,e.length)>2?Pf:Sf)(t,e,r?vf:n);class Af extends cf{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:yf,tickCount:5}}map(t){return bf(t)?this.output(t):this.options.unknown}invert(t){return bf(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 kf}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]):rf}composeOutput(t,e){const{domain:n,range:r,round:i,interpolate:o}=this.options,a=_f(n.map(t),r,o,i);this.output=uf(a,e,t)}composeInput(t,e,n){const{domain:r,range:i}=this.options,o=_f(i,r.map(t),yf);this.input=uf(e,n,o)}}const jf=(t,e,n)=>{let r,i,o=t,a=e;if(o===a&&n>0)return[o];let s=Mf(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 Tf extends Af{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:mf,tickMethod:jf,tickCount:5}}chooseTransforms(){return[rf,rf]}clone(){return new Tf(this.options)}}function Cf(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]}function Nf(t,e){return Object.entries(t).reduce(((n,[r,i])=>(n[r]=e(i,r,t),n)),{})}function Lf(t){return t.map(((t,e)=>e))}function Rf(t){return t[0]}function If(t){return t[t.length-1]}function zf(t,e){const n=[[],[]];return t.forEach((t=>{n[e(t)?0:1].push(t)})),n}function Df(t,e=t.length){if(1===e)return t.map((t=>[t]));const n=[];for(let r=0;r<t.length;r++)Df(t.slice(r+1),e-1).forEach((e=>{n.push([t[r],...e])}));return n}function Bf(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function Ff(t,e,n,r,i){const o=zu(Lu(r,e))+Math.PI,a=zu(Lu(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function Wf(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=Lf(a),[l,u]=Cf(c,(t=>a[t])),f=new Tf({domain:[l,u],range:[0,100]}),h=t=>Qe(a[t])&&!Number.isNaN(a[t])?f.map(a[t]):0,d={between:e=>`${t[e]} ${h(e)}%`,start:e=>0===e?`${t[e]} ${h(e)}%`:`${t[e-1]} ${h(e)}%, ${t[e]} ${h(e)}%`,end:e=>e===t.length-1?`${t[e]} ${h(e)}%`:`${t[e]} ${h(e)}%, ${t[e+1]} ${h(e)}%`},p=c.sort(((t,e)=>h(t)-h(e))).map(d[i]||d.between).join(",");return`linear-gradient(${s}deg, ${p})`}function $f(t){const[e,n,r,i]=t;return[i,e,n,r]}function Gf(t,e,n){const[r,i,,o]=pt(t)?$f(e):e,[a,s]=n,c=t.getCenter(),l=Du(Lu(r,c)),u=Du(Lu(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:Iu(o,c),outerRadius:Iu(r,c)}}function Hf(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function Vf(t,e){if(!gt(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function qf(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]}var Xf=function(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 Yf(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:h=a,radiusTopLeft:d=a,radiusTopRight:p=a,minWidth:g=-1/0,maxWidth:y=1/0,minHeight:m=-1/0}=i,v=Xf(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!gt(r)&&!mt(r)){const n=!!pt(r),[i,,o]=n?$f(e):e,[a,b]=i,[x,O]=Lu(o,i),w=(x>0?a:a+x)+s,M=(O>0?b:b+O)+c,E=Math.abs(x)-(s+l),k=Math.abs(O)-(c+u),S=n?$u(E,m,1/0):$u(E,g,y),P=n?$u(k,g,y):$u(k,m,1/0),_=n?w:w-(S-E)/2,A=n?M-(P-k)/2:M-(P-k);return Cu(t.createElement("rect",{})).style("x",_).style("y",A).style("width",S).style("height",P).style("radius",[d,p,h,f]).call(Bf,v).node()}const{y:b,y1:x}=n,O=r.getCenter(),w=Gf(r,e,[b,x]),M=dt().cornerRadius(a).padAngle(o*Math.PI/180);return Cu(t.createElement("path",{})).style("d",M(w)).style("transform",`translate(${O[0]}, ${O[1]})`).style("radius",a).style("inset",o).call(Bf,v).node()}const Uf=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=t,a=Xf(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,h=Xf(l,["color","radius"]),d=h.lineWidth||1,{stroke:p,radius:g=f,radiusTopLeft:y=g,radiusTopRight:m=g,radiusBottomRight:v=g,radiusBottomLeft:b=g,innerRadius:x=0,innerRadiusTopLeft:O=x,innerRadiusTopRight:w=x,innerRadiusBottomRight:M=x,innerRadiusBottomLeft:E=x,lineWidth:k=("stroke"===n||p?d:0),inset:S=0,insetLeft:P=S,insetRight:_=S,insetBottom:A=S,insetTop:j=S,minWidth:T,maxWidth:C,minHeight:N}=a,L=Xf(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,z=[i?y:O,i?m:w,o?v:M,o?b:E],D=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];pt(s)&&D.push(D.shift());const B=Object.assign(Object.assign({radius:g},Object.fromEntries(D.map(((t,e)=>[t,z[e]])))),{inset:S,insetLeft:P,insetRight:_,insetBottom:A,insetTop:j,minWidth:T,maxWidth:C,minHeight:N});return Cu(Yf(c,e,r,s,B)).call(Bf,h).style("fill","transparent").style(n,R).style(Hf(t),I).style("lineWidth",k).style("stroke",void 0===p?R:p).call(Bf,L).node()}};Uf.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Kf=(t,e)=>Uf(Object.assign({colorAttribute:"fill"},t),e);Kf.props=Object.assign(Object.assign({},Uf.props),{defaultMarker:"square"});const Zf=(t,e)=>Uf(Object.assign({colorAttribute:"stroke"},t),e);function Jf(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Qf(t){this._context=t}function th(t){return new Qf(t)}function eh(t){return t[0]}function nh(t){return t[1]}function rh(t,e){var n=F(!0),r=null,i=th,o=null,a=at(s);function s(s){var c,l,u,f=(s=Jf(s)).length,h=!1;for(null==r&&(o=i(u=a())),c=0;c<=f;++c)!(c<f&&n(l=s[c],c,s))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&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?eh:F(t),e="function"==typeof e?e:void 0===e?nh:F(e),s.x=function(e){return arguments.length?(t="function"==typeof e?e:F(+e),s):t},s.y=function(t){return arguments.length?(e="function"==typeof t?t:F(+t),s):e},s.defined=function(t){return arguments.length?(n="function"==typeof t?t:F(!!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 ih(){}function oh(t){this._context=t}function ah(t){return new oh(t)}Zf.props=Object.assign(Object.assign({},Uf.props),{defaultMarker:"hollowSquare"}),Array.prototype.slice,Qf.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)}}},oh.prototype={areaStart:ih,areaEnd:ih,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))}};var sh=function(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 ch(t,e,n){const[r,i,o,a]=t;return pt(n)?[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:o[0],o[1]],a]:[r,[i[0],e?e[0][1]:i[1]],[o[0],e?e[3][1]:o[1]],a]}const lh=(t,e)=>{const{adjustPoints:n=ch}=t,r=sh(t,["adjustPoints"]),{coordinate:i,document:o}=e;return(t,e,a,s)=>{const{index:c}=e,{color:l}=a,u=sh(a,["color"]),f=s[c+1],h=n(t,f,i),d=!!pt(i),[p,g,y,m]=d?$f(h):h,{color:v=l,opacity:b}=e,x=rh().curve(ah)([p,g,y,m]);return Cu(o.createElement("path",{})).call(Bf,u).style("d",x).style("fill",v).style("fillOpacity",b).call(Bf,r).node()}};function uh(t,e,n){const[r,i,o,a]=t;return pt(n)?[r,[e?e[0][0]:(i[0]+o[0])/2,i[1]],[e?e[3][0]:(i[0]+o[0])/2,o[1]],a]:[r,[i[0],e?e[0][1]:(i[1]+o[1])/2],[o[0],e?e[3][1]:(i[1]+o[1])/2],a]}lh.props={defaultMarker:"square"};const fh=(t,e)=>lh(Object.assign({adjustPoints:uh},t),e);function hh(t){return Math.abs(t)>10?String(t):t.toString().padStart(2,"0")}function dh(t){const e=`${t.getFullYear()}-${hh(t.getMonth()+1)}-${hh(t.getDate())}`,n=t.getHours(),r=t.getMinutes(),i=t.getSeconds();return n||r||i?`${e} ${hh(n)}:${hh(r)}:${hh(i)}`:e}fh.props={defaultMarker:"square"};const ph=(t={})=>{const{channel:e="x"}=t;return(t,n)=>{const{encode:r}=n,{tooltip:i}=n;if(ju(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=>R(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?dh(t[e]):t[e])).join(", ")};return[t,A({},n,{tooltip:{title:s}})]}};ph.props={};const gh=t=>{const{channel:e}=t;return(t,n)=>{const{encode:r,tooltip:i}=n;if(ju(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,A({},n,{tooltip:{items:a}})]}};gh.props={};const yh=()=>(t,e)=>{const{encode:n}=e,{key:r}=n,i=function(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}(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,A({},e,{encode:{key:j(a)}})]};function mh(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 vh(t={}){return[...mh(t),{name:"title",scale:"identity"}]}function bh(){return[{type:ph,channel:"color"},{type:gh,channel:["x","y"]}]}function xh(){return[{type:ph,channel:"x"},{type:gh,channel:["y"]}]}function Oh(t={}){return mh(t)}function wh(){return[{type:yh}]}function Mh(t,e){return t.getBandWidth(t.invert(e))}function Eh(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,h=!!(null==a?void 0:a.getBandWidth),d=!!(null==s?void 0:s.getBandWidth),p=!!(null==c?void 0:c.getBandWidth);return h||d?(t,e)=>{const n=h?Mh(a,r[e]):0,l=d?Mh(s,i[e]):0,g=p&&o?(Mh(c,o[e])/2+ +o[e])*n:0,[y,m]=t;return[y+u*n+g,m+f*l]}:t=>t}function kh(t){return parseFloat(t)/100}function Sh(t,e,n,r){const{x:i,y:o}=n,{innerWidth:a,innerHeight:s}=r.getOptions(),c=Array.from(t,(t=>{const e=i[t],n=o[t];return[["string"==typeof e?kh(e)*a:+e,"string"==typeof n?kh(n)*s:+n]]}));return[t,c]}function Ph(t){return"function"==typeof t?t:e=>e[t]}function _h(t,e){return Array.from(t,Ph(e))}function Ah(t,e){const{source:n=(t=>t.source),target:r=(t=>t.target),value:i=(t=>t.value)}=e,{links:o,nodes:a}=t,s=_h(o,n),c=_h(o,r),l=_h(o,i);return{links:o.map(((t,e)=>({target:c[e],source:s[e],value:l[e]}))),nodes:a||Array.from(new Set([...s,...c]),(t=>({key:t})))}}function jh(t,e){return t.getBandWidth(t.invert(e))}yh.props={};const Th={rect:Kf,hollow:Zf,funnel:lh,pyramid:fh},Ch=()=>(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(),h=c?c.map((t=>+t/f)):null,d=c?(t,e,n)=>{const r=t+e/2,i=h[n];return[r-i/2,r+i/2]}:(t,e,n)=>[t,t+e],p=Array.from(t,(t=>{const e=jh(l,i[t]),n=e*(u?jh(u,null==s?void 0:s[t]):1),c=(+(null==s?void 0:s[t])||0)*e,f=+i[t]+c,[h,p]=d(f,n,t),g=+o[t],y=+a[t];return[[h,g],[p,g],[p,y],[h,y]].map((t=>r.map(t)))}));return[t,p]};Ch.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:Th,channels:[...vh({shapes:Object.keys(Th)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...wh(),{type:D},{type:B}],postInference:[...xh()],interaction:{shareTooltip:!0}};const Nh={rect:Kf,hollow:Zf},Lh=()=>(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]};Lh.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:Nh,channels:[...vh({shapes:Object.keys(Nh)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...wh(),{type:D}],postInference:[...xh()],interaction:{shareTooltip:!0}};var Rh=zh(th);function Ih(t){this._curve=t}function zh(t){function e(e){return new Ih(t(e))}return e._curve=t,e}function Dh(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(zh(t)):e()._curve},t}function Bh(t){const e="function"==typeof t?t:t.render;return class extends Sc{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Ih.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))}};var Fh=function(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};const Wh=Bh((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;Cu(t).maybeAppend("line",(()=>o.createElement("path",{}))).style("d",e).call(Bf,r),Cu(t).maybeAppend("line1",(()=>o.createElement("path",{}))).style("d",n).call(Bf,i)})),$h=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=(t=>!Number.isNaN(t)&&null!=t),connect:a=!1}=t,s=Fh(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:h}=u,d=Fh(u,["color","lineWidth"]),{color:p=f,size:g=h,seriesColor:y,seriesX:m,seriesY:v}=e,b=Vf(c,e),x=pt(c),O=r&&y?Wf(y,m,v,r,i,x):p,w=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),O&&{stroke:O}),g&&{lineWidth:g}),b&&{transform:b}),s);let M;if(gt(c)){const t=c.getCenter();M=e=>Dh(rh().curve(Rh)).angle(((n,r)=>Du(Lu(e[r],t)))).radius(((n,r)=>Iu(e[r],t))).defined((([t,e])=>o(t)&&o(e))).curve(n)(e)}else M=rh().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=ku(w,"connect"),P=!!k.length;return!P||a&&!Object.keys(S).length?Cu(l.createElement("path",{})).style("d",M(E)||[]).call(Bf,w).node():P&&!a?Cu(l.createElement("path",{})).style("d",M(t)).call(Bf,w).node():Cu(new Wh).style("style1",Object.assign(Object.assign({},w),S)).style("style2",w).style("d1",(_=k,_.map(M).join(","))).style("d2",M(t)).node();var _}};$h.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Gh=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=gt(n)?ah:th;return $h(Object.assign({curve:i},t),e)(...r)}};function Hh(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 Vh(t,e){this._context=t,this._k=(1-e)/6}function qh(t,e){this._context=t,this._k=(1-e)/6}function Xh(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Y){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>Y){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 Yh(t,e){this._context=t,this._alpha=e}function Uh(t,e){this._context=t,this._alpha=e}Gh.props=Object.assign(Object.assign({},$h.props),{defaultMarker:"line"}),Vh.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:Hh(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:Hh(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 Vh(t,e)}return n.tension=function(e){return t(+e)},n}(0),qh.prototype={areaStart:ih,areaEnd:ih,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:Hh(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 qh(t,e)}return n.tension=function(e){return t(+e)},n}(0),Yh.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:Xh(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 Yh(t,e):new Vh(t,0)}return n.alpha=function(e){return t(+e)},n}(.5),Uh.prototype={areaStart:ih,areaEnd:ih,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:Xh(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}};const Kh=function t(e){function n(t){return e?new Uh(t,e):new qh(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Zh(t){return t<0?-1:1}function Jh(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(Zh(o)+Zh(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function Qh(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function td(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 ed(t){this._context=t}function nd(t){this._context=new rd(t)}function rd(t){this._context=t}function id(t){return new ed(t)}function od(t){return new nd(t)}ed.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:td(this,this._t0,Qh(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,td(this,Qh(this,n=Jh(this,t,e)),n);break;default:td(this,this._t0,n=Jh(this,t,e))}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}},(nd.prototype=Object.create(ed.prototype)).point=function(t,e){ed.prototype.point.call(this,e,t)},rd.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)}};const ad=(t,e)=>{const n=function(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}(t,[]),{coordinate:r}=e;return(...t)=>{const i=gt(r)?Kh:pt(r)?od:id;return $h(Object.assign({curve:i},n),e)(...t)}};function sd(t,e){this._context=t,this._t=e}function cd(t){return new sd(t,.5)}function ld(t){return new sd(t,0)}function ud(t){return new sd(t,1)}ad.props=Object.assign(Object.assign({},$h.props),{defaultMarker:"smooth"}),sd.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}};const fd=(t,e)=>$h(Object.assign({curve:ud},t),e);fd.props=Object.assign(Object.assign({},$h.props),{defaultMarker:"hv"});const hd=(t,e)=>$h(Object.assign({curve:ld},t),e);hd.props=Object.assign(Object.assign({},$h.props),{defaultMarker:"vh"});const dd=(t,e)=>$h(Object.assign({curve:cd},t),e);dd.props=Object.assign(Object.assign({},$h.props),{defaultMarker:"hvh"});function pd(t,e,n,r,i){const o=zu(Lu(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=Ru(e,s),h=Ru(n,c),d=Ru(h,l),p=Ru(n,l),g=Lu(p,c),y=Lu(n,c),m=Lu(e,s),v=Lu(m,u),b=Lu(e,u),x=Lu(f,u);t.moveTo(...f),t.lineTo(...h),t.arcTo(...d,...p,i/2),t.arcTo(...g,...y,i/2),t.lineTo(...m),t.arcTo(...v,...b,r/2),t.arcTo(...x,...f,r/2),t.closePath()}const gd=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=function(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}(i,["color"]),l=ot();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(Mu)&&pd(l,n,r,i,a)}return Cu(n.createElement("path",{})).call(Bf,c).style("fill",a||s).style("d",l.toString()).call(Bf,t).node()}};gd.props=Object.assign(Object.assign({},$h.props),{defaultMarker:"line"});const yd=()=>(t,e)=>{const{style:n={},encode:r}=e,{series:i}=r,{gradient:o}=n;return!o||i?[t,e]:[t,A({},e,{encode:{series:C(L(t,void 0))}})]};yd.props={};const md=()=>(t,e)=>{const{encode:n}=e,{series:r,color:i}=n;if(void 0!==r||void 0===i)return[t,e];const[o,a]=R(n,"color");return[t,A({},e,{encode:{series:j(o,a)}})]};md.props={};const vd={line:Gh,smooth:ad,hv:fd,vh:hd,hvh:dd,trail:gd},bd=(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(uu(t,(t=>a[t])).values()):[t],h=f.map((t=>t[0])).filter((t=>void 0!==t)),d=((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]+d,+c[t]+p])))));return[h,g,f]},xd=(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}))]},Od=()=>(t,e,n,r)=>(vt(r)?xd:bd)(t,e,n,r);Od.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:vd,channels:[...vh({shapes:Object.keys(vd)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...wh(),{type:yd},{type:md}],postInference:[...xh(),{type:ph,channel:"color"},{type:gh,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};var wd=function(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};const Md=(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"]];Md.style=["fill"];const Ed=Md.bind(void 0);Ed.style=["stroke","lineWidth"];const kd=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];kd.style=["fill"];const Sd=kd.bind(void 0);Sd.style=["fill"];const Pd=kd.bind(void 0);Pd.style=["stroke","lineWidth"];const _d=(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"]]};_d.style=["fill"];const Ad=_d.bind(void 0);Ad.style=["stroke","lineWidth"];const jd=(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"]]};jd.style=["fill"];const Td=jd.bind(void 0);Td.style=["stroke","lineWidth"];const Cd=(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"]]};Cd.style=["fill"];const Nd=Cd.bind(void 0);Nd.style=["stroke","lineWidth"];const Ld=(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"]]};Ld.style=["fill"];const Rd=Ld.bind(void 0);Rd.style=["stroke","lineWidth"];const Id=(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"]]};Id.style=["fill"];const zd=Id.bind(void 0);zd.style=["stroke","lineWidth"];const Dd=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];Dd.style=["stroke","lineWidth"];const Bd=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];Bd.style=["stroke","lineWidth"];const Fd=(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]];Fd.style=["stroke","lineWidth"];const Wd=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];Wd.style=["stroke","lineWidth"];const $d=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];$d.style=["stroke","lineWidth"];const Gd=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];Gd.style=["stroke","lineWidth"];const Hd=Gd.bind(void 0);Hd.style=["stroke","lineWidth"];const Vd=(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]];Vd.style=["stroke","lineWidth"];const qd=(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]];qd.style=["stroke","lineWidth"];const Xd=(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]];Xd.style=["stroke","lineWidth"];const Yd=(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]];Yd.style=["stroke","lineWidth"];const Ud=(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]];Ud.style=["stroke","lineWidth"];const Kd=new Map([["bowtie",Id],["cross",Bd],["dash",Hd],["diamond",_d],["dot",Gd],["hexagon",Ld],["hollowBowtie",zd],["hollowDiamond",Ad],["hollowHexagon",Rd],["hollowPoint",Ed],["hollowSquare",Pd],["hollowTriangle",Td],["hollowTriangleDown",Nd],["hv",qd],["hvh",Yd],["hyphen",$d],["line",Dd],["plus",Wd],["point",Md],["rect",Sd],["smooth",Vd],["square",kd],["tick",Fd],["triangleDown",Cd],["triangle",jd],["vh",Xd],["vhv",Ud]]);function Zd(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||bt(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 Jd=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=function(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}(t,["colorAttribute","symbol","mode"]),a=Kd.get(r)||Kd.get("point"),{coordinate:s,document:c}=e;return(e,r,l)=>{const{lineWidth:u,color:f}=l,h=o.stroke?u||1:u,{color:d=f,transform:p,opacity:g}=r,[y,m]=qf(e),v=Zd(i,e,r,s)||o.r||l.r;return Cu(c.createElement("path",{})).call(Bf,l).style("fill","transparent").style("d",a(y,m,v)).style("lineWidth",h).style("transform",p).style("transformOrigin",`${y-v} ${m-v}`).style("stroke",d).style(Hf(t),g).style(n,d).call(Bf,o).node()}};Jd.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Qd=(t,e)=>Jd(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);Qd.props=Object.assign({defaultMarker:"hollowPoint"},Jd.props);const tp=(t,e)=>Jd(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);tp.props=Object.assign({defaultMarker:"hollowDiamond"},Jd.props);const ep=(t,e)=>Jd(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);ep.props=Object.assign({defaultMarker:"hollowHexagon"},Jd.props);const np=(t,e)=>Jd(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);np.props=Object.assign({defaultMarker:"hollowSquare"},Jd.props);const rp=(t,e)=>Jd(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);rp.props=Object.assign({defaultMarker:"hollowTriangleDown"},Jd.props);const ip=(t,e)=>Jd(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);ip.props=Object.assign({defaultMarker:"hollowTriangle"},Jd.props);const op=(t,e)=>Jd(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);op.props=Object.assign({defaultMarker:"hollowBowtie"},Jd.props);const ap=(t,e)=>{const{colorAttribute:n,mode:r="auto"}=t,i=function(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}(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:h=u,transform:d,opacity:p}=s,[g,y]=qf(e),m=Zd(r,e,s,o)||i.r||c.r;return Cu(a.createElement("circle",{})).call(Bf,c).style("fill","transparent").style("cx",g).style("cy",y).style("r",m).style("lineWidth",f).style("transform",d).style("transformOrigin",`${g} ${y}`).style("stroke",h).style(Hf(t),p).style(n,h).call(Bf,i).node()}},sp=(t,e)=>ap(Object.assign({colorAttribute:"fill"},t),e);sp.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const cp=(t,e)=>ap(Object.assign({colorAttribute:"stroke"},t),e);cp.props=Object.assign({defaultMarker:"hollowPoint"},sp.props);const lp=(t,e)=>Jd(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);lp.props=Object.assign({defaultMarker:"point"},Jd.props);const up=(t,e)=>Jd(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);up.props=Object.assign({defaultMarker:"plus"},Jd.props);const fp=(t,e)=>Jd(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);fp.props=Object.assign({defaultMarker:"diamond"},Jd.props);const hp=(t,e)=>Jd(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);hp.props=Object.assign({defaultMarker:"square"},Jd.props);const dp=(t,e)=>Jd(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);dp.props=Object.assign({defaultMarker:"triangle"},Jd.props);const pp=(t,e)=>Jd(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);pp.props=Object.assign({defaultMarker:"hexagon"},Jd.props);const gp=(t,e)=>Jd(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);gp.props=Object.assign({defaultMarker:"cross"},Jd.props);const yp=(t,e)=>Jd(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);yp.props=Object.assign({defaultMarker:"bowtie"},Jd.props);const mp=(t,e)=>Jd(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);mp.props=Object.assign({defaultMarker:"hyphen"},Jd.props);const vp=(t,e)=>Jd(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);vp.props=Object.assign({defaultMarker:"line"},Jd.props);const bp=(t,e)=>Jd(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);bp.props=Object.assign({defaultMarker:"tick"},Jd.props);const xp=(t,e)=>Jd(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);xp.props=Object.assign({defaultMarker:"triangleDown"},Jd.props);const Op=()=>(t,e)=>{const{encode:n}=e,{y:r}=n;return void 0!==r?[t,e]:[t,A({},e,{encode:{y:T(L(t,0))},scale:{y:{guide:null}}})]};Op.props={};const wp=()=>(t,e)=>{const{encode:n}=e,{size:r}=n;return void 0!==r?[t,e]:[t,A({},e,{encode:{size:C(L(t,3))}})]};wp.props={};const Mp={hollow:Qd,hollowDiamond:tp,hollowHexagon:ep,hollowSquare:np,hollowTriangleDown:rp,hollowTriangle:ip,hollowBowtie:op,hollowCircle:cp,point:lp,plus:up,diamond:fp,square:hp,triangle:dp,hexagon:pp,cross:gp,bowtie:yp,hyphen:mp,line:vp,tick:bp,triangleDown:xp,circle:sp},Ep=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s,y1:c,size:l,dx:u,dy:f}=r,[h,d]=i.getSize(),p=Eh(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]},y=l?Array.from(e,(t=>{const[e,n]=g(t),r=+l[t],o=r/h,a=r/d,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))]));return[e,y]};Ep.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:Mp,channels:[...vh({shapes:Object.keys(Mp)}),{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:[...wh(),{type:B},{type:Op}],postInference:[{type:wp},...bh()]};const kp=function(t){return"function"==typeof t};function Sp(t,e){e(t),t.children&&t.children.forEach((function(t){t&&Sp(t,e)}))}function Pp(t){Ap(t,!0)}function _p(t){Ap(t,!1)}function Ap(t,e){var n=e?"visible":"hidden";Sp(t,(function(t){t.attr("visibility",n)}))}var jp=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var o=(0,Mt.zs)(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?jp(t[a],s,n+1,r):c[a]=e[a]):E(s)?(c[a]=[],c[a]=c[a].concat(s)):c[a]=s:c[a]=s)}))},Tp=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)jp(t,e[r]);return t},Cp=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,(0,Mt.fX)([],(0,Mt.zs)(e),!1))||this;return r.isMutationObserved=!0,r.addEventListener(qs.INSERTED,(function(){_p(r)})),r}return(0,Mt.C6)(e,t),e}(_c);function Np(t){var e=t.appendChild(new Cp({class:"offscreen"}));return _p(e),e}function Lp(){Ap(this,"hidden"!==this.attributes.visibility)}var Rp=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,Tp({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return(0,Mt.C6)(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Np(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&&Lp.call(this)},e.prototype.update=function(t,e){var n;return this.attr(Tp({},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}(Sc);function Ip(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)}var zp=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=(0,Mt.Tt)(e,["style"]);return t.call(this,(0,Mt.Cl)({style:(0,Mt.Cl)({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return(0,Mt.C6)(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Np(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(Ic),Dp=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=(0,Mt.zs)(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=(0,Mt.gn)(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=(0,Mt.gn)(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=(0,Mt.gn)(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]}))),h=new Map(this._facetElements.map((function(t,n){return[e(t.__data__,n),t]}))),d=function(t,e){var n=new Map;return t.forEach((function(t){var e=function(t){return r(t.__data__)}(t);n.has(e)||n.set(e,[]),n.get(e).push(t)})),n}(this._elements),p=0;p<t.length;p++){var g=t[p],y=e(g,p),m=r(g,p);if(f.has(y))(O=f.get(y)).__data__=g,O.__facet__=!1,s.push(O),c.delete(O),f.delete(y);else if(h.has(y))(O=h.get(y)).__data__=g,O.__facet__=!0,s.push(O),h.delete(y);else if(d.has(y)){var v=d.get(y);l.push([g,v]);try{for(var b=(i=void 0,(0,Mt.Ju)(v)),x=b.next();!x.done;x=b.next()){var O=x.value;c.delete(O)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}d.delete(y)}else f.has(m)?((O=f.get(m)).__toData__?O.__toData__.push(g):O.__toData__=[g],u.add(O),c.delete(O)):a.push(g)}var w=[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,w)},t.prototype.merge=function(t){var e=(0,Mt.fX)((0,Mt.fX)([],(0,Mt.zs)(this._elements),!1),(0,Mt.zs)(t._elements),!1),r=(0,Mt.fX)((0,Mt.fX)([],(0,Mt.zs)(this._transitions),!1),(0,Mt.zs)(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=(0,Mt.zs)(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,(0,Mt.fX)([this._parent,this],(0,Mt.zs)(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:_c,rect:Rc,circle:kc,path:Cc,text:zp,ellipse:Pc,image:jc,line:Tc,polygon:Nc,polyline:Lc,html:Ac},t}();function Bp(t){return new Dp([t],null,t,t.ownerDocument)}var Fp=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"]]},Wp=Fp,$p=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},Gp=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},Hp=Gp;var Vp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Mt.C6)(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=(t.transform,t.transformOrigin,(0,Mt.Tt)(t,["symbol","size","x","y","transform","transformOrigin"])),f=function(t){var e=function(t){var e="default";if(Xn(t)&&t instanceof Image)e="image";else if(kp(t))e="symbol";else if(nn(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}(r);Ip(!!f,Bp(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=kp(r)?r:e.getSymbol(r);t.styles((0,Mt.Cl)({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}(Rp);Vp.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]]})),Vp.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),Vp.registerSymbol("line",$p),Vp.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),Vp.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]]})),Vp.registerSymbol("circle",Fp),Vp.registerSymbol("point",Wp),Vp.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"]]})),Vp.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"]]})),Vp.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"]]})),Vp.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),Vp.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"]]})),Vp.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"]]})),Vp.registerSymbol("line",$p),Vp.registerSymbol("dot",Gp),Vp.registerSymbol("dash",Hp),Vp.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]]})),Vp.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]]})),Vp.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]]})),Vp.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]]})),Vp.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 qp=function(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};const Xp=Bh((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:h,background:d,connector:p,startMarker:g,endMarker:y,coordCenter:m,innerHTML:v}=e,b=qp(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=>!Qe(t))))return void t.children.forEach((t=>t.remove()));const x=ku(b,"background"),{padding:O}=x,w=qp(x,["padding"]),M=ku(b,"connector"),{points:E=[]}=M,k=qp(M,["points"]),S=[[+u,+f],[+c,+l]];let P;P=v?Cu(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",v).call(Bf,Object.assign({transform:a,transformOrigin:s},b)).node():Cu(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(Bf,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const _=Cu(t).maybeAppend("background","rect").style("zIndex",-1).call(Bf,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,[h,d]=l;return a.setEulerAngles(s),{x:u-o,y:f-n,width:2*h+o+r,height:2*d+n+i}}(P,O)).call(Bf,d?w:{}).node(),A=function(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 rh()([[0,0],[c,l]]);const u=[[i-a,o-s]].concat(n.length?n:[[0,0]]),f=[r[0]-a,r[1]-s],[h,d]=u;if(((t,e,n)=>{const r=Iu(t,e),i=Iu(e,n),o=Iu(n,t);return(Math.pow(r,2)+Math.pow(i,2)-Math.pow(o,2))/(2*r*i)})(f,h,d)>0){const e=(()=>{const{min:e,max:n}=t.getLocalBounds(),r=h[0]+(h[1]-f[1])*(h[1]-0)/(h[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 rh()(u)}(_,S,E,m),j=g&&new Vp({id:"startMarker",style:Object.assign({x:0,y:0},ku(b,"startMarker"))}),T=y&&new Vp({id:"endMarker",style:Object.assign({x:0,y:0},ku(b,"endMarker"))});Cu(t).maybeAppend("connector","path").style("zIndex",0).style("d",A).style("markerStart",j).style("markerEnd",T).call(Bf,p?k:{})})),Yp=(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,h]]=e;return Cu(new Xp).style("x",f).style("y",h).call(Bf,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(Bf,u).call(Bf,t).node()}};Yp.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Up=function(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};const Kp=Bh((t=>{const e=t.attributes,{class:n,x:r,y:i,transform:o}=e,a=Up(e,["class","x","y","transform"]),s=ku(a,"marker"),{size:c=24}=s,l=()=>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"]]}(c/2),u=Cu(t).maybeAppend("marker",(()=>new Vp({}))).call((t=>t.node().update(Object.assign({symbol:l},s)))).node(),[f,h]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(u);Cu(t).maybeAppend("text","text").style("x",f).style("y",h).call(Bf,a)})),Zp=(t,e)=>{const n=Up(t,[]);return(t,e,r)=>{const{color:i}=r,o=Up(r,["color"]),{color:a=i,text:s=""}=e,c={text:String(s),stroke:a,fill:a},[[l,u]]=t;return Cu(new Kp).call(Bf,o).style("transform",`translate(${l},${u})`).call(Bf,c).call(Bf,n).node()}};Zp.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Jp=(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,h]]=e;return Cu(new Ic).style("x",f).style("y",h).call(Bf,i).style("transformOrigin","center center").style("transform",`${l}rotate(${c}deg)`).style("coordCenter",n.getCenter()).call(Bf,u).call(Bf,t).node()}};Jp.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Qp=()=>(t,e)=>{const{data:n}=e;if(!Array.isArray(n)||n.some(z))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,A({},e,{encode:{x:j(i),y:j(o)}})]};Qp.props={};var tg=function(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};const eg=()=>(t,e)=>{const{data:n,style:r={}}=e,i=tg(e,["data","style"]),{x:o,y:a}=r,s=tg(r,["x","y"]);if(null==o||null==a)return[t,e];const c=a||0;return[[0],A({},i,{data:[0],cartesian:!0,encode:{x:j([o||0]),y:j([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};eg.props={};const ng={text:Yp,badge:Zp,tag:Jp},rg=t=>{const{cartesian:e=!1}=t;return e?Sh:(e,n,r,i)=>{const{x:o,y:a}=r,s=Eh(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};rg.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:ng,channels:[...vh({shapes:Object.keys(ng)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize",scale:"identity"},{name:"rotate",scale:"identity"}],preInference:[...wh(),{type:Qp},{type:eg}],postInference:[...bh()]};const ig=()=>(t,e)=>[t,A({scale:{x:{padding:0},y:{padding:0}}},e)];ig.props={};const og={cell:Kf,hollow:Zf},ag=()=>(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]};function sg(t,e,n){var r=null,i=F(!0),o=null,a=th,s=null,c=at(l);function l(l){var u,f,h,d,p,g=(l=Jf(l)).length,y=!1,m=new Array(g),v=new Array(g);for(null==o&&(s=a(p=c())),u=0;u<=g;++u){if(!(u<g&&i(d=l[u],u,l))===y)if(y=!y)f=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),h=u-1;h>=f;--h)s.point(m[h],v[h]);s.lineEnd(),s.areaEnd()}y&&(m[u]=+t(d,u,l),v[u]=+e(d,u,l),s.point(r?+r(d,u,l):m[u],n?+n(d,u,l):v[u]))}if(p)return s=null,p+""||null}function u(){return rh().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?eh:F(+t),e="function"==typeof e?e:F(void 0===e?0:+e),n="function"==typeof n?n:void 0===n?nh:F(+n),l.x=function(e){return arguments.length?(t="function"==typeof e?e:F(+e),r=null,l):t},l.x0=function(e){return arguments.length?(t="function"==typeof e?e:F(+e),l):t},l.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:F(+t),l):r},l.y=function(t){return arguments.length?(e="function"==typeof t?t:F(+t),n=null,l):e},l.y0=function(t){return arguments.length?(e="function"==typeof t?t:F(+t),l):e},l.y1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:F(+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:F(!!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}ag.props={defaultShape:"cell",defaultLabelShape:"label",shape:og,composite:!1,channels:[...vh({shapes:Object.keys(og)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...wh(),{type:B},{type:Op},{type:ig}],postInference:[...bh()]};const cg=Bh((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;Cu(t).maybeAppend("connect-path",(()=>o.createElement("path",{}))).style("d",n).call(Bf,i),Cu(t).maybeAppend("area-path",(()=>o.createElement("path",{}))).style("d",e).call(Bf,r)})),lg=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=(t=>!Number.isNaN(t)&&null!=t),connect:o=!1}=t,a=function(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}(t,["curve","gradient","defined","connect"]),{coordinate:s,document:c}=e;return(t,e,l)=>{const{color:u}=l,{color:f=u,seriesColor:h,seriesX:d,seriesY:p}=e,g=pt(s),y=Vf(s,e),m=r&&h?Wf(h,d,p,r,void 0,g):f,v=Object.assign(Object.assign(Object.assign(Object.assign({},l),{stroke:m,fill:m}),y&&{transform:y}),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),O=ku(v,"connect"),w=!!x.length,M=t=>Cu(c.createElement("path",{})).style("d",t||"").call(Bf,v).node();if(gt(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=sg().curve(Rh),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 Dh(n())},delete t.lineX0,t.lineEndAngle=function(){return Dh(r())},delete t.lineX1,t.lineInnerRadius=function(){return Dh(i())},delete t.lineY0,t.lineOuterRadius=function(){return Dh(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(zh(t)):e()._curve},t}().angle(((t,n)=>Du(Lu(r[n],e)))).outerRadius(((t,n)=>Iu(r[n],e))).innerRadius(((t,n)=>Iu(o[n],e))).defined(((t,e)=>[...r[e],...o[e]].every(i))).curve(n)(o)};return!w||o&&!Object.keys(O).length?M(e(b)):w&&!o?M(e(t)):Cu(new cg).style("areaStyle",v).style("connectStyle",Object.assign(Object.assign({},O),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?sg().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):sg().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!w||o&&!Object.keys(O).length?M(e(b)):w&&!o?M(e(t)):Cu(new cg).style("areaStyle",v).style("connectStyle",Object.assign(Object.assign({},O),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};lg.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ug=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=gt(n)?ah:th;return lg(Object.assign({curve:i},t),e)(...r)}};ug.props=Object.assign(Object.assign({},lg.props),{defaultMarker:"square"});const fg=(t,e)=>{const n=function(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}(t,[]),{coordinate:r}=e;return(...t)=>{const i=gt(r)?Kh:pt(r)?od:id;return lg(Object.assign({curve:i},n),e)(...t)}};fg.props=Object.assign(Object.assign({},lg.props),{defaultMarker:"smooth"});const hg=(t,e)=>(...n)=>lg(Object.assign({curve:cd},t),e)(...n);hg.props=Object.assign(Object.assign({},lg.props),{defaultMarker:"hvh"});const dg=(t,e)=>(...n)=>lg(Object.assign({curve:ld},t),e)(...n);dg.props=Object.assign(Object.assign({},lg.props),{defaultMarker:"vh"});const pg=(t,e)=>(...n)=>lg(Object.assign({curve:ud},t),e)(...n);pg.props=Object.assign(Object.assign({},lg.props),{defaultMarker:"hv"});const gg={area:ug,smooth:fg,hvh:hg,vh:dg,hv:pg},yg=()=>(t,e,n,r)=>{var i,o;const{x:a,y:s,y1:c,series:l}=n,{x:u,y:f}=e,h=l?Array.from(uu(t,(t=>l[t])).values()):[t],d=h.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[d,Array.from(h,(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})),h]};yg.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:gg,channels:[...vh({shapes:Object.keys(gg)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...wh(),{type:md},{type:D},{type:ig}],postInference:[...xh()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const mg=()=>(t,e)=>{const{encode:n}=e,{y1:r}=n;if(r)return[t,e];const[i]=R(n,"y");return[t,A({},e,{encode:{y1:j([...i])}})]};mg.props={};const vg=()=>(t,e)=>{const{encode:n}=e,{x1:r}=n;if(r)return[t,e];const[i]=R(n,"x");return[t,A({},e,{encode:{x1:j([...i])}})]};vg.props={};var bg=function(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};const xg=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=bg(t,["arrow","arrowSize"]),{document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=bg(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=ot();if(d.moveTo(...f),d.lineTo(...h),n){const[t,e]=function(t,e,n){const{arrowSize:r}=n,i="string"==typeof r?+parseFloat(r)/100*Iu(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,h,{arrowSize:r});d.moveTo(...h),d.lineTo(...t),d.moveTo(...h),d.lineTo(...e)}return Cu(o.createElement("path",{})).call(Bf,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(Bf,i).node()}};xg.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Og=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>xg(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};Og.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var wg=function(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};const Mg=(t,e)=>{const n=wg(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=wg(o,["color"]),{color:c=a,transform:l}=e,[u,f]=t,h=ot();if(h.moveTo(u[0],u[1]),gt(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],f[0],f[1])}else Ff(h,u,f,Wu(u,f),Iu(u,f)/2);return Cu(i.createElement("path",{})).call(Bf,s).style("d",h.toString()).style("stroke",c).style("transform",l).call(Bf,n).node()}};Mg.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Eg=function(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};const kg=(t,e)=>{const n=Eg(t,[]),{document:r}=e;return(t,e,i)=>{const{color:o}=i,a=Eg(i,["color"]),{color:s=o,transform:c}=e,[l,u]=t,f=ot();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]),Cu(r.createElement("path",{})).call(Bf,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(Bf,n).node()}};kg.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Sg=function(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};const Pg=(t,e)=>{const{cornerRatio:n=1/3}=t,r=Sg(t,["cornerRatio"]),{coordinate:i,document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Sg(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=function(t,e,n,r){const i=ot();if(gt(n)){const o=n.getCenter(),a=Iu(t,o),s=(Iu(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),Ff(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return pt(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)}(f,h,i,n);return Cu(o.createElement("path",{})).call(Bf,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(Bf,r).node()}};Pg.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const _g={link:Og,arc:Mg,smooth:kg,vhv:Pg},Ag=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=Eh(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]};Ag.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:_g,channels:[...vh({shapes:Object.keys(_g)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...wh(),{type:mg},{type:vg}],postInference:[...bh()]};const jg=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=function(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}(o,["color"]),{color:c=a,src:l="",size:u=32,transform:f=""}=i;let{width:h=u,height:d=u}=t;const[[p,g]]=e,[y,m]=n.getSize();h="string"==typeof h?kh(h)*y:h,d="string"==typeof d?kh(d)*m:d;const v=p-Number(h)/2,b=g-Number(d)/2;return Cu(r.createElement("image",{})).call(Bf,s).style("x",v).style("y",b).style("src",l).style("stroke",c).style("transform",f).call(Bf,t).style("width",h).style("height",d).node()}};jg.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Tg={image:jg},Cg=t=>{const{cartesian:e}=t;return e?Sh:(e,n,r,i)=>{const{x:o,y:a}=r,s=Eh(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};Cg.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:Tg,channels:[...vh({shapes:Object.keys(Tg)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...wh(),{type:Qp},{type:eg}],postInference:[...bh()]};const Ng=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=function(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}(o,["color"]),{color:c=a,transform:l}=i,u=function(t,e){const n=ot();if(gt(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>Iu(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?Ff(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)}(e,n);return Cu(r.createElement("path",{})).call(Bf,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(Bf,t).node()}};Ng.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Lg=function(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};const Rg=(t,e)=>{const n=Lg(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Lg(o,["color"]),{color:c=a,transform:l}=e,u=function(t,e){const[n,r,i,o]=t,a=ot();if(gt(e)){const t=e.getCenter(),s=Iu(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),Ff(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),Ff(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}(t,r);return Cu(i.createElement("path",{})).call(Bf,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(Bf,n).node()}};Rg.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ig={polygon:Ng,ribbon:Rg},zg=()=>(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]};zg.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:Ig,channels:[...vh({shapes:Object.keys(Ig)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...wh()],postInference:[...bh()]};const Dg=(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=function(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}(o,["color","fill","stroke"]),h=function(t,e){const n=ot();if(gt(e)){const r=e.getCenter(),[i,o]=r,a=zu(Lu(t[0],r)),s=zu(Lu(t[1],r)),c=Iu(r,t[2]),l=Iu(r,t[3]),u=Iu(r,t[8]),f=Iu(r,t[10]),h=Iu(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,h,a,s),n.arc(i,o,h,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}(e,n);return Cu(r.createElement("path",{})).call(Bf,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Bf,t).node()}};Dg.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Bg=(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=function(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}(o,["color","fill","stroke"]),h=function(t,e,n=4){const r=ot();if(!gt(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=Iu(i,t[3]),c=Iu(i,t[8]),l=Iu(i,t[10]),u=zu(Lu(t[2],i)),f=Math.asin(n/c),h=u-f,d=u+f;r.moveTo(...t[2]),r.lineTo(...t[3]),r.moveTo(Math.cos(h)*s+o,Math.sin(h)*s+a),r.arc(o,a,s,h,d),r.lineTo(Math.cos(d)*l+o,Math.sin(d)*l+a),r.arc(o,a,l,d,h,!0),r.lineTo(Math.cos(h)*s+o,Math.sin(h)*s+a),r.closePath(),r.moveTo(...t[10]),r.lineTo(...t[11]);const p=(h+d)/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}(e,n,4);return Cu(r.createElement("path",{})).call(Bf,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(Bf,t).node()}};Bg.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Fg={box:Dg,violin:Bg},Wg=()=>(t,e,n,r)=>{const{x:i,y:o,y1:a,y2:s,y3:c,y4:l,series:u}=n,f=e.x,h=e.series,d=Array.from(t,(t=>{const e=f.getBandWidth(f.invert(+i[t])),n=e*(h?h.getBandWidth(h.invert(+(null==u?void 0:u[t]))):1),d=(+(null==u?void 0:u[t])||0)*e,p=+i[t]+d+n/2,[g,y,m,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,y],[p-n/2,y],[p-n/2,m],[p+n/2,m],[p,y],[p,g],[p-n/2,g],[p+n/2,g]].map((t=>r.map(t)))}));return[t,d]};Wg.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:Fg,channels:[...vh({shapes:Object.keys(Fg)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...wh(),{type:B}],postInference:[...xh()],interaction:{shareTooltip:!0}};const $g={vector:xg},Gg=()=>(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),h=-u*Math.sin(e);return[r.map([+i[t]-f/2,+o[t]-h/2]),r.map([+i[t]+f/2,+o[t]+h/2])]}));return[t,u]};Gg.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:$g,channels:[...vh({shapes:Object.keys($g)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...wh()],postInference:[...bh()]};var Hg=function(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};const Vg=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=Hg(t,["arrow","arrowSize"]),{coordinate:o,document:a}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=Hg(s,["color","lineWidth"]),{color:f=c,size:h=l}=e,d=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},ku(i,"arrow"))):null,p=function(t,e){if(!gt(e))return rh().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return dt()({startAngle:0,endAngle:2*Math.PI,outerRadius:Iu(t[0],n),innerRadius:Iu(t[1],n)})}(t,o),g=function(t,e){if(!gt(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,e.transform);return Cu(a.createElement("path",{})).call(Bf,u).style("d",p).style("stroke",f).style("lineWidth",h).style("transform",g).style("markerEnd",d).call(Bf,i).node()}};Vg.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const qg=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(z)?[t,e]:[t,A({},e,{encode:{x:j(n)}})]};qg.props={};const Xg={line:Vg},Yg=t=>(e,n,r,i)=>{const{x:o}=r,a=Eh(n,r,A({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]};Yg.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:Xg,channels:[...Oh({shapes:Object.keys(Xg)}),{name:"x",required:!0}],preInference:[...wh(),{type:qg}],postInference:[]};const Ug=()=>(t,e)=>{const{data:n}=e;return!Array.isArray(n)||n.some(z)?[t,e]:[t,A({},e,{encode:{y:j(n)}})]};Ug.props={};const Kg={line:Vg},Zg=t=>(e,n,r,i)=>{const{y:o}=r,a=Eh(n,r,A({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]};Zg.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:Kg,channels:[...Oh({shapes:Object.keys(Kg)}),{name:"y",required:!0}],preInference:[...wh(),{type:Ug}],postInference:[]};var Jg=function(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 Qg(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}const ty=(t,e)=>{const{offset:n=0,offset1:r=n,offset2:i=n,connectLength1:o,endMarker:a=!0}=t,s=Jg(t,["offset","offset1","offset2","connectLength1","endMarker"]),{coordinate:c}=e;return(t,e,n)=>{const{color:l,connectLength1:u}=n,f=Jg(n,["color","connectLength1"]),{color:h,transform:d}=e,p=function(t,e,n,r,i=0){const[[o,a],[s,c]]=e;if(pt(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=ku(Object.assign(Object.assign({},s),n),"endMarker");return Cu(new Cc).call(Bf,f).style("d",function(t){return rh().x((t=>t[0])).y((t=>t[1]))(t)}(p)).style("stroke",h||l).style("transform",d).style("markerEnd",a?new Vp({className:"marker",style:Object.assign(Object.assign({},g),{symbol:Qg})}):null).call(Bf,s).node()}};ty.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ey={connector:ty},ny=(...t)=>Ag(...t);function ry(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 iy(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=ry("x",e,i,r.x),s=ry("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]}}ny.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:ey,channels:[...Oh({shapes:Object.keys(ey)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...wh()],postInference:[]};const oy={range:Kf},ay=()=>iy();ay.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:oy,channels:[...Oh({shapes:Object.keys(oy)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...wh()],postInference:[]};const sy=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(z))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,A({},e,{encode:{x:j(r(n,0)),x1:j(r(n,1))}})]}return[t,e]};sy.props={};const cy={range:Kf},ly=()=>iy({extendY:!0});ly.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:cy,channels:[...Oh({shapes:Object.keys(cy)}),{name:"x",required:!0}],preInference:[...wh(),{type:sy}],postInference:[]};const uy=()=>(t,e)=>{const{data:n}=e;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(z))){const r=(t,e)=>Array.isArray(t[0])?t.map((t=>t[e])):[t[e]];return[t,A({},e,{encode:{y:j(r(n,0)),y1:j(r(n,1))}})]}return[t,e]};uy.props={};const fy={range:Kf},hy=()=>iy({extendX:!0});hy.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:fy,channels:[...Oh({shapes:Object.keys(fy)}),{name:"y",required:!0}],preInference:[...wh(),{type:uy}],postInference:[]};var dy=function(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};const py=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=dy(t,["arrow","colorAttribute"]),{coordinate:o,document:a}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=dy(n,["color","stroke"]),{d:u,color:f=s}=e,[h,d]=o.getSize();return Cu(a.createElement("path",{})).call(Bf,l).style("d","function"==typeof u?u({width:h,height:d}):u).style(r,f).call(Bf,i).node()}};py.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const gy=(t,e)=>py(Object.assign({colorAttribute:"fill"},t),e);gy.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const yy=(t,e)=>py(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);yy.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const my={path:gy,hollow:yy},vy=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];vy.props={defaultShape:"path",defaultLabelShape:"label",shape:my,composite:!1,channels:[...vh({shapes:Object.keys(my)}),{name:"d",scale:"identity"}],preInference:[...wh()],postInference:[]};const by=(t,e)=>{const{render:n}=t,r=function(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}(t,["render"]);return t=>{const[[i,o]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:o}),e)}};by.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xy=()=>(t,e)=>{const{style:n={}}=e;return[t,A({},e,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter((([,t])=>"function"==typeof t)).map((([t,e])=>[t,()=>e]))))})]};xy.props={};const Oy=t=>{const{cartesian:e}=t;return e?Sh:(e,n,r,i)=>{const{x:o,y:a}=r,s=Eh(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};Oy.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:by},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...wh(),{type:Qp},{type:eg},{type:xy}]};const wy=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:o}=r,{color:a}=i,s=function(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}(i,["color"]),{color:c=a}=r,[l,...u]=e,f=ot();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),Cu(n.createElement("path",{})).call(Bf,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(Bf,t).node()}};wy.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const My={density:wy},Ey=()=>(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,h=+i[e]+f+u/2;return[...a.map(((n,r)=>[h+ +s[r][e]/t.length,+a[r][e]])),...a.map(((n,r)=>[h-+s[r][e]/t.length,+a[r][e]])).reverse()].map((t=>r.map(t)))}));return[t,u]};function ky(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 Sy(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 Py(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 _y(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}Ey.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:My,channels:[...vh({shapes:Object.keys(My)}),{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:[...wh(),{type:D},{type:B}],postInference:[...xh()],interaction:{shareTooltip:!0}},Py(3);const Ay=function(t,e=((...t)=>`${t[0]}`),n=16){const r=Py(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=_y(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}`));const jy=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:o,blur:a,useGradientOpacity:s}=t,c=function(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}(t,["gradient","opacity","maxOpacity","minOpacity","blur","useGradientOpacity"]),{coordinate:l,createCanvas:u,document:f}=e;return(t,e,h)=>{const{transform:d}=e,[p,g]=l.getSize(),y=t.map((t=>({x:t[0],y:t[1],value:t[2],radius:t[3]}))),m=ky(t,(t=>t[2])),v=Sy(t,(t=>t[2])),b=p&&g?function(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=_y(a,t,e).getContext("2d"),l=function(t,e){const n=_y(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),h=i-u,d=c-u,p=Ay(u,1-a,o),g=(f-e)/(n-e);t.globalAlpha=Math.max(g,.001),t.drawImage(p,h,d)}}(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),h=f.data,d=h.length;for(let t=3;t<d;t+=4){const e=h[t],n=4*e;if(!n)continue;const i=a||Math.max(0,Math.min(s,Math.max(o,e)));h[t-3]=r[n],h[t-2]=r[n+1],h[t-1]=r[n+2],h[t]=c?r[n+3]:i}return f}(c,t,e,l,s),f=_y(a,t,e).getContext("2d");return f.putImageData(u,0,0),f}(p,g,m,v,y,(x={gradient:n,opacity:r,minOpacity:o,maxOpacity:i,blur:a,useGradientOpacity:s},O=t=>void 0===t,Object.keys(x).reduce(((t,e)=>{const n=x[e];return O(n)||(t[e]=n),t}),{})),u):{canvas:null};var x,O;return Cu(f.createElement("image",{})).call(Bf,h).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas).style("transform",d).call(Bf,c).node()}};jy.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ty={heatmap:jy},Cy=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]}))]]};Cy.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:Ty,channels:[...vh({shapes:Object.keys(Ty)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...wh(),{type:B},{type:Op}],postInference:[...bh()]};const Ny=(t,e)=>{return n=void 0,r=void 0,o=function*(){const{width:n,height:r}=e,{data:i,encode:o={},scale:a,style:s={},layout:c={}}=t,l=function(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}(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 A({},{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}))},new((i=void 0)||(i=Promise))((function(t,e){function a(t){try{c(o.next(t))}catch(t){e(t)}}function s(t){try{c(o.throw(t))}catch(t){e(t)}}function c(e){e.done?t(e.value):function(t){return t instanceof i?t:new i((function(e){e(t)}))}(e.value).then(a,s)}c((o=o.apply(n,r||[])).next())}));var n,r,i,o};Ny.props={};const Ly=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];Ly.props={};const Ry=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];Ry.props={};const Iy=t=>new Tf(t);Iy.props={};const zy=Symbol("defaultUnknown");function Dy(t,e,n){for(let r=0;r<e.length;r+=1)t.has(e[r])||t.set(n(e[r]),r)}function By(t){const{value:e,from:n,to:r,mapper:i,notFoundReturn:o}=t;let a=i.get(e);if(void 0===a){if(o!==zy)return o;a=n.push(e)-1,i.set(e,a)}return r[a%r.length]}function Fy(t){return t instanceof Date?t=>`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class Wy extends cf{getDefaultOptions(){return{domain:[],range:[],unknown:zy}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&Dy(this.domainIndexMap,this.getDomain(),this.domainKey),By({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&Dy(this.rangeIndexMap,this.getRange(),this.rangeKey),By({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=Fy(e),this.rangeKey=Fy(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 Wy(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}}const $y=t=>new Wy(t);function Gy({map:t,initKey:e},n){const r=e(n);return t.has(r)?t.get(r):n}function Hy(t){return"object"==typeof t?t.valueOf():t}$y.props={};class Vy extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=Hy,null!==t)for(const[e,n]of t)this.set(e,n)}get(t){return super.get(Gy({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Gy({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))}}function qy(t){return Math.round(1e12*t)/1e12}class Xy extends Wy{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:zy,flex:[]}}constructor(t){super(t)}clone(){return new Xy(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 function(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,h=f-u,d=h/(2/c*r+1-1/c*i),p=d*i/c,g=d-c*p,y=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(l),m=y.reduce(((t,e)=>t+e)),v=g/m,b=new Vy(e.map(((t,e)=>{const n=y[e]*v;return[t,a?Math.floor(n):n]}))),x=new Vy(e.map(((t,e)=>{const n=y[e]*v+p;return[t,a?Math.floor(n):n]}))),O=Array.from(x.values()).reduce(((t,e)=>t+e)),w=u+(h-(O-O/c*i))*s;let M=a?Math.round(w):w;const E=new Array(c);for(let t=0;t<c;t+=1){E[t]=qy(M);const n=e[t];M+=x.get(n)}return{valueBandWidth:b,valueStep:x,adjustedRange:E}}(t);const{range:i,paddingOuter:o,paddingInner:a,round:s,align:c}=t;let l,u,f=i[0];const h=i[1]-f,d=2*o,p=r-a;l=h/Math.max(1,d+p),s&&(l=Math.floor(l)),f+=(h-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 Yy=t=>new Xy(t);function Uy(t){return Math.abs(t)<1e-14?t:parseFloat(t.toFixed(14))}Yy.props={};const Ky=[1,5,2,2.5,4,3],Zy=100*Number.EPSILON;function Jy(t,e,n,r,i,o){const a=af(e),s=nf(e,t);let c=0;const l=function(t,e){return(t%e+e)%e}(r,o);return(l<Zy||o-l<Zy)&&r<=0&&i>=0&&(c=1),1-s/(a-1)-n+c}function Qy(t,e,n){const r=af(e);return 1-nf(e,t)/(r-1)-n+1}function tm(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 em(t,e){return t>=e?2-(t-1)/(e-1):1}function nm(t,e,n,r){return 1-.5*((e-r)**2+(t-n)**2)/(.1*(e-t))**2}function rm(t,e,n){const r=e-t;return n>r?1-((n-r)/2)**2/(.1*r)**2:1}const im=(t,e,n=5,r=!0,i=Ky,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=Qy(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=em(f,a);if(o[0]*u+o[1]+o[2]*n+o[3]<s.score)break;const h=(e-t)/(f+1)/c/l;let d=Math.ceil(Math.log10(h));for(;d<1/0;){const h=c*l*10**d,p=rm(t,e,h*(f-1));if(o[0]*u+o[1]*p+o[2]*n+o[3]<s.score)break;const g=Math.floor(e/h)*c-(f-1)*c,y=Math.ceil(t/h)*c;if(g<=y){const n=y-g;for(let u=0;u<=n;u+=1){const n=(g+u)*(h/c),d=n+h*(f-1),p=h,y=Jy(l,i,c,n,d,p),m=nm(t,e,n,d),v=tm(f,a,t,e,n,d),b=1,x=o[0]*y+o[1]*m+o[2]*v+o[3]*b;x>s.score&&(!r||n<=t&&d>=e)&&(s.lmin=n,s.lmax=d,s.lstep=p,s.score=x)}}d+=1}f+=1}}c+=1}const l=Uy(s.lmax),u=Uy(s.lmin),f=Uy(s.lstep),h=Math.floor(function(t){return Math.round(1e12*t)/1e12}((l-u)/f))+1,d=new Array(h);d[0]=Uy(u);for(let t=1;t<h;t+=1)d[t]=Uy(d[t-1]+f);return d};class om extends cf{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:im}}map(t){return bf(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new om(this.options)}getTicks(){const{domain:t,tickCount:e,tickMethod:n}=this.options,[r,i]=t;return Ku(r)&&Ku(i)?n(r,i,e):[]}}const am=t=>new om(t);am.props={};class sm extends Xy{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:zy,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new sm(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}}const cm=t=>new sm(t);cm.props={};var lm=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,um=/\[([^]*?)\]/gm;function fm(t,e){for(var n=[],r=0,i=t.length;r<i;r++)n.push(t[r].substr(0,e));return n}var hm=function(t){return function(e,n){var r=n[t].map((function(t){return t.toLowerCase()})),i=r.indexOf(e.toLowerCase());return i>-1?i:null}};function dm(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 pm=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],gm=["January","February","March","April","May","June","July","August","September","October","November","December"],ym=fm(gm,3),mm=dm({},{dayNamesShort:fm(pm,3),dayNames:pm,monthNamesShort:ym,monthNames:gm,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10?1:0)*t%10]}}),vm=function(t,e){for(void 0===e&&(e=2),t=String(t);t.length<e;)t="0"+t;return t},bm={D:function(t){return String(t.getDate())},DD:function(t){return vm(t.getDate())},Do:function(t,e){return e.DoFn(t.getDate())},d:function(t){return String(t.getDay())},dd:function(t){return vm(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 vm(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 vm(String(t.getFullYear()),4).substr(2)},YYYY:function(t){return vm(t.getFullYear(),4)},h:function(t){return String(t.getHours()%12||12)},hh:function(t){return vm(t.getHours()%12||12)},H:function(t){return String(t.getHours())},HH:function(t){return vm(t.getHours())},m:function(t){return String(t.getMinutes())},mm:function(t){return vm(t.getMinutes())},s:function(t){return String(t.getSeconds())},ss:function(t){return vm(t.getSeconds())},S:function(t){return String(Math.round(t.getMilliseconds()/100))},SS:function(t){return vm(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return vm(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?"-":"+")+vm(100*Math.floor(Math.abs(e)/60)+Math.abs(e)%60,4)},Z:function(t){var e=t.getTimezoneOffset();return(e>0?"-":"+")+vm(Math.floor(Math.abs(e)/60),2)+":"+vm(Math.abs(e)%60,2)}},xm=(hm("monthNamesShort"),hm("monthNames"),{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 Om=1e3,wm=6e4,Mm=36e5,Em=864e5,km=6048e5,Sm=2592e6,Pm=31536e6;function _m(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 Am=_m(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),jm=_m(Om,(t=>{t.setMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Om*e)}),(t=>t.getSeconds())),Tm=_m(wm,(t=>{t.setSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+wm*e)}),(t=>t.getMinutes())),Cm=_m(Mm,(t=>{t.setMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+Mm*e)}),(t=>t.getHours())),Nm=_m(Em,(t=>{t.setHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Em*e)}),(t=>t.getDate()-1)),Lm=_m(Sm,(t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e=1)=>{const n=t.getMonth();t.setMonth(n+e)}),(t=>t.getMonth())),Rm=_m(km,(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=Lm.floor(t),n=new Date(+t);return Math.floor((+n-+e)/km)})),Im=_m(Pm,(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())),zm={millisecond:Am,second:jm,minute:Tm,hour:Cm,day:Nm,week:Rm,month:Lm,year:Im},Dm=_m(1,(t=>t),((t,e=1)=>{t.setTime(+t+e)}),(t=>t.getTime())),Bm=_m(Om,(t=>{t.setUTCMilliseconds(0)}),((t,e=1)=>{t.setTime(+t+Om*e)}),(t=>t.getUTCSeconds())),Fm=_m(wm,(t=>{t.setUTCSeconds(0,0)}),((t,e=1)=>{t.setTime(+t+wm*e)}),(t=>t.getUTCMinutes())),Wm=_m(Mm,(t=>{t.setUTCMinutes(0,0,0)}),((t,e=1)=>{t.setTime(+t+Mm*e)}),(t=>t.getUTCHours())),$m=_m(Em,(t=>{t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+Em*e)}),(t=>t.getUTCDate()-1)),Gm=_m(Sm,(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{const n=t.getUTCMonth();t.setUTCMonth(n+e)}),(t=>t.getUTCMonth())),Hm=_m(km,(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7)%7),t.setUTCHours(0,0,0,0)}),((t,e=1)=>{t.setTime(+t+km*e)}),(t=>{const e=Gm.floor(t),n=new Date(+t);return Math.floor((+n-+e)/km)})),Vm=_m(Pm,(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())),qm={millisecond:Dm,second:Bm,minute:Fm,hour:Wm,day:$m,week:Hm,month:Gm,year:Vm};function Xm(t,e,n,r,i){const o=+t,a=+e,{tickIntervals:s,year:c,millisecond:l}=function(t){const e=t?qm:zm,{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,h=r||(a-o)/f,d=s.length,p=ff(s,h,0,d,u);let g;if(p===d)g=[c,Ef(o/c.duration,a/c.duration,f)];else if(p){const t=h/u(s[p-1])<u(s[p])/h,[e,n]=t?s[p-1]:s[p];g=[e,r?Math.ceil(r/e.duration):n]}else g=[l,Math.max(Ef(o,a,f),1)];return g}const Ym=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Xm(a,s,n,r,i),u=c.range(a,new Date(+s+1),l,!0);return o?u.reverse():u},Um=(t,e,n,r,i)=>{const o=t>e,a=o?e:t,s=o?t:e,[c,l]=Xm(a,s,n,r,i),u=[c.floor(a,l),c.ceil(s,l)];return o?u.reverse():u};function Km(t){const e=t.getTimezoneOffset(),n=new Date(t);return n.setMinutes(n.getMinutes()+e,n.getSeconds(),n.getMilliseconds()),n}class Zm extends Af{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:Ym,interpolate:yf,mask:void 0,utc:!1}}chooseTransforms(){return[t=>+t,t=>new Date(t)]}chooseNice(){return Um}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?qm:zm,r=e?Km:rf;return e=>function(t,e,n){if(void 0===e&&(e=xm.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=xm[e]||e).replace(um,(function(t,e){return r.push(e),"@@@"}));var i=dm(dm({},mm),n);return(e=e.replace(lm,(function(e){return bm[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 Zm(this.options)}}const Jm=t=>new Zm(t);Jm.props={};const Qm=t=>e=>-t(-e),tv=(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?Qm(r):r},ev=(t,e)=>{const n=t===Math.E?Math.exp:e=>t**e;return e?Qm(n):n},nv=(t,e,n,r=10)=>{const i=t<0,o=ev(r,i),a=tv(r,i),s=e<t,c=s?e:t,l=s?t:e;let u=a(c),f=a(l),h=[];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&&h.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&&h.push(n)}}2*h.length<n&&(h=jf(c,l,n))}else{const t=-1===n?f-u:Math.min(f-u,n);h=jf(u,f,t).map(o)}return s?h.reverse():h},rv=(t,e,n,r)=>{const i=t<0,o=tv(r,i),a=ev(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};class iv extends Af{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:mf,tickMethod:nv,tickCount:5}}chooseNice(){return rv}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[tv(t,n),ev(t,n)]}clone(){return new iv(this.options)}}const ov=t=>new iv(t);ov.props={};const av=t=>t<0?-Math.sqrt(-t):Math.sqrt(t);class sv extends Af{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:mf,tickMethod:jf,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(1===t)return[rf,rf];const e=.5===t?av:(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 sv(this.options)}}const cv=t=>new sv(t);cv.props={};class lv extends sv{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:mf,tickMethod:jf,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new lv(this.options)}}const uv=t=>new lv(t);uv.props={};class fv extends cf{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!bf(t))return this.options.unknown;const e=ff(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 fv(this.options)}rescale(){const{domain:t,range:e}=this.options;this.n=Math.min(t.length,e.length-1),this.thresholds=t}}const hv=t=>new fv(t);function dv(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)}hv.props={};class pv extends fv{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:im}}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(dv(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 pv(this.options)}getTicks(){const{tickCount:t,domain:e,tickMethod:n}=this.options,r=e.length-1;return n(e[0],e[r],t)}}const gv=t=>new pv(t);gv.props={};class yv extends fv{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:im}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[t,e,n]=this.getTickMethodOptions();this.options.domain=kf(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 yv(this.options)}}const mv=t=>new yv(t);mv.props={};var vv;let bv=vv=class extends Tf{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:rf,tickMethod:jf,tickCount:5}}constructor(t){super(t)}clone(){return new vv(this.options)}};bv=vv=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}([t=>{t.prototype.rescale=function(){this.initRange(),this.nice();const[t]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t))},t.prototype.initRange=function(){const{interpolator:t}=this.options;this.options.range=function(t){return[t(0),t(1)]}(t)},t.prototype.composeOutput=function(t,e){const{domain:n,interpolator:r,round:i}=this.getOptions(),o=(t=>{const[e,n]=t;return uf(yf(0,1),lf(e,n))})(n.map(t)),a=i?(t=>e=>{const n=t(e);return Ku(n)?Math.round(n):n})(r):r;this.output=uf(a,o,e,t)},t.prototype.invert=void 0}],bv);const xv=t=>new bv(t);xv.props={};class Ov extends cf{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:jf}}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 Ku(r)&&Ku(i)?t(r,i,n):[]}clone(){return new Ov(this.options)}}const wv=t=>new Ov(t);function Mv({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:h,category10:d,category20:p,sizeDefault:g=1,padding:y="auto",margin:m=16}){return{padding:y,margin:m,size:g,color:t,category10:d,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:h,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"}}}wv.props={};const Ev=Mv({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}),kv=t=>A({},Ev,t);kv.props={};const Sv=t=>A({},kv(),{category10:"category10",category20:"category20"},t);Sv.props={};const Pv=Mv({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}),_v=t=>A({},Pv,{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),Av=t=>Object.assign({},_v(),{category10:"category10",category20:"category20"},t);Av.props={};const jv=Mv({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}),Tv=t=>A({},jv,{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 Cv(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=(0,Mt.zs)(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,(0,Mt.Cl)((0,Mt.Cl)({},t[e]),n)]:[e,n]})))}function Nv(t,e){t?t.finished.then(e):e()}function Lv(t,e){"update"in t?t.update(e):t.attr(e)}function Rv(t,e,n){return 0===e.length?null:n?t.animate(e,n):(Lv(t,{style:e.slice(-1)[0]}),null)}function Iv(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=(0,Mt.zs)(e,2),o=n[0],a=n[1];if(!en(a)){var s=t.style[o]||t.parsedStyle[o]||0;s!==a&&(r[o]=s,i[o]=a)}})),n?Rv(t,[r,i],(0,Mt.Cl)({fill:"both"},n)):(Lv(t,i),null)}Tv.props={};var zv=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=(0,Mt.zs)(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},Dv={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 Cc({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:[]},Bv=(A({},Dv,{style:{type:"arc"}}),A({},Dv,{style:{}}),zv({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"));function Fv(t,e){return[t[0]*e,t[1]*e]}function Wv(t,e){return[t[0]+e[0],t[1]+e[1]]}function $v(t,e){return[t[0]-e[0],t[1]-e[1]]}function Gv(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function Hv(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Vv(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function qv(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 Xv(t){return t*Math.PI/180}function Yv(t){return Number((180*t/Math.PI).toPrecision(5))}function Uv(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Kv(t,e,n){var r;void 0===n&&(n=!0);var i=e||(null===(r=t.match(/^([a-z][a-z0-9]+)/))||void 0===r?void 0:r[0])||"",o=t.replace(new RegExp("^(".concat(i,")")),"");return n?function(t){return t.toString().charAt(0).toLowerCase()+t.toString().slice(1)}(o):o}var Zv=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function Jv(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i,o=(0,Mt.zs)(t,2),a=o[0],s=o[1];if("className"===a||"class"===a);else if(Zv(a,"show")&&Zv(Kv(a,"show"),e)!==n)a===(i=e,"".concat("show").concat(Uv(i)))?r[a]=s:r[a.replace(new RegExp(Uv(e)),"")]=s;else if(!Zv(a,"show")&&Zv(a,e)!==n){var c=Kv(a,e);"filter"===c&&"function"==typeof s||(r[c]=s)}})),r}function Qv(t,e){return Object.entries(t).reduce((function(t,n){var r=(0,Mt.zs)(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(Uv(i))]=o,t}),{})}function tb(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=(0,Mt.zs)(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)})),[r,i]}function eb(t,e){return kp(t)?t.apply(void 0,(0,Mt.fX)([],(0,Mt.zs)(e),!1)):t}function nb(t,e){return t.style.opacity||(t.style.opacity=1),Iv(t,{opacity:0},e)}var rb=["$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 ib(t){return rb.includes(t)}function ob(t){var e={};for(var n in t)ib(n)&&(e[n]=t[n]);return e}var ab=zv({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function sb(t){return t.reduce((function(t,e,n){return t.push((0,Mt.fX)([0===n?"M":"L"],(0,Mt.zs)(e),!1)),t}),[])}function cb(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 sb(t);if(!o)return[];var a=Vv(t[0],o),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push((0,Mt.fX)(["M"],(0,Mt.zs)(e),!1)):t.push((0,Mt.fX)(["A",a,a,0,0,s],(0,Mt.zs)(e),!1)),t}),[])}(t,e,n):sb(t)}function lb(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=(0,Mt.zs)([cb(t,n),cb(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=(0,Mt.zs)([t[0],e.slice(-1)[0]],2),f=u[0],h=u[1],d=function(t,e){return[c,t,l,e,a].flat()};if("line"===i||"surround"===r)return d([(0,Mt.fX)(["L"],(0,Mt.zs)(h),!1)],[(0,Mt.fX)(["L"],(0,Mt.zs)(f),!1)]);if(!o)throw new Error("Arc grid need to specified center");var p=(0,Mt.zs)([Vv(h,o),Vv(f,o)],2),g=p[0],y=p[1];return d([(0,Mt.fX)(["A",g,g,0,0,1],(0,Mt.zs)(h),!1),(0,Mt.fX)(["L"],(0,Mt.zs)(h),!1)],[(0,Mt.fX)(["A",y,y,0,0,0],(0,Mt.zs)(f),!1),(0,Mt.fX)(["L"],(0,Mt.zs)(f),!1)])}var ub=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Mt.C6)(e,t),e.prototype.render=function(t,e){t.type,t.center,t.areaFill,t.closed;var n=(0,Mt.Tt)(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=(0,Mt.zs)(e,1)[0];return(0,Mt.Cl)((0,Mt.Cl)({},t),{points:(0,Mt.fX)((0,Mt.fX)([],(0,Mt.zs)(e),!1),[n],!1)})})):n}(t),i=Bp(e).maybeAppendByClassName(ab.lineGroup,"g"),o=Bp(e).maybeAppendByClassName(ab.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:cb(t.points,n)}}));return t.selectAll(ab.line.class).data(a,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=eb(ob((0,Mt.Cl)({d:t.d},r)),[t,e,a]);this.attr((0,Mt.Cl)({class:ab.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))}))}),(function(t){return t.transition((function(t,e){return Iv(this,eb(ob((0,Mt.Cl)({d:t.d},r)),[t,e,a]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=nb(this,i.exit);return Nv(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=(0,Mt.zs)([e[l].points,e[l+1].points],2),f=lb(u[0],u[1],n);c.push({d:f,fill:s(l)})}return t.selectAll(ab.region.class).data(c,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=eb(t,[t,e,c]);this.attr(n)})).attr("className",ab.region.name)}),(function(t){return t.transition((function(t,e){return Iv(this,eb(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=nb(this,r.exit);return Nv(e,(function(){return t.remove()})),e}))})).transitions()}(o,r,t);return(0,Mt.fX)((0,Mt.fX)([],(0,Mt.zs)(a),!1),(0,Mt.zs)(s),!1)},e}(Rp);const fb=function(t,e,n){for(var r=0,i=nn(e)?e.split("."):e;t&&r<i.length;)t=t[i[r++]];return void 0===t||r<i.length?n:t};var hb,db=function(t,e){return function(n){return t*(1-n)+e*n}};function pb(t,e){return"number"==typeof t&&"number"==typeof e?db(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]=pb(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=(0,Mt.zs)(e,2),o=i[0],a=i[1];o in t?n[o]=pb(t[o],a):r[o]=a})),function(t){return Object.entries(n).forEach((function(e){var n=(0,Mt.zs)(e,2),i=n[0],o=n[1];return r[i]=o(t)})),r}}(t,e):function(e){return t}}function gb(t){return"function"==typeof t?t():nn(t)||Qe(t)?new zp({style:{text:String(t)}}):t}function yb(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}function mb(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 vb(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=(0,Mt.zs)(t,2);return[n[0],eb(n[1],e)]})))}function bb(t,e){return e&&kp(e)?t.filter(e):t}function xb(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function Ob(t,e){if("linear"===e.type){var n=(0,Mt.zs)(e.startPos,2),r=n[0],i=n[1],o=(0,Mt.zs)(e.endPos,2),a=o[0],s=o[1],c=(0,Mt.zs)([a-r,s-i],2);return qv([c[0],c[1]])}var l=Xv(xb(t,e));return[-Math.sin(l),Math.cos(l)]}function wb(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(Ob(t,n),"positive"!==e)}function Mb(t,e){return wb(t,e.labelDirection,e)}function Eb(t,e){return"linear"===e.type?function(t,e){var n=(0,Mt.zs)(e.startPos,2),r=n[0],i=n[1],o=(0,Mt.zs)(e.endPos,2),a=o[0],s=o[1],c=(0,Mt.zs)([a-r,s-i],2);return[r+c[0]*t,i+c[1]*t]}(t,e):function(t,e){var n=e.radius,r=(0,Mt.zs)(e.center,2),i=r[0],o=r[1],a=Xv(xb(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function kb(t){return 0===Ob(0,t)[1]}function Sb(t){return 0===Ob(0,t)[0]}function Pb(t,e){return e-t==360}function _b(t,e,n,r,i){var o=e-t,a=(0,Mt.zs)([i,i],2),s=a[0],c=a[1],l=(0,Mt.zs)([Xv(t),Xv(e)],2),u=l[0],f=l[1],h=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},d=(0,Mt.zs)(h(u),2),p=d[0],g=d[1],y=(0,Mt.zs)(h(f),2),m=y[0],v=y[1];if(Pb(t,e)){var b=(f+u)/2,x=(0,Mt.zs)(h(b),2);return[["M",p,g],["A",s,c,0,1,0,x[0],x[1]],["A",s,c,0,1,0,m,v]]}var O=o>180?1:0,w=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(c,",0,").concat(O,",").concat(w,",").concat(m,",").concat(v)}function Ab(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(Bv.line.class).data([{d:_b.apply(void 0,(0,Mt.fX)((0,Mt.fX)([i,o],(0,Mt.zs)(a),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",Bv.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=pb(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,(0,Mt.Cl)({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return(0,Mt.fX)((0,Mt.fX)([n,r],(0,Mt.zs)(i),!1),[o],!1)}(this),(0,Mt.fX)((0,Mt.fX)([i,o],(0,Mt.zs)(a),!1),[s],!1),r.update);if(e){var n=function(){var e=fb(t.attributes,"__keyframe_data__");t.style.d=_b.apply(void 0,(0,Mt.fX)([],(0,Mt.zs)(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function jb(t){var e=(0,Mt.zs)(t,2),n=(0,Mt.zs)(e[0],2),r=n[0],i=n[1],o=(0,Mt.zs)(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function Tb(t,e,n){var r,i=e.type,o=Jv(e,"line");return r="linear"===i?function(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,c=e.lineExtension,l=(0,Mt.zs)([o,a],2),u=(0,Mt.zs)(l[0],2),f=u[0],h=u[1],d=(0,Mt.zs)(l[1],2),p=d[0],g=d[1],y=(0,Mt.zs)(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=(0,Mt.zs)([t,e,n],3),i=(0,Mt.zs)(r[0],2),o=i[0],a=i[1],s=(0,Mt.zs)(r[1],2),c=s[0],l=s[1],u=(0,Mt.zs)(r[2],2),f=u[0],h=u[1],d=(0,Mt.zs)([c-o,l-a],2),p=d[0],g=d[1],y=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),m=(0,Mt.zs)([-f/y,h/y],2),v=m[0],b=m[1];return[v*p,v*g,b*p,b*g]}(o,a,c):new Array(4).fill(0),4),m=y[0],v=y[1],b=y[2],x=y[3],O=function(e){return t.selectAll(Bv.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(Bv.line.name," ").concat(t.className)})).styles(n).transition((function(t){return Iv(this,jb(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return Iv(this,jb(t.line),r.update)}))}),(function(t){return t.remove()})).transitions()};if(!i||!s)return O([{line:[[f+m,h+v],[p+b,g+x]],className:Bv.line.name}]);var w=(0,Mt.zs)(s,2),M=w[0],E=w[1],k=p-f,S=g-h,P=(0,Mt.zs)([f+k*M,h+S*M],2),_=P[0],A=P[1],j=(0,Mt.zs)([f+k*E,h+S*E],2),T=j[0],C=j[1],N=O([{line:[[f+m,h+v],[_,A]],className:Bv.lineFirst.name},{line:[[T,C],[p+b,g+x]],className:Bv.lineSecond.name}]);return function(t,e){e.truncRange,e.truncShape,e.lineExtension}(0,e),N}(t,e,mb(o,"arrow"),n):Ab(t,e,mb(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(Bv.line.class):a?t.select(Bv.lineSecond.class):t.select(Bv.line.class),!o||!s||"arc"===n.type&&Pb(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=gb(s);f.attr(r),yb(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function Cb(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Nb(t,e,n,r){var i=Jv(n,"grid"),o=i.type,a=i.areaFill,s=Cb(n),c=bb(e,n.gridFilter),l="segment"===o?function(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=(0,Mt.zs)(Eb(i,e),2),a=o[0],s=o[1],c=(0,Mt.zs)(Fv(function(t,e){return wb(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}}))}(c,n):function(t,e){var n=e.gridControlAngles,r=Cb(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=(0,Mt.zs)(r,2),o=i[0],a=i[1];return t.map((function(t,r){var i=t.value,s=(0,Mt.zs)(Eb(i,e),2),c=s[0],l=s[1],u=(0,Mt.zs)([c-o,l-a],2),f=u[0],h=u[1],d=[];return n.forEach((function(t){var e=Xv(t),n=(0,Mt.zs)([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=f*r-h*i+o,c=f*i+h*r+a;d.push([s,c])})),{points:d,id:r}}))}(c,n),u=(0,Mt.Cl)((0,Mt.Cl)({},i),{center:s,areaFill:kp(a)?c.map((function(t,e){return eb(a,[t,e,c])})):a,animate:r,data:l});return t.selectAll(Bv.grid.class).data([1]).join((function(t){return t.append((function(){return new ub({style:u})})).attr("className",Bv.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}function Lb(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 Rb=function(t,e,n){if(void 0===n&&(n=128),!kp(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 hb||(hb=cc.offscreenCanvasCreator.getOrCreateContext(void 0)),hb.font=[o,a,i,"".concat(n,"px"),r].join(" "),hb.measureText(t).width}),(function(t,e){return[t,Object.values(e||Ib(t)).join()].join("")}),4096),Ib=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 zb(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function Db(t,e){var n=zb(t);n&&n.attr(e)}function Bb(t,e,n){void 0===n&&(n="..."),Db(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function Fb(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=(0,Mt.zs)([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){}}var Wb=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)};function $b(t){if(Qe(t))return[t,t,t,t];if(E(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]}var Gb=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 Hb(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getBounds(),i=(0,Mt.zs)(r.min,2),o=i[0],a=i[1],s=(0,Mt.zs)(r.max,2),c=s[0],l=s[1],u=t.getBBox(),f=u.width,h=u.height,d=0,p=0,g=o,y=a,m=zb(t);if(m){h-=1.5;var v=m.style.textAlign,b=m.style.textBaseline;"center"===v?g=(o+c)/2:"right"!==v&&"end"!==v||(g=c),"middle"===b?y=(a+l)/2:"bottom"===b&&(y=l)}var x=(0,Mt.zs)($b(e),4),O=x[0],w=void 0===O?0:O,M=x[1],E=void 0===M?0:M,k=x[2],S=void 0===k?w:k,P=x[3],_=new Gb((d+=o)-(void 0===P?E:P),(p+=a)-w,d+f+E,p+h+S);return t.setEulerAngles(n),_.rotatedPoints(Xv(n),g,y)}function Vb(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 qb(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 Xb(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=(0,Mt.zs)(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=(0,Mt.zs)(e,4),c=s[0],l=s[1],u=o-r,f=a-i,h=s[2]-c,d=s[3]-l,p=u*d-h*f;if(0===p)return!1;var g=p>0,y=r-c,m=i-l,v=u*m-f*y;if(v<0===g)return!1;var b=h*m-d*y;return b<0!==g&&v>p!==g&&b>p!==g}(e,t)}))}function Yb(t,e,n){var r,i,o,a,s=e.crossPadding,c=new Set,l=null,u=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=(0,Mt.zs)(o,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-a-u,h=a+u,d=(0,Mt.zs)($b(e),4),p=d[0],g=d[1],y=d[2],m=d[3];return new Gb(c+f-m,l+f-p,c+h+g,l+h+y)}var v=(0,Mt.zs)(t.startPos,2),b=v[0],x=v[1],O=(0,Mt.zs)(t.endPos,2),w=O[0],M=O[1],E=(0,Mt.zs)(Sb(t)?[-e,0,e,0]:[0,e,0,-e],4),k=E[0],S=E[1],P=E[2],_=E[3],A=Fv(Mb(0,t),i),j=new Gb(b,x,w,M);return j.x1+=_,j.y1+=k,j.x2+=S+A[0],j.y2+=P+A[1],j}(e,s),f=function(t){return!u||function(t,e,n){var r,i=t.x1,o=t.x2,a=t.y1,s=t.y2;return r=[[i,a],[o,a],[o,s],[i,s]],Hb(e,void 0).every((function(t){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 h=[t[f],t[(f+1)%n]];if(o=qb((r=h)[0],r[1],(i=l)[0]),a=qb(r[0],r[1],i[1]),s=qb(i[0],i[1],r[0]),c=qb(i[0],i[1],r[1]),o!==a&&s!==c||0===o&&Vb(r,i[0])||0===a&&Vb(r,i[1])||0===s&&Vb(i,r[0])||0===c&&Vb(i,r[1])){if(0===qb(h[0],e,h[1]))return Vb(h,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(r,t)}))}(u,t)};try{for(var h=(0,Mt.Ju)(t),d=h.next();!d.done;d=h.next()){var p=d.value;f(p)?l&&(a=p,(o=l)&&o.firstChild&&function(t,e,n){var r,i,o=Hb(t,n).flat(1),a=Hb(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=(0,Mt.Ju)(s),l=c.next();!l.done;l=c.next())if(Xb(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}(o.firstChild,a.firstChild,$b(n)))?(c.add(l),c.add(p)):l=p:c.add(p)}}catch(t){r={error:t}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return Array.from(c)}function Ub(t,e){return void 0===e&&(e={}),en(t)?0:"number"==typeof t?t:Math.floor(Rb(t,e))}function Kb(t){var e=t.getLocalBounds(),n=e.min,r=e.max,i=(0,Mt.zs)([n,r],2),o=(0,Mt.zs)(i[0],2),a=o[0],s=o[1],c=(0,Mt.zs)(i[1],2),l=c[0],u=c[1];return{x:a,y:s,width:l-a,height:u-s,left:a,bottom:u,top:s,right:l}}function Zb(t,e){var n=(0,Mt.zs)(t,2),r=n[0],i=n[1],o=(0,Mt.zs)(e,2),a=o[0],s=o[1];return r!==a&&i===s}var Jb=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r&&(_p(t),1))}))},Qb=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=Jb,f=function(t){return t.forEach(r.show),t},h=2,d=t.slice(),p=t.slice(),g=Math.min.apply(Math,(0,Mt.fX)([1],(0,Mt.zs)(t.map((function(t){return t.getBBox().width}))),!1));if("linear"===n.type&&(kb(n)||Sb(n))){var y=Kb(t[0]).left,m=Kb(t[i-1]).right,v=Math.abs(m-y)||1;h=Math.max(Math.floor(i*g/v),h)}for(o&&(s=d.splice(0,1)[0]),a&&(c=d.splice(-1,1)[0],d.reverse()),f(d);h<t.length&&Yb((l=c?(0,Mt.fX)((0,Mt.fX)([c],(0,Mt.zs)(p),!1),[s],!1):(0,Mt.fX)([s],(0,Mt.zs)(p),!1),l.filter(Wb)),n,null==e?void 0:e.margin).length;)(c&&!s&&h%2==0||c&&s)&&d.splice(0,1).forEach(r.hide),p=u(f(d),{seq:h}),h++}}],["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()})),h=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.rotate(t,+i)}))};try{for(var d=(0,Mt.Ju)(s),p=d.next();!p.done;p=d.next())if(h(p.value),Yb(t,n,c).length<1)return}catch(t){i={error:t}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}u&&h(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,h=void 0===f?[0,0,0,0]:f,d=Ib(r.getTextShape(t[0])),p=Ub(u,d),g=a?Ub(a,d):p,y=Ub(c,d);(en(y)||y===1/0)&&(y=Math.max.apply(null,t.map((function(t){return t.getBBox().width}))));for(var m=t.slice(),v=(0,Mt.zs)(h,4),b=(v[0],v[1],v[2],v[3],function(e){if(m.forEach((function(t){r.ellipsis(r.getTextShape(t),e,o)})),(m=Yb(t,n,h)).length<1)return{value:void 0}}),x=y;x>g+p;x-=p){var O=b(x);if("object"==typeof O)return O.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,h=t.map((function(t){return t.attr("maxLines")||1})),d=Math.min.apply(Math,(0,Mt.fX)([],(0,Mt.zs)(h),!1)),p=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&kb(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(!(d>s)){for(var y=d;y<=s;y++)if(g(y),Yb(t,n,f).length<1)return;l&&g(h)}}]]);function tx(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return t*("positive"===e?-1:1)}),1)}function ex(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function nx(t,e){var n=(0,Mt.zs)(t,2),r=n[0],i=n[1],o=(0,Mt.zs)(e,2),a=o[0],s=o[1],c=(0,Mt.zs)([r*a+i*s,r*s-i*a],2),l=c[0],u=c[1];return Math.atan2(u,l)}function rx(t,e,n){var r=n.type,i=n.labelAlign,o=Mb(t,n),a=ex(e),s=ex(Yv(nx([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?(Lb(a,0,90,!1,!0)||Lb(a,0,90)||Lb(a,270,360))&&(c="start"):90===s?Lb(a,0,90,!1,!0)?c="start":(Lb(a,90,180)||Lb(a,270,360))&&(c="end"):270===s?Lb(a,0,90,!1,!0)?c="end":(Lb(a,90,180)||Lb(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(Lb(a,0,90)||Lb(a,270,360))&&(c="end")):c="center":"parallel"===i?l=Lb(s,0,180,!0)?"top":"bottom":"horizontal"===i?Lb(s,90,270,!1)?c="end":(Lb(s,270,360,!1)||Lb(s,0,90))&&(c="start"):"perpendicular"===i&&(c=Lb(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function ix(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=eb(s,[t,c,e]),u=(0,Mt.zs)([Mb(t.value,n),tx(a,o)],2),f=u[0],h=1===u[1]?eb(r?i:0,[t,c,e]):0,d=(0,Mt.zs)(Wv(Fv(f,l+h),Eb(t.value,n)),2);return{x:d[0],y:d[1]}}function ox(t,e){"text"===t.nodeName&&t.attr(e)}function ax(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=Qb.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:_p,show:Pp,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=rx(e.__data__.value,t,n),i=e.querySelector(Bv.labelItem.class);i&&ox(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&Bb(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"),Db(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function sx(t,e,n,r,i){var o=n.indexOf(e),a=Bp(t).append(function(t,e,n,r){var i=r.labelFormatter;return kp(i)?function(){return gb(eb(i,[t,e,n,Mb(t.value,r)]))}:function(){return gb(t.label||"")}}(e,o,n,i)).attr("className",Bv.labelItem.name).node(),s=(0,Mt.zs)(tb(vb(r,[e,o,n])),2),c=s[0],l=s[1],u=l.transform,f=(0,Mt.Tt)(l,["transform"]);Fb(a,u);var h=function(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=Mb(t.value,n),a=Ob(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return Lb(e,-90,90)||(e+=180),e}(Yv("perpendicular"===i?nx([1,0],o):nx([a[0]<0?-1:1,0],a)))}(e,a,i);return a.getLocalEulerAngles()||a.setLocalEulerAngles(h),ox(a,(0,Mt.Cl)((0,Mt.Cl)({},rx(e.value,h,i)),c)),t.attr(f),a}function cx(t,e){return wb(t,e.tickDirection,e)}function lx(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=cx(e.value,i),s="line";return kp(o)&&(s=function(){return eb(o,[e,n,r,a])}),t.append(s).attr("className",Bv.tickItem.name)}(Bp(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=cx(t.value,o),c=function(t,e,n,r,i){var o=i.tickLength,a=(0,Mt.zs)(function(t,e){var n=(0,Mt.zs)(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,eb(o,[t,e,n])),2),s=(0,Mt.zs)(a[0],2),c=s[0],l=s[1],u=(0,Mt.zs)(a[1],2);return{x1:c,x2:u[0],y1:l,y2:u[1]}}(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,h=c.y2,d=(0,Mt.zs)(tb(vb(a,[t,e,n,s])),2),p=d[0],g=d[1];"line"===r.node().nodeName&&r.styles((0,Mt.Cl)({x1:l,x2:u,y1:f,y2:h},p)),i.attr(g),r.styles(p)}(t,e,n,a,this,r,i);var s=(0,Mt.zs)(Eb(t.value,r),2),c=s[0],l=s[1];return Iv(this,{transform:"translate(".concat(c,", ").concat(l,")")},o)}var ux=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}(),fx=zv({text:"text"},"title");function hx(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function dx(t,e){var n=Object.entries(e).reduce((function(e,n){var r=(0,Mt.zs)(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e}),{});t.styles(n)}var px=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(0,Mt.C6)(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(fx.text.class);if(!a)return new ux(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=(0,Mt.zs)($b(i),4),f=u[0],h=u[1],d=u[2],p=u[3],g=(0,Mt.zs)([0,0,+e,+n],4),y=g[0],m=g[1],v=g[2],b=g[3],x=hx(r);if(x.includes("i"))return new ux(y,m,v,b);x.forEach((function(t,r){var i,o,a,s;"t"===t&&(i=(0,Mt.zs)(0===r?[l+d,+n-l-d]:[0,+n],2),m=i[0],b=i[1]),"r"===t&&(o=(0,Mt.zs)([+e-c-p],1),v=o[0]),"b"===t&&(a=(0,Mt.zs)([+n-l-f],1),b=a[0]),"l"===t&&(s=(0,Mt.zs)(0===r?[c+h,+e-c-h]:[0,+e],2),y=s[0],v=s[1])}));var O=(0,Mt.zs)($b(o),4),w=O[0],M=O[1],E=O[2],k=O[3],S=(0,Mt.zs)([k+M,w+E],2),P=S[0],_=S[1];return new ux(y+k,m+w,v-P,b-_)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new ux(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=(t.width,t.height,t.position,t.spacing,(0,Mt.Tt)(t,["width","height","position","spacing"])),i=(0,Mt.zs)(tb(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,c=o.position,l=(0,Mt.zs)([+a/2,+s/2],2),u=l[0],f=l[1],h=(0,Mt.zs)([+u,+f,"center","middle"],4),d=h[0],p=h[1],g=h[2],y=h[3],m=hx(c);return m.includes("l")&&(d=(e=(0,Mt.zs)([0,"start"],2))[0],g=e[1]),m.includes("r")&&(d=(n=(0,Mt.zs)([+a,"end"],2))[0],g=n[1]),m.includes("t")&&(p=(r=(0,Mt.zs)([0,"top"],2))[0],y=r[1]),m.includes("b")&&(p=(i=(0,Mt.zs)([+s,"bottom"],2))[0],y=i[1]),{x:d,y:p,textAlign:g,textBaseline:y}}(t),a=o.x,s=o.y,c=o.textAlign,l=o.textBaseline;Ip(!!r.text,Bp(e),(function(t){n.title=t.maybeAppendByClassName(fx.text,"text").styles(i).call(dx,{x:a,y:s,textAlign:c,textBaseline:l}).node()}))},e}(Rp);function gx(t,e,n,r,i){var o=Jv(r,"title"),a=(0,Mt.zs)(tb(o),2),s=a[0],c=a[1],l=c.transform,u=c.transformOrigin,f=(0,Mt.Tt)(c,["transform","transformOrigin"]);e.styles(f);var h=l||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(),s.direction,s.position);t.styles((0,Mt.Cl)((0,Mt.Cl)({},s),{transformOrigin:u})),Fb(t.node(),h);var d=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=hx(i),s=t.node().getLocalBounds(),c=(0,Mt.zs)(s.min,2),l=c[0],u=c[1],f=(0,Mt.zs)(s.halfExtents,2),h=f[0],d=f[1],p=(0,Mt.zs)(e.node().getLocalBounds().halfExtents,2),g=p[0],y=p[1],m=(0,Mt.zs)([l+h,u+d],2),v=m[0],b=m[1],x=(0,Mt.zs)($b(o),4),O=x[0],w=x[1],M=x[2],E=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var k=n.startPos,S=n.endPos,P=(0,Mt.zs)("start"===i?[k,S]:[S,k],2),_=P[0],A=P[1],j=qv([-A[0]+_[0],-A[1]+_[1]]),T=(0,Mt.zs)(Fv(j,O),2),C=T[0],N=T[1];return{x:_[0]+C,y:_[1]+N}}return a.includes("t")&&(b-=d+y+O),a.includes("r")&&(v+=h+g+w),a.includes("l")&&(v-=h+g+E),a.includes("b")&&(b+=d+y+M),{x:v,y:b}}(Bp(n._offscreen||n.querySelector(Bv.mainGroup.class)),e,r),p=d.x,g=d.y;return Iv(e.node(),{transform:"translate(".concat(p,", ").concat(g,")")},i)}function yx(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=Ip(i,e.maybeAppendByClassName(Bv.lineGroup,"g"),(function(e){return Tb(e,t,r)}))||[],c=Ip(o,e.maybeAppendByClassName(Bv.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=bb(e,n.tickFilter),o=Jv(n,"tick");return t.selectAll(Bv.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",Bv.tick.name).transition((function(t,e){return lx.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),lx.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=nb(this.childNodes[0],r.exit);return Nv(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=Ip(a,e.maybeAppendByClassName(Bv.labelGroup,"g"),(function(e){return function(t,e,n,r){var i=bb(e,n.labelFilter),o=Jv(n,"label");return t.selectAll(Bv.label.class).data(i,(function(t,e){return e})).join((function(r){return r.append("g").attr("className",Bv.label.name).transition((function(t){sx(this,t,e,o,n);var r=ix(t,e,n),i=r.x,a=r.y;return this.style.transform="translate(".concat(i,", ").concat(a,")"),null})).call((function(){ax.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&&_p(t),e.isVisible()&&Pp(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=(0,Mt.zs)(t.getGeometryBounds().center,2),h=f[0],d=f[1],p=(0,Mt.zs)(e.getGeometryBounds().center,2),g=p[0],y=p[1],m=(0,Mt.zs)([(h+g)/2-h,(d+y)/2-d],2),v=m[0],b=m[1],x=t.style.opacity,O=void 0===x?1:x,w=e.style.opacity,M=void 0===w?1:w,E=t.style.transform||"",k=e.style.transform||"",S=t.animate([{opacity:O,transform:"translate(0, 0) ".concat(E)},{opacity:0,transform:"translate(".concat(v,", ").concat(b,") ").concat(E)}],(0,Mt.Cl)((0,Mt.Cl)({fill:"both"},n),{duration:c+l+u})),P=e.animate([{opacity:0,transform:"translate(".concat(-v,", ").concat(-b,") ").concat(k),offset:.01},{opacity:M,transform:"translate(0, 0) ".concat(k)}],(0,Mt.Cl)((0,Mt.Cl)({fill:"both"},n),{duration:l+u,delay:c+l-u}));return Nv(P,i),[S,P]}(this.querySelector(Bv.labelItem.class),sx(this,t,e,o,n),r.update),a=ix(t,e,n),s=a.x,c=a.y,l=Iv(this,{transform:"translate(".concat(s,", ").concat(c,")")},r.update);return(0,Mt.fX)((0,Mt.fX)([],(0,Mt.zs)(i),!1),[l],!1)})).call((function(e){var r,i;i=function(){ax.call(t,n)},0===(r=fb(e,"_transitions").flat().filter(Wb)).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=nb(this.childNodes[0],r.exit);return Nv(e,(function(){return Bp(t).remove()})),e}))})).transitions()}(e,n,t,r)}))||[];return(0,Mt.fX)((0,Mt.fX)((0,Mt.fX)([],(0,Mt.zs)(s),!1),(0,Mt.zs)(c),!1),(0,Mt.zs)(l),!1).filter((function(t){return!!t}))}var mx=function(t){function e(e){return t.call(this,e,Dv)||this}return(0,Mt.C6)(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])})),h=Cv(void 0===n?a:n),d=Ip(c,Bp(e).maybeAppendByClassName(Bv.gridGroup,"g"),(function(e){return Nb(e,f,t,h)}))||[],p=Bp(e).maybeAppendByClassName(Bv.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&yx(t,Bp(this.offscreenGroup),f,Cv(!1));var g=yx(t,Bp(p.node()),f,h),y=Ip(s,Bp(e).maybeAppendByClassName(Bv.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(Bv.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 gb(i)})).attr("className",Bv.title.name).transition((function(){return gx(Bp(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return gx(Bp(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,h)}))||[];return(0,Mt.fX)((0,Mt.fX)((0,Mt.fX)([],(0,Mt.zs)(d),!1),(0,Mt.zs)(g),!1),(0,Mt.zs)(y),!1).flat().filter((function(t){return!!t}))},e}(Rp);const vx=function(t,e){if(t)if(E(t))for(var n=0,r=t.length;n<r&&!1!==e(t[n],n);n++);else if(Xn(t))for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break},bx=function(t,e){return function(t,e,n){if(!E(t)&&!S(t))return t;var r=n;return vx(t,(function(t,n){r=e(r,t,n)})),r}(t,(function(t,n,r){return e.includes(r)||(t[r]=n),t}),{})},xx=function(t){var e=gu(t);return e.charAt(0).toUpperCase()+e.substring(1)};function Ox(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)]}var wx,Mx=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ex(t){if(!(e=Mx.exec(t)))throw new Error("invalid format: "+t);var e;return new kx({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 kx(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 Sx(t,e){var n=Ox(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")}Ex.prototype=kx.prototype,kx.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};const Px={"%":(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)=>Sx(100*t,e),r:Sx,s:function(t,e){var n=Ox(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(wx=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")+Ox(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function _x(t){return t}var Ax,jx,Tx=Array.prototype.map,Cx=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Nx(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=a.width,u=a.height,f=(0,Mt.zs)([s+l,c+u],2),h=f[0],d=f[1];s<e&&(e=s),c<n&&(n=c),h>r&&(r=h),d>i&&(i=d)}return new ux(e,n,r-e,i-n)}Ax=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?_x:(e=Tx.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?_x:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Tx.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=Ex(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,y=t.precision,m=t.trim,v=t.type;"n"===v?(g=!0,v="g"):Px[v]||(void 0===y&&(y=12),m=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",x="$"===h?o:/[%p]/.test(v)?c:"",O=Px[v],w=/[defgprs%]/.test(v);function M(t){var i,o,c,h=b,M=x;if("c"===v)M=O(t)+M,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:O(Math.abs(t),y),m&&(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),h=(E?"("===f?f:l:"-"===f||"("===f?"":f)+h,M=("s"===v?Cx[8+wx/3]:"")+M+(E&&"("===f?")":""),w)for(i=-1,o=t.length;++i<o;)if(48>(c=t.charCodeAt(i))||c>57){M=(46===c?a+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var k=h.length+t.length+M.length,S=k<p?new Array(p-k+1).join(e):"";switch(g&&d&&(t=r(S+t,S.length?p-M.length:1/0),S=""),n){case"<":t=h+t+M+S;break;case"=":t=h+S+t+M;break;case"^":t=S.slice(0,k=S.length>>1)+h+t+M+S.slice(k);break;default:t=S+h+t+M}return s(t)}return y=void 0===y?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,e){var n,r=f(((t=Ex(t)).type="f",t)),i=3*Math.max(-8,Math.min(8,Math.floor((n=e,((n=Ox(Math.abs(n)))?n[1]:NaN)/3)))),o=Math.pow(10,-i),a=Cx[8+i/3];return function(t){return r(o*t)+a}}}}({thousands:",",grouping:[3],currency:["$",""]}),jx=Ax.format,Ax.formatPrefix;var Lx=function(t,e,n){var r=t.width,i=t.height,o=n.flexDirection,a=void 0===o?"row":o,s=(n.flexWrap,n.justifyContent),c=void 0===s?"flex-start":s,l=(n.alignContent,n.alignItems),u=void 0===l?"flex-start":l,f="row"===a,h="row"===a||"column"===a,d=f?h?[1,0]:[-1,0]:h?[0,1]:[0,-1],p=(0,Mt.zs)([0,0],2),g=p[0],y=p[1],m=e.map((function(t){var e,n=t.width,r=t.height,i=(0,Mt.zs)([g,y],2),o=i[0],a=i[1];return e=(0,Mt.zs)([g+n*d[0],y+r*d[1]],2),g=e[0],y=e[1],new ux(o,a,n,r)})),v=Nx(m),b={"flex-start":0,"flex-end":f?r-v.width:i-v.height,center:f?(r-v.width)/2:(i-v.height)/2},x=m.map((function(t){var e=t.x,n=t.y,r=ux.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r})),O=(Nx(x),function(t){var e=(0,Mt.zs)(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}}),w=x.map((function(t){var e=t.x,n=t.y,r=ux.fromRect(t);return r.x=f?e:e+O(r),r.y=f?n+O(r):n,r})).map((function(e){var n,r,i=ux.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 w},Rx=function(t,e,n){return[]},Ix=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[qs.BOUNDS_CHANGED,qs.INSERTED,qs.REMOVED],n.$margin=$b(0),n.$padding=$b(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(0,Mt.C6)(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=$b(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=$b(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=(0,Mt.zs)(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new ux(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=(0,Mt.zs)(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],c=(0,Mt.zs)(this.$margin,4),l=c[0],u=c[3];return new ux(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:Lx,grid:Rx},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}(_c);function zx(t,e,n){return t.querySelector(e)?Cu(t).select(e):Cu(t).append(n)}function Dx(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function Bx(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)}class Fx extends Ix{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 Wx extends Fx{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function $x(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function Gx(t){return"vertical"===t||t===-Math.PI/2}function Hx(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,h=o||u||c,d=a||f||l,p=s?"horizontal":"vertical",[g,y]=s?[d,h]:[h,d];return{orientation:p,width:g,height:y,size:h,length:d}}function Vx(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=function(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}(t,["style"]),i={};return Object.entries(r).forEach((([t,n])=>{e.includes(t)?i[`show${xx(t)}`]=n:i[t]=n})),Object.assign(Object.assign({},i),n)}var qx=function(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 Xx(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function Yx(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function Ux(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]=Cf(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),h=r||(null===(c=t.getFormatter)||void 0===c?void 0:c.call(t))||f,d=function(t,e){if(gt(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],h=new Tf({domain:[0,1],range:[l/f,1-u/f]});return t=>h.map(t)}(a,s),p=function(t,e){const{width:n,height:r}=e.getOptions();return i=>{if(!bt(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new Tf({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new Tf({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return gt(s)||pt(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=d(t.map(e)+c);return{value:yt(s)&&"center"===a||pt(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||pt(s)&&g(a)?1-l:l,label:f(h(Gu(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(d(t.map(e)+o));return{value:g(a)?1-s:s,label:f(h(Gu(e),n,r)),id:String(n)}}))}function Kx(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 Zx(t,e,n){return!function(t){return gt(t)&&pt(t)}(e)&&!vt(e)&&(void 0===t?!!n.getTicks:t)}const Jx=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?jx(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)}},Qx=Jx((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:h,tickMethod:d,transform:p,indexBBox:g}=t,y=qx(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:i,value:m,coordinate:v,theme:b})=>{const{bbox:x}=m,[O]=i,{domain:w,xScale:M}=O.getOptions(),E=function(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${xu(i)}`]:n.axisLinear,c=t.getOptions().name,l=n[`axis${xx(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:Gx(o)?10:0,tick:"center"!==r&&void 0}):a}(O,0,b,e,s,o),k=Object.assign(Object.assign(Object.assign({},E),l),y),S=function(t,e,n="xy"){const[r,i,o]=Yx(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),P=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]=Ot(r),[f,h]=wt(r),d=Math.min(s,c)/2,{insetLeft:p,insetTop:g}=r.getOptions(),y=l*d,m=u*d,[v,b]=[t+o-p,n+a-g],[x,O]=[Math.cos(e),Math.sin(e)],w=[v+m*x,b+m*O],M=[v+y*x,b+y*O],E=()=>{const{domain:t}=i.getOptions();return t.length},k=gt(r)&&i?E():3;return{startPos:w,endPos:M,gridClosed:Math.abs(h-f-360)<1e-6,gridCenter:[v,b],gridControlAngles:new Array(k).fill(0).map(((t,e,n)=>(h-f)/k*e))}}}return{}}(s,o,x,v,M),_=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(v),A=Ux(O,w,f,r,h,d,s,v),j=g?A.map(((t,e)=>{const n=g.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):A,T=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},k),{type:"linear",data:j,crossSize:c,titleText:Dx(u),labelOverlap:Kx(p,k),grid:Zx(k.grid,v,O),gridLength:S,line:!0,indexBBox:g}),k.line?null:{lineOpacity:0}),P),_),n),C=T.labelOverlap.find((t=>"hide"===t.type));return C&&(T.crossSize=!1),new mx({className:"axis",style:Vx(T)})}})),tO=Jx((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:h,grid:d=!1}=t,p=qx(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(),y=Ux(t,g,s,o,a,c,r,n),m=f?y.map(((t,e)=>{const n=f.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):y,[v,b]=Ot(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,h]=wt(i),[d,p]=Yx(i),g={center:l,radius:u,startAngle:f,endAngle:h,gridLength:(r-n)*(Math.min(d,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:O,axisArc:w={}}=i,M=Vx(A({},O,w,x,Object.assign(Object.assign({type:"arc",data:m,titleText:Dx(h),grid:d},p),l)));return new mx({style:bx(M,["transform"])})}}));Qx.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},tO.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const eO=t=>(...e)=>{const n=Qx(Object.assign({},{crossPadding:50},t))(...e);return Xx(n,t),n};eO.props=Object.assign(Object.assign({},Qx.props),{defaultPosition:"bottom"});const nO=t=>(...e)=>{const n=Qx(Object.assign({},{crossPadding:10},t))(...e);return Xx(n,t),n};nO.props=Object.assign(Object.assign({},Qx.props),{defaultPosition:"left"});const rO=function(){},iO=function(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)}};var oO=zv({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"),aO=function(t){function e(e){var n,r,i,o=t.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:(n=0,r=0,i=6,[["M",n-i,r-i],["L",n+i,r],["L",n-i,r+i],["Z"]]),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 o.playState="idle",o.contentGroup=o.appendChild(new _c({class:oO.contentGroup.name})),o.playWindow=o.contentGroup.appendChild(new _c({class:oO.playWindow.name})),o.innerCurrPage=o.defaultPage,o}return(0,Mt.C6)(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return rn(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=this.pageViews,e=(0,Mt.zs)(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]}))})))||[]}(t.map((function(t){var e=t.getBBox();return[e.width,e.height]}))).map((function(t){return Math.max.apply(Math,(0,Mt.fX)([],(0,Mt.zs)(t),!1))})),2),n=e[0],r=e[1],i=this.attributes,o=i.pageWidth,a=void 0===o?n:o,s=i.pageHeight;return{pageWidth:a,pageHeight:void 0===s?r:s}},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 ux(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=(0,Mt.zs)(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=Rv(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return Nv(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:rn(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:rn(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(oO.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)?Pp(e):_p(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(),c=s.width,l=(s.height,(0,Mt.zs)("horizontal"===o?[-180,0]:[-90,90],2)),u=l[0],f=l[1];e.setLocalEulerAngles(u),n.setLocalEulerAngles(f);var h=e.getBBox(),d=h.width,p=h.height,g=n.getBBox(),y=g.width,m=g.height,v=Math.max(d,c,y),b="horizontal"===o?{offset:[[0,0],[d/2+a,0],[d+c+2*a,0]],textAlign:"start"}:{offset:[[v/2,-p-a],[v/2,0],[v/2,m+a]],textAlign:"center"},x=(0,Mt.zs)(b.offset,3),O=(0,Mt.zs)(x[0],2),w=O[0],M=O[1],E=(0,Mt.zs)(x[1],2),k=E[0],S=E[1],P=(0,Mt.zs)(x[2],2),_=P[0],A=P[1],j=b.textAlign,T=r.querySelector("text");T&&(T.style.textAlign=j),e.setLocalPosition(w,M),r.setLocalPosition(k,S),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(oO.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=(0,Mt.zs)(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(oO.controller,"g");if(Ap(s.node(),a),a){var c=Jv(this.attributes,"button"),l=Jv(this.attributes,"pageNum"),u=(0,Mt.zs)(tb(c),2),f=u[0],h=u[1],d=f.size,p=(0,Mt.Tt)(f,["size"]),g=!s.select(oO.prevBtnGroup.class).node(),y=s.maybeAppendByClassName(oO.prevBtnGroup,"g").styles(h);this.prevBtnGroup=y.node();var m=y.maybeAppendByClassName(oO.prevBtn,"path"),v=s.maybeAppendByClassName(oO.nextBtnGroup,"g").styles(h);this.nextBtnGroup=v.node(),[m,v.maybeAppendByClassName(oO.nextBtn,"path")].forEach((function(t){t.styles((0,Mt.Cl)((0,Mt.Cl)({},p),{transformOrigin:"center"})),yb(t.node(),d,!0)}));var b=s.maybeAppendByClassName(oO.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(oO.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=Bp(e);this.renderClipPath(a),this.renderController(a),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=iO((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener(qs.INSERTED,e),this.playWindow.addEventListener(qs.REMOVED,e)},e}(Rp);function sO(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}Vp.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"]]})),Vp.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]]})),Vp.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 cO=zv({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"),lO=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new kc({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return(0,Mt.C6)(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=(0,Mt.zs)($b(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=(0,Mt.zs)(this.spacing,2),f=u[0],h=u[1];if(r){var d=r-n-f-h,p=(0,Mt.zs)(this.span,2),g=p[0],y=p[1];c=(t=(0,Mt.zs)([g*d,y*d],2))[0],l=t[1]}return{width:o+c+l+f+h,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=(0,Mt.zs)($b(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=(0,Mt.zs)(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(cO.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,h=u.height;return(1-l/Math.max(f,h))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,r=Jv(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(cO.markerGroup,"g").style("zIndex",0),Ip(!!n,this.markerGroup,(function(){var t=e.markerGroup.node(),i=t.getElementsByClassName(cO.marker.name)[0],o=n();i?o.nodeName===i.nodeName?(function(t,e){var n,r,i=e.attributes;try{for(var o=(0,Mt.Ju)(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=(0,Mt.zs)(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),Bp(i).styles(r)):(i.remove(),Bp(o).attr("className",cO.marker.name).styles(r),t.appendChild(o)):(Bp(o).attr("className",cO.marker.name).styles(r),t.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var a=yb(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(a,")")}))},e.prototype.renderLabel=function(t){var e=Jv(this.attributes,"label"),n=e.text,r=(0,Mt.Tt)(e,["text"]);this.labelGroup=t.maybeAppendByClassName(cO.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(cO.label,(function(){return gb(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=Jv(this.attributes,"value"),r=n.text,i=(0,Mt.Tt)(n,["text"]);this.valueGroup=t.maybeAppendByClassName(cO.valueGroup,"g").style("zIndex",0),Ip(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(cO.value,(function(){return gb(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=Jv(this.attributes,"background");this.background=t.maybeAppendByClassName(cO.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(cO.background,"rect").styles((0,Mt.Cl)({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=(0,Mt.zs)(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,")")}),Bb(this.labelGroup.select(cO.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(c,")")}),Bb(this.valueGroup.select(cO.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=Bp(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}(Rp),uO=zv({page:"item-page",navigator:"navigator",item:"item"},"items"),fO=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},hO=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:rO,mouseenter:rO,mouseleave:rO})||this;return n.navigatorShape=[0,0],n}return(0,Mt.C6)(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,r=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,r.length]:[r.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,r=Jv(this.attributes,"item"),i=e.map((function(t,i){var o=t.id,a=void 0===o?i:o,s=t.label,c=t.value;return{id:"".concat(a),index:i,style:(0,Mt.Cl)({layout:n,labelText:s,valueText:c},Object.fromEntries(Object.entries(r).map((function(n){var r=(0,Mt.zs)(n,2);return[r[0],eb(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=(0,Mt.zs)(this.navigatorShape,1)[0],s=(0,Mt.zs)(this.grid,2),c=s[0],l=s[1],u=l*c,f=0;return this.pageViews.children.map((function(e,s){var h,d,p=Math.floor(s/u),g=s%u,y=t.ifHorizontal(l,c),m=[Math.floor(g/y),g%y];"vertical"===n&&m.reverse();var v=(0,Mt.zs)(m,2),b=v[0],x=v[1],O=(r-a-(l-1)*o)/l,w=e.getBBox().height,M=(0,Mt.zs)([0,0],2),E=M[0],k=M[1];return"horizontal"===n?(E=(h=(0,Mt.zs)([f,b*(w+i)],2))[0],k=h[1],f=x===l-1?0:f+O+o):(E=(d=(0,Mt.zs)([x*(O+o),f],2))[0],k=d[1],f=b===c-1?0:f+w+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:O,height:w,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=(0,Mt.zs)(this.navigatorShape,1)[0],a=(0,Mt.zs)(this.grid,2),s=a[0],c=a[1],l=(0,Mt.zs)([e-o,n],2),u=l[0],f=l[1],h=(0,Mt.zs)([0,0,0,0,0,0,0,0],8),d=h[0],p=h[1],g=h[2],y=h[3],m=h[4],v=h[5],b=h[6],x=h[7];return this.pageViews.children.map((function(t,e){var n,o,a,l,h=t.getBBox(),O=h.width,w=h.height,M=0===b?0:i,E=b+M+O;return E<=u&&fO(m,(function(t){return t<c}))?(n=(0,Mt.zs)([b+M,x,E],3),d=n[0],p=n[1],b=n[2],{width:O,height:w,x:d,y:p,page:g,index:e,pageIndex:y++,row:v,col:m++}):(o=(0,Mt.zs)([v+1,0,0,x+w+r],4),v=o[0],m=o[1],b=o[2],(x=o[3])+w<=f&&fO(v,(function(t){return t<s}))?(a=(0,Mt.zs)([b,x,O],3),d=a[0],p=a[1],b=a[2],{width:O,height:w,x:d,y:p,page:g,index:e,pageIndex:y++,row:v,col:m++}):(l=(0,Mt.zs)([0,0,O,0,g+1,0,0,0],8),d=l[0],p=l[1],b=l[2],x=l[3],g=l[4],y=l[5],v=l[6],m=l[7],{width:O,height:w,x:d,y:p,page:g,index:e,pageIndex:y++,row:v,col:m++}))}))},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 sO(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(uO.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(uO.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);Bp(t).selectAll(uO.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new lO({style:e})})).attr("className",uO.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=(0,Mt.zs)(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=(0,Mt.zs)(t,2);return{page:e[0],layouts:e[1]}})),i=(0,Mt.fX)([],(0,Mt.zs)(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new _c({className:uO.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=nn(e)?e.split("."):e;i.forEach((function(t,e){e<i.length-1?(Xn(r[t])||(r[t]=Qe(i[e+1])?[]:{}),r=r[t]):r[t]=n}))}(c,"__layout__",t),c.update({x:e,y:n,width:a,height:s})}))})),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=Jv(this.attributes,"nav"),r=Tp({orientation:e},n),i=this;return t.selectAll(uO.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new aO({style:r})})).attr("className",uO.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(Bp(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Ws(t,{detail:e});this.dispatchEvent(n)},e}(Rp),dO=zv({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),pO={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},gO=function(t){function e(e){return t.call(this,e,pO)||this}return(0,Mt.C6)(e,t),e.prototype.render=function(t,e){var n=Bp(e).maybeAppendByClassName(dO.markerGroup,"g");this.renderMarker(n);var r=Bp(e).maybeAppendByClassName(dO.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?sO(r,"horizontalHandle","verticalHandle"):i;Ip(!!o,t,(function(t){var n=Jv(e.attributes,"marker"),r=(0,Mt.Cl)({symbol:o},n);e.marker=t.maybeAppendByClassName(dO.marker,(function(){return new Vp({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;Ip(r,t,(function(t){var n,r=Jv(e.attributes,"label"),o=r.text,c=(0,Mt.Tt)(r,["text"]),l=(null===(n=t.select(dO.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,h=l.height,d=void 0===h?0:h,p=(0,Mt.zs)(sO(i,[0,d+a,"center","top"],[f+a,0,"start","middle"]),4),g=p[0],y=p[1],m=p[2],v=p[3];t.maybeAppendByClassName(dO.label,"text").styles((0,Mt.Cl)((0,Mt.Cl)({},c),{x:g,y,text:s(o).toString(),textAlign:m,textBaseline:v}))}))},e}(Rp),yO={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},mO=Tp({},yO,{}),vO=Tp({},yO,Qv(pO,"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"}),bO=zv({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"),xO=function(t){function e(e){return t.call(this,e,mO)||this}return(0,Mt.C6)(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=Jv(this.attributes,"title"),s=(0,Mt.zs)(tb(a),2),c=s[0],l=s[1];this.titleGroup=t.maybeAppendByClassName(bO.titleGroup,"g").styles(l);var u=(0,Mt.Cl)((0,Mt.Cl)({width:e,height:n},c),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(bO.title,(function(){return new px({style:u})})).update(u)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,o=e.height,a=Jv(this.attributes,"title",!0),s=(0,Mt.zs)(tb(a),2),c=s[0],l=s[1],u=(0,Mt.Cl)((0,Mt.Cl)({},c),{width:i,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(bO.itemsGroup,"g").styles((0,Mt.Cl)((0,Mt.Cl)({},l),{transform:"translate(".concat(n,", ").concat(r,")")}));var f=this;this.itemsGroup.selectAll(bO.items.class).data(["items"]).join((function(t){return t.append((function(){return new hO({style:u})})).attr("className",bO.items.name).each((function(){f.items=Bp(this)}))}),(function(t){return t.update(u)}),(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 ux(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=hx(r),u=(0,Mt.zs)($b(a?i:0),4),f=u[0],h=u[1],d=u[2],p=u[3],g=(0,Mt.zs)($b(o),4),y=g[0],m=g[1],v=g[2],b=g[3],x=(0,Mt.zs)([p+h,f+d],2),O=x[0],w=x[1],M=(0,Mt.zs)([b+m,y+v],2),E=M[0],k=M[1];if("l"===l[0])return new ux(s.x,s.y,c.width+s.width+O+E,Math.max(c.height+k,s.height));if("t"===l[0])return new ux(s.x,s.y,Math.max(c.width+E,s.width),c.height+s.height+w+k);var S=(0,Mt.zs)([e.attributes.width||c.width,e.attributes.height||c.height],2),P=S[0],_=S[1];return new ux(c.x,c.y,P+s.width+O+E,_+s.height+w+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=Bp(e);e.style.transform="translate(".concat(a,", ").concat(c,")"),this.renderTitle(l,r,i),this.renderItems(l,this.availableSpace),this.adjustLayout()},e}(Rp);const OO=function(t){return null!==t&&"function"!=typeof t&&isFinite(t.length)};function wO(t){if(OO(t))return t[t.length-1]}function MO(t,e){const{scales:n,library:r,markState:i}=e,[o,a]=function(t,e){const n=$x(t,"shape"),r=$x(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)||wO(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=wd(e,["d","fill","lineWidth","path","stroke","color"]);const l=Kd.get(t)||Kd.get("point");return(...t)=>new Cc({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 $x(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 EO(t){const e=$x(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}const kO=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,cols:c,itemMarker:l}=t,u=function(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}(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:h}=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}=Hx(t,e,n);return{width:i,height:o}}(r,t,kO),d=Bx(o,n),p=Object.assign(Object.assign(Object.assign(Object.assign({orientation:["right","left","center"].includes(o)?"vertical":"horizontal",width:l,height:h,layout:void 0!==c?"grid":"flex"},void 0!==c&&{gridCol:c}),void 0!==f&&{gridRow:f}),{titleText:Dx(s)}),function(t,e){const{labelFormatter:n=(t=>`${t}`)}=t,{scales:r,theme:i}=e,o=function(t,e){const n=$x(t,"size");return n instanceof om?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:MO(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:EO(r)},s="string"==typeof n?jx(n):n,c=$x(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)})))})}(t,e)),{legendCategory:g={}}=i,y=Vx(Object.assign({},g,p,u)),m=new Wx({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},d),{subOptions:y})});return m.appendChild(new xO({className:"legend-category",style:y})),m}};function SO(t,e){return+t.toPrecision(e)}function PO(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]}kO.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};var _O={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},AO=zv({background:"background",labelGroup:"label-group",label:"label"},"indicator"),jO=function(t){function e(e){var n=t.call(this,e,_O)||this;return n.point=[0,0],n.group=n.appendChild(new _c({})),n.isMutationObserved=!0,n}return(0,Mt.C6)(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=t.padding,r=(0,Mt.zs)($b(n),4),i=r[0],o=r[1],a=r[2],s=r[3],c=this.label.node().getLocalBounds(),l=c.min,u=c.max,f=new ux(l[0]-s,l[1]-i,u[0]+o-l[0]+s,u[1]+a-l[1]+i),h=this.getPath(e,f),d=Jv(this.attributes,"background");this.background=Bp(this.group).maybeAppendByClassName(AO.background,"path").styles((0,Mt.Cl)((0,Mt.Cl)({},d),{d:h})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=Jv(this.attributes,"label"),i=(0,Mt.zs)(tb(r),2),o=i[0],a=i[1],s=(o.text,(0,Mt.Tt)(o,["text"]));this.label=Bp(this.group).maybeAppendByClassName(AO.labelGroup,"g").styles(a),n&&this.label.maybeAppendByClassName(AO.label,(function(){return gb(e(n))})).style("text",e(n).toString()).selectAll("text").styles(s)},e.prototype.adjustLayout=function(){var t=(0,Mt.zs)(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,(0,Mt.fX)([c+1,1],(0,Mt.zs)(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=Zb.apply(void 0,(0,Mt.fX)([],(0,Mt.zs)(t),!1)),r=(0,Mt.zs)(t,2),i=(0,Mt.zs)(r[0],2),o=i[0],a=i[1],s=(0,Mt.zs)(r[1],2),c=s[0],l=s[1],u=(0,Mt.zs)(n?[c-o,[o,c]]:[l-a,[a,l]],2),f=u[0],h=(0,Mt.zs)(u[1],2),d=h[0],p=h[1],g=f/2,y=e*(f/Math.abs(f)),m=y/2,v=y*Math.sqrt(3)/2*.8,b=(0,Mt.zs)([d,d+g-m,d+g,d+g+m,p],5),x=b[0],O=b[1],w=b[2],M=b[3],E=b[4];return n?(this.point=[w,a-v],[["L",x,a],["L",O,a],["L",w,a-v],["L",M,a],["L",E,a]]):(this.point=[o+v,w],[["L",o,x],["L",o,O],["L",o+v,w],["L",o,M],["L",o,E]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?_p(this):Pp(this)},e.prototype.bindEvents=function(){this.label.on(qs.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(Rp),TO={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},CO={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},NO={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},LO=zv({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),RO=zv({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),IO=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,Mt.C6)(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=(0,Mt.Tt)(t,["x","y","size","radius","orientation"]),u=o,f=2.4*u,h=Bp(e).maybeAppendByClassName(RO.iconRect,"rect").styles((0,Mt.Cl)((0,Mt.Cl)({},l),{width:u,height:f,radius:s,x:n-u/2,y:r-f/2,transformOrigin:"center"})),d=n+1/3*u-u/2,p=n+2/3*u-u/2,g=r+1/4*f-f/2,y=r+3/4*f-f/2;h.maybeAppendByClassName("".concat(RO.iconLine,"-1"),"line").styles((0,Mt.Cl)({x1:d,x2:d,y1:g,y2:y},l)),h.maybeAppendByClassName("".concat(RO.iconLine,"-2"),"line").styles((0,Mt.Cl)({x1:p,x2:p,y1:g,y2:y},l)),"vertical"===c&&(h.node().style.transform="rotate(90)")},e}(Rp),zO=function(t){function e(e){return t.call(this,e,NO)||this}return(0,Mt.C6)(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,o=n.showLabel,a=Jv(this.attributes,"label"),s=a.x,c=void 0===s?0:s,l=a.y,u=void 0===l?0:l,f=a.transform,h=a.transformOrigin,d=(0,Mt.Tt)(a,["x","y","transform","transformOrigin"]),p=(0,Mt.zs)(tb(d,[]),2),g=p[0],y=p[1],m=Bp(t).maybeAppendByClassName(RO.labelGroup,"g").styles(y),v=(0,Mt.Cl)((0,Mt.Cl)({},CO),g),b=v.text,x=(0,Mt.Tt)(v,["text"]);Ip(!!o,m,(function(t){e.label=t.maybeAppendByClassName(RO.label,"text").styles((0,Mt.Cl)((0,Mt.Cl)({},x),{x:r+c,y:i+u,transform:f,transformOrigin:h,text:"".concat(b)})),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=(0,Mt.Cl)((0,Mt.Cl)({x:n,y:r,orientation:i},TO),Jv(this.attributes,"icon")),s=this.attributes.iconShape,c=void 0===s?function(){return new IO({style:a})}:s;Bp(t).maybeAppendByClassName(RO.iconGroup,"g").selectAll(RO.icon.class).data([c]).join((function(t){return t.append("string"==typeof c?c:function(){return c(o)}).attr("className",RO.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}(Rp);function DO(t,e){var n=(0,Mt.zs)(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 BO=zv({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function FO(t){var e=t.orientation,n=t.size,r=t.length;return sO(e,[r,n],[n,r])}function WO(t){var e=t.type,n=(0,Mt.zs)(FO(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 $O(t){return WO(t)}function GO(t){var e=t.orientation,n=t.range;if(!n)return[];var r=(0,Mt.zs)(FO(t),2),i=r[0],o=r[1],a=(0,Mt.zs)(n,2),s=a[0],c=a[1],l=sO(e,s*i,0),u=sO(e,0,s*o),f=sO(e,c*i,i),h=sO(e,o,c*o);return[["M",l,u],["L",l,h],["L",f,h],["L",f,u],["Z"]]}var HO=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(0,Mt.C6)(e,t),e.prototype.render=function(t,e){!function(t,e){var n=Jv(e,"track");t.maybeAppendByClassName(BO.track,"path").styles((0,Mt.Cl)({d:WO(e)},n))}(Bp(e).maybeAppendByClassName(BO.trackGroup,"g"),t),function(t,e){var n=Jv(e,"selection"),r=function(t){var e,n=t.orientation,r=t.color,i=t.block,o=t.partition,a=(e=kp(r)?new Array(20).fill(0).map((function(t,e,n){return r(e/(n.length-1))})):r).length,s=e.map((function(t){return bo(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(sO(n,"0","270"),")")):""}(e),i=t.maybeAppendByClassName(BO.selection,"path").styles((0,Mt.Cl)({d:$O(e),fill:r},n)),o=i.maybeAppendByClassName(BO.clipPath,"path").styles({d:GO(e)}).node();i.style("clipPath",o)}(Bp(e).maybeAppendByClassName(BO.selectionGroup,"g"),t)},e}(Rp),VO=function(t){function e(e){var n=t.call(this,e,vO)||this;return n.eventToOffsetScale=new Tf({}),n.innerRibbonScale=new Tf({}),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=DO(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=(0,Mt.zs)(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(0,Mt.C6)(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 ux(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(Bp(e));var i=this.availableSpace,o=i.x,a=i.y,s=Bp(e).maybeAppendByClassName(bO.contentGroup,"g").styles({transform:"translate(".concat(o,", ").concat(a,")")});Ip(!!r,s.maybeAppendByClassName(bO.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(bO.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(bO.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,(0,Mt.fX)([],(0,Mt.zs)(t.map((function(t){return t.value}))),!1)),max:Math.max.apply(Math,(0,Mt.fX)([],(0,Mt.zs)(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=(0,Mt.zs)(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=void 0===r?[e,n]:r,o=(0,Mt.zs)(i,2);return[o[0],o[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return sO(this.attributes.orientation,"function"==typeof t?t():t,"function"==typeof e?e():e)},e.prototype.renderTitle=function(t){var e=this.attributes,n=e.showTitle,r=e.titleText,i=e.width,o=e.height,a=Jv(this.attributes,"title"),s=(0,Mt.Cl)((0,Mt.Cl)({},a),{width:i,height:o,text:r}),c=this;t.selectAll(bO.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new px({style:s})})).attr("className",bO.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 ux(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 ux(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(Bv.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new ux(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,e=this.attributes,n=e.showHandle,r=e.ribbonSize,i=this.availableSpace,o=i.width,a=i.height,s=this.labelShape,c=s.size,l=s.length,u=(0,Mt.zs)(this.ifHorizontal([a,o],[o,a]),2),f=u[0],h=u[1],d=n?this.handleShape:{size:0,length:0},p=d.size,g=d.length,y=this.handleOffsetRatio,m=this.labelPosition;t=r||(["bottom","right"].includes(m)?Math.min(f-c,(f-p)/y):f*(1-y)>p?Math.max(f-c,0):Math.max((f-c-p)/y,0));var v=Math.max(g,l),b=h-v,x=(0,Mt.zs)(this.ifHorizontal([b,t],[t,b]),2),O=x[0],w=x[1],M=["top","left"].includes(m)?c:0,E=(0,Mt.zs)(this.ifHorizontal([v/2,M],[M,v/2]),2),k=E[0],S=E[1];return new ux(k,S,O,w)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonShape",{get:function(){var t=this.ribbonBBox,e=t.width,n=t.height;return this.ifHorizontal({size:n,length:e},{size:e,length:n})},enumerable:!1,configurable:!0}),e.prototype.renderRibbon=function(t){var e=this.attributes,n=e.data,r=e.type,i=e.orientation,o=e.color,a=e.block,s=Jv(this.attributes,"ribbon"),c=this.range,l=c.min,u=c.max,f=this.ribbonBBox,h=f.x,d=f.y,p=this.ribbonShape,g=p.length,y=p.size,m=Tp({transform:"translate(".concat(h,", ").concat(d,")"),length:g,size:y,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(bO.ribbon,(function(){return new HO({style:m})})).update(m)},e.prototype.getHandleClassName=function(t){return"".concat(bO.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=Jv(this.attributes,"handle"),i=(0,Mt.zs)(this.selection,2),o=i[0],a=i[1],s=(0,Mt.Cl)((0,Mt.Cl)({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?gO:zO,u=this;this.handlesGroup.selectAll(bO.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(bO.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=(0,Mt.zs)(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 ux(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=(0,Mt.zs)([Math.max(e,i),Math.max(n,o)],2),s=a[0],c=a[1];return this.cacheHandleBBox=new ux(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=(0,Mt.zs)(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=(0,Mt.zs)(this.ifHorizontal([i+s,o+a*this.handleOffsetRatio],[i+a*this.handleOffsetRatio,o+s]),2),l=c[0],u=c[1],f=this.handlesGroup.select(".".concat(this.getHandleClassName(t))).node();null==f||f.update({transform:"translate(".concat(l,", ").concat(u,")"),formatter:n})},e.prototype.renderIndicator=function(t){var e=Jv(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(bO.indicator,(function(){return new jO({})})).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((0,Mt.Cl)((0,Mt.Cl)({},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=(0,Mt.zs)([n.value,c.value],2),u=l[0],f=l[1],h=(u+f)/2;e.push((0,Mt.Cl)((0,Mt.Cl)({},n),{id:s,index:r,type:"range",range:[u,f],label:[u,f].join("~"),value:t.ribbonScale.map(h)}))}return e}),[])},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelStyle",{get:function(){var t=(0,Mt.zs)(["center","middle"],2),e=t[0],n=t[1],r=this.labelPosition;return"top"===r?n="bottom":"bottom"===r?n="top":"left"===r?e="end":"right"===r&&(e="start"),{labelTextAlign:e,labelTextBaseline:n}},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(t){var e=this.attributes,n=e.showTick,r=void 0!==n&&n,i=e.labelFilter,o=e.labelFormatter,a=Jv(this.attributes,"tick"),s=Jv(this.attributes,"label"),c=s.align,l=Tp((0,Mt.Cl)({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Qv(a,"tick"),Qv(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=(0,Mt.Cl)((0,Mt.Cl)((0,Mt.Cl)({},l),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(bO.label,(function(){return new mx({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=(0,Mt.zs)([0,0,0],3),l=c[0],u=(c[1],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=(0,Mt.zs)(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=rn(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}),Pp(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){_p(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=(0,Mt.zs)(this.selection,2),o=i[0],a=i[1],s=(0,Mt.zs)([t,e],2),c=s[0],l=s[1];n&&(c+=o,l+=a);var u=this.range,f=u.min,h=u.max;r=(0,Mt.zs)(function(t,e,n,r){var i;void 0===r&&(r=4);var o=(0,Mt.zs)(t,2),a=o[0],s=o[1],c=(0,Mt.zs)(e,2),l=c[0],u=c[1],f=(0,Mt.zs)(n,2),h=f[0],d=f[1],p=(0,Mt.zs)([l,u],2),g=p[0],y=p[1],m=y-g;return g>y&&(g=(i=(0,Mt.zs)([y,g],2))[0],y=i[1]),m>s-a?[a,s]:g<a?h===a&&d===y?[a,y]:[a,m+a]:y>s?d===s&&h===g?[g,s]:[s-m,s]:[g,y]}([f,h],[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 Vn(e)?SO(.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?DO(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){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,o=(0,Mt.zs)(this.ribbon.node().getPosition(),2),a=o[0],s=o[1],c=this.ifHorizontal(a,s),l=this.ifHorizontal.apply(this,(0,Mt.fX)([],(0,Mt.zs)(PO(t)),!1))-c;return rn(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 Ws("valuechange",{detail:{value:this.selection}});this.dispatchEvent(t)},e.prototype.dispatchIndicated=function(t,e){var n=new Ws("indicate",{detail:{value:t,range:e}});this.dispatchEvent(n)},e}(Rp);function qO(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],If(e)];return[n,r]}function XO(t,e,n,r,i,o){const a=$x(t,"color"),s=function(t,e,n){const{size:r}=e,i=Hx(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 fv){const{range:t}=a.getOptions(),[e,n]=qO(a);return a instanceof yv||a instanceof pv?function(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)})}(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 function(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:[bo(e).toString()]})),r}(s,c),[u,f]=qO(l),[h,d]=qO([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof Ov))));return Object.assign(Object.assign({},t),{domain:[h,d],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})`))}))})}(s,a,$x(t,"size"),$x(t,"opacity"),e,o)}const YO=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,style:c,crossPadding:l,padding:u}=t,f=function(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}(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:h,y:d,width:p,height:g}=u,y=Bx(o,n),{legendContinuous:m={}}=a,v=Vx(Object.assign({},m,Object.assign(Object.assign({titleText:Dx(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>jx(e)(t.label):e},XO(r,l,i,t,YO,a)),c),f)),b=new Fx({style:Object.assign(Object.assign({x:h,y:d,width:p,height:g},y),{subOptions:v})});return b.appendChild(new VO({className:"legend-continuous",style:v})),b}};YO.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const UO=t=>()=>new _c;UO.props={};function KO(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"}}}const ZO=(JO={render(t,e){const{width:n,title:r,subtitle:i,spacing:o=2,align:a="left",x:s,y:c}=t,l=function(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}(t,["width","title","subtitle","spacing","align","x","y"]);e.style.transform=`translate(${s}, ${c})`;const u=ku(l,"title"),f=ku(l,"subtitle"),h=zx(e,".title","text").attr("className","title").call(Bf,Object.assign(Object.assign(Object.assign({},KO(0,0,n,a)),{fontSize:14,textBaseline:"top",text:r}),u)).node().getLocalBounds();zx(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({},KO(0,h.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),f))}))}},class extends Sc{constructor(t){super(t),this.descriptor=JO}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(A({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var JO;const QO=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new ZO({style:A({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};QO.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};var tw=function(t){if("object"!=typeof t||null===t)return t;var e;if(E(t)){e=[];for(var n=0,r=t.length;n<r;n++)"object"==typeof t[n]&&null!=t[n]?e[n]=tw(t[n]):e[n]=t[n]}else for(var i in e={},t)"object"==typeof t[i]&&null!=t[i]?e[i]=tw(t[i]):e[i]=t[i];return e};const ew=tw;var nw=function(t){function e(e){var n=this,r=e.style,i=(0,Mt.Tt)(e,["style"]);return(n=t.call(this,A({},{type:"column"},(0,Mt.Cl)({style:r},i)))||this).columnsGroup=new _c({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return(0,Mt.C6)(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,")"),Bp(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(Tp({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Ec),rw=function(t){function e(e){var n=this,r=e.style,i=(0,Mt.Tt)(e,["style"]);return(n=t.call(this,A({},{type:"lines"},(0,Mt.Cl)({style:r},i)))||this).linesGroup=n.appendChild(new _c),n.areasGroup=n.appendChild(new _c),n.render(),n}return(0,Mt.C6)(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(Tp({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){Bp(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){Bp(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}(Ec),iw=function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(nn(t)||nn(e))return!1;if(OO(t)||OO(e)){if(t.length!==e.length)return!1;for(var n=!0,r=0;r<t.length&&(n=iw(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=iw(t[i[r]],e[i[r]]));r++);return n}return!1};const ow=iw;function aw(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return(0,Mt.fX)([e===n?"M":"L"],(0,Mt.zs)(t),!1)}));return e?r.reverse():r}function sw(t,e){if(void 0===e&&(e=!1),t.length<=2)return aw(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];ow(o,n.slice(-2))||n.push.apply(n,(0,Mt.fX)([],(0,Mt.zs)(o),!1))}var a=function(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,h=[1/0,1/0],d=[-1/0,-1/0];if(f){h=(i=(0,Mt.zs)(r,2))[0],d=i[1];for(var p=0,g=t.length;p<g;p+=1)h=Gv(h,m=t[p]),d=Hv(d,m)}p=0;for(var y=t.length;p<y;p+=1){var m=t[p];if(0!==p||n)if(p!==y-1||n){o=t[[p?p-1:y-1,p-1][n?0:1]];var v=[0,0];v=Fv(v=$v(a=t[n?(p+1)%y:p+1],o),.4);var b=Vv(m,o),x=Vv(m,a),O=b+x;0!==O&&(b/=O,x/=O);var w=Fv(v,-b),M=Fv(v,x);c=Wv(m,w),s=Gv(s=Wv(m,M),Hv(a,m)),s=Hv(s,Gv(a,m)),c=Gv(c=Wv(m,w=Fv(w=$v(s,m),-b/x)),Hv(o,m)),s=Wv(m,M=Fv(M=$v(m,c=Hv(c,Gv(o,m))),x/b)),f&&(c=Gv(c=Hv(c,h),d),s=Gv(s=Hv(s,h),d)),u.push(l),u.push(c),l=s}else c=m,u.push(l),u.push(c);else l=m}return n&&u.push(u.shift()),u}(i,0,r,n),f=i.length,h=[];for(o=0;o<f-1;o+=1)s=u[2*o],c=u[2*o+1],l=i[o+1],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]]);return r&&(s=u[f],c=u[f+1],l=(0,Mt.zs)(i,1)[0],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),h}(n,!1);return e?a.unshift((0,Mt.fX)(["M"],(0,Mt.zs)(t[r-1]),!1)):a.unshift((0,Mt.fX)(["M"],(0,Mt.zs)(t[0]),!1)),a}function cw(t,e,n){var r=ew(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}const lw=function(t,e){if(E(t)){for(var n,r=1/0,i=0;i<t.length;i++){var o=t[i],a=kp(e)?e(o):o[e];a<r&&(n=o,r=a)}return n}},uw=function(t,e){if(E(t)){for(var n,r=-1/0,i=0;i<t.length;i++){var o=t[i],a=kp(e)?e(o):o[e];a>r&&(n=o,r=a)}return n}};function fw(t){return 0===t.length?[0,0]:[jn(lw(t,(function(t){return jn(t)||0}))),Tn(uw(t,(function(t){return Tn(t)||0})))]}function hw(t){for(var e=ew(t),n=e[0].length,r=(0,Mt.zs)([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 dw=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(0,Mt.C6)(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=ew(t);return Qe(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?hw(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=(0,Mt.zs)(t.getOptions().domain||[0,0],2),n=e[0],r=e[1];return r<0?t.map(r):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,r=e.isStack,i=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var o=Jv(this.attributes,"area"),a=Jv(this.attributes,"line"),s=this.containerShape.width,c=this.data;if(0===c[0].length)return{lines:[],areas:[]};var l=this.scales,u=function(t,e){var n,r=e.x,i=e.y,o=(0,Mt.zs)(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=(0,Mt.zs)([a,s],2),s=n[0],a=n[1]),t.map((function(t){return t.map((function(t,e){return[r.map(e),rn(i.map(t),s,a)]}))}))}(c,{type:"line",x:l.x,y:l.y}),f=[];if(o){var h=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=sw(o),s=void 0;if(0===i)s=cw(a,e,n);else{var c=sw(t[i-1],!0),l=o[0];c[0][0]="L",s=(0,Mt.fX)((0,Mt.fX)((0,Mt.fX)([],(0,Mt.zs)(a),!1),(0,Mt.zs)(c),!1),[(0,Mt.fX)(["M"],(0,Mt.zs)(l),!1),["Z"]],!1)}r.push(s)}return r}(u,s,h):function(t,e,n){for(var r=[],i=t.length-1;i>=0;i-=1){var o=aw(t[i]),a=void 0;if(0===i)a=cw(o,e,n);else{var s=aw(t[i-1],!0);s[0][0]="L",a=(0,Mt.fX)((0,Mt.fX)((0,Mt.fX)([],(0,Mt.zs)(o),!1),(0,Mt.zs)(s),!1),[["Z"]],!1)}r.push(a)}return r}(u,s,h):function(t,e,n,r){return t.map((function(t){return cw(e?sw(t):aw(t),n,r)}))}(u,i,s,h)}return{lines:u.map((function(e,n){return(0,Mt.Cl)({stroke:t.getColor(n),d:i?sw(e):aw(e)},a)})),areas:f.map((function(e,n){return(0,Mt.Cl)({d:e,fill:t.getColor(n)},o)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=Jv(this.attributes,"column"),n=this.attributes,r=n.isStack,i=n.type,o=n.scale;if("column"!==i)throw new Error("columnsStyle can only be used in column type");var a=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};r&&(s=hw(s));var c=this.createScales(s),l=c.x,u=c.y,f=(0,Mt.zs)(fw(s),2),h=f[0],d=f[1],p=new Tf({domain:[0,d-(h>0?0:h)],range:[0,a*o]}),g=l.getBandWidth(),y=this.rawData;return{columns:s.map((function(n,i){return n.map((function(n,o){var a=g/s.length;return(0,Mt.Cl)((0,Mt.Cl)({fill:t.getColor(i)},e),r?{x:l.map(o),y:u.map(n),width:g,height:p.map(y[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;(n=e,r=".container","rect",n.querySelector(r)?Bp(n).select(r):Bp(n).append("rect")).attr("className","container").node();var i=t.type,o=t.x,a=t.y,s="spark".concat(i),c=(0,Mt.Cl)({x:o,y:a},"line"===i?this.linesStyle:this.columnsStyle);Bp(e).selectAll(".spark").data([i]).join((function(t){return t.append((function(t){return"line"===t?new rw({className:s,style:c}):new nw({className:s,style:c})})).attr("className","spark ".concat(s))}),(function(t){return t.update(c)}),(function(t){return t.remove()}))},e.prototype.getColor=function(t){var e=this.attributes.color;return E(e)?e[t%e.length]:kp(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,h=(0,Mt.zs)(fw(t),2),d=h[0],p=h[1],g=new Tf({domain:[null!==(e=s[0])&&void 0!==e?e:d,null!==(n=s[1])&&void 0!==n?n:p],range:[f,f*(1-o)]});return"line"===i?{type:i,x:new Tf({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new Xy({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}(Rp),pw=function(t){function e(e){var n=t.call(this,e,(0,Mt.Cl)((0,Mt.Cl)((0,Mt.Cl)({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},Qv(NO,"handle")),Qv(TO,"handleIcon")),Qv(CO,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(PO(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(PO(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 Ws("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(0,Mt.C6)(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=Jv(this.attributes,"sparkline");return(0,Mt.Cl)((0,Mt.Cl)({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=(0,Mt.zs)(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=this.attributes,e=(t.x,t.y,t.padding),n=(0,Mt.zs)($b(e),4),r=n[0],i=n[1],o=n[2],a=n[3],s=this.shape;return{x:a,y:r,width:s.width-(a+i),height:s.height-(r+o)}},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(LO.selection.class).each((function(n,r){Iv(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&Iv(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&Iv(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,r=this.clampValues(t);this.attributes.values=r,this.setValues(r),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=this.attributes,n=e.x,r=e.y,i=Jv(this.attributes,"track");this.trackShape=Bp(t).maybeAppendByClassName(LO.track,"rect").styles((0,Mt.Cl)((0,Mt.Cl)({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=Bp(t).maybeAppendByClassName(LO.brushArea,"rect").styles((0,Mt.Cl)({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;Ip("horizontal"===n.orientation,Bp(t).maybeAppendByClassName(LO.sparklineGroup,"g"),(function(t){var n=(0,Mt.Cl)((0,Mt.Cl)({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName(LO.sparkline,(function(){return new dw({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(LO.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 zO({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(LO.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=Bp(t).maybeAppendByClassName(LO.foreground,"g");var a=Jv(this.attributes,"selection"),s=function(t){return t.style("visibility",(function(t){return t.show?"visible":"hidden"})).style("cursor",(function(t){return"select"===o?"grab":"invert"===o?"crosshair":"default"})).styles((0,Mt.Cl)((0,Mt.Cl)({},a),{transform:"translate(".concat(n,", ").concat(r,")")}))},c=this;this.foregroundGroup.selectAll(LO.selection.class).data("value"===i?[]:this.calcSelectionArea().map((function(t,e){return{style:(0,Mt.Cl)({},t),index:e,show:"select"===o?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",LO.selection.name).call(s).each((function(t,e){var n=this;1===e?(c.selectionShape=Bp(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=(0,Mt.zs)(this.range,2),i=r[0],o=r[1],a=(0,Mt.zs)(this.getValues().map((function(t){return SO(t,e)})),2),s=a[0],c=a[1],l=Array.isArray(t)?t:[s,null!=t?t:c],u=(0,Mt.zs)((l||[s,c]).map((function(t){return SO(t,e)})),2),f=u[0],h=u[1];if("value"===this.attributes.type)return[0,rn(h,i,o)];f>h&&(f=(n=(0,Mt.zs)([h,f],2))[0],h=n[1]);var d=h-f;return d>o-i?[i,o]:f<i?s===i&&c===h?[i,h]:[i,d+i]:h>o?c===o&&s===f?[f,o]:[o-d,o]:[f,h]},e.prototype.calcSelectionArea=function(t){var e=(0,Mt.zs)(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=(0,Mt.zs)(this.clampValues(),2),c=s[0],l=s[1],u="start"===t?-e:e,f=("start"===t?c:l)*this.getOrientVal([o,a])+u;return{x:r+this.getOrientVal([f,o/2]),y:i+this.getOrientVal([a/2,f])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:"end"===t?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,r=n.type,i=n.orientation,o=n.formatter,a=n.autoFitLabel,s=Jv(this.attributes,"handle"),c=Jv(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),h=o("start"===t?f[0]:f[1]),d=new zp({style:(0,Mt.Cl)((0,Mt.Cl)((0,Mt.Cl)({},c),this.inferTextStyle(t)),{text:h})}),p=d.getBBox(),g=p.width,y=p.height;if(d.destroy(),!a){if("value"===r)return{text:h,x:0,y:-y-l};var m=l+u+("horizontal"===i?g/2:0);return(e={text:h})["horizontal"===i?"x":"y"]="start"===t?-m:m,e}var v=0,b=0,x=this.availableSpace,O=x.width,w=x.height,M=this.calcSelectionArea()[1],E=M.x,k=M.y,S=M.width,P=M.height,_=l+u;if("horizontal"===i){var A=_+g/2;v="start"===t?E-_-g>0?-A:A:O-E-S-_>g?A:-A}else{var j=y+_;b="start"===t?k-u>y?-j:_:w-(k+P)-u>y?j:-_}return{x:v,y:b,text:h}},e.prototype.getHandleLabelStyle=function(t){var e=Jv(this.attributes,"handleLabel");return(0,Mt.Cl)((0,Mt.Cl)((0,Mt.Cl)({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=Jv(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return(0,Mt.Cl)({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),(0,Mt.Cl)((0,Mt.Cl)((0,Mt.Cl)({},Qv(this.getHandleIconStyle(),"icon")),Qv((0,Mt.Cl)((0,Mt.Cl)({},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=(0,Mt.zs)(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=(0,Mt.zs)(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 Ws(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}(Rp);function gw(t,e){return null==t||null==e?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function yw(t,e){return null==t||null==e?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function mw(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=gw,n=(e,n)=>gw(t(e),n),r=(e,n)=>t(e)-n):(e=t===gw||t===yw?t:vw,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 vw(){return 0}function bw(t){return null===t?NaN:+t}const xw=mw(gw),Ow=xw.right,ww=xw.left,Mw=mw(bw).center,Ew=Ow;function kw(t,...e){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&2!==n.length||e.length>1){const o=Uint32Array.from(t,((t,e)=>e));return e.length>1?(e=e.map((e=>t.map(e))),o.sort(((t,n)=>{for(const r of e){const e=Pw(r[t],r[n]);if(e)return e}}))):(n=t.map(n),o.sort(((t,e)=>Pw(n[t],n[e])))),r=t,i=o,Array.from(i,(t=>r[t]))}var r,i;return t.sort(Sw(n))}function Sw(t=gw){if(t===gw)return Pw;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 Pw(t,e){return(null==t||!(t>=t))-(null==e||!(e>=e))||(t<e?-1:t>e?1:0)}function _w(t){return!!t.getBandWidth}function Aw(t,e,n){if(!_w(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(0,t))}(ww(s,e)+o,0,i.length-1);return i[c]}function jw(t,e,n){if(!e)return t.getOptions().domain;if(!_w(t)){const r=kw(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 Tw(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[Aw(a,n,e),Aw(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[jw(a,[l[0],u[0]]),jw(s,[l[1],u[1]])]}function Cw(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}const Nw=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:o}=t,a=function(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}(t,["orientation","labelFormatter","size","style","position"]);return r=>{var s;const{scales:[c],value:l,theme:u,coordinate:f}=r,{bbox:h}=l,{width:d,height:p}=h,{slider:g={}}=u,y=(null===(s=c.getFormatter)||void 0===s?void 0:s.call(c))||(t=>t+""),m="string"==typeof n?jx(n):n,v="horizontal"===e,b=pt(f)&&v,{trackSize:x=g.trackSize}=i,[O,w]=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}(h,o,x);return new pw({className:"slider",style:Object.assign({},g,Object.assign(Object.assign({x:O,y:w,trackLength:v?d:p,orientation:e,formatter:t=>(m||y)(Aw(c,b?1-t:t,!0)),sparklineData:Lw(t,r)},i),a))})}};function Lw(t,e){const{markState:n}=e;return E(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"])}Nw.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const Rw=t=>Nw(Object.assign(Object.assign({},t),{orientation:"horizontal"}));Rw.props=Object.assign(Object.assign({},Nw.props),{defaultPosition:"bottom"});const Iw=t=>Nw(Object.assign(Object.assign({},t),{orientation:"vertical"}));Iw.props=Object.assign(Object.assign({},Nw.props),{defaultPosition:"left"});var zw=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 Ws("scroll",r)),n.dispatchEvent(new Ws("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=(0,Mt.zs)(n.getLocalPosition(),2),r=e[0],i=e[1],o=(0,Mt.zs)(n.padding,4),a=o[0],s=o[3],c=n.getOrientVal([r+s,i+a]),l=(n.getOrientVal(PO(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Ws("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Ws("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Ws("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Ws("trackMouseleave",{detail:t.detail}))},n}return(0,Mt.C6)(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return $b(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=(0,Mt.zs)(this.range,2),n=e[0],r=e[1];return rn(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=(0,Mt.zs)(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=(0,Mt.zs)(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=(0,Mt.zs)(this.range,2),i=r[0],o=t*(r[1]-i-n);return[o,o+n]},e.prototype.getValue=function(){return this.value},e.prototype.renderSlider=function(t){var e=this.attributes,n=e.x,r=e.y,i=e.orientation,o=e.trackSize,a=e.padding,s=e.slidable,c=Jv(this.attributes,"track"),l=Jv(this.attributes,"thumb"),u=(0,Mt.Cl)((0,Mt.Cl)({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()},Qv(c,"track")),Qv(l,"selection"));this.slider=Bp(t).maybeAppendByClassName("scrollbar",(function(){return new pw({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=(0,Mt.zs)(this.range,2),i=r[0],o=r[1];this.slider.setValues(this.getValues(rn(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}(Rp);const Dw=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=function(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}(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:h,range:d}=t.getOptions(),p="horizontal"===e?l:u,g=p/h,[y,m]=d,v=m>y?0:1;return new zw({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}))})}};Dw.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const Bw=t=>Dw(Object.assign(Object.assign({},t),{orientation:"horizontal"}));Bw.props=Object.assign(Object.assign({},Dw.props),{defaultPosition:"bottom"});const Fw=t=>Dw(Object.assign(Object.assign({},t),{orientation:"vertical"}));Fw.props=Object.assign(Object.assign({},Dw.props),{defaultPosition:"left"});const Ww=(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]=pt(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{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(h,Object.assign(Object.assign({},i),t))}},$w=(t,e)=>{const n=1e-4,{coordinate:r}=e;return Dc({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:io.NUMBER}),(e,i,o)=>{const[a]=e;return gt(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:h,y:d,y1:p}=i,g=Gf(r,h,[d,p]),{innerRadius:y,outerRadius:m}=g,v=dt().cornerRadius(s).padAngle(c*Math.PI/180),b=new Cc({}),x=t=>(b.attr({d:v(t)}),ta(b)),O=[{scaleInYRadius:y+n,fillOpacity:0,strokeOpacity:0,opacity:0},{scaleInYRadius:y+n,fillOpacity:l,strokeOpacity:u,opacity:f,offset:.01},{scaleInYRadius:m,fillOpacity:l,strokeOpacity:u,opacity:f}],w=e.animate(O,Object.assign(Object.assign({},o),t));return w.onframe=function(){e.style.d=x(Object.assign(Object.assign({},g),{outerRadius:Number(e.style.scaleInYRadius)}))},w.onfinish=function(){e.style.d=x(Object.assign(Object.assign({},g),{outerRadius:m}))},w})(a):(e=>{const{style:n}=e,{transform:i="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=n,[l,u]=pt(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)}},Gw=(t,e)=>{const n=1e-4;Dc({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:io.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!gt(r))return Ww(t,e)(i,o,a);const{__data__:c,style:l}=s,{radius:u=0,inset:f=0,fillOpacity:h=1,strokeOpacity:d=1,opacity:p=1}=l,{points:g,y,y1:m}=c,v=dt().cornerRadius(u).padAngle(f*Math.PI/180),b=Gf(r,g,[y,m]),{startAngle:x,endAngle:O}=b,w=[{waveInArcAngle:x+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:x+n,fillOpacity:h,strokeOpacity:d,opacity:p,offset:.01},{waveInArcAngle:O,fillOpacity:h,strokeOpacity:d,opacity:p}],M=s.animate(w,Object.assign(Object.assign({},a),t));return M.onframe=function(){s.style.d=v(Object.assign(Object.assign({},b),{endAngle:Number(s.style.waveInArcAngle)}))},M.onfinish=function(){s.style.d=v(Object.assign(Object.assign({},b),{endAngle:O}))},M}};Gw.props={};const Hw=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))};Hw.props={};const Vw=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))};Vw.props={};const qw=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))};qw.props={};const Xw={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},Yw={[Wr.CIRCLE]:["cx","cy","r"],[Wr.ELLIPSE]:["cx","cy","rx","ry"],[Wr.RECT]:["x","y","width","height"],[Wr.IMAGE]:["x","y","width","height"],[Wr.LINE]:["x1","y1","x2","y2"],[Wr.POLYLINE]:["points"],[Wr.POLYGON]:["points"]};function Uw(t,e,n=!1){const r={};for(const i of e){const e=t.style[i];e?r[i]=e:n&&(r[i]=Xw[i])}return r}const Kw=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function Zw(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function Jw(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 Qw(t,e){const[n,r,i,o]=Zw(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(Jw([t,o,e,l]))}f-=t,u+=1}return c}function tM(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function eM(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function nM(t){const e=ta(t);if(e&&!function(t){return!eM(t,"m")||!eM(t,"M")}(e))return e}function rM(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=nM(e),s=nM(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;tM(e,t);let o=Kw;if(t.nodeName===Wr.GROUP){const[n,i,o,a]=Zw(t),[s,c,l,u]=Zw(e);r=`translate(${n-s}, ${i-c}) scale(${o/l}, ${a/u})`}else o=o.concat(Yw[t.nodeName]||[]);const a=[Object.assign({transform:null!=r?r:"none"},Uw(t,o,!0)),Object.assign({transform:null!=i?i:"none"},Uw(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 Cc({style:Object.assign(Object.assign({},Uw(t,Kw)),{d:e})});return tM(r,t),r}(t,a),l=[Object.assign({},Uw(e,Kw)),Object.assign({},Uw(n,Kw))];a!==s&&(l[0].d=a,l[1].d=s);const u=c.animate(l,r);return u.onfinish=()=>{const t=c.style.d;wu(c,n),c.style.d=t,c.style.transform="none"},c.style.transform="none",u}const iM=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:Qw}(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 rM(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)=>rM(e,new Cc({style:Object.assign({d:i[r]},Uw(t,Kw))}),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)=>rM(t,t,new Cc({style:{d:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,o,i)}return null};iM.props={};const oM=(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 Cc({style:{d:`M${a},${s}L${a+l},${s}L${a+l},${s+u}L${a},${s+u}Z`}});return o.appendChild(f),o.style.clipPath=f,Ww(t,e)([f],r,i)};oM.props={};const aM=(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 Cc({style:{d:`M${a},${s}L${a+l},${s}L${a+l},${s+u}L${a},${s+u}Z`}});return o.appendChild(f),o.style.clipPath=f,$w(t,e)([f],r,i)};aM.props={};const sM=function(t,e){if(!OO(t))return t;for(var n=[],r=0;r<t.length;r++){var i=t[r];e(i,r)&&n.push(i)}return n},cM="main-layer",lM="label-layer",uM="element",fM="view",hM="plot",dM="component",pM="label",gM="area",yM={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function mM(t,e){var n;return null!==(n=t.style[e])&&void 0!==n?n:yM[e]}function vM(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>vM(t,e,n,r)))}function bM(t){vM(t,"visibility","hidden",!0)}function xM(t){vM(t,"visibility","visible",!0)}var OM=function(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 wM(t){return Cu(t).selectAll(`.${uM}`).nodes().filter((t=>!t.__removed__))}function MM(t,e){return EM(t,e).flatMap((({container:t})=>wM(t)))}function EM(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function kM(t){return Cu(t).select(`.${hM}`).node()}function SM(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new li;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function PM(t,e){const{offsetX:n,offsetY:r}=e,i=SM(t),{min:[o,a],max:[s,c]}=i;return n<o||n>s||r<a||r>c?null:[n-o,r-a]}function _M(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 AM(t){return t=>t.__data__.color}function jM(t){return t=>t.__data__.x}function TM(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[NM(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(NM(i,r))[e]}}function CM(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=mM(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 NM(t,e){return`${t},${e}`}function LM(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[NM(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=NM(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 RM(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 IM(t){var{link:e=!1,valueof:n=((t,e)=>t),coordinate:r}=t,i=OM(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=kw(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=ot(),c=r[t-1],l=r[t],[u,f,h,d]=a(o(c),o(l));s.moveTo(...u),s.lineTo(...f),s.lineTo(...h),s.lineTo(...d),s.closePath();const p=Nf(i,(t=>n(t,c))),{fill:g=c.getAttribute("fill")}=p,y=OM(p,["fill"]),m=new Cc({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},y)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(m),c.link=m}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function zM(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(gt(n)){const{points:i}=t.__data__,[o,a]=pt(n)?$f(i):i,s=n.getCenter(),c=Lu(o,s),l=Lu(a,s),u=zu(c)+Bu(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return pt(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function DM(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=OM(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(!_w(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(!_w(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__:h}=t,{y:d,y1:p}=h;return Yf(e,f,{y:d,y1:p},i,n)},u=(t,e)=>{const{transform:n="scale(1.2, 1.2)",transformOrigin:r="center center",stroke:i=""}=e,o=OM(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=Nf(a,(e=>o(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,lineWidth:h=0}=e,d=OM(e,["fill","fillOpacity","zIndex","padding","lineWidth"]),p=Object.assign(Object.assign({},d),{fill:n,fillOpacity:i,zIndex:c,padding:f,lineWidth:h}),g=((()=>{const{x:t,y:e}=r;return[t,e].some(_w)})()?l:u)(t,p);g.className=s,t.parentNode.parentNode.appendChild(g),t.background=g},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function BM(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 FM(t){BM(t,t.cursor)}function WM(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function $M(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function GM(t,e=!1){const n=sM(t,(t=>!!t)).map(((t,e)=>[0===e?"M":"L",...t]));return e&&n.push(["Z"]),n}function HM(t){return t.querySelectorAll(".element")}function VM(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}var qM=function(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 XM(t){var{delay:e,createGroup:n,background:r=!1,link:i=!1}=t,o=qM(t,["delay","createGroup","background","link"]);return(t,a,s)=>{const{container:c,view:l,options:u}=t,{scale:f,coordinate:h}=l;return function(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 h=e(t),d=new Set(h),p=uu(h,r),g=RM(h,n),[y,m]=IM(Object.assign({elements:h,valueof:g,link:i,coordinate:c},ku(u.active,"link"))),[v,b,x]=DM(Object.assign({document:t.ownerDocument,scale:s,coordinate:c,background:o,valueof:g},ku(u.active,"background"))),O=A(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 zM(h[n],e,c)}})}),{setState:w,removeState:M,hasState:E}=CM(O,g);let k;const S=t=>{const{target:e,nativeEvent:i=!0}=t;if(!d.has(e))return;k&&clearTimeout(k);const o=r(e),a=p.get(o),s=new Set(a);for(const t of h)s.has(t)?E(t,"active")||w(t,"active"):(w(t,"inactive"),m(t)),t!==e&&b(t);v(e),y(a),i&&l.emit("element:highlight",{nativeEvent:i,data:{data:n(e),group:a.map(n)}})},P=(t=!0)=>{for(const t of h)M(t,"active","inactive"),b(t),m(t);t&&l.emit("element:unhighlight",{nativeEvent:t})},_=t=>{const{target:e}=t;o&&!x(e)||(o||d.has(e))&&(a>0?(k&&clearTimeout(k),k=setTimeout((()=>{P(),k=null}),a)):P())},j=()=>{P()};t.addEventListener("pointerover",S),t.addEventListener("pointerout",_),t.addEventListener("pointerleave",j);const T=t=>{const{nativeEvent:e}=t;e||P(!1)},C=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=WM(h,r,n);i&&S({target:i,nativeEvent:!1})};return l.on("element:highlight",C),l.on("element:unhighlight",T),()=>{t.removeEventListener("pointerover",S),t.removeEventListener("pointerout",_),t.removeEventListener("pointerleave",j),l.off("element:highlight",C),l.off("element:unhighlight",T);for(const t of h)b(t),m(t)}}(kM(c),Object.assign({elements:wM,datum:TM(l),groupKey:n?n(l):void 0,coordinate:h,scale:f,state:LM(u,[["active",r?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:r,link:i,delay:e,emitter:s},o))}}function YM(t){return XM(Object.assign(Object.assign({},t),{createGroup:jM}))}function UM(t){return XM(Object.assign(Object.assign({},t),{createGroup:AM}))}XM.props={reapplyWhenUpdate:!0},YM.props={reapplyWhenUpdate:!0},UM.props={reapplyWhenUpdate:!0};var KM=function(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 ZM(t){var{createGroup:e,background:n=!1,link:r=!1}=t,i=KM(t,["createGroup","background","link"]);return(t,o,a)=>{const{container:s,view:c,options:l}=t,{coordinate:u,scale:f}=c;return function(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 h=e(t),d=new Set(h),p=uu(h,r),g=RM(h,n),[y,m]=IM(Object.assign({link:i,elements:h,valueof:g,coordinate:a},ku(u.selected,"link"))),[v,b]=DM(Object.assign({document:t.ownerDocument,background:s,coordinate:a,scale:c,valueof:g},ku(u.selected,"background"))),x=A(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 zM(h[n],e,a)}})}),{setState:O,removeState:w,hasState:M}=CM(x,g),E=(t=!0)=>{for(const t of h)w(t,"selected","unselected"),m(t),b(t);t&&l.emit("element:unselect",{nativeEvent:!0})},k=t=>{const{target:e,nativeEvent:a=!0}=t;return d.has(e)?o?((t,e,i=!0)=>{if(M(e,"selected"))E();else{const o=r(e),a=p.get(o),s=new Set(a);for(const t of h)s.has(t)?O(t,"selected"):(O(t,"unselected"),m(t)),t!==e&&b(t);if(y(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(M(e,"selected")){if(!h.some((t=>!c.has(t)&&M(t,"selected"))))return E();for(const t of s)O(t,"unselected"),m(t),b(t)}else{const t=s.some((t=>M(t,"selected")));for(const t of h)c.has(t)?O(t,"selected"):M(t,"selected")||O(t,"unselected");!t&&i&&y(s),v(e)}o&&l.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:o,data:{data:h.filter((t=>M(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=WM(h,t,n);k({target:e,nativeEvent:!1})}},P=()=>{E(!1)};return l.on("element:select",S),l.on("element:unselect",P),()=>{for(const t of h)m(t);t.removeEventListener("click",k),l.off("element:select",S),l.off("element:unselect",P)}}(kM(s),Object.assign({elements:wM,datum:TM(c),groupKey:e?e(c):void 0,coordinate:u,scale:f,state:LM(l,[["selected",n?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:n,link:r,emitter:a},i))}}function JM(t){return ZM(Object.assign(Object.assign({},t),{createGroup:jM}))}function QM(t){return ZM(Object.assign(Object.assign({},t),{createGroup:AM}))}ZM.props={reapplyWhenUpdate:!0},JM.props={reapplyWhenUpdate:!0},QM.props={reapplyWhenUpdate:!0};const tE=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};function eE(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=(t=>`${t}`)}=t,o=function(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}(t,["wait","leading","trailing","labelFormatter"]);return t=>{const{view:a,container:s,update:c,setState:l}=t,{markState:u,scale:f,coordinate:h}=a,d=function(t,e,n){const[r]=Array.from(t.entries()).filter((([t])=>"line"===t.type)).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,0,["x","y","series"]);if(!d)return;const{y:p,x:g,series:y=[]}=d,m=p.map(((t,e)=>e)),v=kw(m.map((t=>g[t]))),b=kM(s),x=s.getElementsByClassName(uM),O=uu(s.getElementsByClassName(pM),(t=>t.__data__.key.split("-")[0])),w=new Tc({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},ku(o,"rule"))}),M=new Ic({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},ku(o,"label"))});w.append(M),b.appendChild(w);const E=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return v[Mw(v,i)]},k=(t,e)=>{w.setAttribute("x1",t[0]),w.setAttribute("x2",t[0]),M.setAttribute("text",i(e))};let S;const P=tE((t=>{const e=PM(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[mw((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 h=O.get(r)||[];for(const t of h)t.setAttribute("dy",f)}})(e)}),e,{leading:n,trailing:r});return(t=>{var e,n,r,i;e=this,n=void 0,i=function*(){const{x:e}=f,n=E(h,e,t);k(t,n),l("chartIndex",(t=>{const e=A({},t),r=e.marks.find((t=>"line"===t.type)),i=Sy(hu(m,(t=>Sy(t,(t=>+p[t]))/ky(t,(t=>+p[t]))),(t=>y[t])).values());A(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[mw((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},new((r=void 0)||(r=Promise))((function(t,o){function a(t){try{c(i.next(t))}catch(t){o(t)}}function s(t){try{c(i.throw(t))}catch(t){o(t)}}function c(e){e.done?t(e.value):function(t){return t instanceof r?t:new r((function(e){e(t)}))}(e.value).then(a,s)}c((i=i.apply(e,n||[])).next())}))})([0,0]),b.addEventListener("pointerenter",P),b.addEventListener("pointermove",P),b.addEventListener("pointerleave",P),()=>{w.remove(),b.removeEventListener("pointerenter",P),b.removeEventListener("pointermove",P),b.removeEventListener("pointerleave",P)}}}function nE(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 rE(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 iE(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}eE.props={reapplyWhenUpdate:!0};function oE(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 aE={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function sE(t){var e;void 0===t&&(t="");var n=oE(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)]=(0,Mt.Cl)({flex:1},aE),e[".".concat(n.VALUE)]=(0,Mt.Cl)({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},aE),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 cE=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=oE(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:sE(o)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return(0,Mt.C6)(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,i,o=t.name,a=void 0===o?"":o,s=t.color,c=void 0===s?"black":s,l=t.index,u=(0,Mt.Tt)(t,["name","color","index"]),f=(0,Mt.Cl)({name:a,color:c,index:null!=l?l:e},u);return iE((r=n.item,i=f,r&&i?r.replace(/\\?\{([^{}]+)\}/g,(function(t,e){return"\\"===t.charAt(0)?t.slice(1):void 0===i[e]?"":i[e]})):r))}))},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=iE(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=oE(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,(0,Mt.fX)([],(0,Mt.zs)(u),!1));var h=this.element.querySelector(".".concat(c.LIST));h?h.replaceWith(f):l.appendChild(f)}!function(t,e){Object.entries(e).forEach((function(e){var n=(0,Mt.zs)(e,2),r=n[0],i=n[1];(0,Mt.fX)([t],(0,Mt.zs)(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=(0,Mt.zs)(l,2),n=e[0],i=e[1],a=(0,Mt.zs)(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=(0,Mt.zs)(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=(0,Mt.zs)(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,h=(0,Mt.zs)([+o+n,+a+r],2),d=h[0],p=h[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},y=s.x,m=s.y,v={left:d<y,right:d+u>y+s.width,top:p<m,bottom:p+f>m+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 ux(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}(Rp);const lE={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"};function uE(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 fE(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=VM(o,(t=>"element"===t.className)),c=VM(o,(t=>"component"===t.className)),l=function(t){return VM(t,(t=>"label"===t.className))}(o),u=s||c||l;if(!u)return;const{className:f,markType:h}=u,d=Object.assign(Object.assign({},i),{nativeEvent:!0});"element"===f?(d.data={data:uE(u,e)},n.emit(`element:${t}`,d),n.emit(`${h}:${t}`,d)):"label"===f?(d.data={data:u.attributes.datum},n.emit(`label:${t}`,d),n.emit(`${a}:${t}`,d)):(n.emit(`component:${t}`,d),n.emit(`${a}:${t}`,d))}}function hE(){return(t,e,n)=>{const{container:r,view:i}=t,o=fE(lE.CLICK,i,n,(t=>1===t.detail)),a=fE(lE.DBLCLICK,i,n,(t=>2===t.detail)),s=fE(lE.POINTER_TAP,i,n),c=fE(lE.POINTER_DOWN,i,n),l=fE(lE.POINTER_UP,i,n),u=fE(lE.POINTER_OVER,i,n),f=fE(lE.POINTER_OUT,i,n),h=fE(lE.POINTER_MOVE,i,n),d=fE(lE.POINTER_ENTER,i,n),p=fE(lE.POINTER_LEAVE,i,n),g=fE(lE.POINTER_UPOUTSIDE,i,n),y=fE(lE.DRAG_START,i,n),m=fE(lE.DRAG,i,n),v=fE(lE.DRAG_END,i,n),b=fE(lE.DRAG_ENTER,i,n),x=fE(lE.DRAG_LEAVE,i,n),O=fE(lE.DRAG_OVER,i,n),w=fE(lE.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",h),r.addEventListener("pointerenter",d),r.addEventListener("pointerleave",p),r.addEventListener("pointerupoutside",g),r.addEventListener("dragstart",y),r.addEventListener("drag",m),r.addEventListener("dragend",v),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",O),r.addEventListener("drop",w),()=>{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",h),r.removeEventListener("pointerenter",d),r.removeEventListener("pointerleave",p),r.removeEventListener("pointerupoutside",g),r.removeEventListener("dragstart",y),r.removeEventListener("drag",m),r.removeEventListener("dragend",v),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",O),r.removeEventListener("drop",w)}}}hE.props={reapplyWhenUpdate:!0};var dE=function(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 pE(t,e){return e?"string"==typeof e?document.querySelector(e):e:t.ownerDocument.defaultView.getContextService().getDomElement().parentElement}function gE(t,e,n,r,i,o,a,s={}){const c=new cE({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:[10,10],template:{prefixCls:"g2-"},style:A({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(c.HTMLTooltipElement),c}function yE({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 h=pE(t,u),d=pE(t),p=a?d: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),y=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(d,h),{tooltipElement:m=gE(h,n,r,s,c,g,y,l)}=p,{items:v,title:b=""}=e;m.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=m}function mE({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const o=pE(t),a=e?o:t,{tooltipElement:s}=a;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY)}function vE({root:t,single:e}){const n=pE(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0)}function bE(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function xE(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function OE(t,e=(t=>t)){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function wE(t,e,n,r=t.map((t=>t.__data__)),i={}){const o=t=>t instanceof Date?+t:t,a=OE(r.map((t=>t.title)),o).filter(Mu),s=r.flatMap(((r,o)=>{const a=t[o],{items:s=[],title:c}=r,l=s.filter(Mu),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=xE(a)||i.color,name:o}=t,s=dE(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 Xy)&&!(t instanceof Ov);if(s(r))return r.clone().invert(a);if(a&&r instanceof Xy&&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(bE);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:OE(s,(t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`))})}function ME(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function EE(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function kE(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function SE(t,e){return void 0===t?e:t}function PE(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function _E(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:h=!0,trailing:d=!1,startX:p=0,startY:g=0,body:y=!0,single:m=!0,position:v,enterable:b,mount:x,bounding:O,theme:w,disableNative:M=!1,marker:E=!0,preserve:k=!1,style:S={},css:P={}}=e,_=dE(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 j=n(t),T=pt(a),C=gt(a),N=A(S,_),{innerWidth:L,innerHeight:R,width:I,height:z,insetLeft:D,insetTop:B}=a.getOptions(),F=[],W=[];for(const t of j){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?F.push(t):(r||i)&&W.push(t)}const $=!!(T?o.y:o.x).getBandWidth&&W.length>0;F.sort(((t,e)=>{const n=T?0:1,r=t=>t.getBounds().min[n];return T?r(e)-r(t):r(t)-r(e)}));const G=t=>{const e=T?1:0,{min:n,max:r}=t.getLocalBounds();return kw([n[e],r[e]])};W.sort(((t,e)=>{const[n,r]=G(t),[i,o]=G(e),a=(n+r)/2,s=(i+o)/2;return T?s-a:a-s}));const H=new Map(F.map((t=>{const{__data__:e}=t,{seriesX:n}=e;return[t,[kw(n.map(((t,e)=>e)),(t=>n[+t])),n]]}))),{x:V}=o,q=(null==V?void 0:V.getBandWidth)?V.getBandWidth()/2:0,X=t=>{const[e]=a.invert(t);return e-q},Y=(t,e,n)=>{const r=X(t),i=n.filter(Mu),[o,a]=kw([i[0],i[i.length-1]]);if(!$&&(r<o||r>a)&&o!==a)return null;return e[(0,mw((t=>n[+t])).center)(e,r)]},U=(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[yu(t.replace("series","")),r]})))},K=tE((e=>{const n=PM(t,e);if(!n)return;const f=SM(t),h=f.min[0],d=f.min[1],M=[n[0]-p,n[1]-g];if(!M)return;const k=((t,e)=>{const n=t[T?1:0],r=e.filter((t=>{const[e,r]=G(t);return n>=e&&n<=r}));if(!$||r.length>0)return r;const i=mw((t=>{const[e,n]=G(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(Mu)})(M,W),S=[],_=[];for(const t of F){const[e,n]=H.get(t),r=Y(M,e,n);if(null!==r){S.push(t);const e=U(t,r),{x:n,y:i}=e,o=a.map([(n||0)+q,i||0]);_.push([Object.assign(Object.assign({},e),{element:t}),o])}}const A=Array.from(new Set(_.map((t=>t[0].x)))),j=A[rE(A,(t=>Math.abs(t-X(M))))],V=_.filter((t=>t[0].x===j)),K=[...V.map((t=>t[0])),...k.map((t=>t.__data__))],J=[...S,...k],Q=wE(J,o,l,K,w);if(r&&Q.items.sort(((t,e)=>r(t)-r(e))),i&&(Q.items=Q.items.filter(i)),0===J.length||PE(Q))Z(e);else{if(y&&yE({root:t,data:Q,x:n[0]+h,y:n[1]+d,render:c,event:e,single:m,position:v,enterable:b,mount:x,bounding:O,css:P}),s){const e=V.map((t=>t[1])),n=ku(N,"crosshairs");!function(t,e,n){var{plotWidth:r,plotHeight:i,mainWidth:o,mainHeight:a,startX:s,startY:c,transposed:l,polar:u,insetLeft:f,insetTop:h}=n,d=dE(n,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const p=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},d),g=e.map((t=>t[1])),y=e.map((t=>t[0])),m=nE(g),v=nE(y),[b,x,O,w]=(()=>{if(u){const t=Math.min(o,a)/2,e=s+f+o/2,n=c+h+a/2,r=zu(Lu([v,m],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,m+c,m+c]:[v+s,v+s,c,c+i]})();if(y.length>0){const e=t.ruleY||(()=>{const e=new Tc({style:Object.assign({x1:b,x2:x,y1:O,y2:w},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=O,e.style.y2=w,t.ruleY=e}}(t,e,Object.assign(Object.assign({},n),{plotWidth:L,plotHeight:R,mainWidth:I,mainHeight:z,insetLeft:D,insetTop:B,startX:p,startY:g,transposed:T,polar:C}))}if(E){const e=ku(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 Mu(e)&&Mu(n)})).map((t=>{const[{color:e,element:i},o]=t,a=e||i.style.fill||i.style.stroke||r.color;return new kc({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:w})}u.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:{x:Aw(o.x,X(M),!0)}}}))}}),f,{leading:h,trailing:d}),Z=e=>{mE({root:t,single:m,emitter:u,event:e}),s&&ME(t),E&&EE(t)},J=()=>{vE({root:t,single:m}),s&&ME(t),E&&EE(t)},Q=({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})},tt=()=>{mE({root:t,single:m,emitter:u,nativeEvent:!1})},et=()=>{it(),J()},nt=()=>{rt()},rt=()=>{M||(t.addEventListener("pointerenter",K),t.addEventListener("pointermove",K),t.addEventListener("pointerleave",Z))},it=()=>{M||(t.removeEventListener("pointerenter",K),t.removeEventListener("pointermove",K),t.removeEventListener("pointerleave",Z))};return rt(),u.on("tooltip:show",Q),u.on("tooltip:hide",tt),u.on("tooltip:disable",et),u.on("tooltip:enable",nt),()=>{it(),u.off("tooltip:show",Q),u.off("tooltip:hide",tt),u.off("tooltip:disable",et),u.off("tooltip:enable",nt),k?mE({root:t,single:m,emitter:u,nativeEvent:!1}):J()}}function AE(t){const{shared:e,crosshairs:n,series:r,name:i,item:o=(()=>({})),facet:a=!1}=t,s=dE(t,["shared","crosshairs","series","name","item","facet"]);return(t,i,c)=>{const{container:l,view:u}=t,{scale:f,markState:h,coordinate:d,theme:p}=u,g=kE(h,"seriesTooltip"),y=kE(h,"crosshairs"),m=kM(l),v=SE(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}))}(h)&&!a)return _E(m,Object.assign(Object.assign({},s),{theme:p,elements:wM,scale:f,coordinate:d,crosshairs:SE(n,y),item:o,emitter:c}));if(v&&a){const e=i.filter((e=>e!==t&&e.options.parentKey===t.options.key)),r=MM(t,i),a=e[0].view.scale,l=m.getBounds(),u=l.min[0],f=l.min[1];return Object.assign(a,{facet:!0}),_E(m.parentNode.parentNode,Object.assign(Object.assign({},s),{theme:p,elements:()=>r,scale:a,coordinate:d,crosshairs:SE(n,y),item:o,startX:u,startY:f,emitter:c}))}return function(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:h=!0,position:d,enterable:p,datum:g,view:y,mount:m,bounding:v,theme:b,shared:x=!1,body:O=!0,disableNative:w=!1,preserve:M=!1,css:E={}}){const k=e(t),S=uu(k,f),P=tE((e=>{const{target:c}=e,l=VM(c,(t=>!!t.classList&&t.classList.includes("element")));if(!l)return void mE({root:t,single:h,emitter:s,event:e});const u=f(l),g=S.get(u);if(!g)return;const w=1!==g.length||x?wE(g,n,i,void 0,b):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(Mu).map((e=>{var{color:n=xE(t)}=e,r=dE(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(bE);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(g[0]);if(o&&w.items.sort(((t,e)=>o(t)-o(e))),a&&(w.items=w.items.filter(a)),PE(w))return void mE({root:t,single:h,emitter:s,event:e});const{offsetX:M,offsetY:k}=e;O&&yE({root:t,data:w,x:M,y:k,render:r,event:e,single:h,position:d,enterable:p,mount:m,bounding:v,css:E}),s.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:{data:uE(l,y)}}))}),c,{leading:l,trailing:u}),_=e=>{mE({root:t,single:h,emitter:s,event:e})},A=()=>{w||(t.addEventListener("pointermove",P),t.addEventListener("pointerleave",_))},j=()=>{w||(t.removeEventListener("pointermove",P),t.removeEventListener("pointerleave",_))},T=({nativeEvent:t,data:e})=>{if(t)return;const n=WM(k,e.data,g);if(!n)return;const r=n.getBBox(),{x:i,y:o,width:a,height:s}=r;P({target:n,offsetX:i+a/2,offsetY:o+s/2})},C=({nativeEvent:e}={})=>{e||mE({root:t,single:h,emitter:s,nativeEvent:!1})};return s.on("tooltip:show",T),s.on("tooltip:hide",C),s.on("tooltip:enable",(()=>{A()})),s.on("tooltip:disable",(()=>{j(),vE({root:t,single:h})})),A(),()=>{j(),s.off("tooltip:show",T),s.off("tooltip:hide",C),M?mE({root:t,single:h,emitter:s,nativeEvent:!1}):vE({root:t,single:h})}}(m,Object.assign(Object.assign({},s),{datum:TM(u),elements:wM,scale:f,coordinate:d,groupKey:e?t=>t.__data__.x:void 0,item:o,emitter:c,view:u,theme:p,shared:e}))}}AE.props={reapplyWhenUpdate:!0};var jE=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))};const TE="legend-category",CE="legend-continuous",NE="items-item",LE="legend-category-item-marker",RE="legend-category-item-label";function IE(t){return t.getElementsByClassName(LE)[0]}function zE(t){return t.getElementsByClassName(RE)[0]}function DE(t){return t.getElementsByClassName(NE)}function BE(t){return t.getElementsByClassName(TE)}function FE(t){return t.getElementsByClassName(CE)}function WE(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function $E(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){return jE(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 A({},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 GE(t,e){for(const n of t)$E(n,Object.assign(Object.assign({},e),{facet:!0}))}var HE=function(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 VE(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function qE(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function XE(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const YE=Bh((t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:c=10,document:l}=e,u=HE(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,h=(t,e,n)=>{t.handle||(t.handle=n.createElement("rect"),t.append(t.handle));const{handle:r}=t;return r.attr(e),r},d=ku(Pu(u,"handleNW","handleNE"),"handleN"),{render:p=h}=d,g=HE(d,["render"]),y=ku(u,"handleE"),{render:m=h}=y,v=HE(y,["render"]),b=ku(Pu(u,"handleSE","handleSW"),"handleS"),{render:x=h}=b,O=HE(b,["render"]),w=ku(u,"handleW"),{render:M=h}=w,E=HE(w,["render"]),k=ku(u,"handleNW"),{render:S=h}=k,P=HE(k,["render"]),_=ku(u,"handleNE"),{render:A=h}=_,j=HE(_,["render"]),T=ku(u,"handleSE"),{render:C=h}=T,N=HE(T,["render"]),L=ku(u,"handleSW"),{render:R=h}=L,I=HE(L,["render"]),z=t=>()=>{const e=Bh((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=Cu(t).attr("className",a).style("transform",`translate(${n}, ${r})`).style("draggable",!0);D.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(XE,Object.assign(Object.assign({width:i,height:o},Pu(u,"handle")),{transform:void 0})),D.maybeAppend("handle-n",z(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(XE,g),D.maybeAppend("handle-e",z(m)).style("x",i-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(XE,v),D.maybeAppend("handle-s",z(x)).style("x",f).style("y",o-f).style("width",i-c).style("height",c).style("fill","transparent").call(XE,O),D.maybeAppend("handle-w",z(M)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(XE,E),D.maybeAppend("handle-nw",z(S)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(XE,P),D.maybeAppend("handle-ne",z(A)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(XE,j),D.maybeAppend("handle-se",z(C)).style("x",i-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(XE,N),D.maybeAppend("handle-sw",z(R)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(XE,I)}));function UE(t,e){var{brushed:n=(()=>{}),brushended:r=(()=>{}),brushcreated:i=(()=>{}),brushstarted:o=(()=>{}),brushupdated:a=(()=>{}),extent:s=qE(t),brushRegion:c=((t,e,n,r,i)=>[t,e,n,r]),reverse:l=!1,fill:u="#777",fillOpacity:f="0.3",stroke:h="#fff",selectedHandles:d=["handle-n","handle-e","handle-s","handle-w","handle-nw","handle-ne","handle-se","handle-sw"]}=e,p=HE(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,y=null,m=null,v=null,b=null,x=!1;const[O,w,M,E]=s;BM(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();P()},S=()=>{b=new Cc({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),v=new YE({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(v)},P=()=>{v=new YE({style:Object.assign(Object.assign({document:t.ownerDocument,x:0,y:0},p),{fill:u,fillOpacity:f,stroke:h,draggable:!0}),className:"mask"}),t.appendChild(v)},_=(t=!0)=>{v&&v.remove(),b&&b.remove(),g=null,y=null,m=null,x=!1,v=null,b=null,r(t)},A=(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,h,d,p]=c(i,o,a,u,s);return l?T(f,h,d,p):j(f,h,d,p),n(f,h,d,p,r),[f,h,d,p]},j=(t,e,n,r)=>{v.style.x=t,v.style.y=e,v.style.width=n-t,v.style.height=r-e},T=(t,e,n,r)=>{b.style.d=`\n M${O},${w}L${M},${w}L${M},${E}L${O},${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},C={"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"}},N=t=>R(t)||L(t),L=t=>{const{id:e}=t;return-1!==d.indexOf(e)&&new Set(Object.keys(C)).has(e)},R=t=>t===v.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=_M(t,e);if(!v||!N(n))return k(r,i,e),void(x=!0);N(n)&&(m=[r,i])},z=e=>{const{target:n}=e,r=_M(t,e);if(!g)return;if(!m)return A(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]-m[0],r=t[1]-m[1],i=e(n,g[0],y[0],O,M),o=e(r,g[1],y[1],w,E),a=[g[0]+i,g[1]+o],s=[y[0]+i,y[1]+o];A(a,s)})(r);const[i,o]=[r[0]-m[0],r[1]-m[1]],{id:a}=n;if(C[a]){const[t,e,n,r]=C[a].vector;return A([g[0]+i*t,g[1]+o*e],[y[0]+i*n,y[1]+o*r])}},D=e=>{if(m){m=null;const{x:t,y:n,width:r,height:i}=v.style;return g=[t,n],y=[t+r,n+i],void a(t,n,t+r,n+i,e)}y=_M(t,e);const[n,r,o,s]=A(g,y);x=!1,i(n,r,o,s,e)},B=t=>{const{target:e}=t;v&&!N(e)&&_()},F=e=>{const{target:n}=e;v&&N(n)&&!x?R(n)?BM(t,"move"):L(n)&&BM(t,C[n.id].cursor):BM(t,"crosshair")},W=()=>{BM(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",z),t.addEventListener("dragend",D),t.addEventListener("click",B),t.addEventListener("pointermove",F),t.addEventListener("pointerleave",W),{mask:v,move(t,e,n,r,i=!0){v||k(t,e,{}),g=[t,e],y=[n,r],A([t,e],[n,r],i)},remove(t=!0){v&&_(t)},destroy(){v&&_(!1),BM(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",z),t.removeEventListener("dragend",D),t.removeEventListener("click",B),t.removeEventListener("pointermove",F),t.removeEventListener("pointerleave",W)}}}function KE(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 ZE(t,e,n){return KE(t,e,n).map((t=>t.options))}function JE(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:h=(t=>t),bboxOf:d=(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,y=HE(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const m=n(t),v=i(t),b=v.flatMap(n),x=RM(m,o),O=ku(y,"mask"),{setState:w,removeState:M}=CM(p,x),E=new Map,{width:k,height:S,x:P=0,y:_=0}=d(t),A=s||[0,0,k,S],j=()=>{for(const t of[...m,...b])M(t,"active","inactive")},T=(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 m){const{min:a,max:s}=i.getLocalBounds(),[c,l]=a,[u,f]=s;VE([c,l,u,f],[t,e,n,r])?(w(i,"active"),o.add(h(i))):w(i,"inactive")}for(const t of b)o.has(h(t))?w(t,"active"):w(t,"inactive")},C=()=>{for(const t of m)M(t,"inactive");for(const t of E.values())t.remove();E.clear()},N=(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 m){const a=E.get(o)||i(o);a.style.clipPath=new Rc({style:{x:t+P,y:e+_,width:n-t,height:r-e}}),w(o,"inactive"),w(a,"active")}},L=UE(t,Object.assign(Object.assign({},O),{extent:A,brushRegion:a,reverse:c,selectedHandles:r,brushended:t=>{const e=f?C:j;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const o=Tw(t,e,n,r,l,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:o}}),(f?N:T)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const o=Tw(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=Tw(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=Cw(o,r),c=Cw(a,i),l=[s[0],c[0]],u=[s[1],c[1]],[f,h]=n.map(l),[d,p]=n.map(u);return[f,h,d,p]}(n,l,u);L.move(r,i,o,a,!1)};g.on("brush:highlight",R);const I=({nativeEvent:t}={})=>{t||L.remove(!1)};g.on("brush:remove",I);const z=L.destroy.bind(L);return L.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),z()},L}function QE(t){var{facet:e,brushKey:n}=t,r=HE(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:c}=t,l=kM(a),u={maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",reverse:!1},f=["active",["inactive",{opacity:.5}]],{scale:h,coordinate:d}=s;if(e){const e=l.getBounds(),n=e.min[0],a=e.min[1],s=e.max[0],c=e.max[1];return JE(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>MM(t,i),datum:TM(EM(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:LM(EM(t,i).map((t=>t.options)),f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=JE(l,Object.assign(Object.assign({elements:wM,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return KE(t,e,n).map((t=>kM(t.container)))}(t,i,n),datum:TM([s,...KE(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:LM([c,...ZE(t,i,n)],f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function tk(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function ek(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}var nk=function(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};const rk="axis",ik="axis-line",ok="axis-main-group",ak="axis-hot-area";function sk(t){return t.getElementsByClassName(rk)}function ck(t){return t.getElementsByClassName(ik)[0]}function lk(t){return function(t){return t.getElementsByClassName(ok)[0]}(t).getLocalBounds()}function uk(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=nk(e,["cross","offsetX","offsetY"]);const a=lk(t),s=ck(t),[c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=2*(f-l);return{brushRegion:ek,hotZone:new Rc({className:ak,style:Object.assign({width:n?d/2:d,transform:`translate(${(n?l:c-d/2).toFixed(2)}, ${u})`,height:h-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 fk(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=nk(e,["offsetY","offsetX","cross"]);const a=lk(t),s=ck(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=h-u;return{brushRegion:tk,hotZone:new Rc({className:ak,style:Object.assign({width:f-l,height:i?d:2*d,transform:`translate(${l}, ${i?u:c-d})`},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(h-n)]}}var hk=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))},dk=function(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 pk(t){var{hideX:e=!0,hideY:n=!0}=t,r=dk(t,["hideX","hideY"]);return(t,i,o)=>{const{container:a,view:s,options:c,update:l,setState:u}=t,f=kM(a);let h=!1,d=!1,p=s;const{scale:g,coordinate:y}=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 h=ku(dk(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:d,height:p}=t.getBBox(),g=o||[0,0,d,p],y=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),m=UE(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:a,brushcreated:function(t,e,r,i,o){o.nativeEvent=!0,n(u(t,e,r,i),o),m.remove()}}));function v(t){y(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),()=>{m.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 Tw(t,e,n,r,i,o)},filter:(t,r)=>hk(this,void 0,void 0,(function*(){if(d)return;d=!0;const[i,a]=t;u("brushFilter",(t=>{const{marks:r}=t,o=r.map((t=>A({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,d=!1,h=!0})),reset:t=>{if(d||!h)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]}})),h=!1,p=s,u("brushFilter"),l()},extent:void 0,emitter:o,scale:g,coordinate:y},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}var gk=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))};const yk="slider";function mk(t,e,n,r=!1,i="x",o="y"){const{marks:a}=t,s=a.map((t=>{var a,s;return A({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 vk(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return jw(e,[Aw(e,o(r),!0),Aw(e,o(i),!1)])}function bk(t){return[t[0],t[t.length-1]]}function xk({initDomain:t={},className:e=yk,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:h,view:d,update:p,setState:g}=l,y=h.getElementsByClassName(e);if(!y.length)return()=>{};let m=!1;const{scale:v,coordinate:b,layout:x}=d,{paddingLeft:O,paddingTop:w,paddingBottom:M,paddingRight:E}=x,{x:k,y:S}=v,P=pt(b),_=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return P?[n,e]:[e,n]},A=new Map,j=new Set,T={x:t.x||k.getOptions().domain,y:t.y||S.getOptions().domain};for(const t of y){const{orientation:e}=t.attributes,[l,u]=_(e),h=`${n}${xx(l)}:filter`,d="x"===l,{ratio:y}=k.getOptions(),{ratio:b}=S.getOptions(),x=t=>{if(t.data){const{selection:e}=t.data,[n=bk(T.x),r=bk(T.y)]=e;return d?[jw(k,n,y),jw(S,r,b)]:[jw(S,r,b),jw(k,n,y)]}const{value:n}=t.detail;return[vk(n,v[l],P&&"horizontal"===e),T[u]]},C=tE((e=>gk(this,void 0,void 0,(function*(){const{initValue:r=!1}=e;if(m&&!r)return;m=!0;const{nativeEvent:o=!0}=e,[a,s]=x(e);if(T[l]=a,T[u]=s,o){const t=d?a:s,n=d?s:a;f.emit(h,Object.assign(Object.assign({},e),{nativeEvent:o,data:{selection:[bk(t),bk(n)]}}))}g(t,(t=>Object.assign(Object.assign({},mk(t,{[l]:{domain:a,nice:!1}},n,i,l,u)),{paddingLeft:O,paddingTop:w,paddingBottom:M,paddingRight:E}))),yield p(),m=!1}))),o,{leading:a,trailing:s}),N=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:o}=i,[a,s]=o;t.dispatchEvent(new Ws("valuechange",{data:i,nativeEvent:!1}));const c=d?Cw(a,k):Cw(s,S);r(t,c)};f.on(h,N),t.addEventListener("valuechange",C),A.set(t,C),j.add([h,N]);const L=c(t);L&&t.dispatchEvent(new Ws("valuechange",{detail:{value:L},nativeEvent:!1,initValue:!0}))}return p(),()=>{for(const[t,e]of A)t.removeEventListener("valuechange",e);for(const[t,e]of j)f.off(t,e)}}}const Ok="g2-scrollbar";function wk(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function Mk(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 Ek={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 kk(t){return"text"===t.nodeName&&!!t.isOverflowing()}function Sk(t){var{offsetX:e=8,offsetY:n=8}=t,r=function(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}(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=ku(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!kk(r))return void t.stopPropagation();const{offsetX:l,offsetY:u}=t,f=l+e-o,h=u+n-a;if(r.tip)return r.tip.style.x=f,void(r.tip.style.y=h);const{text:d}=r.style,p=new Ac({className:"poptip",style:{innerHTML:Mk("div",d,Object.assign(Object.assign({},Ek),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;kk(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()))}}}function Pk(t){return en(t)?0:OO(t)?t.length:Object.keys(t).length}Sk.props={reapplyWhenUpdate:!0};const _k=Object.keys?function(t){return Object.keys(t)}:function(t){var e=[];return vx(t,(function(n,r){kp(t)&&"prototype"===r||e.push(r)})),e},Ak=function(t,e){if(!E(t))return null;var n;if(kp(e)&&(n=e),S(e)&&(n=function(t){return function(t,e){var n=_k(e),r=n.length;if(en(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 jk=Object.prototype.hasOwnProperty;function Tk(t){return null==t?null:Ck(t)}function Ck(t){if("function"!=typeof t)throw new Error;return t}function Nk(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 Lk(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=Ik)):void 0===e&&(e=Rk);for(var n,r,i,o,a,s=new Bk(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 Bk(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(Dk)}function Rk(t){return t.children}function Ik(t){return Array.isArray(t)?t[1]:null}function zk(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Dk(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function Bk(t){this.data=t,this.depth=this.height=0,this.parent=null}Bk.prototype=Lk.prototype={constructor:Bk,count:function(){return this.eachAfter(Nk)},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;for(t=n.pop(),e=r.pop();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 Lk(this).eachBefore(zk)},[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 Fk={depth:-1},Wk={},$k={};function Gk(t){return t.id}function Hk(t){return t.parentId}function Vk(){var t,e=Gk,n=Hk;function r(r){var i,o,a,s,c,l,u,f,h=Array.from(r),d=e,p=n,g=new Map;if(null!=t){const e=h.map(((e,n)=>function(t){let e=(t=`${t}`).length;return Xk(t,e-1)&&!Xk(t,e-2)&&(t=t.slice(0,-1)),"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(qk),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(qk(t)),h.push($k));d=(t,n)=>e[n],p=(t,e)=>n[e]}for(a=0,i=h.length;a<i;++a)o=h[a],l=h[a]=new Bk(o),null!=(u=d(o,a,r))&&(u+="")&&(f=l.id=u,g.set(f,g.has(f)?Wk:l)),null!=(u=p(o,a,r))&&(u+="")&&(l.parent=u);for(a=0;a<i;++a)if(u=(l=h[a]).parent){if(!(c=g.get(u)))throw new Error("missing: "+u);if(c===Wk)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===$k&&1===s.children.length;)s=s.children[0],--i;for(let t=h.length-1;t>=0&&(l=h[t]).data===$k;--t)l.data=null}if(s.parent=Fk,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(Dk),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=Tk(t),r):e},r.parentId=function(t){return arguments.length?(n=Tk(t),r):n},r.path=function(e){return arguments.length?(t=Tk(e),r):t},r}function qk(t){let e=t.length;if(e<2)return"";for(;--e>1&&!Xk(t,e););return t.slice(0,e)}function Xk(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(0==(1&n))return!0}return!1}function Yk(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)}for(var f=l[e],h=r/2+f,d=e+1,p=n-1;d<p;){var g=d+p>>>1;l[g]<h?d=g+1:p=g}h-l[d-1]<l[d]-h&&e+1<d&&--d;var y=l[d]-f,m=r-y;if(a-i>c-o){var v=r?(i*m+a*y)/r:a;t(e,d,y,i,o,v,c),t(d,n,m,v,o,a,c)}else{var b=r?(o*m+c*y)/r:c;t(e,d,y,i,o,a,b),t(d,n,m,i,b,a,c)}}(0,c,t.value,e,n,r,i)}function Uk(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}function Kk(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}function Zk(t,e,n,r,i){(1&t.depth?Kk:Uk)(t,e,n,r,i)}var Jk=(1+Math.sqrt(5))/2;function Qk(t,e,n,r,i,o){for(var a,s,c,l,u,f,h,d,p,g,y,m=[],v=e.children,b=0,x=0,O=v.length,w=e.value;b<O;){c=i-n,l=o-r;do{u=v[x++].value}while(!u&&x<O);for(f=h=u,y=u*u*(g=Math.max(l/c,c/l)/(w*t)),p=Math.max(h/y,y/f);x<O;++x){if(u+=s=v[x].value,s<f&&(f=s),s>h&&(h=s),y=u*u*g,(d=Math.max(h/y,y/f))>p){u-=s;break}p=d}m.push(a={value:u,dice:c<l,children:v.slice(b,x)}),a.dice?Uk(a,n,r,i,w?r+=l*u/w:o):Kk(a,n,r,w?n+=c*u/w:i,o),w-=u,b=x}return m}const tS=function t(e){function n(t,n,r,i,o){Qk(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(Jk),eS=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,h=a.length,d=t.value;++f<h;){for(c=(s=a[f]).children,l=s.value=0,u=c.length;l<u;++l)s.value+=c[l].value;s.dice?Uk(s,n,r,i,d?r+=(o-r)*s.value/d:o):Kk(s,n,r,d?n+=(i-n)*s.value/d:i,o),d-=s.value}else t._squarify=a=Qk(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(Jk);function nS(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 rS(){return 0}function iS(t){return function(){return t}}function oS(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],oS(n,n.path)}))}function aS(t){const e=fb(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach((t=>{aS(t)}))}function sS(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:Yk,treemapDice:Uk,treemapSlice:Kk,treemapSliceDice:Zk,treemapSquarify:tS,treemapResquarify:eS},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?Vk().path(e)(t):Vk()(t):Lk(t)}(t,e.path);E(t)?aS(o):oS(o),r?o.sum((t=>e.ignoreParentValue&&t.children?0:Ph(r)(t))).sort(e.sort):o.count(),function(){var t=tS,e=!1,n=1,r=1,i=[0],o=rS,a=rS,s=rS,c=rS,l=rS;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(nS),t}function f(e){var n=i[e.depth],r=e.x0+n,u=e.y0+n,f=e.x1-n,h=e.y1-n;f<r&&(r=f=(r+f)/2),h<u&&(u=h=(u+h)/2),e.x0=r,e.y0=u,e.x1=f,e.y1=h,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),(h-=c(e)-n)<u&&(u=h=(u+h)/2),t(e,r,u,f,h))}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=Ck(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:iS(+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:iS(+t),u):a},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:iS(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"==typeof t?t:iS(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:iS(+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 cS={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};var lS=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))};const uS={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},fS="movePoint",hS=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")))},dS=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},pS=(t,e,n)=>{t.forEach(((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)}))},gS=(t,e,n,r)=>{const i=new Cc({style:n}),o=new Ic({style:r});return e.appendChild(o),t.appendChild(i),[i,o]},yS=(t,e)=>{if(!fb(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},mS=(t,e,n)=>{const r=$M(t,e),i=$M(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function vS(t){return(e,...n)=>A({},t(e,...n),e)}function bS(t){return(e,...n)=>A({},e,t(e,...n))}function xS(t,e){if(!t)return e;if(Array.isArray(t))return t;const{value:n=e}=t,r=function(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}(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}const OS=()=>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=function(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}(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:xS(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})}))};OS.props={};var wS=function(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};const MS=()=>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),h=r.map((t=>f*(t/u))),d=[];let p=t[a]||0;for(let n=0;n<h.length;n+=1){const r=e[n],{data:u}=r,f=wS(r,["data"]),g=xS(u,o);d.push(Object.assign({[a]:p,[s]:h[n],[l]:t[l]||0,[c]:t[c],data:g},f)),p+=h[n]+i}return d};MS.props={};class ES{constructor(t){this.$value=t}static of(t){return new ES(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const kS=vS((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=uu(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"))}}})),SS=vS((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))?[Cf(a)]:[Array.from(new Set(a)),"ordinal"]})();return{encode:{color:i},scale:{color:A({},o,{domain:c,type:l})},legend:{color:A({title:s},a)}}})),PS=vS((()=>({animate:{enterType:"fadeIn"}}))),_S=bS((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),AS=bS((()=>({type:"cell"}))),jS=bS((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]}}})),TS=bS(((t,e=CS,n=LS,r=RS,i={})=>{const{data:o,encode:a,children:s,scale:c,x:l=0,y:u=0,shareData:f=!1,key:h}=t,{value:d}=o,{x:p,y:g}=a,{color:y}=c,{domain:m}=y;return{children:(t,o,a)=>{const{x:c,y}=o,{paddingLeft:v,paddingTop:b,marginLeft:x,marginTop:O}=a,{domain:w}=c.getOptions(),{domain:M}=y.getOptions(),E=Lf(t),k=t.map(e),S=t.map((({x:t,y:e})=>[c.invert(t),y.invert(e)])),P=S.map((([t,e])=>n=>{const{[p]:r,[g]:i}=n;return!(void 0!==p&&r!==t||void 0!==g&&i!==e)})),_=P.map((t=>d.filter(t))),j=f?Sy(_,(t=>t.length)):void 0,T=S.map((([t,e])=>({columnField:p,columnIndex:w.indexOf(t),columnValue:t,columnValuesLength:w.length,rowField:g,rowIndex:M.indexOf(e),rowValue:e,rowValuesLength:M.length}))),C=T.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return E.flatMap((t=>{const[e,o,a,s]=k[t],c=T[t],f=_[t];return C[t].map((y=>{var w,M,{scale:E,key:k,facet:S=!0,axis:P={},legend:_={}}=y,T=function(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}(y,["scale","key","facet","axis","legend"]);const C=(null===(w=null==E?void 0:E.y)||void 0===w?void 0:w.guide)||P.y,N=(null===(M=null==E?void 0:E.x)||void 0===M?void 0:M.guide)||P.x,L={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},R=S?f:0===f.length?[]:d,I={color:{domain:m}},z={x:IS(N,n)(c,R),y:IS(C,r)(c,R)};return Object.assign(Object.assign({key:`${k}-${t}`,data:R,margin:0,x:e+v+l+x,y:o+b+u+O,parentKey:h,width:a,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!R.length,dataDomain:j,scale:A(L,E,I),axis:A({},P,z),legend:!1},T),i)}))}))}}}));function CS(t){const{points:e}=t;return Fu(e)}function NS(t,e){return e.length?A({title:!1,tick:null,label:null},t):A({title:!1,tick:null,label:null,grid:null},t)}function LS(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return NS(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return A({title:s,grid:c},t)}}function RS(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return NS(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return A({title:o,grid:a},t)}}function IS(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const zS=()=>t=>[ES.of(t).call(AS).call(SS).call(PS).call(kS).call(_S).call(jS).call(TS).value()];zS.props={};var DS=function(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};const BS=vS((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),FS=bS((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:h,marginTop:d}=s,{domain:p}=c.getOptions(),{domain:g}=l.getOptions(),y=Lf(t),m=t.map((({points:t})=>Fu(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 y.flatMap((t=>{const[n,a,s,c]=m[t],[l,p]=v[t],g=b[t];return x[t].map((y=>{var m,v;const{scale:b,key:x,encode:O,axis:w,interaction:M}=y,E=DS(y,["scale","key","encode","axis","interaction"]),k=null===(m=null==b?void 0:b.y)||void 0===m?void 0:m.guide,S={x:(P=null===(v=null==b?void 0:b.x)||void 0===v?void 0:v.guide,"function"==typeof P?P:null===P?()=>null:(t,e)=>{const{rowIndex:n,rowValuesLength:r}=t;if(n!==r-1)return NS(P,e)})(g,e),y:$S(k)(g,e)};var P;return Object.assign({data:e,parentKey:o,key:`${x}-${t}`,x:n+u+r+h,y:a+f+i+d,width:s,height:c,margin:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!0,scale:A({x:{facet:!1},y:{facet:!1}},b),axis:A({x:{tickCount:5},y:{tickCount:5}},w,S),legend:!1,encode:A({},O,{x:l,y:p}),interaction:A({},M,{legendFilter:!1})},E)}))}))}}})),WS=bS((t=>{const{encode:e}=t,n=DS(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=DS(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 $S(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return NS(t,n)}}const GS=vS((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),HS=vS((t=>({coordinate:{type:"polar"}}))),VS=t=>{const{encode:e}=t,n=function(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}(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function qS(t){return t=>null}function XS(t){const{points:e}=t,[n,r,i,o]=e,a=Iu(n,o),s=Lu(n,o),c=Bu(s,Lu(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=Du(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d-g*Math.cos(p)-f/2,f,f]}function YS(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 US=()=>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=A({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]=YS(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 KS(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 ZS(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=R(r,t))||void 0===e?void 0:e[0]]})).filter((([,t])=>Mu(t)));return Array.from(uu(e,(t=>i.map((([,e])=>e[t])).join("-"))).values())}function JS(t){return Array.isArray(t)?function(t){return(e,n,r)=>(n,r)=>t.reduce(((t,i)=>0!==t?t:gw(e[n][i],e[r][i])),0)}(t):"function"==typeof t?function(t){return(e,n,r)=>oP((n=>t(e[n])))}(t):"series"===t?eP:"value"===t?nP:"sum"===t?rP:"maxIndex"===t?iP:()=>null}function QS(t,e){for(const n of t)n.sort(e)}function tP(t,e){return(null==e?void 0:e.domain)||Array.from(new Set(t))}function eP(t,e,n){return oP((t=>n[t]))}function nP(t,e,n){return oP((t=>e[t]))}function rP(t,e,n){const r=Lf(t),i=Array.from(uu(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,n.reduce(((t,n)=>t+ +e[n]))])));return oP((t=>o.get(n[t])))}function iP(t,e,n){const r=Lf(t),i=Array.from(uu(r,(t=>n[+t])).entries()),o=new Map(i.map((([t,n])=>[t,KS(n,(t=>e[t]))])));return oP((t=>o.get(n[t])))}function oP(t){return(e,n)=>gw(t(e),t(n))}US.props={};const aP=(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,h]=R(l,"y"),[d,p]=R(l,"y1"),[g]=a?I(l,"series","color"):R(l,"color"),y=ZS(e,t,s),m=JS(n)(c,f,g);m&&QS(y,m);const v=new Array(t.length),b=new Array(t.length),x=new Array(t.length),O=[],w=[];for(const t of y){r&&t.reverse();const e=d?+d[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++;O.push(o[s]),w.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 M=new Set(O),E=new Set(w),k="y"===i?v:b,S="y"===o?v:b;return[t,A({},s,{encode:{y0:T(f,h),y:j(k,h),y1:j(S,p)},style:Object.assign({first:(t,e)=>M.has(e),last:(t,e)=>E.has(e)},u)})]}};function sP(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 cP(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}aP.props={};var lP=Array.prototype,uP=lP.slice;function fP(t){return()=>t}lP.map;const hP=Math.sqrt(50),dP=Math.sqrt(10),pP=Math.sqrt(2);function gP(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>=hP?10:o>=dP?5:o>=pP?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?gP(t,e,2*n):[s,c,l]}function yP(t,e,n){return gP(t=+t,e=+e,n=+n)[2]}function mP(t){return Math.max(1,Math.ceil(Math.log(sP(t))/Math.LN2)+1)}function vP(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?Pw:Sw(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);vP(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(bP(t,n,e),i(t[r],o)>0&&bP(t,n,r);a<s;){for(bP(t,a,s),++a,--s;i(t[a],o)<0;)++a;for(;i(t[s],o)>0;)--s}0===i(t[n],o)?bP(t,n,s):(++s,bP(t,s,r)),s<=e&&(n=s+1),e<=s&&(r=s-1)}return t}function bP(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function xP(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 ky(t);if(e>=1)return Sy(t);var r,i=(r-1)*e,o=Math.floor(i),a=Sy(vP(t,o).subarray(0,o+1));return a+(ky(t.subarray(o+1))-a)*(i-o)}}function OP(t,e){return xP(t,.5,e)}function wP(t,e){return function(t,e,n=bw){if(!isNaN(e=+e)){if(r=Float64Array.from(t,((e,r)=>bw(n(t[r],r,t)))),e<=0)return rE(r);if(e>=1)return KS(r);var r,i=Uint32Array.from(t,((t,e)=>e)),o=r.length-1,a=Math.floor(o*e);return vP(i,a,0,o,((t,e)=>Pw(r[t],r[e]))),a=function(t,e=gw){let n,r=!1;if(1===e.length){let i;for(const o of t){const t=e(o);(r?gw(t,i)>0:0===gw(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}}(t,.5,e)}function MP(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 EP(t){return e=>null===e?t:`${t} of ${e}`}function kP(){return[(t,e)=>nE(t,(t=>+e[t])),EP("mean")]}function SP(){return[(t,e)=>OP(t,(t=>+e[t])),EP("median")]}function PP(){return[(t,e)=>Sy(t,(t=>+e[t])),EP("max")]}function _P(){return[(t,e)=>ky(t,(t=>+e[t])),EP("min")]}function AP(){return[(t,e)=>t.length,EP("count")]}function jP(){return[(t,e)=>MP(t,(t=>+e[t])),EP("sum")]}function TP(){return[(t,e)=>e[t[0]],EP("first")]}function CP(){return[(t,e)=>e[t[t.length-1]],EP("last")]}const NP=(t={})=>{const{groupBy:e}=t,n=function(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}(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:kP,max:PP,count:AP,first:TP,last:CP,sum:jP,min:_P,median:SP}[t];if(!e)throw new Error(`Unknown reducer: ${t}.`);return e()}(e),[s,c]=R(o,t),l=((t,e)=>{if(t)return t;const{from:n}=e;if(!n)return t;const[,r]=R(o,n);return r})(c,e),u=a.map((t=>n(t,null!=s?s:i)));return[t,Object.assign(Object.assign({},N(u,(null==r?void 0:r(l))||l)),{aggregate:!0})]})),c=Object.keys(o).map((t=>{const[e,n]=R(o,t),r=a.map((t=>e[t[0]]));return[t,j(r,n)]})),l=a.map((t=>i[t[0]]));return[Lf(a),A({},r,{data:l,encode:Object.fromEntries([...c,...s])})]}};NP.props={};const LP="thresholds";const RP=(t={})=>{const{groupChannels:e=["color"],binChannels:n=["x","y"]}=t,r=function(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}(t,["groupChannels","binChannels"]),i={};return NP(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter((([t])=>!t.startsWith(LP))))),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]=R(a,t);return e})),c=ku(r,LP),l=t.filter((t=>s.every((e=>Mu(e[t]))))),u=[...e.map((t=>{const[e]=R(a,t);return e})).filter(Mu).map((t=>e=>t[e])),...n.map(((t,e)=>{const n=s[e],r=c[t]||function(t){const[e,n]=Cf(t);return Math.min(200,function(t,e,n){const r=sP(t),i=cP(t);return r&&i?Math.ceil((n-e)*Math.cbrt(r)/(3.49*i)):1}(t,e,n))}(n),o=function(){var t=lu,e=Cf,n=mP;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,s=r.length,c=new Array(s);for(i=0;i<s;++i)c[i]=t(r[i],i,r);var l=e(c),u=l[0],f=l[1],h=n(c,u,f);if(!Array.isArray(h)){const t=f,n=+h;if(e===Cf&&([u,f]=function(t,e,n){let r;for(;;){const i=yP(t,e,n);if(i===r||0===i||!isFinite(i))return[t,e];i>0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}(u,f,n)),h=function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e<t,[i,o,a]=r?gP(e,t,n):gP(t,e,n);if(!(o>=i))return[];const s=o-i+1,c=new Array(s);if(r)if(a<0)for(let t=0;t<s;++t)c[t]=(o-t)/-a;else for(let t=0;t<s;++t)c[t]=(o-t)*a;else if(a<0)for(let t=0;t<s;++t)c[t]=(i+t)/-a;else for(let t=0;t<s;++t)c[t]=(i+t)*a;return c}(u,f,n),h[0]<=u&&(a=yP(u,f,n)),h[h.length-1]>=f)if(t>=f&&e===Cf){const t=yP(u,f,n);isFinite(t)&&(t>0?f=(Math.floor(f/t)+1)*t:t<0&&(f=(Math.ceil(f*-t)+1)/-t))}else h.pop()}for(var d=h.length,p=0,g=d;h[p]<=u;)++p;for(;h[g-1]>f;)--g;(p||g<d)&&(h=h.slice(p,g),d=g-p);var y,m=new Array(d+1);for(i=0;i<=d;++i)(y=m[i]=[]).x0=i>0?h[i-1]:u,y.x1=i<d?h[i]:f;if(isFinite(a)){if(a>0)for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&m[Math.min(d,Math.floor((o-u)/a))].push(r[i]);else if(a<0)for(i=0;i<s;++i)if(null!=(o=c[i])&&u<=o&&o<=f){const t=Math.floor((u-o)*a);m[Math.min(d,t+(h[t]<=o))].push(r[i])}}else for(i=0;i<s;++i)null!=(o=c[i])&&u<=o&&o<=f&&m[Ew(h,o,0,d)].push(r[i]);return m}return r.value=function(e){return arguments.length?(t="function"==typeof e?e:fP(e),r):t},r.domain=function(t){return arguments.length?(e="function"==typeof t?t:fP([t[0],t[1]]),r):e},r.thresholds=function(t){return arguments.length?(n="function"==typeof t?t:fP(Array.isArray(t)?uP.call(t):t),r):n},r}().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(uu(l,(t=>u.map((e=>e(t))).join("-"))).values())}}))};RP.props={};const IP=(t={})=>{const{thresholds:e}=t;return RP(Object.assign(Object.assign({},t),{thresholdsX:e,groupChannels:["color"],binChannels:["x"]}))};IP.props={};const zP=(t={})=>{const{groupBy:e="x",reverse:n=!1,orderBy:r,padding:i}=t;return function(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]])}}(t,["groupBy","reverse","orderBy","padding"]),(t,o)=>{const{data:a,encode:s,scale:c}=o,{series:l}=c,[u]=R(s,"y"),[f]=I(s,"series","color"),h=tP(f,l),d=ZS(e,t,o),p=JS(r)(a,u,f);p&&QS(d,p);const g=new Array(t.length);for(const t of d){n&&t.reverse();for(let e=0;e<t.length;e++)g[t[e]]=h[e]}return[t,A({},o,{scale:{series:{domain:h,paddingInner:i}},encode:{series:j(g)}})]}};function DP(t,e,n){if(null===t)return[-.5,.5];const r=tP(t,e),i=new Xy({domain:r,range:[0,1],padding:n}).getBandWidth();return[-i/2,i/2]}function BP(t,e,n){return e*(1-t)+n*t}zP.props={};const FP=(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]=R(o,"x"),[u]=R(o,"y"),f=DP(l,s,n),h=DP(u,c,r),d=t.map((()=>BP(i(),...h))),p=t.map((()=>BP(i(),...f)));return[t,A({scale:{x:{padding:.5},y:{padding:.5}}},e,{encode:{dy:j(d),dx:j(p)}})]}};FP.props={};const WP=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{x:a}=o,[s]=R(i,"x"),c=DP(s,a,e),l=t.map((()=>BP(n(),...c)));return[t,A({scale:{x:{padding:.5}}},r,{encode:{dx:j(l)}})]}};WP.props={};const $P=(t={})=>{const{padding:e=0,random:n=Math.random}=t;return(t,r)=>{const{encode:i,scale:o}=r,{y:a}=o,[s]=R(i,"y"),c=DP(s,a,e),l=t.map((()=>BP(n(),...c)));return[t,A({scale:{y:{padding:.5}}},r,{encode:{dy:j(l)}})]}};$P.props={};const GP=(t={})=>{const{groupBy:e="x"}=t;return(t,n)=>{const{encode:r}=n,{x:i}=r,o=function(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}(r,["x"]),a=Object.entries(o).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,R(r,t)[0]])),s=a.map((([e])=>[e,new Array(t.length)])),c=ZS(e,t,n),l=new Array(c.length);for(let t=0;t<c.length;t++){const e=c[t].flatMap((t=>a.map((([,e])=>+e[t])))),[n,r]=Cf(e);l[t]=(n+r)/2}const u=Math.max(...l);for(let t=0;t<c.length;t++){const e=u-l[t],n=c[t];for(const t of n)for(let n=0;n<a.length;n++){const[,r]=a[n],[,i]=s[n];i[t]=+r[t]+e}}return[t,A({},n,{encode:Object.fromEntries(s.map((([t,e])=>[t,j(e,R(r,t)[1])])))})]}};GP.props={};const HP=(t={})=>{const{groupBy:e="x",series:n=!0}=t;return(t,r)=>{const{encode:i}=r,[o]=R(i,"y"),[a,s]=R(i,"y1"),[c]=n?I(i,"series","color"):R(i,"color"),l=ZS(e,t,r),u=new Array(t.length);for(const t of l){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)));u[r]=o[r]>i?i:o[r]}}return[t,A({},r,{encode:{y1:j(u,s)}})]}};HP.props={};const VP=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,R(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(uu(n,(e=>t[e])).values());e.push(...r)}l=e}if(r){const[t]=R(s,r);t&&l.sort(((e,r)=>n(e,t)-n(r,t))),i&&l.reverse()}const u=(o||3e3)/l.length,[f]=o?[L(t,u)]:I(s,"enterDuration",L(t,u)),[h]=I(s,"enterDelay",L(t,0)),d=new Array(t.length);for(let t=0,e=0;t<l.length;t++){const n=l[t],r=Sy(n,(t=>+f[t]));for(const t of n)d[t]=+h[t]+e;e+=r}return[t,A({},a,{encode:{enterDuration:C(f),enterDelay:C(d)}})]}};VP.props={};const qP=(t={})=>{const{groupBy:e="x",basis:n="max"}=t;return(t,r)=>{const{encode:i,tooltip:o}=r,{x:a}=i,s=function(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}(i,["x"]),c=Object.entries(s).filter((([t])=>t.startsWith("y"))).map((([t])=>[t,R(i,t)[0]])),[,l]=c.find((([t])=>"y"===t)),u=c.map((([e])=>[e,new Array(t.length)])),f=ZS(e,t,r),h=function(t){return"function"==typeof t?t:{min:(t,e)=>ky(t,(t=>e[+t])),max:(t,e)=>Sy(t,(t=>e[+t])),first:(t,e)=>e[t[0]],last:(t,e)=>e[t[t.length-1]],mean:(t,e)=>nE(t,(t=>e[+t])),median:(t,e)=>OP(t,(t=>e[+t])),sum:(t,e)=>MP(t,(t=>e[+t])),deviation:(t,e)=>cP(t,(t=>e[+t]))}[t]||Sy}(n);for(const t of f){const e=h(t,l);for(const n of t)for(let t=0;t<c.length;t++){const[,r]=c[t],[,i]=u[t];i[n]=+r[n]/e}}const d=ju(o)||(null==o?void 0:o.items)&&0!==(null==o?void 0:o.items.length);return[t,A({},r,Object.assign({encode:Object.fromEntries(u.map((([t,e])=>[t,j(e,R(i,t)[1])])))},!d&&i.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};function XP(t,e){return[t[0]]}function YP(t,e){return[t[t.length-1]]}function UP(t,e){return[t[KS(t,(t=>e[t]))]]}function KP(t,e){return[t[rE(t,(t=>e[t]))]]}qP.props={};const ZP=(t={})=>{const{groupBy:e="series",channel:n,selector:r}=t;return(t,i)=>{const{encode:o}=i,a=ZS(e,t,i),[s]=R(o,n),c=function(t){return"function"==typeof t?t:{first:XP,last:YP,max:UP,min:KP}[t]||XP}(r);return[a.flatMap((t=>c(t,s))),i]}};ZP.props={};const JP=(t={})=>{const{selector:e}=t,n=function(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}(t,["selector"]);return ZP(Object.assign({channel:"x",selector:e},n))};JP.props={};const QP=(t={})=>{const{selector:e}=t,n=function(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}(t,["selector"]);return ZP(Object.assign({channel:"y",selector:e},n))};QP.props={};const t_=(t={})=>{const{channels:e=["x","y"]}=t,n=function(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}(t,["channels"]);return NP(Object.assign(Object.assign({},n),{groupBy:(t,n)=>ZS(e,t,n)}))};t_.props={};const e_=(t={})=>t_(Object.assign(Object.assign({},t),{channels:["x","color","series"]}));e_.props={};const n_=(t={})=>t_(Object.assign(Object.assign({},t),{channels:["y","color","series"]}));n_.props={};const r_=(t={})=>t_(Object.assign(Object.assign({},t),{channels:["color"]}));r_.props={};var i_=function(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};const o_=(t={})=>{const{reverse:e=!1,slice:n,channel:r,ordinal:i=!0}=t,o=i_(t,["reverse","slice","channel","ordinal"]);return(t,a)=>i?function(t,e,n){var r;const{reverse:i,slice:o,channel:a}=n,s=i_(n,["reverse","slice","channel"]),{encode:c,scale:l={}}=e,u=null===(r=l[a])||void 0===r?void 0:r.domain,[f]=R(c,a),h=function(t,e,n){const{by:r=t,reducer:i="max"}=e,[o]=R(n,r);if("function"==typeof i)return t=>i(t,o);if("max"===i)return t=>Sy(t,(t=>+o[t]));if("min"===i)return t=>ky(t,(t=>+o[t]));if("sum"===i)return t=>MP(t,(t=>+o[t]));if("median"===i)return t=>OP(t,(t=>+o[t]));if("mean"===i)return t=>nE(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),d=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=(g=d,m=t=>f[t],(2!==(y=h).length?kw(hu(g,y,m),(([t,e],[n,r])=>gw(e,r)||gw(t,n))):kw(uu(g,m),(([t,e],[n,r])=>y(e,r)||gw(t,n)))).map((([t])=>t)));var g,y,m;i&&p.reverse();const v="number"==typeof o?[0,o]:o,b=o?p.slice(...v):p;return[t,A(e,{scale:{[a]:{domain:b}}})]}(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]=R(o,i),s=kw(t,(t=>a[t]));return r&&s.reverse(),[s,e]}(t,a,Object.assign({reverse:e,slice:n,channel:r},o))};o_.props={};const a_=(t={})=>o_(Object.assign(Object.assign({},t),{channel:"x"}));a_.props={};const s_=(t={})=>o_(Object.assign(Object.assign({},t),{channel:"y"}));s_.props={};const c_=(t={})=>o_(Object.assign(Object.assign({},t),{channel:"color"}));c_.props={};const l_=(t={})=>{const{field:e,channel:n="y",reducer:r="sum"}=t;return(t,i)=>{const{data:o,encode:a}=i,[s]=R(a,"x"),c=e?function(t,e){return"string"==typeof e?t.map((t=>t[e])):t.map(e)}(o,e):R(a,n)[0],l=function(t,e){if("function"==typeof t)return n=>t(n,e);if("sum"===t)return t=>MP(t,(t=>+e[t]));throw new Error(`Unknown reducer: ${t}`)}(r,c),u=du(t,l,(t=>s[t])).map((t=>t[1]));return[t,A({},i,{scale:{x:{flex:u}}})]}};function u_(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),h=f*u;for(;h>s;)l+=1,u=a/l,f=Math.ceil(r/l),h=f*u;const d=s-f*u,p=f<=1?0:d/(f-1),[g,y]=f<=1?[(a-o*u)/(o-1),(s-u)/2]:[0,0];return t.map(((t,r)=>{const[i,o,a,s]=Fu(t),c="col"===n?r%l:Math.floor(r/f),h="col"===n?Math.floor(r/l):r%f;return`translate(${c*u-i+g*c+.5*e}, ${(f-h-1)*u+d-o-p*h-y+.5*e}) scale(${(u-e)/a}, ${(u-e)/s})`}))}}l_.props={};const f_=t=>(e,n)=>[e,A({},n,{modifier:u_(t),axis:!1})];function h_(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,h=0;s.push(h);for(let t=0;t<r-2;t++){let e=0,n=0,r=Math.floor((t+1)*c)+1,d=Math.floor((t+2)*c)+1;d=Math.min(d,i);const p=d-r;for(;r<d;r++)e+=o(r),n+=a(r);e/=p,n/=p;let g=Math.floor((t+0)*c)+1;const y=Math.floor((t+1)*c)+1,m=[o(h),a(h)];for(l=u=-1;g<y;g++)u=.5*Math.abs((m[0]-e)*(o(g)-m[1])-(m[0]-a(g))*(n-m[0])),u>l&&(l=u,f=g);s.push(f),h=f}return s.push(i-1),s.map((e=>t[e]))}f_.props={};const d_=(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 h_;const e={first:t=>[t[0]],last:t=>[t[t.length-1]],min:(t,e,n)=>[t[rE(t,(t=>n[t]))]],max:(t,e,n)=>[t[KS(t,(t=>n[t]))]],median:(t,e,n)=>[t[wP(t,(t=>n[t]))]]},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=ZS(r,t,e),[s]=R(o,"x"),[c]=R(o,"y");return[a.flatMap((t=>i(t,s,c,n))),e]}};d_.props={};const p_=(t={})=>(e,n)=>{const{encode:r,data:i}=n,o=Object.entries(t).map((([t,e])=>{const[n]=R(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(Mu);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,A({},n,{encode:Object.fromEntries(c),data:a.map((t=>i[t]))})]};p_.props={};var g_={},y_={};function m_(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function v_(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 b_(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function x_(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 y_;if(l)return l=!1,g_;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())!==y_;){for(var f=[];r!==g_&&r!==y_;)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?(r=(n=t).getUTCHours(),i=n.getUTCMinutes(),o=n.getUTCSeconds(),a=n.getUTCMilliseconds(),isNaN(n)?"Invalid Date":function(t){return t<0?"-"+b_(-t,6):t>9999?"+"+b_(t,6):b_(t,4)}(n.getUTCFullYear())+"-"+b_(n.getUTCMonth()+1,2)+"-"+b_(n.getUTCDate(),2)+(a?"T"+b_(r,2)+":"+b_(i,2)+":"+b_(o,2)+"."+b_(a,3)+"Z":o?"T"+b_(r,2)+":"+b_(i,2)+":"+b_(o,2)+"Z":i||r?"T"+b_(r,2)+":"+b_(i,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var n,r,i,o,a}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=m_(t);return function(r,i){return e(n(r),i,t)}}(t,e):m_(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=v_(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=v_(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function O_(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;w_&&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 w_=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours();const M_=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>{return t=void 0,o=void 0,s=function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return x_(r).parse(e,i?O_:vu)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)},new((a=void 0)||(a=Promise))((function(e,n){function r(t){try{c(s.next(t))}catch(t){n(t)}}function i(t){try{c(s.throw(t))}catch(t){n(t)}}function c(t){t.done?e(t.value):function(t){return t instanceof a?t:new a((function(e){e(t)}))}(t.value).then(r,i)}c((s=s.apply(t,o||[])).next())}));var t,o,a,s}};M_.props={};const E_=t=>{const{value:e}=t;return()=>e};E_.props={};const k_=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)))};k_.props={};const S_=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};function P_(t){return null!=t&&!Number.isNaN(t)}S_.props={};const __=t=>{const{callback:e=P_}=t;return t=>t.filter(e)};__.props={};const A_=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)))};A_.props={};const j_=t=>e=>{return t&&(n=t,0!==Object.keys(n).length)?e.map((e=>Object.entries(e).reduce(((e,[n,r])=>(e[t[n]||n]=r,e)),{}))):e;var n};j_.props={};const T_=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}};T_.props={};const C_=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};C_.props={};const N_=t=>{const{callback:e=vu}=t;return t=>e(t)};N_.props={};const L_=t=>{const{callback:e=vu}=t;return t=>Array.isArray(t)?t.map(e):t};function R_(t){return"string"==typeof t?e=>e[t]:t}L_.props={};const I_=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=R_(s),l=R_(a),u=hu(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)),{}))}))};I_.props={};var z_=n(3761),D_=n.n(z_);const B_=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(uu(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=D_().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})}))}};B_.props={};const F_=()=>t=>(console.log("G2 data section:",t),t);F_.props={};const W_=Math.PI/180,$_=64,G_=2048;function H_(t){return t.text}function V_(){return"serif"}function q_(){return"normal"}function X_(t){return t.value}function Y_(){return 90*~~(2*Math.random())}function U_(){return 1}function K_(){}function Z_(t,e,n,r){if(e.sprite)return;const i=t.context,o=t.ratio;i.clearRect(0,0,($_<<5)/o,G_/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*W_),r=Math.cos(e.rotate*W_),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>=$_<<5&&(a=0,s+=c,c=0),s+l>=G_)break;i.translate((a+(t>>1))/o,(s+(l>>1))/o),e.rotate&&i.rotate(e.rotate*W_),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,($_<<5)/o,G_/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)*($_<<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 J_(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 Q_(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 tA(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0<e[1].x&&t.y+t.y1>e[0].y&&t.y+t.y0<e[1].y}function eA(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function nA(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function rA(){return document.createElement("canvas")}function iA(t){return"function"==typeof t?t:function(){return t}}const oA={archimedean:eA,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 aA(){let t=[256,256],e=H_,n=V_,r=X_,i=q_,o=Y_,a=U_,s=eA,c=Math.random,l=K_,u=[],f=null,h=1/0;const d=q_,p=rA,g={};function y(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,h,d,p=-u;for(;(f=l(p+=u))&&(h=~~f[0],d=~~f[1],!(Math.min(Math.abs(h),Math.abs(d))>=a));)if(n.x=i+h,n.y=o+d,!(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1])&&(!r||!J_(n,e,t[0]))&&(!r||tA(n,r))){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}return!1}return g.start=function(){const[s,m]=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=($_<<5)/e,t.height=G_/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:nA((t[0]>>5)*t[1]),x=u.length,O=[],w=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=d.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 M=-1,E=g.board?[{x:0,y:0},{x:s,y:m}]:void 0;function k(){const e=Date.now();for(;Date.now()-e<h&&++M<x;){const e=w[M];e.x=s*(c()+.5)>>1,e.y=m*(c()+.5)>>1,Z_(v,e,w,M),e.hasText&&y(b,e,E)&&(l.call(null,"word",{cloud:g,word:e}),O.push(e),E?g.hasImage||Q_(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=O,g._bounds=E,M>=x&&(g.stop(),l.call(null,"end",{cloud:g,words:O,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=nA((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){h=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=iA(t)},g.font=function(t){n=iA(t)},g.fontWeight=function(t){i=iA(t)},g.rotate=function(t){o=iA(t)},g.spiral=function(t){s=oA[t]||t},g.fontSize=function(t){r=iA(t)},g.padding=function(t){a=iA(t)},g.random=function(t){c=iA(t)},g.on=function(t){l=iA(t)},g}const sA={fontSize:[20,60],font:"Impact",padding:2,rotate:function(){return 30*(~~(6*Math.random())-3)}};function cA(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 lA=t=>e=>{return n=void 0,r=void 0,o=function*(){const n=Object.assign({},sA,t),r=aA();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 r=this,a=void 0,c=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},new((s=void 0)||(s=Promise))((function(t,e){function n(t){try{o(c.next(t))}catch(t){e(t)}}function i(t){try{o(c.throw(t))}catch(t){e(t)}}function o(e){e.done?t(e.value):function(t){return t instanceof s?t:new s((function(e){e(t)}))}(e.value).then(n,i)}o((c=c.apply(r,a||[])).next())}));var r,a,s,c}}).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,[ky(n),Sy(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",cA,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:h}=a,d=f.map((t=>{var{x:e,y:n,font:r}=t,i=function(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}(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:y,y:m}]=u,v={text:"",value:0,opacity:0,fontSize:0};return d.push(Object.assign(Object.assign({},v),{x:h?0:p,y:h?0:g}),Object.assign(Object.assign({},v),{x:h?s:y,y:h?c:m})),d},new((i=void 0)||(i=Promise))((function(t,e){function a(t){try{c(o.next(t))}catch(t){e(t)}}function s(t){try{c(o.throw(t))}catch(t){e(t)}}function c(e){e.done?t(e.value):function(t){return t instanceof i?t:new i((function(e){e(t)}))}(e.value).then(a,s)}c((o=o.apply(n,r||[])).next())}));var n,r,i,o};function uA(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function fA(t,e){const[n,r]=t,[i,o]=e;return n>=i[0]&&n<=o[0]&&r>=i[1]&&r<=o[1]}lA.props={};function hA([t,e],[n,r]){return r>t&&e>n}function dA(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function pA(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}}function gA(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function yA(t,e,n){return.2126*gA(t)+.7152*gA(e)+.0722*gA(n)}function mA(t,e){const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=yA(n,r,i),l=yA(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}const vA=t=>t;function bA(t,e){t&&OA.hasOwnProperty(t.type)&&OA[t.type](t,e)}var xA={Feature:function(t,e){bA(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)bA(n[r].geometry,e)}},OA={Sphere:function(t,e){e.sphere()},Point:function(t,e){t=t.coordinates,e.point(t[0],t[1],t[2])},MultiPoint:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)t=n[r],e.point(t[0],t[1],t[2])},LineString:function(t,e){wA(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)wA(n[r],e,0)},Polygon:function(t,e){MA(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)MA(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)bA(n[r],e)}};function wA(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1],r[2]);e.lineEnd()}function MA(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)wA(t[n],e,1);e.polygonEnd()}function EA(t,e){t&&xA.hasOwnProperty(t.type)?xA[t.type](t,e):bA(t,e)}class kA{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const e=this._partials;let n=0;for(let r=0;r<this._n&&r<32;r++){const i=e[r],o=t+i,a=Math.abs(t)<Math.abs(i)?t-(o-i):i-(o-t);a&&(e[n++]=a),t=o}return e[n]=t,this._n=n+1,this}valueOf(){const t=this._partials;let e,n,r,i=this._n,o=0;if(i>0){for(o=t[--i];i>0&&(e=o,n=t[--i],o=e+n,r=n-(o-e),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(n=2*r,e=o+n,n==e-o&&(o=e))}return o}}var SA=1e-6,PA=1e-12,_A=Math.PI,AA=_A/2,jA=_A/4,TA=2*_A,CA=180/_A,NA=_A/180,LA=Math.abs,RA=Math.atan,IA=Math.atan2,zA=Math.cos,DA=Math.ceil,BA=Math.exp,FA=(Math.floor,Math.hypot,Math.log),WA=Math.pow,$A=Math.sin,GA=Math.sign||function(t){return t>0?1:t<0?-1:0},HA=Math.sqrt,VA=Math.tan;function qA(t){return t>1?0:t<-1?_A:Math.acos(t)}function XA(t){return t>1?AA:t<-1?-AA:Math.asin(t)}function YA(){}var UA,KA,ZA,JA,QA=new kA,tj=new kA,ej={point:YA,lineStart:YA,lineEnd:YA,polygonStart:function(){ej.lineStart=nj,ej.lineEnd=oj},polygonEnd:function(){ej.lineStart=ej.lineEnd=ej.point=YA,QA.add(LA(tj)),tj=new kA},result:function(){var t=QA/2;return QA=new kA,t}};function nj(){ej.point=rj}function rj(t,e){ej.point=ij,UA=ZA=t,KA=JA=e}function ij(t,e){tj.add(JA*t-ZA*e),ZA=t,JA=e}function oj(){ij(UA,KA)}const aj=ej;var sj=1/0,cj=sj,lj=-sj,uj=lj,fj={point:function(t,e){t<sj&&(sj=t),t>lj&&(lj=t),e<cj&&(cj=e),e>uj&&(uj=e)},lineStart:YA,lineEnd:YA,polygonStart:YA,polygonEnd:YA,result:function(){var t=[[sj,cj],[lj,uj]];return lj=uj=-(cj=sj=1/0),t}};const hj=fj;var dj,pj,gj,yj,mj=0,vj=0,bj=0,xj=0,Oj=0,wj=0,Mj=0,Ej=0,kj=0,Sj={point:Pj,lineStart:_j,lineEnd:Tj,polygonStart:function(){Sj.lineStart=Cj,Sj.lineEnd=Nj},polygonEnd:function(){Sj.point=Pj,Sj.lineStart=_j,Sj.lineEnd=Tj},result:function(){var t=kj?[Mj/kj,Ej/kj]:wj?[xj/wj,Oj/wj]:bj?[mj/bj,vj/bj]:[NaN,NaN];return mj=vj=bj=xj=Oj=wj=Mj=Ej=kj=0,t}};function Pj(t,e){mj+=t,vj+=e,++bj}function _j(){Sj.point=Aj}function Aj(t,e){Sj.point=jj,Pj(gj=t,yj=e)}function jj(t,e){var n=t-gj,r=e-yj,i=HA(n*n+r*r);xj+=i*(gj+t)/2,Oj+=i*(yj+e)/2,wj+=i,Pj(gj=t,yj=e)}function Tj(){Sj.point=Pj}function Cj(){Sj.point=Lj}function Nj(){Rj(dj,pj)}function Lj(t,e){Sj.point=Rj,Pj(dj=gj=t,pj=yj=e)}function Rj(t,e){var n=t-gj,r=e-yj,i=HA(n*n+r*r);xj+=i*(gj+t)/2,Oj+=i*(yj+e)/2,wj+=i,Mj+=(i=yj*t-gj*e)*(gj+t),Ej+=i*(yj+e),kj+=3*i,Pj(gj=t,yj=e)}const Ij=Sj;function zj(t){this._context=t}zj.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,TA)}},result:YA};var Dj,Bj,Fj,Wj,$j,Gj=new kA,Hj={point:YA,lineStart:function(){Hj.point=Vj},lineEnd:function(){Dj&&qj(Bj,Fj),Hj.point=YA},polygonStart:function(){Dj=!0},polygonEnd:function(){Dj=null},result:function(){var t=+Gj;return Gj=new kA,t}};function Vj(t,e){Hj.point=qj,Bj=Wj=t,Fj=$j=e}function qj(t,e){Wj-=t,$j-=e,Gj.add(HA(Wj*Wj+$j*$j)),Wj=t,$j=e}const Xj=Hj;let Yj,Uj,Kj,Zj;class Jj{constructor(t){this._append=null==t?Qj:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return Qj;if(e!==Yj){const t=10**e;Yj=e,Uj=function(e){let n=1;this._+=e[0];for(const r=e.length;n<r;++n)this._+=Math.round(arguments[n]*t)/t+e[n]}}return Uj}(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){0===this._line&&(this._+="Z"),this._point=NaN}point(t,e){switch(this._point){case 0:this._append`M${t},${e}`,this._point=1;break;case 1:this._append`L${t},${e}`;break;default:if(this._append`M${t},${e}`,this._radius!==Kj||this._append!==Uj){const t=this._radius,e=this._;this._="",this._append`m0,${t}a${t},${t} 0 1,1 0,${-2*t}a${t},${t} 0 1,1 0,${2*t}z`,Kj=t,Uj=this._append,Zj=this._,this._=e}this._+=Zj}}result(){const t=this._;return this._="",t.length?t:null}}function Qj(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function tT(t,e){let n,r,i=3,o=4.5;function a(t){return t&&("function"==typeof o&&r.pointRadius(+o.apply(this,arguments)),EA(t,n(r))),r.result()}return a.area=function(t){return EA(t,n(aj)),aj.result()},a.measure=function(t){return EA(t,n(Xj)),Xj.result()},a.bounds=function(t){return EA(t,n(hj)),hj.result()},a.centroid=function(t){return EA(t,n(Ij)),Ij.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,vA):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new Jj(i)):new zj(e=t),"function"!=typeof o&&r.pointRadius(o),a):e},a.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(r.pointRadius(+t),+t),a):o},a.digits=function(t){if(!arguments.length)return i;if(null==t)i=null;else{const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);i=e}return null===e&&(r=new Jj(i)),a},a.projection(t).digits(i).context(e)}function eT(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r<i;)o[r]=t+r*n;return o}function nT(t,e,n){var r=eT(t,e-SA,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function rT(t,e,n){var r=eT(t,e-SA,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function iT(t,e,n={},r=!1){if(ju(t))return t;if(Array.isArray(t)&&r)return t;const i=ku(t,e);return A(n,i)}function oT(t,e={}){return ju(t)||Array.isArray(t)?t:aT(t)?A(e,t):t}function aT(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}function sT(t,e){return"object"==typeof t?ku(t,e):t}function cT(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:YA,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function lT(t,e){return LA(t[0]-e[0])<SA&&LA(t[1]-e[1])<SA}function uT(t,e,n,r){this.x=t,this.z=e,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function fT(t,e,n,r,i){var o,a,s=[],c=[];if(t.forEach((function(t){if(!((e=t.length-1)<=0)){var e,n,r=t[0],a=t[e];if(lT(r,a)){if(!r[2]&&!a[2]){for(i.lineStart(),o=0;o<e;++o)i.point((r=t[o])[0],r[1]);return void i.lineEnd()}a[0]+=2*SA}s.push(n=new uT(r,t,null,!0)),c.push(n.o=new uT(r,null,n,!1)),s.push(n=new uT(a,t,null,!1)),c.push(n.o=new uT(a,null,n,!0))}})),s.length){for(c.sort(e),hT(s),hT(c),o=0,a=c.length;o<a;++o)c[o].e=n=!n;for(var l,u,f=s[0];;){for(var h=f,d=!0;h.v;)if((h=h.n)===f)return;l=h.z,i.lineStart();do{if(h.v=h.o.v=!0,h.e){if(d)for(o=0,a=l.length;o<a;++o)i.point((u=l[o])[0],u[1]);else r(h.x,h.n.x,1,i);h=h.n}else{if(d)for(l=h.p.z,o=l.length-1;o>=0;--o)i.point((u=l[o])[0],u[1]);else r(h.x,h.p.x,-1,i);h=h.p}l=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function hT(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.n=n=t[r],n.p=i,i=n;i.n=n=t[0],n.p=i}}function dT(t){return[IA(t[1],t[0]),XA(t[2])]}function pT(t){var e=t[0],n=t[1],r=zA(n);return[r*zA(e),r*$A(e),$A(n)]}function gT(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function yT(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function mT(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function vT(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function bT(t){var e=HA(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function xT(t){return LA(t[0])<=_A?t[0]:GA(t[0])*((LA(t[0])+_A)%TA-_A)}function OT(t){return Array.from(function*(t){for(const e of t)yield*e}(t))}function wT(t,e,n,r){return function(i){var o,a,s,c=e(i),l=cT(),u=e(l),f=!1,h={point:d,lineStart:g,lineEnd:y,polygonStart:function(){h.point=m,h.lineStart=v,h.lineEnd=b,a=[],o=[]},polygonEnd:function(){h.point=d,h.lineStart=g,h.lineEnd=y,a=OT(a);var t=function(t,e){var n=xT(e),r=e[1],i=$A(r),o=[$A(n),-zA(n),0],a=0,s=0,c=new kA;1===i?r=AA+SA:-1===i&&(r=-AA-SA);for(var l=0,u=t.length;l<u;++l)if(h=(f=t[l]).length)for(var f,h,d=f[h-1],p=xT(d),g=d[1]/2+jA,y=$A(g),m=zA(g),v=0;v<h;++v,p=x,y=w,m=M,d=b){var b=f[v],x=xT(b),O=b[1]/2+jA,w=$A(O),M=zA(O),E=x-p,k=E>=0?1:-1,S=k*E,P=S>_A,_=y*w;if(c.add(IA(_*k*$A(S),m*M+_*zA(S))),a+=P?E+k*TA:E,P^p>=n^x>=n){var A=yT(pT(d),pT(b));bT(A);var j=yT(o,A);bT(j);var T=(P^E>=0?-1:1)*XA(j[2]);(r>T||r===T&&(A[0]||A[1]))&&(s+=P^E>=0?1:-1)}}return(a<-SA||a<SA&&c<-PA)^1&s}(o,r);a.length?(f||(i.polygonStart(),f=!0),fT(a,ET,t,n,i)):t&&(f||(i.polygonStart(),f=!0),i.lineStart(),n(null,null,1,i),i.lineEnd()),f&&(i.polygonEnd(),f=!1),a=o=null},sphere:function(){i.polygonStart(),i.lineStart(),n(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function d(e,n){t(e,n)&&i.point(e,n)}function p(t,e){c.point(t,e)}function g(){h.point=p,c.lineStart()}function y(){h.point=d,c.lineEnd()}function m(t,e){s.push([t,e]),u.point(t,e)}function v(){u.lineStart(),s=[]}function b(){m(s[0][0],s[0][1]),u.lineEnd();var t,e,n,r,c=u.clean(),h=l.result(),d=h.length;if(s.pop(),o.push(s),s=null,d)if(1&c){if((e=(n=h[0]).length-1)>0){for(f||(i.polygonStart(),f=!0),i.lineStart(),t=0;t<e;++t)i.point((r=n[t])[0],r[1]);i.lineEnd()}}else d>1&&2&c&&h.push(h.pop().concat(h.shift())),a.push(h.filter(MT))}return h}}function MT(t){return t.length>1}function ET(t,e){return((t=t.x)[0]<0?t[1]-AA-SA:AA-t[1])-((e=e.x)[0]<0?e[1]-AA-SA:AA-e[1])}const kT=wT((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?_A:-_A,c=LA(o-n);LA(c-_A)<SA?(t.point(n,r=(r+a)/2>0?AA:-AA),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&c>=_A&&(LA(n-i)<SA&&(n-=i*SA),LA(o-s)<SA&&(o-=s*SA),r=function(t,e,n,r){var i,o,a=$A(t-n);return LA(a)>SA?RA(($A(e)*(o=zA(r))*$A(n)-$A(r)*(i=zA(e))*$A(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*AA,r.point(-_A,i),r.point(0,i),r.point(_A,i),r.point(_A,0),r.point(_A,-i),r.point(0,-i),r.point(-_A,-i),r.point(-_A,0),r.point(-_A,i);else if(LA(t[0]-e[0])>SA){var o=t[0]<e[0]?_A:-_A;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-_A,-AA]);function ST(t,e){(e=pT(e))[0]-=t,bT(e);var n=qA(-e[1]);return((-e[2]<0?-n:n)+TA-SA)%TA}var PT=1e9,_T=-PT;function AT(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,s,l){var u=0,f=0;if(null==i||(u=a(i,s))!==(f=a(o,s))||c(i,o)<0^s>0)do{l.point(0===u||3===u?t:n,u>1?r:e)}while((u=(u+s+4)%4)!==f);else l.point(o[0],o[1])}function a(r,i){return LA(r[0]-t)<SA?i>0?0:3:LA(r[0]-n)<SA?i>0?2:1:LA(r[1]-e)<SA?i>0?1:0:i>0?3:2}function s(t,e){return c(t.x,e.x)}function c(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var c,l,u,f,h,d,p,g,y,m,v,b=a,x=cT(),O={point:w,lineStart:function(){O.point=M,l&&l.push(u=[]),m=!0,y=!1,p=g=NaN},lineEnd:function(){c&&(M(f,h),d&&y&&x.rejoin(),c.push(x.result())),O.point=w,y&&b.lineEnd()},polygonStart:function(){b=x,c=[],l=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=l.length;n<i;++n)for(var o,a,s=l[n],c=1,u=s.length,f=s[0],h=f[0],d=f[1];c<u;++c)o=h,a=d,h=(f=s[c])[0],d=f[1],a<=r?d>r&&(h-o)*(r-a)>(d-a)*(t-o)&&++e:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--e;return e}(),n=v&&e,i=(c=OT(c)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&fT(c,s,e,o,a),a.polygonEnd()),b=a,c=l=u=null}};function w(t,e){i(t,e)&&b.point(t,e)}function M(o,a){var s=i(o,a);if(l&&u.push([o,a]),m)f=o,h=a,d=s,m=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&y)b.point(o,a);else{var c=[p=Math.max(_T,Math.min(PT,p)),g=Math.max(_T,Math.min(PT,g))],x=[o=Math.max(_T,Math.min(PT,o)),a=Math.max(_T,Math.min(PT,a))];!function(t,e,n,r,i,o){var a,s=t[0],c=t[1],l=0,u=1,f=e[0]-s,h=e[1]-c;if(a=n-s,f||!(a>0)){if(a/=f,f<0){if(a<l)return;a<u&&(u=a)}else if(f>0){if(a>u)return;a>l&&(l=a)}if(a=i-s,f||!(a<0)){if(a/=f,f<0){if(a>u)return;a>l&&(l=a)}else if(f>0){if(a<l)return;a<u&&(u=a)}if(a=r-c,h||!(a>0)){if(a/=h,h<0){if(a<l)return;a<u&&(u=a)}else if(h>0){if(a>u)return;a>l&&(l=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>u)return;a>l&&(l=a)}else if(h>0){if(a<l)return;a<u&&(u=a)}return l>0&&(t[0]=s+l*f,t[1]=c+l*h),u<1&&(e[0]=s+u*f,e[1]=c+u*h),!0}}}}}(c,x,t,e,n,r)?s&&(b.lineStart(),b.point(o,a),v=!1):(y||(b.lineStart(),b.point(c[0],c[1])),b.point(x[0],x[1]),s||b.lineEnd(),v=!1)}p=o,g=a,y=s}return O}}function jT(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return(n=e.invert(n,r))&&t.invert(n[0],n[1])}),n}function TT(t,e){return LA(t)>_A&&(t-=Math.round(t/TA)*TA),[t,e]}function CT(t,e,n){return(t%=TA)?e||n?jT(LT(t),RT(e,n)):LT(t):e||n?RT(e,n):TT}function NT(t){return function(e,n){return LA(e+=t)>_A&&(e-=Math.round(e/TA)*TA),[e,n]}}function LT(t){var e=NT(t);return e.invert=NT(-t),e}function RT(t,e){var n=zA(t),r=$A(t),i=zA(e),o=$A(e);function a(t,e){var a=zA(e),s=zA(t)*a,c=$A(t)*a,l=$A(e),u=l*n+s*r;return[IA(c*i-u*o,s*n-l*r),XA(u*i+c*o)]}return a.invert=function(t,e){var a=zA(e),s=zA(t)*a,c=$A(t)*a,l=$A(e),u=l*i-c*o;return[IA(c*i+l*o,s*n+u*r),XA(u*n-s*r)]},a}function IT(t){return function(e){var n=new zT;for(var r in t)n[r]=t[r];return n.stream=e,n}}function zT(){}function DT(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),EA(n,t.stream(hj)),e(hj.result()),null!=r&&t.clipExtent(r),t}function BT(t,e,n){return DT(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,s=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,s])}),n)}function FT(t,e,n){return BT(t,[[0,0],e],n)}function WT(t,e,n){return DT(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function $T(t,e,n){return DT(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}TT.invert=TT,zT.prototype={constructor:zT,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var GT=16,HT=zA(30*NA);function VT(t,e){return+e?function(t,e){function n(r,i,o,a,s,c,l,u,f,h,d,p,g,y){var m=l-r,v=u-i,b=m*m+v*v;if(b>4*e&&g--){var x=a+h,O=s+d,w=c+p,M=HA(x*x+O*O+w*w),E=XA(w/=M),k=LA(LA(w)-1)<SA||LA(o-f)<SA?(o+f)/2:IA(O,x),S=t(k,E),P=S[0],_=S[1],A=P-r,j=_-i,T=v*A-m*j;(T*T/b>e||LA((m*A+v*j)/b-.5)>.3||a*h+s*d+c*p<HT)&&(n(r,i,o,a,s,c,P,_,k,x/=M,O/=M,w,g,y),y.point(P,_),n(P,_,k,x,O,w,l,u,f,h,d,p,g,y))}}return function(e){var r,i,o,a,s,c,l,u,f,h,d,p,g={point:y,lineStart:m,lineEnd:b,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=m}};function y(n,r){n=t(n,r),e.point(n[0],n[1])}function m(){u=NaN,g.point=v,e.lineStart()}function v(r,i){var o=pT([r,i]),a=t(r,i);n(u,f,l,h,d,p,u=a[0],f=a[1],l=r,h=o[0],d=o[1],p=o[2],GT,e),e.point(u,f)}function b(){g.point=y,e.lineEnd()}function x(){m(),g.point=O,g.lineEnd=w}function O(t,e){v(r=t,e),i=u,o=f,a=h,s=d,c=p,g.point=v}function w(){n(u,f,l,h,d,p,i,o,r,a,s,c,GT,e),g.lineEnd=b,b()}return g}}(t,e):function(t){return IT({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var qT=IT({point:function(t,e){this.stream.point(t*NA,e*NA)}});function XT(t,e,n,r,i,o){if(!o)return function(t,e,n,r,i){function o(o,a){return[e+t*(o*=r),n-t*(a*=i)]}return o.invert=function(o,a){return[(o-e)/t*r,(n-a)/t*i]},o}(t,e,n,r,i);var a=zA(o),s=$A(o),c=a*t,l=s*t,u=a/t,f=s/t,h=(s*n-a*e)/t,d=(s*e+a*n)/t;function p(t,o){return[c*(t*=r)-l*(o*=i)+e,n-l*t-c*o]}return p.invert=function(t,e){return[r*(u*t-f*e+h),i*(d-f*t-u*e)]},p}function YT(t){return UT((function(){return t}))()}function UT(t){var e,n,r,i,o,a,s,c,l,u,f=150,h=480,d=250,p=0,g=0,y=0,m=0,v=0,b=0,x=1,O=1,w=null,M=kT,E=null,k=vA,S=.5;function P(t){return c(t[0]*NA,t[1]*NA)}function _(t){return(t=c.invert(t[0],t[1]))&&[t[0]*CA,t[1]*CA]}function A(){var t=XT(f,0,0,x,O,b).apply(null,e(p,g)),r=XT(f,h-t[0],d-t[1],x,O,b);return n=CT(y,m,v),s=jT(e,r),c=jT(n,s),a=VT(s,S),j()}function j(){return l=u=null,P}return P.stream=function(t){return l&&u===t?l:l=qT(function(t){return IT({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(M(a(k(u=t)))))},P.preclip=function(t){return arguments.length?(M=t,w=void 0,j()):M},P.postclip=function(t){return arguments.length?(k=t,E=r=i=o=null,j()):k},P.clipAngle=function(t){return arguments.length?(M=+t?function(t){var e=zA(t),n=2*NA,r=e>0,i=LA(e)>SA;function o(t,n){return zA(t)*zA(n)>e}function a(t,n,r){var i=[1,0,0],o=yT(pT(t),pT(n)),a=gT(o,o),s=o[0],c=a-s*s;if(!c)return!r&&t;var l=e*a/c,u=-e*s/c,f=yT(i,o),h=vT(i,l);mT(h,vT(o,u));var d=f,p=gT(h,d),g=gT(d,d),y=p*p-g*(gT(h,h)-1);if(!(y<0)){var m=HA(y),v=vT(d,(-p-m)/g);if(mT(v,h),v=dT(v),!r)return v;var b,x=t[0],O=n[0],w=t[1],M=n[1];O<x&&(b=x,x=O,O=b);var E=O-x,k=LA(E-_A)<SA;if(!k&&M<w&&(b=w,w=M,M=b),k||E<SA?k?w+M>0^v[1]<(LA(v[0]-x)<SA?w:M):w<=v[1]&&v[1]<=M:E>_A^(x<=v[0]&&v[0]<=O)){var S=vT(d,(-p+m)/g);return mT(S,h),[v,dT(S)]}}}function s(e,n){var i=r?t:_A-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return wT(o,(function(t){var e,n,c,l,u;return{lineStart:function(){l=c=!1,u=1},point:function(f,h){var d,p=[f,h],g=o(f,h),y=r?g?0:s(f,h):g?s(f+(f<0?_A:-_A),h):0;if(!e&&(l=c=g)&&t.lineStart(),g!==c&&(!(d=a(e,p))||lT(e,d)||lT(p,d))&&(p[2]=1),g!==c)u=0,g?(t.lineStart(),d=a(p,e),t.point(d[0],d[1])):(d=a(e,p),t.point(d[0],d[1],2),t.lineEnd()),e=d;else if(i&&e&&r^g){var m;y&n||!(m=a(p,e,!0))||(u=0,r?(t.lineStart(),t.point(m[0][0],m[0][1]),t.point(m[1][0],m[1][1]),t.lineEnd()):(t.point(m[1][0],m[1][1]),t.lineEnd(),t.lineStart(),t.point(m[0][0],m[0][1],3)))}!g||e&&lT(e,p)||t.point(p[0],p[1]),e=p,c=g,n=y},lineEnd:function(){c&&t.lineEnd(),e=null},clean:function(){return u|(l&&c)<<1}}}),(function(e,r,i,o){!function(t,e,n,r,i,o){if(n){var a=zA(e),s=$A(e),c=r*n;null==i?(i=e+r*TA,o=e-c/2):(i=ST(a,i),o=ST(a,o),(r>0?i<o:i>o)&&(i+=r*TA));for(var l,u=i;r>0?u>o:u<o;u-=c)l=dT([a,-s*zA(u),-s*$A(u)]),t.point(l[0],l[1])}}(o,t,n,i,e,r)}),r?[0,-t]:[-_A,t-_A])}(w=t*NA):(w=null,kT),j()):w*CA},P.clipExtent=function(t){return arguments.length?(k=null==t?(E=r=i=o=null,vA):AT(E=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),j()):null==E?null:[[E,r],[i,o]]},P.scale=function(t){return arguments.length?(f=+t,A()):f},P.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],A()):[h,d]},P.center=function(t){return arguments.length?(p=t[0]%360*NA,g=t[1]%360*NA,A()):[p*CA,g*CA]},P.rotate=function(t){return arguments.length?(y=t[0]%360*NA,m=t[1]%360*NA,v=t.length>2?t[2]%360*NA:0,A()):[y*CA,m*CA,v*CA]},P.angle=function(t){return arguments.length?(b=t%360*NA,A()):b*CA},P.reflectX=function(t){return arguments.length?(x=t?-1:1,A()):x<0},P.reflectY=function(t){return arguments.length?(O=t?-1:1,A()):O<0},P.precision=function(t){return arguments.length?(a=VT(s,S=t*t),j()):HA(S)},P.fitExtent=function(t,e){return BT(P,t,e)},P.fitSize=function(t,e){return FT(P,t,e)},P.fitWidth=function(t,e){return WT(P,t,e)},P.fitHeight=function(t,e){return $T(P,t,e)},function(){return e=t.apply(this,arguments),P.invert=e.invert&&_,A()}}function KT(t){var e=0,n=_A/3,r=UT(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*NA,n=t[1]*NA):[e*CA,n*CA]},i}function ZT(t,e){var n=$A(t),r=(n+$A(e))/2;if(LA(r)<SA)return function(t){var e=zA(t);function n(t,n){return[t*e,$A(n)/e]}return n.invert=function(t,n){return[t/e,XA(n*e)]},n}(t);var i=1+n*(2*r-n),o=HA(i)/r;function a(t,e){var n=HA(i-2*r*$A(e))/r;return[n*$A(t*=r),o-n*zA(t)]}return a.invert=function(t,e){var n=o-e,a=IA(t,LA(n))*GA(n);return n*r<0&&(a-=_A*GA(t)*GA(n)),[a/r,XA((i-(t*t+n*n)*r*r)/(2*r))]},a}function JT(){return KT(ZT).scale(155.424).center([0,33.6442])}function QT(){return JT().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function tC(){var t,e,n,r,i,o,a=QT(),s=JT().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=JT().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(t,e){o=[t,e]}};function u(t){var e=t[0],a=t[1];return o=null,n.point(e,a),o||(r.point(e,a),o)||(i.point(e,a),o)}function f(){return t=e=null,u}return u.invert=function(t){var e=a.scale(),n=a.translate(),r=(t[0]-n[0])/e,i=(t[1]-n[1])/e;return(i>=.12&&i<.234&&r>=-.425&&r<-.214?s:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:a).invert(t)},u.stream=function(n){return t&&e===n?t:(r=[a.stream(e=n),s.stream(n),c.stream(n)],i=r.length,t={point:function(t,e){for(var n=-1;++n<i;)r[n].point(t,e)},sphere:function(){for(var t=-1;++t<i;)r[t].sphere()},lineStart:function(){for(var t=-1;++t<i;)r[t].lineStart()},lineEnd:function(){for(var t=-1;++t<i;)r[t].lineEnd()},polygonStart:function(){for(var t=-1;++t<i;)r[t].polygonStart()},polygonEnd:function(){for(var t=-1;++t<i;)r[t].polygonEnd()}});var r,i},u.precision=function(t){return arguments.length?(a.precision(t),s.precision(t),c.precision(t),f()):a.precision()},u.scale=function(t){return arguments.length?(a.scale(t),s.scale(.35*t),c.scale(t),u.translate(a.translate())):a.scale()},u.translate=function(t){if(!arguments.length)return a.translate();var e=a.scale(),o=+t[0],u=+t[1];return n=a.translate(t).clipExtent([[o-.455*e,u-.238*e],[o+.455*e,u+.238*e]]).stream(l),r=s.translate([o-.307*e,u+.201*e]).clipExtent([[o-.425*e+SA,u+.12*e+SA],[o-.214*e-SA,u+.234*e-SA]]).stream(l),i=c.translate([o-.205*e,u+.212*e]).clipExtent([[o-.214*e+SA,u+.166*e+SA],[o-.115*e-SA,u+.234*e-SA]]).stream(l),f()},u.fitExtent=function(t,e){return BT(u,t,e)},u.fitSize=function(t,e){return FT(u,t,e)},u.fitWidth=function(t,e){return WT(u,t,e)},u.fitHeight=function(t,e){return $T(u,t,e)},u.scale(1070)}function eC(t){return function(e,n){var r=zA(e),i=zA(n),o=t(r*i);return o===1/0?[2,0]:[o*i*$A(e),o*$A(n)]}}function nC(t){return function(e,n){var r=HA(e*e+n*n),i=t(r),o=$A(i),a=zA(i);return[IA(e*o,r*a),XA(r&&n*o/r)]}}var rC=eC((function(t){return HA(2/(1+t))}));function iC(){return YT(rC).scale(124.75).clipAngle(179.999)}rC.invert=nC((function(t){return 2*XA(t/2)}));var oC=eC((function(t){return(t=qA(t))&&t/$A(t)}));function aC(){return YT(oC).scale(79.4188).clipAngle(179.999)}function sC(t,e){return[t,FA(VA((AA+e)/2))]}function cC(){return lC(sC).scale(961/TA)}function lC(t){var e,n,r,i=YT(t),o=i.center,a=i.scale,s=i.translate,c=i.clipExtent,l=null;function u(){var o=_A*a(),s=i(function(t){function e(e){return(e=t(e[0]*NA,e[1]*NA))[0]*=CA,e[1]*=CA,e}return t=CT(t[0]*NA,t[1]*NA,t.length>2?t[2]*NA:0),e.invert=function(e){return(e=t.invert(e[0]*NA,e[1]*NA))[0]*=CA,e[1]*=CA,e},e}(i.rotate()).invert([0,0]));return c(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===sC?[[Math.max(s[0]-o,l),e],[Math.min(s[0]+o,n),r]]:[[l,Math.max(s[1]-o,e)],[n,Math.min(s[1]+o,r)]])}return i.scale=function(t){return arguments.length?(a(t),u()):a()},i.translate=function(t){return arguments.length?(s(t),u()):s()},i.center=function(t){return arguments.length?(o(t),u()):o()},i.clipExtent=function(t){return arguments.length?(null==t?l=e=n=r=null:(l=+t[0][0],e=+t[0][1],n=+t[1][0],r=+t[1][1]),u()):null==l?null:[[l,e],[n,r]]},u()}function uC(t){return VA((AA+t)/2)}function fC(t,e){var n=zA(t),r=t===e?$A(t):FA(n/zA(e))/FA(uC(e)/uC(t)),i=n*WA(uC(t),r)/r;if(!r)return sC;function o(t,e){i>0?e<-AA+SA&&(e=-AA+SA):e>AA-SA&&(e=AA-SA);var n=i/WA(uC(e),r);return[n*$A(r*t),i-n*zA(r*t)]}return o.invert=function(t,e){var n=i-e,o=GA(r)*HA(t*t+n*n),a=IA(t,LA(n))*GA(n);return n*r<0&&(a-=_A*GA(t)*GA(n)),[a/r,2*RA(WA(i/o,1/r))-AA]},o}function hC(){return KT(fC).scale(109.5).parallels([30,30])}function dC(t,e){return[t,e]}function pC(){return YT(dC).scale(152.63)}function gC(t,e){var n=zA(t),r=t===e?$A(t):(n-zA(e))/(e-t),i=n/r+t;if(LA(r)<SA)return dC;function o(t,e){var n=i-e,o=r*t;return[n*$A(o),i-n*zA(o)]}return o.invert=function(t,e){var n=i-e,o=IA(t,LA(n))*GA(n);return n*r<0&&(o-=_A*GA(t)*GA(n)),[o/r,i-GA(r)*HA(t*t+n*n)]},o}function yC(){return KT(gC).scale(131.154).center([0,13.9389])}oC.invert=nC((function(t){return t})),sC.invert=function(t,e){return[t,2*RA(BA(e))-AA]},dC.invert=dC;var mC=1.340264,vC=-.081106,bC=893e-6,xC=.003796,OC=HA(3)/2;function wC(t,e){var n=XA(OC*$A(e)),r=n*n,i=r*r*r;return[t*zA(n)/(OC*(mC+3*vC*r+i*(7*bC+9*xC*r))),n*(mC+vC*r+i*(bC+xC*r))]}function MC(){return YT(wC).scale(177.158)}function EC(t,e){var n=zA(e),r=zA(t)*n;return[n*$A(t)/r,$A(e)/r]}function kC(){return YT(EC).scale(144.049).clipAngle(60)}function SC(){var t,e,n,r,i,o,a,s=1,c=0,l=0,u=1,f=1,h=0,d=null,p=1,g=1,y=IT({point:function(t,e){var n=b([t,e]);this.stream.point(n[0],n[1])}}),m=vA;function v(){return p=s*u,g=s*f,o=a=null,b}function b(n){var r=n[0]*p,i=n[1]*g;if(h){var o=i*t-r*e;r=r*t+i*e,i=o}return[r+c,i+l]}return b.invert=function(n){var r=n[0]-c,i=n[1]-l;if(h){var o=i*t+r*e;r=r*t-i*e,i=o}return[r/p,i/g]},b.stream=function(t){return o&&a===t?o:o=y(m(a=t))},b.postclip=function(t){return arguments.length?(m=t,d=n=r=i=null,v()):m},b.clipExtent=function(t){return arguments.length?(m=null==t?(d=n=r=i=null,vA):AT(d=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),v()):null==d?null:[[d,n],[r,i]]},b.scale=function(t){return arguments.length?(s=+t,v()):s},b.translate=function(t){return arguments.length?(c=+t[0],l=+t[1],v()):[c,l]},b.angle=function(n){return arguments.length?(e=$A(h=n%360*NA),t=zA(h),v()):h*CA},b.reflectX=function(t){return arguments.length?(u=t?-1:1,v()):u<0},b.reflectY=function(t){return arguments.length?(f=t?-1:1,v()):f<0},b.fitExtent=function(t,e){return BT(b,t,e)},b.fitSize=function(t,e){return FT(b,t,e)},b.fitWidth=function(t,e){return WT(b,t,e)},b.fitHeight=function(t,e){return $T(b,t,e)},b}function PC(t,e){var n=e*e,r=n*n;return[t*(.8707-.131979*n+r*(r*(.003971*n-.001529*r)-.013791)),e*(1.007226+n*(.015085+r*(.028874*n-.044475-.005916*r)))]}function _C(){return YT(PC).scale(175.295)}function AC(t,e){return[zA(e)*$A(t),$A(e)]}function jC(){return YT(AC).scale(249.5).clipAngle(90+SA)}function TC(t,e){var n=zA(e),r=1+zA(t)*n;return[n*$A(t)/r,$A(e)/r]}function CC(){return YT(TC).scale(250).clipAngle(142)}function NC(t,e){return[FA(VA((AA+e)/2)),-t]}function LC(){var t=lC(NC),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)}wC.invert=function(t,e){for(var n,r=e,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=n=(r*(mC+vC*i+o*(bC+xC*i))-e)/(mC+3*vC*i+o*(7*bC+9*xC*i)))*r)*i*i,!(LA(n)<PA));++a);return[OC*t*(mC+3*vC*i+o*(7*bC+9*xC*i))/zA(r),XA($A(r)/OC)]},EC.invert=nC(RA),PC.invert=function(t,e){var n,r=e,i=25;do{var o=r*r,a=o*o;r-=n=(r*(1.007226+o*(.015085+a*(.028874*o-.044475-.005916*a)))-e)/(1.007226+o*(.045255+a*(.259866*o-.311325-.005916*11*a)))}while(LA(n)>SA&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},AC.invert=nC(XA),TC.invert=nC((function(t){return 2*RA(t)})),NC.invert=function(t,e){return[-e,2*RA(BA(t))-AA]};function RC(t){const{data:e}=t;if(Array.isArray(e))return Object.assign(Object.assign({},t),{data:{value:e}});const{type:n}=e;return"graticule10"===n?Object.assign(Object.assign({},t),{data:{value:[function(){var t,e,n,r,i,o,a,s,c,l,u,f,h=10,d=h,p=90,g=360,y=2.5;function m(){return{type:"MultiLineString",coordinates:v()}}function v(){return eT(DA(r/p)*p,n,p).map(u).concat(eT(DA(s/g)*g,a,g).map(f)).concat(eT(DA(e/h)*h,t,h).filter((function(t){return LA(t%p)>SA})).map(c)).concat(eT(DA(o/d)*d,i,d).filter((function(t){return LA(t%g)>SA})).map(l))}return m.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},m.outline=function(){return{type:"Polygon",coordinates:[u(r).concat(f(a).slice(1),u(n).reverse().slice(1),f(s).reverse().slice(1))]}},m.extent=function(t){return arguments.length?m.extentMajor(t).extentMinor(t):m.extentMinor()},m.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],s=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),s>a&&(t=s,s=a,a=t),m.precision(y)):[[r,s],[n,a]]},m.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),m.precision(y)):[[e,o],[t,i]]},m.step=function(t){return arguments.length?m.stepMajor(t).stepMinor(t):m.stepMinor()},m.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],m):[p,g]},m.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],m):[h,d]},m.precision=function(h){return arguments.length?(y=+h,c=nT(o,i,90),l=rT(e,t,y),u=nT(s,a,90),f=rT(r,n,y),m):y},m.extentMajor([[-180,-90+SA],[180,90-SA]]).extentMinor([[-180,-80-SA],[180,80+SA]])}()()]}}):"sphere"===n?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t}function IC(t){return"geoPath"===t.type}const zC=()=>t=>{const{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,o=function(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}(n,["type"]),a=function(t){if("function"==typeof t)return t;const e=`geo${xx(t)}`,n=i[e];if(!n)throw new Error(`Unknown coordinate: ${t}`);return n}(r),s=e.map(RC);let c;return[Object.assign(Object.assign({},t),{type:"view",scale:{x:{type:"identity"},y:{type:"identity"}},axis:!1,coordinate:{type:function(){return[["custom",(t,e,n,r)=>{const i=a();(function(t,e,n,r){const i=()=>{const t=e.filter(IC),n=t.find((t=>t.sphere));return n?{type:"Sphere"}:(r=t.filter((t=>!t.sphere)).flatMap((t=>t.data.value)),{type:"FeatureCollection",features:r.flatMap((t=>function(t){if(!t||!t.type)return null;const e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"}[t.type];return e?"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featureCollection"===e?t:void 0:null}(t).features))});var r},{outline:o=i()}=r,{size:a="fitExtent"}=r;"fitExtent"===a?function(t,e,n){const{x:r,y:i,width:o,height:a}=n;t.fitExtent([[r,i],[o,a]],e)}(t,o,n):"fitWidth"===a&&function(t,e,n){const{width:r,height:i}=n,[[o,a],[s,c]]=tT(t.fitWidth(r,e)).bounds(e),l=Math.ceil(c-a),u=Math.min(Math.ceil(s-o),l),f=t.scale()*(u-1)/u,[h,d]=t.translate(),p=d+(i-l)/2;t.scale(f).translate([h,p]).precision(.2)}(t,o,n)})(i,s,{x:t,y:e,width:n,height:r},o),function(t,e){var n;for(const[r,i]of Object.entries(e))null===(n=t[r])||void 0===n||n.call(t,i)}(i,o),c=tT(i);const l=new Tf({domain:[t,t+n]}),u=new Tf({domain:[e,e+r]});return{transform:t=>(t=>{const e=i(t);if(!e)return[null,null];const[n,r]=e;return[l.map(n),u.map(r)]})(t),untransform:t=>(t=>{if(!t)return null;const[e,n]=t,r=[l.invert(e),u.invert(n)];return i.invert(r)})(t)}}]]}},children:s.flatMap((t=>IC(t)?function(t){const{style:e,tooltip:n={}}=t;return Object.assign(Object.assign({},t),{type:"path",tooltip:oT(n,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},e),{d:t=>c(t)||[]})})}(t):t))})]};zC.props={};const DC=()=>t=>{const{type:e,data:n,scale:r,encode:i,style:o,animate:a,key:s,state:c}=t,l=function(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}(t,["type","data","scale","encode","style","animate","key","state"]);return[Object.assign(Object.assign({type:"geoView"},l),{children:[{type:"geoPath",key:`${s}-0`,data:{value:n},scale:r,encode:i,style:o,animate:a,state:c}]})]};function BC(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,o,a,s,c,l,u,f,h,d=t._root,p={data:r},g=t._x0,y=t._y0,m=t._x1,v=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=e>=(o=(g+m)/2))?g=o:m=o,(u=n>=(a=(y+v)/2))?y=a:v=a,i=d,!(d=d[f=u<<1|l]))return i[f]=p,t;if(s=+t._x.call(null,d.data),c=+t._y.call(null,d.data),e===s&&n===c)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(l=e>=(o=(g+m)/2))?g=o:m=o,(u=n>=(a=(y+v)/2))?y=a:v=a}while((f=u<<1|l)==(h=(c>=a)<<1|s>=o));return i[h]=d,i[f]=p,t}function FC(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function WC(t){return t[0]}function $C(t){return t[1]}function GC(t,e,n){var r=new HC(null==e?WC:e,null==n?$C:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function HC(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function VC(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}DC.props={};var qC=GC.prototype=HC.prototype;function XC(t){return function(){return t}}function YC(t){return 1e-6*(t()-.5)}qC.copy=function(){var t,e,n=new HC(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=VC(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=VC(e));return n},qC.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return BC(this.cover(e,n),e,n,t)},qC.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),s=new Array(o),c=1/0,l=1/0,u=-1/0,f=-1/0;for(n=0;n<o;++n)isNaN(r=+this._x.call(null,e=t[n]))||isNaN(i=+this._y.call(null,e))||(a[n]=r,s[n]=i,r<c&&(c=r),r>u&&(u=r),i<l&&(l=i),i>f&&(f=i));if(c>u||l>f)return this;for(this.cover(c,l).cover(u,f),n=0;n<o;++n)BC(this,a[n],s[n],t[n]);return this},qC.cover=function(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,o=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,o=(r=Math.floor(e))+1;else{for(var a,s,c=i-n||1,l=this._root;n>t||t>=i||r>e||e>=o;)switch(s=(e<r)<<1|t<n,(a=new Array(4))[s]=l,l=a,c*=2,s){case 0:i=n+c,o=r+c;break;case 1:n=i-c,o=r+c;break;case 2:i=n+c,r=o-c;break;case 3:n=i-c,r=o-c}this._root&&this._root.length&&(this._root=l)}return this._x0=n,this._y0=r,this._x1=i,this._y1=o,this},qC.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},qC.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},qC.find=function(t,e,n){var r,i,o,a,s,c,l,u=this._x0,f=this._y0,h=this._x1,d=this._y1,p=[],g=this._root;for(g&&p.push(new FC(g,u,f,h,d)),null==n?n=1/0:(u=t-n,f=e-n,h=t+n,d=e+n,n*=n);c=p.pop();)if(!(!(g=c.node)||(i=c.x0)>h||(o=c.y0)>d||(a=c.x1)<u||(s=c.y1)<f))if(g.length){var y=(i+a)/2,m=(o+s)/2;p.push(new FC(g[3],y,m,a,s),new FC(g[2],i,m,y,s),new FC(g[1],y,o,a,m),new FC(g[0],i,o,y,m)),(l=(e>=m)<<1|t>=y)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=c)}else{var v=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),x=v*v+b*b;if(x<n){var O=Math.sqrt(n=x);u=t-O,f=e-O,h=t+O,d=e+O,r=g.data}}return r},qC.remove=function(t){if(isNaN(o=+this._x.call(null,t))||isNaN(a=+this._y.call(null,t)))return this;var e,n,r,i,o,a,s,c,l,u,f,h,d=this._root,p=this._x0,g=this._y0,y=this._x1,m=this._y1;if(!d)return this;if(d.length)for(;;){if((l=o>=(s=(p+y)/2))?p=s:y=s,(u=a>=(c=(g+m)/2))?g=c:m=c,e=d,!(d=d[f=u<<1|l]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(n=e,h=f)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(n?n[h]=d:this._root=d),this):(this._root=i,this)},qC.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},qC.root=function(){return this._root},qC.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},qC.visit=function(t){var e,n,r,i,o,a,s=[],c=this._root;for(c&&s.push(new FC(c,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(c=e.node,r=e.x0,i=e.y0,o=e.x1,a=e.y1)&&c.length){var l=(r+o)/2,u=(i+a)/2;(n=c[3])&&s.push(new FC(n,l,u,o,a)),(n=c[2])&&s.push(new FC(n,r,u,l,a)),(n=c[1])&&s.push(new FC(n,l,i,o,u)),(n=c[0])&&s.push(new FC(n,r,i,l,u))}return this},qC.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new FC(this._root,this._x0,this._y0,this._x1,this._y1));e=n.pop();){var i=e.node;if(i.length){var o,a=e.x0,s=e.y0,c=e.x1,l=e.y1,u=(a+c)/2,f=(s+l)/2;(o=i[0])&&n.push(new FC(o,a,s,u,f)),(o=i[1])&&n.push(new FC(o,u,s,c,f)),(o=i[2])&&n.push(new FC(o,a,f,u,l)),(o=i[3])&&n.push(new FC(o,u,f,c,l))}r.push(e)}for(;e=r.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},qC.x=function(t){return arguments.length?(this._x=t,this):this._x},qC.y=function(t){return arguments.length?(this._y=t,this):this._y};var UC={value:()=>{}};function KC(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new ZC(r)}function ZC(t){this._=t}function JC(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function QC(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=UC,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}ZC.prototype=KC.prototype={constructor:ZC,on:function(t,e){var n,r,i=this._,o=(r=i,(t+"").trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");if(n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),a=-1,s=o.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++a<s;)if(n=(t=o[a]).type)i[n]=QC(i[n],t.name,e);else if(null==e)for(n in i)i[n]=QC(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=JC(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new ZC(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};const tN=KC;var eN,nN,rN=0,iN=0,oN=0,aN=1e3,sN=0,cN=0,lN=0,uN="object"==typeof performance&&performance.now?performance:Date,fN="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function hN(){return cN||(fN(dN),cN=uN.now()+lN)}function dN(){cN=0}function pN(){this._call=this._time=this._next=null}function gN(t,e,n){var r=new pN;return r.restart(t,e,n),r}function yN(){cN=(sN=uN.now())+lN,rN=iN=0;try{!function(){hN(),++rN;for(var t,e=eN;e;)(t=cN-e._time)>=0&&e._call.call(void 0,t),e=e._next;--rN}()}finally{rN=0,function(){for(var t,e,n=eN,r=1/0;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:eN=e);nN=t,vN(r)}(),cN=0}}function mN(){var t=uN.now(),e=t-sN;e>aN&&(lN-=e,sN=t)}function vN(t){rN||(iN&&(iN=clearTimeout(iN)),t-cN>24?(t<1/0&&(iN=setTimeout(yN,t-uN.now()-lN)),oN&&(oN=clearInterval(oN))):(oN||(sN=uN.now(),oN=setInterval(mN,aN)),rN=1,fN(yN)))}pN.prototype=gN.prototype={constructor:pN,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?hN():+n)+(null==e?0:+e),this._next||nN===this||(nN?nN._next=this:eN=this,nN=this),this._call=t,this._time=n,vN()},stop:function(){this._call&&(this._call=null,this._time=1/0,vN())}};const bN=1664525,xN=1013904223,ON=4294967296;function wN(t){return t.x}function MN(t){return t.y}var EN=10,kN=Math.PI*(3-Math.sqrt(5));function SN(t){return t.index}function PN(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}const _N={joint:!0},AN={type:"link",axis:!1,legend:!1,encode:{x:[t=>t.source.x,t=>t.target.x],y:[t=>t.source.y,t=>t.target.y]},style:{stroke:"#999",strokeOpacity:.6}},jN={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},style:{stroke:"#fff"}},TN={text:""};function CN(t,e,n){const{nodes:r,links:i}=t,{joint:o,nodeStrength:a,linkStrength:s}=e,{nodeKey:c=(t=>t.id),linkKey:l=(t=>t.id)}=n,u=function(){var t,e,n,r,i,o=XC(-30),a=1,s=1/0,c=.81;function l(n){var i,o=t.length,a=GC(t,wN,MN).visitAfter(f);for(r=n,i=0;i<o;++i)e=t[i],a.visit(h)}function u(){if(t){var e,n,r=t.length;for(i=new Array(r),e=0;e<r;++e)n=t[e],i[n.index]=+o(n,e,t)}}function f(t){var e,n,r,o,a,s=0,c=0;if(t.length){for(r=o=a=0;a<4;++a)(e=t[a])&&(n=Math.abs(e.value))&&(s+=e.value,c+=n,r+=n*e.x,o+=n*e.y);t.x=r/c,t.y=o/c}else{(e=t).x=e.data.x,e.y=e.data.y;do{s+=i[e.data.index]}while(e=e.next)}t.value=s}function h(t,o,l,u){if(!t.value)return!0;var f=t.x-e.x,h=t.y-e.y,d=u-o,p=f*f+h*h;if(d*d/c<p)return p<s&&(0===f&&(p+=(f=YC(n))*f),0===h&&(p+=(h=YC(n))*h),p<a&&(p=Math.sqrt(a*p)),e.vx+=f*t.value*r/p,e.vy+=h*t.value*r/p),!0;if(!(t.length||p>=s)){(t.data!==e||t.next)&&(0===f&&(p+=(f=YC(n))*f),0===h&&(p+=(h=YC(n))*h),p<a&&(p=Math.sqrt(a*p)));do{t.data!==e&&(d=i[t.data.index]*r/p,e.vx+=f*d,e.vy+=h*d)}while(t=t.next)}}return l.initialize=function(e,r){t=e,n=r,u()},l.strength=function(t){return arguments.length?(o="function"==typeof t?t:XC(+t),u(),l):o},l.distanceMin=function(t){return arguments.length?(a=t*t,l):Math.sqrt(a)},l.distanceMax=function(t){return arguments.length?(s=t*t,l):Math.sqrt(s)},l.theta=function(t){return arguments.length?(c=t*t,l):Math.sqrt(c)},l}(),f=function(t){var e,n,r,i,o,a,s=SN,c=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=XC(30),u=1;function f(r){for(var i=0,s=t.length;i<u;++i)for(var c,l,f,h,d,p,g,y=0;y<s;++y)l=(c=t[y]).source,h=(f=c.target).x+f.vx-l.x-l.vx||YC(a),d=f.y+f.vy-l.y-l.vy||YC(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[y])/p*r*e[y],d*=p,f.vx-=h*(g=o[y]),f.vy-=d*g,l.vx+=h*(g=1-g),l.vy+=d*g}function h(){if(r){var a,c,l=r.length,u=t.length,f=new Map(r.map(((t,e)=>[s(t,e,r),t])));for(a=0,i=new Array(l);a<u;++a)(c=t[a]).index=a,"object"!=typeof c.source&&(c.source=PN(f,c.source)),"object"!=typeof c.target&&(c.target=PN(f,c.target)),i[c.source.index]=(i[c.source.index]||0)+1,i[c.target.index]=(i[c.target.index]||0)+1;for(a=0,o=new Array(u);a<u;++a)c=t[a],o[a]=i[c.source.index]/(i[c.source.index]+i[c.target.index]);e=new Array(u),d(),n=new Array(u),p()}}function d(){if(r)for(var n=0,i=t.length;n<i;++n)e[n]=+c(t[n],n,t)}function p(){if(r)for(var e=0,i=t.length;e<i;++e)n[e]=+l(t[e],e,t)}return null==t&&(t=[]),f.initialize=function(t,e){r=t,a=e,h()},f.links=function(e){return arguments.length?(t=e,h(),f):t},f.id=function(t){return arguments.length?(s=t,f):s},f.iterations=function(t){return arguments.length?(u=+t,f):u},f.strength=function(t){return arguments.length?(c="function"==typeof t?t:XC(+t),d(),f):c},f.distance=function(t){return arguments.length?(l="function"==typeof t?t:XC(+t),p(),f):l},f}(i).id(Ph(l));"function"==typeof a&&u.strength(a),"function"==typeof s&&f.strength(s);const h=function(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,c=gN(f),l=tN("tick","end"),u=function(){let t=1;return()=>(t=(bN*t+xN)%ON)/ON}();function f(){h(),l.call("tick",e),n<r&&(c.stop(),l.call("end",e))}function h(r){var c,l,u=t.length;void 0===r&&(r=1);for(var f=0;f<r;++f)for(n+=(o-n)*i,s.forEach((function(t){t(n)})),c=0;c<u;++c)null==(l=t[c]).fx?l.x+=l.vx*=a:(l.x=l.fx,l.vx=0),null==l.fy?l.y+=l.vy*=a:(l.y=l.fy,l.vy=0);return e}function d(){for(var e,n=0,r=t.length;n<r;++n){if((e=t[n]).index=n,null!=e.fx&&(e.x=e.fx),null!=e.fy&&(e.y=e.fy),isNaN(e.x)||isNaN(e.y)){var i=EN*Math.sqrt(.5+n),o=n*kN;e.x=i*Math.cos(o),e.y=i*Math.sin(o)}(isNaN(e.vx)||isNaN(e.vy))&&(e.vx=e.vy=0)}}function p(e){return e.initialize&&e.initialize(t,u),e}return null==t&&(t=[]),d(),e={tick:h,restart:function(){return c.restart(f),e},stop:function(){return c.stop(),e},nodes:function(n){return arguments.length?(t=n,d(),s.forEach(p),e):t},alpha:function(t){return arguments.length?(n=+t,e):n},alphaMin:function(t){return arguments.length?(r=+t,e):r},alphaDecay:function(t){return arguments.length?(i=+t,e):+i},alphaTarget:function(t){return arguments.length?(o=+t,e):o},velocityDecay:function(t){return arguments.length?(a=1-t,e):1-a},randomSource:function(t){return arguments.length?(u=t,s.forEach(p),e):u},force:function(t,n){return arguments.length>1?(null==n?s.delete(t):s.set(t,p(n)),e):s.get(t)},find:function(e,n,r){var i,o,a,s,c,l=0,u=t.length;for(null==r?r=1/0:r*=r,l=0;l<u;++l)(a=(i=e-(s=t[l]).x)*i+(o=n-s.y)*o)<r&&(c=s,r=a);return c},on:function(t,n){return arguments.length>1?(l.on(t,n),e):l.on(t)}}}(r).force("link",f).force("charge",u);o?h.force("center",function(t,e){var n,r=1;function i(){var i,o,a=n.length,s=0,c=0;for(i=0;i<a;++i)s+=(o=n[i]).x,c+=o.y;for(s=(s/a-t)*r,c=(c/a-e)*r,i=0;i<a;++i)(o=n[i]).x-=s,o.y-=c}return null==t&&(t=0),null==e&&(e=0),i.initialize=function(t){n=t},i.x=function(e){return arguments.length?(t=+e,i):t},i.y=function(t){return arguments.length?(e=+t,i):e},i.strength=function(t){return arguments.length?(r=+t,i):r},i}()):h.force("x",function(t){var e,n,r,i=XC(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vx+=(r[o]-i.x)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=XC(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:XC(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:XC(+e),a(),o):t},o}()).force("y",function(t){var e,n,r,i=XC(.1);function o(t){for(var i,o=0,a=e.length;o<a;++o)(i=e[o]).vy+=(r[o]-i.y)*n[o]*t}function a(){if(e){var o,a=e.length;for(n=new Array(a),r=new Array(a),o=0;o<a;++o)n[o]=isNaN(r[o]=+t(e[o],o,e))?0:+i(e[o],o,e)}}return"function"!=typeof t&&(t=XC(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:XC(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:XC(+e),a(),o):t},o}()),h.stop();const d=Math.ceil(Math.log(h.alphaMin())/Math.log(1-h.alphaDecay()));for(let t=0;t<d;t++)h.tick();return{nodesData:r,linksData:i}}const NN=t=>{const{data:e,encode:n={},scale:r,style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={}}=t,{nodeKey:u=(t=>t.id),linkKey:f=(t=>t.id)}=n,h=function(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}(n,["nodeKey","linkKey"]),d=Object.assign({nodeKey:u,linkKey:f},h),p=ku(d,"node"),g=ku(d,"link"),{links:y,nodes:m}=Ah(e,d),{nodesData:v,linksData:b}=CN({links:y,nodes:m},A({},_N,o),d),x=iT(l,"link",{items:[t=>({name:"source",value:Ph(f)(t.source)}),t=>({name:"target",value:Ph(f)(t.target)})]}),O=iT(l,"node",{items:[t=>({name:"key",value:Ph(u)(t)})]},!0);return[A({},AN,{data:b,encode:g,labels:s,style:ku(i,"link"),tooltip:x,animate:sT(c,"link")}),A({},jN,{data:v,encode:Object.assign({},p),scale:r,style:ku(i,"node"),tooltip:O,labels:[Object.assign(Object.assign({},TN),ku(i,"label")),...a],animate:sT(c,"link")})]};function LN(t,e){return t.parent===e.parent?1:2}function RN(t){var e=t.children;return e?e[0]:t.t}function IN(t){var e=t.children;return e?e[e.length-1]:t.t}function zN(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function DN(t,e,n){return t.a.parent===e.parent?t.a:n}function BN(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}function FN(){var t=LN,e=1,n=1,r=null;function i(i){var c=function(t){for(var e,n,r,i,o,a=new BN(t,0),s=[a];e=s.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)s.push(n=e.children[i]=new BN(r[i],i)),n.parent=e;return(a.parent=new BN(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(s);else{var l=i,u=i,f=i;i.eachBefore((function(t){t.x<l.x&&(l=t),t.x>u.x&&(u=t),t.depth>f.depth&&(f=t)}));var h=l===u?1:t(l,u)/2,d=h-l.x,p=e/(u.x+h+d),g=n/(f.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,s=n,c=o.parent.children[0],l=o.m,u=a.m,f=s.m,h=c.m;s=IN(s),o=RN(o),s&&o;)c=RN(c),(a=IN(a)).a=e,(i=s.z+f-o.z-l+t(s._,o._))>0&&(zN(DN(s,e,r),e,i),l+=i,u+=i),f+=s.m,l+=o.m,h+=c.m,u+=a.m;s&&!IN(a)&&(a.t=s,a.m+=f-u),o&&!RN(c)&&(c.t=o,c.m+=l-h,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function s(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}function WN(t,e){return t.parent===e.parent?1:2}function $N(t,e){return t+e.x}function GN(t,e){return Math.max(t,e.y)}function HN(){var t=WN,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce($N,0)/t.length}(n),e.y=function(t){return 1+t.reduce(GN,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var s=function(t){for(var e;e=t.children;)t=e[0];return t}(i),c=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),l=s.x-t(s,c)/2,u=c.x+t(c,s)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-l)/(u-l)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i}NN.props={},BN.prototype=Object.create(Bk.prototype);const VN=t=>e=>n=>{const{field:r="value",nodeSize:i,separation:o,sortBy:a,as:s=["x","y"]}=e,[c,l]=s,u=Lk(n,(t=>t.children)).sum((t=>t[r])).sort(a),f=t();f.size([1,1]),i&&f.nodeSize(i),o&&f.separation(o),f(u);const h=[];u.each((t=>{t[c]=t.x,t[l]=t.y,t.name=t.data.name,h.push(t)}));const d=u.links();return d.forEach((t=>{t[c]=[t.source[c],t.target[c]],t[l]=[t.source[l],t.target[l]]})),{nodes:h,edges:d}},qN=t=>VN(HN)(t);qN.props={};const XN=t=>VN(FN)(t);XN.props={};const YN={sortBy:(t,e)=>e.value-t.value},UN={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},KN={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},ZN={text:"",fontSize:10},JN=t=>{const{data:e,encode:n={},scale:r={},style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={}}=t,u=null==n?void 0:n.value,{nodes:f,edges:h}=XN(Object.assign(Object.assign(Object.assign({},YN),o),{field:u}))(e),d=iT(l,"node",{title:"name",items:["value"]},!0),p=iT(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[A({},KN,{data:h,encode:ku(n,"link"),scale:ku(r,"link"),labels:s,style:Object.assign({stroke:"#999"},ku(i,"link")),tooltip:p,animate:sT(c,"link")}),A({},UN,{data:f,scale:ku(r,"node"),encode:ku(n,"node"),labels:[Object.assign(Object.assign({},ZN),ku(i,"label")),...a],style:Object.assign({},ku(i,"node")),tooltip:d,animate:sT(c,"node")})]};JN.props={};const QN=4294967296;function tL(t,e){var n,r;if(rL(e,t))return[e];for(n=0;n<t.length;++n)if(eL(e,t[n])&&rL(oL(t[n],e),t))return[t[n],e];for(n=0;n<t.length-1;++n)for(r=n+1;r<t.length;++r)if(eL(oL(t[n],t[r]),e)&&eL(oL(t[n],e),t[r])&&eL(oL(t[r],e),t[n])&&rL(aL(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function eL(t,e){var n=t.r-e.r,r=e.x-t.x,i=e.y-t.y;return n<0||n*n<r*r+i*i}function nL(t,e){var n=t.r-e.r+1e-9*Math.max(t.r,e.r,1),r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function rL(t,e){for(var n=0;n<e.length;++n)if(!nL(t,e[n]))return!1;return!0}function iL(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return oL(t[0],t[1]);case 3:return aL(t[0],t[1],t[2])}}function oL(t,e){var n=t.x,r=t.y,i=t.r,o=e.x,a=e.y,s=e.r,c=o-n,l=a-r,u=s-i,f=Math.sqrt(c*c+l*l);return{x:(n+o+c/f*u)/2,y:(r+a+l/f*u)/2,r:(f+i+s)/2}}function aL(t,e,n){var r=t.x,i=t.y,o=t.r,a=e.x,s=e.y,c=e.r,l=n.x,u=n.y,f=n.r,h=r-a,d=r-l,p=i-s,g=i-u,y=c-o,m=f-o,v=r*r+i*i-o*o,b=v-a*a-s*s+c*c,x=v-l*l-u*u+f*f,O=d*p-h*g,w=(p*x-g*b)/(2*O)-r,M=(g*y-p*m)/O,E=(d*b-h*x)/(2*O)-i,k=(h*m-d*y)/O,S=M*M+k*k-1,P=2*(o+w*M+E*k),_=w*w+E*E-o*o,A=-(Math.abs(S)>1e-6?(P+Math.sqrt(P*P-4*S*_))/(2*S):_/P);return{x:r+w+M*A,y:i+E+k*A,r:A}}function sL(t,e,n){var r,i,o,a,s=t.x-e.x,c=t.y-e.y,l=s*s+c*c;l?(i=e.r+n.r,i*=i,a=t.r+n.r,i>(a*=a)?(r=(l+a-i)/(2*l),o=Math.sqrt(Math.max(0,a/l-r*r)),n.x=t.x-r*s-o*c,n.y=t.y-r*c+o*s):(r=(l+i-a)/(2*l),o=Math.sqrt(Math.max(0,i/l-r*r)),n.x=e.x+r*s-o*c,n.y=e.y+r*c+o*s)):(n.x=e.x+n.r,n.y=e.y)}function cL(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function lL(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function uL(t){this._=t,this.next=null,this.previous=null}function fL(t,e){if(!(a=(n=t,t="object"==typeof n&&"length"in n?n:Array.from(n)).length))return 0;var n,r,i,o,a,s,c,l,u,f,h,d;if((r=t[0]).x=0,r.y=0,!(a>1))return r.r;if(i=t[1],r.x=-i.r,i.x=r.r,i.y=0,!(a>2))return r.r+i.r;sL(i,r,o=t[2]),r=new uL(r),i=new uL(i),o=new uL(o),r.next=o.previous=i,i.next=r.previous=o,o.next=i.previous=r;t:for(l=3;l<a;++l){sL(r._,i._,o=t[l]),o=new uL(o),u=i.next,f=r.previous,h=i._.r,d=r._.r;do{if(h<=d){if(cL(u._,o._)){i=u,r.next=i,i.previous=r,--l;continue t}h+=u._.r,u=u.next}else{if(cL(f._,o._)){(r=f).next=i,i.previous=r,--l;continue t}d+=f._.r,f=f.previous}}while(u!==f.next);for(o.previous=r,o.next=i,r.next=i.previous=i=o,s=lL(r);(o=o.next)!==i;)(c=lL(o))<s&&(r=o,s=c);i=r.next}for(r=[i._],o=i;(o=o.next)!==i;)r.push(o._);for(o=function(t,e){for(var n,r,i=0,o=(t=function(t,e){let n,r,i=t.length;for(;i;)r=e()*i--|0,n=t[i],t[i]=t[r],t[r]=n;return t}(Array.from(t),e)).length,a=[];i<o;)n=t[i],r&&nL(r,n)?++i:(r=iL(a=tL(a,n)),i=0);return r}(r,e),l=0;l<a;++l)(r=t[l]).x-=o.x,r.y-=o.y;return o.r}function hL(t){return Math.sqrt(t.value)}function dL(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function pL(t,e,n){return function(r){if(i=r.children){var i,o,a,s=i.length,c=t(r)*e||0;if(c)for(o=0;o<s;++o)i[o].r+=c;if(a=fL(i,n),c)for(o=0;o<s;++o)i[o].r-=c;r.r=a+c}}}function gL(t){return function(e){var n=e.parent;e.r*=t,n&&(e.x=n.x+t*e.x,e.y=n.y+t*e.y)}}const yL={text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r},mL={title:t=>t.data.name,items:[{field:"value"}]},vL=(t,e)=>{const{width:n,height:r}=e,{data:i,encode:o={},scale:a={},style:s={},layout:c={},labels:l=[],tooltip:u={}}=t,f=function(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}(t,["data","encode","scale","style","layout","labels","tooltip"]),h=((t,e,n)=>({type:"point",axis:!1,legend:!1,scale:{x:{domain:[0,t]},y:{domain:[0,e]},size:{type:"identity"}},encode:{x:"x",y:"y",size:"r",shape:"point"},style:{fill:n.color?void 0:t=>0===t.height?"#ddd":"#fff",stroke:n.color?void 0:t=>0===t.height?"":"#000"}}))(n,r,o),d=((t,e,n)=>{const{value:r}=n,i=E(t)?Vk().path(e.path)(t):Lk(t);return r?i.sum((t=>Ph(r)(t))).sort(e.sort):i.count(),function(){var t=null,e=1,n=1,r=rS;function i(i){const o=function(){let t=1;return()=>(t=(1664525*t+1013904223)%QN)/QN}();return i.x=e/2,i.y=n/2,t?i.eachBefore(dL(t)).eachAfter(pL(r,.5,o)).eachBefore(gL(1)):i.eachBefore(dL(hL)).eachAfter(pL(rS,1,o)).eachAfter(pL(r,i.r/Math.min(e,n),o)).eachBefore(gL(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=Tk(e),i):t},i.size=function(t){return arguments.length?(e=+t[0],n=+t[1],i):[e,n]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:iS(+t),i):r},i}().size(e.size).padding(e.padding)(i),i.descendants()})(i,A({},((t,e)=>({size:[t,e],padding:0,sort:(t,e)=>e.value-t.value}))(n,r),c),A({},h.encode,o)),p=ku(s,"label");return A({},h,Object.assign(Object.assign({data:d,encode:o,scale:a,style:s,labels:[Object.assign(Object.assign({},yL),p),...l]},f),{tooltip:oT(u,mL),axis:!1}))};function bL(t){return t.target.depth}function xL(t,e){return t.sourceLinks.length?t.depth:e-1}function OL(t){return function(){return t}}function wL(t,e){return EL(t.source,e.source)||t.index-e.index}function ML(t,e){return EL(t.target,e.target)||t.index-e.index}function EL(t,e){return t.y0-e.y0}function kL(t){return t.value}function SL(t){return t.index}function PL(t){return t.nodes}function _L(t){return t.links}function AL(t,e){const n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function jL({nodes:t}){for(const e of t){let t=e.y0,n=t;for(const n of e.sourceLinks)n.y0=t+n.width/2,t+=n.width;for(const t of e.targetLinks)t.y1=n+t.width/2,n+=t.width}}vL.props={};const TL={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},CL={left:function(t){return t.depth},right:function(t,e){return e-1-t.height},center:function(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?ky(t.sourceLinks,bL)-1:0},justify:xL},NL=t=>e=>{const{nodeId:n,nodeSort:r,nodeAlign:i,nodeWidth:o,nodePadding:a,nodeDepth:s,nodes:c,links:l,linkSort:u,iterations:f}=Object.assign({},TL,t),h=function(){let t,e,n,r,i=0,o=0,a=1,s=1,c=24,l=8,u=SL,f=xL,h=PL,d=_L,p=6;function g(g){const v={nodes:h(g),links:d(g)};return function({nodes:t,links:e}){t.forEach(((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[]}));const n=new Map(t.map((t=>[u(t),t])));if(e.forEach(((t,e)=>{t.index=e;let{source:r,target:i}=t;"object"!=typeof r&&(r=t.source=AL(n,r)),"object"!=typeof i&&(i=t.target=AL(n,i)),r.sourceLinks.push(t),i.targetLinks.push(t)})),null!=r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(r),n.sort(r)}(v),function({nodes:t}){for(const e of t)e.value=void 0===e.fixedValue?Math.max(MP(e.sourceLinks,kL),MP(e.targetLinks,kL)):e.fixedValue}(v),function({nodes:t}){const n=t.length;let r=new Set(t),i=new Set,o=0;for(;r.size;){if(r.forEach((t=>{t.depth=o;for(const{target:e}of t.sourceLinks)i.add(e)})),++o>n)throw new Error("circular link");r=i,i=new Set}if(e){const n=Math.max(Sy(t,(t=>t.depth))+1,0);let r;for(let i=0;i<t.length;i++)r=t[i],r.depth=e.call(null,r,n)}}(v),function({nodes:t}){const e=t.length;let n=new Set(t),r=new Set,i=0;for(;n.size;){if(n.forEach((t=>{t.height=i;for(const{source:e}of t.targetLinks)r.add(e)})),++i>e)throw new Error("circular link");n=r,r=new Set}}(v),function(e){const r=function({nodes:t}){const e=Math.max(Sy(t,(t=>t.depth))+1,0),r=(a-i-c)/(e-1),o=new Array(e).fill(0).map((()=>[]));for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(f.call(null,n,e))));n.layer=t,n.x0=i+t*r,n.x1=n.x0+c,o[t]?o[t].push(n):o[t]=[n]}if(n)for(const t of o)t.sort(n);return o}(e);t=Math.min(l,(s-o)/(Sy(r,(t=>t.length))-1)),function(e){const n=ky(e,(e=>(s-o-(e.length-1)*t)/MP(e,kL)));for(const r of e){let e=o;for(const i of r){i.y0=e,i.y1=e+i.value*n,e=i.y1+t;for(const t of i.sourceLinks)t.width=t.value*n}e=(s-e+t)/(r.length+1);for(let t=0;t<r.length;++t){const n=r[t];n.y0+=e*(t+1),n.y1+=e*(t+1)}w(r)}}(r);for(let t=0;t<p;++t){const e=Math.pow(.99,t),n=Math.max(1-e,(t+1)/p);m(r,e,n),y(r,e,n)}}(v),jL(v),v}function y(t,e,r){for(let i=1,o=t.length;i<o;++i){const o=t[i];for(const t of o){let n=0,r=0;for(const{source:e,value:i}of t.targetLinks){const o=i*(t.layer-e.layer);n+=M(e,t)*o,r+=o}if(!(r>0))continue;const i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,O(t)}void 0===n&&o.sort(EL),o.length&&v(o,r)}}function m(t,e,r){for(let i=t.length-2;i>=0;--i){const o=t[i];for(const t of o){let n=0,r=0;for(const{target:e,value:i}of t.sourceLinks){const o=i*(e.layer-t.layer);n+=E(t,e)*o,r+=o}if(!(r>0))continue;const i=(n/r-t.y0)*e;t.y0+=i,t.y1+=i,O(t)}void 0===n&&o.sort(EL),o.length&&v(o,r)}}function v(e,n){const r=e.length>>1,i=e[r];x(e,i.y0-t,r-1,n),b(e,i.y1+t,r+1,n),x(e,s,e.length-1,n),b(e,o,0,n)}function b(e,n,r,i){for(;r<e.length;++r){const o=e[r],a=(n-o.y0)*i;a>1e-6&&(o.y0+=a,o.y1+=a),n=o.y1+t}}function x(e,n,r,i){for(;r>=0;--r){const o=e[r],a=(o.y1-n)*i;a>1e-6&&(o.y0-=a,o.y1-=a),n=o.y0-t}}function O({sourceLinks:t,targetLinks:e}){if(void 0===r){for(const{source:{sourceLinks:t}}of e)t.sort(ML);for(const{target:{targetLinks:e}}of t)e.sort(wL)}}function w(t){if(void 0===r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(ML),n.sort(wL)}function M(e,n){let r=e.y0-(e.sourceLinks.length-1)*t/2;for(const{target:i,width:o}of e.sourceLinks){if(i===n)break;r+=o+t}for(const{source:t,width:i}of n.targetLinks){if(t===e)break;r-=i}return r}function E(e,n){let r=n.y0-(n.targetLinks.length-1)*t/2;for(const{source:i,width:o}of n.targetLinks){if(i===e)break;r+=o+t}for(const{target:t,width:i}of e.sourceLinks){if(t===n)break;r-=i}return r}return g.update=function(t){return jL(t),t},g.nodeId=function(t){return arguments.length?(u="function"==typeof t?t:OL(t),g):u},g.nodeAlign=function(t){return arguments.length?(f="function"==typeof t?t:OL(t),g):f},g.nodeDepth=function(t){return arguments.length?(e=t,g):e},g.nodeSort=function(t){return arguments.length?(n=t,g):n},g.nodeWidth=function(t){return arguments.length?(c=+t,g):c},g.nodePadding=function(e){return arguments.length?(l=t=+e,g):l},g.nodes=function(t){return arguments.length?(h="function"==typeof t?t:OL(t),g):h},g.links=function(t){return arguments.length?(d="function"==typeof t?t:OL(t),g):d},g.linkSort=function(t){return arguments.length?(r=t,g):r},g.size=function(t){return arguments.length?(i=o=0,a=+t[0],s=+t[1],g):[a-i,s-o]},g.extent=function(t){return arguments.length?(i=+t[0][0],a=+t[1][0],o=+t[0][1],s=+t[1][1],g):[[i,o],[a,s]]},g.iterations=function(t){return arguments.length?(p=+t,g):p},g}().nodeSort(r).linkSort(u).links(l).nodes(c).nodeWidth(o).nodePadding(a).nodeDepth(s).nodeAlign(function(t){const e=typeof t;return"string"===e?CL[t]||xL:"function"===e?t:xL}(i)).iterations(f).extent([[0,0],[1,1]]);"function"==typeof n&&h.nodeId(n);const d=h(e),{nodes:p,links:g}=d,y=p.map((t=>{const{x0:e,x1:n,y0:r,y1:i}=t;return Object.assign(Object.assign({},t),{x:[e,n,n,e],y:[r,r,i,i]})})),m=g.map((t=>{const{source:e,target:n}=t,r=e.x1,i=n.x0,o=t.width/2;return Object.assign(Object.assign({},t),{x:[r,r,i,i],y:[t.y0+o,t.y0-o,t.y1+o,t.y1-o]})}));return{nodes:y,links:m}};NL.props={};const LL={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},RL={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},IL={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},zL={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},DL=t=>{const{data:e,encode:n={},scale:r,style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={}}=t,{links:u,nodes:f}=Ah(e,n),h=ku(n,"node"),d=ku(n,"link"),{key:p=(t=>t.key),color:g=p}=h,{links:y,nodes:m}=NL(Object.assign(Object.assign(Object.assign({},LL),{nodeId:Ph(p)}),o))({links:u,nodes:f}),v=ku(i,"label"),{text:b=p,spacing:x=5}=v,O=function(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}(v,["text","spacing"]),w=Ph(p),M=iT(l,"node",{title:w,items:[{field:"value"}]},!0),E=iT(l,"link",{title:"",items:[t=>({name:"source",value:w(t.source)}),t=>({name:"target",value:w(t.target)})]});return[A({},RL,{data:m,encode:Object.assign(Object.assign({},h),{color:g}),scale:r,style:ku(i,"node"),labels:[Object.assign(Object.assign(Object.assign({},zL),{text:b,dx:t=>t.x[0]<.5?x:-x}),O),...a],tooltip:M,animate:sT(c,"node"),axis:!1}),A({},IL,{data:y,encode:d,labels:s,style:Object.assign({fill:d.color?void 0:"#aaa",lineWidth:0},ku(i,"link")),tooltip:E,animate:sT(c,"link")})]};function BL(t,e){return e.value-t.value}function FL(t,e){return e.frequency-t.frequency}function WL(t,e){return`${t.id}`.localeCompare(`${e.id}`)}function $L(t,e){return`${t.name}`.localeCompare(`${e.name}`)}DL.props={};const GL={y:0,thickness:.05,weight:!1,marginRatio:.1,id:t=>t.id,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null};const HL=t=>e=>function(t){const{y:e,thickness:n,weight:r,marginRatio:i,id:a,source:s,target:c,sourceWeight:l,targetWeight:u,sortBy:f}=Object.assign(Object.assign({},GL),t);return function(t){const h=t.nodes.map((t=>Object.assign({},t))),d=t.edges.map((t=>Object.assign({},t)));return function(t,e){e.forEach((t=>{t.source=s(t),t.target=c(t),t.sourceWeight=l(t),t.targetWeight=u(t)}));const n=uu(e,(t=>t.source)),r=uu(e,(t=>t.target));t.forEach((t=>{t.id=a(t);const e=n.has(t.id)?n.get(t.id):[],i=r.has(t.id)?r.get(t.id):[];t.frequency=e.length+i.length,t.value=MP(e,(t=>t.sourceWeight))+MP(i,(t=>t.targetWeight))}))}(h,d),function(t,e){const n="function"==typeof f?f:o[f];n&&t.sort(n)}(h),function(t,o){const a=t.length;if(!a)throw Ou("Invalid nodes: it's empty!");if(!r){const n=1/a;return t.forEach(((t,r)=>{t.x=(r+.5)*n,t.y=e})),{nodes:t,edges:o}}const s=i/(2*a),c=t.reduce(((t,e)=>t+e.value),0);t.reduce(((t,r)=>{r.weight=r.value/c,r.width=r.weight*(1-i),r.height=n;const o=s+t,a=o+r.width,l=e-n/2,u=l+n;return r.x=[o,a,a,o],r.y=[l,l,u,u],t+r.width+2*s}),0)}(h,d),function(t,n){const i=new Map(t.map((t=>[t.id,t])));if(!r)return n.forEach((t=>{const e=s(t),n=c(t),r=i.get(e),o=i.get(n);r&&o&&(t.x=[r.x,o.x],t.y=[r.y,o.y])})),{nodes:t,edges:n};n.forEach((t=>{t.x=[0,0,0,0],t.y=[e,e,e,e]}));const o=uu(n,(t=>t.source)),a=uu(n,(t=>t.target));t.forEach((t=>{const{edges:e,width:n,x:r,y:i,value:s,id:c}=t,l=o.get(c)||[],u=a.get(c)||[];let f=0;l.map((t=>{const e=t.sourceWeight/s*n;t.x[0]=r[0]+f,t.x[1]=r[0]+f+e,f+=e})),u.forEach((t=>{const e=t.targetWeight/s*n;t.x[3]=r[0]+f,t.x[2]=r[0]+f+e,f+=e}))}))}(h,d),{nodes:h,edges:d}}}(t)(e);HL.props={};var VL=function(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};const qL={y:0,thickness:.05,marginRatio:.1,id:t=>t.key,source:t=>t.source,target:t=>t.target,sourceWeight:t=>t.value||1,targetWeight:t=>t.value||1,sortBy:null},XL={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{opacity:1,fillOpacity:1,lineWidth:1}},YL={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{opacity:.5,lineWidth:1}},UL={position:"outside",fontSize:10},KL=(t,e)=>{const{data:n,encode:r={},scale:i,style:o={},layout:a={},nodeLabels:s=[],linkLabels:c=[],animate:l={},tooltip:u={}}=t,{nodes:f,links:h}=Ah(n,r),d=ku(r,"node"),p=ku(r,"link"),{key:g=(t=>t.key),color:y=g}=d,{linkEncodeColor:m=(t=>t.source)}=p,{nodeWidthRatio:v=qL.thickness,nodePaddingRatio:b=qL.marginRatio}=a,x=VL(a,["nodeWidthRatio","nodePaddingRatio"]),{nodes:O,edges:w}=HL(Object.assign(Object.assign(Object.assign(Object.assign({},qL),{id:Ph(g),thickness:v,marginRatio:b}),x),{weight:!0}))({nodes:f,edges:h}),M=ku(o,"label"),{text:E=g}=M,k=VL(M,["text"]),S=iT(u,"node",{title:"",items:[t=>({name:t.key,value:t.value})]},!0),P=iT(u,"link",{title:"",items:[t=>({name:`${t.source} -> ${t.target}`,value:t.value})]}),{height:_,width:j}=e,T=Math.min(_,j);return[A({},YL,{data:w,encode:Object.assign(Object.assign({},p),{color:m}),labels:c,style:Object.assign({fill:m?void 0:"#aaa"},ku(o,"link")),tooltip:P,animate:sT(l,"link")}),A({},XL,{data:O,encode:Object.assign(Object.assign({},d),{color:y}),scale:i,style:ku(o,"node"),coordinate:{type:"polar",outerRadius:(T-20)/T,startAngle:2*-Math.PI,endAngle:0},labels:[Object.assign(Object.assign(Object.assign({},UL),{text:E}),k),...s],tooltip:S,animate:sT(l,"node"),axis:!1})]};KL.props={};const ZL={fontSize:10,text:t=>wO(t.path),position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0},JL={title:t=>{var e,n;return null===(n=null===(e=t.path)||void 0===e?void 0:e.join)||void 0===n?void 0:n.call(e,".")},items:[{field:"value"}]},QL={title:t=>wO(t.path),items:[{field:"value"}]},tR=(t,e)=>{const{width:n,height:r,options:i}=e,{data:o,encode:a={},scale:s,style:c={},layout:l={},labels:u=[],tooltip:f={}}=t,h=function(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}(t,["data","encode","scale","style","layout","labels","tooltip"]),d=fb(i,["interaction","treemapDrillDown"]),p=A({},((t,e)=>({tile:"treemapSquarify",ratio:.5*(1+Math.sqrt(5)),size:[t,e],round:!1,ignoreParentValue:!0,padding:0,paddingInner:0,paddingOuter:0,paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0,sort:(t,e)=>e.value-t.value,layer:0}))(n,r),l,{layer:d?t=>1===t.depth:l.layer}),[g,y]=sS(o,p,a),m=ku(c,"label");return A({},((t,e)=>({type:"rect",axis:!1,encode:{x:"x",y:"y",key:"id",color:t=>t.path[1]},scale:{x:{domain:[0,t],range:[0,1]},y:{domain:[0,e],range:[0,1]}},style:{stroke:"#fff"},state:{active:{opacity:.6},inactive:{opacity:1}}}))(n,r),Object.assign(Object.assign({data:g,scale:s,style:c,labels:[Object.assign(Object.assign({},ZL),m),...u]},h),{encode:a,tooltip:oT(f,JL),axis:!1}),d?{interaction:Object.assign(Object.assign({},h.interaction),{treemapDrillDown:d?Object.assign(Object.assign({},d),{originData:y,layout:p}):void 0}),encode:Object.assign({color:t=>wO(t.path)},a),tooltip:oT(f,QL)}:{})};tR.props={};var eR=function(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 nR(t,e){return ky(t,(t=>e[t]))}function rR(t,e){return Sy(t,(t=>e[t]))}function iR(t,e){const n=2.5*oR(t,e)-1.5*sR(t,e);return ky(t,(t=>e[t]>=n?e[t]:NaN))}function oR(t,e){return xP(t,.25,(t=>e[t]))}function aR(t,e){return xP(t,.5,(t=>e[t]))}function sR(t,e){return xP(t,.75,(t=>e[t]))}function cR(t,e){const n=2.5*sR(t,e)-1.5*oR(t,e);return Sy(t,(t=>e[t]<=n?e[t]:NaN))}function lR(){return(t,e)=>{const{encode:n}=e,{y:r,x:i}=n,{value:o}=r,{value:a}=i,s=Array.from(uu(t,(t=>a[+t])).values()).flatMap((t=>{const e=iR(t,o),n=cR(t,o);return t.filter((t=>o[t]<e||o[t]>n))}));return[s,e]}}const uR=t=>{const{data:e,encode:n,style:r={},tooltip:i={},transform:o,animate:a}=t,s=eR(t,["data","encode","style","tooltip","transform","animate"]),{point:c=!0}=r,l=eR(r,["point"]),{y:u}=n,f={y:u,y1:u,y2:u,y3:u,y4:u},h={y1:oR,y2:aR,y3:sR},d=iT(i,"box",{items:[{channel:"y",name:"min"},{channel:"y1",name:"q1"},{channel:"y2",name:"q2"},{channel:"y3",name:"q3"},{channel:"y4",name:"max"}]},!0),p=iT(i,"point",{title:{channel:"x"},items:[{name:"outlier",channel:"y"}]});if(!c)return Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:nR},h),{y4:rR})],encode:Object.assign(Object.assign({},n),f),style:l,tooltip:d},s);const g=ku(l,"box"),y=ku(l,"point");return[Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:iR},h),{y4:cR})],encode:Object.assign(Object.assign({},n),f),style:g,tooltip:d,animate:sT(a,"box")},s),{type:"point",data:e,transform:[{type:lR}],encode:n,style:Object.assign({},y),tooltip:p,animate:sT(a,"point")}]};uR.props={};const fR=(t,e)=>Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))/2,hR=(t,e)=>{if(!e)return;const{coordinate:n}=e;if(!(null==n?void 0:n.getCenter))return;const r=n.getCenter();return(n,i,o)=>{const{document:a}=e.canvas,{color:s,index:c}=i,l=a.createElement("g",{}),u=fR(n[0],n[1]),f=2*fR(n[0],r),h=a.createElement("path",{style:Object.assign(Object.assign(Object.assign({d:[["M",...n[0]],["A",u,u,0,1,0,...n[1]],["A",f+2*u,f+2*u,0,0,0,...n[2]],["A",u,u,0,1,0===c?0:1,...n[3]],["A",f,f,0,0,1,...n[0]],["Z"]]},o),bx(t,["shape","last","first"])),{fill:s||o.color})});return l.appendChild(h),l}};var dR=function(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};const pR={coordinate:{type:"radial",innerRadius:.9,outerRadius:1,startAngle:-1.1*Math.PI,endAngle:.1*Math.PI},axis:{x:!1},legend:!1,tooltip:!1,encode:{x:"x",y:"y",color:"color"},scale:{color:{range:["#30BF78","#D0D0D0"]}}},gR={style:{shape:(t,e)=>{const{shape:n,radius:r}=t,i=dR(t,["shape","radius"]),o=ku(i,"pointer"),a=ku(i,"pin"),{shape:s}=o,c=dR(o,["shape"]),{shape:l}=a,u=dR(a,["shape"]),{coordinate:f,theme:h}=e;return(t,e)=>{const n=t.map((t=>f.invert(t))),[o,a,d]=function(t,e){const{transformations:n}=t.getOptions(),[,...r]=n.find((t=>"polar"===t[0]));return r}(f),p=f.clone(),{color:g}=e,m=y({startAngle:o,endAngle:a,innerRadius:d,outerRadius:r});m.push(["cartesian"]),p.update({transformations:m});const v=n.map((t=>p.map(t))),[b,x]=qf(v),[O,w]=f.getCenter(),M=Object.assign(Object.assign({x1:b,y1:x,x2:O,y2:w,stroke:g},c),i),E=Object.assign(Object.assign({cx:O,cy:w,stroke:g},u),i),k=Cu(new _c);return ju(s)||("function"==typeof s?k.append((()=>s(v,e,p,h))):k.append("line").call(Bf,M).node()),ju(l)||("function"==typeof l?k.append((()=>l(v,e,p,h))):k.append("circle").call(Bf,E).node()),k.node()}},lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},yR={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"}};function mR(t,{target:e,total:n}){const{content:r}=t;return r?r(e,n):e.toString()}const vR=t=>{const{data:e={},scale:n={},style:r={},animate:i={},transform:o=[]}=t,a=dR(t,["data","scale","style","animate","transform"]),{targetData:s,totalData:c,target:l,total:u,scale:f}=function(t,e){const{name:n="score",target:r,total:i,percent:o,thresholds:a=[]}=function(t){if(Qe(t)){const e=Math.max(0,Math.min(t,1));return{percent:e,target:e,total:1}}return t}(t),s=o||r,c=o?1:i,l=Object.assign({y:{domain:[0,c]}},e);return a.length?{targetData:[{x:n,y:s,color:"target"}],totalData:a.map(((t,e)=>({x:n,y:e>=1?t-a[e-1]:t,color:e}))),target:s,total:c,scale:l}:{targetData:[{x:n,y:s,color:"target"}],totalData:[{x:n,y:s,color:"target"},{x:n,y:c-s,color:"total"}],target:s,total:c,scale:l}}(e,n),h=ku(r,"text"),d=(p=r,g=["pointer","pin"],Object.fromEntries(Object.entries(p).filter((([t])=>g.find((e=>t.startsWith(e)))))));var p,g;const y=ku(r,"arc"),m=y.shape;return[A({},pR,Object.assign({type:"interval",transform:[{type:"stackY"}],data:c,scale:f,style:"round"===m?Object.assign(Object.assign({},y),{shape:hR}):y,animate:"object"==typeof i?ku(i,"arc"):i},a)),A({},pR,gR,Object.assign({type:"point",data:s,scale:f,style:d,animate:"object"==typeof i?ku(i,"indicator"):i},a)),A({},yR,{style:Object.assign({text:mR(h,{target:l,total:u})},h),animate:"object"==typeof i?ku(i,"text"):i})]};function bR(t,e,n){return t+(e-t)*n}function xR(t,e,n,r){return 0===e?[[t+.5*n/Math.PI/2,r/2],[t+.5*n/Math.PI,r],[t+n/4,r]]:1===e?[[t+.5*n/Math.PI/2*(Math.PI-2),r],[t+.5*n/Math.PI/2*(Math.PI-1),r/2],[t+n/4,0]]:2===e?[[t+.5*n/Math.PI/2,-r/2],[t+.5*n/Math.PI,-r],[t+n/4,-r]]:[[t+.5*n/Math.PI/2*(Math.PI-2),-r],[t+.5*n/Math.PI/2*(Math.PI-1),-r/2],[t+n/4,0]]}function OR(t,e,n,r,i,o,a){const s=4*Math.ceil(2*t/n*4),c=[];let l=r;for(;l<2*-Math.PI;)l+=2*Math.PI;for(;l>0;)l-=2*Math.PI;l=l/Math.PI/2*n;const u=o-t+l-2*t;c.push(["M",u,e]);let f=0;for(let t=0;t<s;++t){const r=xR(t*n/4,t%4,n,i);c.push(["C",r[0][0]+u,-r[0][1]+e,r[1][0]+u,-r[1][1]+e,r[2][0]+u,-r[2][1]+e]),t===s-1&&(f=r[2][0])}return c.push(["L",f+u,a+t]),c.push(["L",u,a+t]),c.push(["Z"]),c}vR.props={};const wR={pin:function(t,e,n){const r=4*n/3,i=Math.max(r,2*n),o=r/2,a=t,s=o+e-i/2,c=Math.asin(o/(.85*(i-o))),l=Math.sin(c)*o,u=Math.cos(c)*o,f=a-u,h=s+l,d=t,p=s+o/Math.sin(c);return`\n M ${f} ${h}\n A ${o} ${o} 0 1 1 ${f+2*u} ${h}\n Q ${d} ${p} ${t} ${e+i/2}\n Q ${d} ${p} ${f} ${h}\n Z \n `},rect:function(t,e,n){const r=.618*n;return`\n M ${t-r} ${e-n}\n L ${t+r} ${e-n}\n L ${t+r} ${e+n}\n L ${t-r} ${e+n}\n Z\n `},circle:function(t,e,n){return`\n M ${t} ${e-n} \n a ${n} ${n} 0 1 0 0 ${2*n}\n a ${n} ${n} 0 1 0 0 ${2*-n}\n Z\n `},diamond:function(t,e,n){return`\n M ${t} ${e-n}\n L ${t+n} ${e}\n L ${t} ${e+n}\n L ${t-n} ${e}\n Z\n `},triangle:function(t,e,n){return`\n M ${t} ${e-n}\n L ${t+n} ${e+n}\n L ${t-n} ${e+n}\n Z\n `}};var MR=function(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};const ER=(t,e)=>{if(!e)return;const{coordinate:n}=e,{liquidOptions:r,styleOptions:i}=t,{liquidShape:o,percent:a}=r,{background:s,outline:c={},wave:l={}}=i,u=MR(i,["background","outline","wave"]),{border:f=2,distance:h=0}=c,d=MR(c,["border","distance"]),{length:p=192,count:g=3}=l;return(t,r,i)=>{const{document:c}=e.canvas,{color:l,fillOpacity:y}=i,m=Object.assign(Object.assign({fill:l},i),u),v=c.createElement("g",{}),[b,x]=n.getCenter(),O=n.getSize(),w=Math.min(...O)/2,M=kp(o)?o:((t="circle")=>wR[t]||wR.circle)(o),E=M(b,x,w,...O);if(Object.keys(s).length){const t=c.createElement("path",{style:Object.assign({d:E,fill:"#fff"},s)});v.appendChild(t)}if(a>0){const t=c.createElement("path",{style:{d:E}});v.appendChild(t),v.style.clipPath=t,function(t,e,n,r,i,o,a,s,c,l,u){const{fill:f,fillOpacity:h,opacity:d}=i;for(let i=0;i<r;i++){const l=r<=1?1:i/(r-1),p=OR(s,a+s*n,c,0,s/40,t,e),g=u.createElement("path",{style:{d:p,fill:f,opacity:bR(.2,.9,l)*Number(d||h)}});o.appendChild(g);try{0;const t=[{transform:"translate(0, 0)"},{transform:`translate(${2*c}, 0)`}];g.animate(t,{duration:2*bR(2500,5e3,l),iterations:1/0})}catch(t){console.warn("off-screen group animate error!")}}}(b,x,1-a,g,m,v,t.getBBox().y,2*w,p,0,c)}const k=c.createElement("path",{style:{d:E,fill:"transparent",lineWidth:f+2*h,stroke:"#fff"}}),S=c.createElement("path",{style:Object.assign(Object.assign(Object.assign({d:E,stroke:l,strokeOpacity:y,lineWidth:f},m),d),{fill:"transparent"})});return v.appendChild(k),v.appendChild(S),v}};ER.props={};const kR={axis:{x:!1,y:!1},legend:!1,tooltip:!1,encode:{x:"type",y:"percent"},scale:{y:{domain:[0,1]}},style:{shape:ER},animate:{enter:{type:"fadeIn"}}},SR={type:"text",style:{x:"50%",y:"50%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"},animate:{enter:{type:"fadeIn"}}},PR=t=>{const{data:e={},style:n={},animate:r}=t,i=function(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}(t,["data","style","animate"]),o=Math.max(0,Qe(e)?e:null==e?void 0:e.percent),a=[{percent:o,type:"liquid"}],s=Object.assign(Object.assign({},ku(n,"text")),ku(n,"content")),c=ku(n,"outline"),l=ku(n,"wave"),u=ku(n,"background");return[A({},kR,Object.assign({type:"interval",data:a,style:{liquidOptions:{percent:o,liquidShape:null==n?void 0:n.shape},styleOptions:Object.assign(Object.assign({},n),{outline:c,wave:l,background:u})},animate:r},i)),A({},SR,{style:Object.assign({text:`${Gu(100*o)} %`},s),animate:r})]};PR.props={};var _R=n(9561);const AR=1e-10;function jR(t,e){const n=function(t){const e=[];for(let n=0;n<t.length;++n)for(let r=n+1;r<t.length;++r){const i=LR(t[n],t[r]);for(let t=0;t<i.length;++t){const o=i[t];o.parentIndex=[n,r],e.push(o)}}return e}(t),r=n.filter((function(e){return function(t,e){for(let n=0;n<e.length;++n)if(CR(t,e[n])>e[n].radius+AR)return!1;return!0}(e,t)}));let i,o=0,a=0;const s=[];if(r.length>1){const e=function(t){const e={x:0,y:0};for(let n=0;n<t.length;++n)e.x+=t[n].x,e.y+=t[n].y;return e.x/=t.length,e.y/=t.length,e}(r);for(i=0;i<r.length;++i){const t=r[i];t.angle=Math.atan2(t.x-e.x,t.y-e.y)}r.sort((function(t,e){return e.angle-t.angle}));let n=r[r.length-1];for(i=0;i<r.length;++i){const e=r[i];a+=(n.x+e.x)*(e.y-n.y);const c={x:(e.x+n.x)/2,y:(e.y+n.y)/2};let l=null;for(let r=0;r<e.parentIndex.length;++r)if(n.parentIndex.indexOf(e.parentIndex[r])>-1){const i=t[e.parentIndex[r]],o=Math.atan2(e.x-i.x,e.y-i.y),a=Math.atan2(n.x-i.x,n.y-i.y);let s=a-o;s<0&&(s+=2*Math.PI);const u=a-s/2;let f=CR(c,{x:i.x+i.radius*Math.sin(u),y:i.y+i.radius*Math.cos(u)});f>2*i.radius&&(f=2*i.radius),(null===l||l.width>f)&&(l={circle:i,width:f,p1:e,p2:n})}null!==l&&(s.push(l),o+=TR(l.circle.radius,l.width),n=e)}}else{let e=t[0];for(i=1;i<t.length;++i)t[i].radius<e.radius&&(e=t[i]);let n=!1;for(i=0;i<t.length;++i)if(CR(t[i],e)>Math.abs(e.radius-t[i].radius)){n=!0;break}n?o=a=0:(o=e.radius*e.radius*Math.PI,s.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-AR,y:e.y+e.radius},width:2*e.radius}))}return a/=2,e&&(e.area=o+a,e.arcArea=o,e.polygonArea=a,e.arcs=s,e.innerPoints=r,e.intersectionPoints=n),o+a}function TR(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function CR(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function NR(t,e,n){if(n>=t+e)return 0;if(n<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const r=e-(n*n-t*t+e*e)/(2*n);return TR(t,t-(n*n-e*e+t*t)/(2*n))+TR(e,r)}function LR(t,e){const n=CR(t,e),r=t.radius,i=e.radius;if(n>=r+i||n<=Math.abs(r-i))return[];const o=(r*r-i*i+n*n)/(2*n),a=Math.sqrt(r*r-o*o),s=t.x+o*(e.x-t.x)/n,c=t.y+o*(e.y-t.y)/n,l=-(e.y-t.y)*(a/n),u=-(e.x-t.x)*(a/n);return[{x:s+l,y:c-u},{x:s-l,y:c+u}]}const RR=1e-10;function IR(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+RR?Math.abs(t-e):(0,_R.bisect)((function(r){return NR(t,e,r)-n}),0,t+e)}function zR(t,e){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:DR,r={},i={};let o;for(let e=0;e<t.length;++e){const n=t[e];1==n.sets.length&&(o=n.sets[0],r[o]={x:1e10,y:1e10,rowid:Object.keys(r).length,size:n.size,radius:Math.sqrt(n.size/Math.PI)},i[o]=[])}t=t.filter((function(t){return 2==t.sets.length}));for(let e=0;e<t.length;++e){const n=t[e];let o=n.hasOwnProperty("weight")?n.weight:1;const a=n.sets[0],s=n.sets[1];n.size+RR>=Math.min(r[a].size,r[s].size)&&(o=0),i[a].push({set:s,size:n.size,weight:o}),i[s].push({set:a,size:n.size,weight:o})}const a=[];for(o in i)if(i.hasOwnProperty(o)){let t=0;for(let e=0;e<i[o].length;++e)t+=i[o][e].size*i[o][e].weight;a.push({set:o,size:t})}function s(t,e){return e.size-t.size}a.sort(s);const c={};function l(t){return t.set in c}function u(t,e){r[e].x=t.x,r[e].y=t.y,c[e]=!0}u({x:0,y:0},a[0].set);for(let e=1;e<a.length;++e){const c=a[e].set,f=i[c].filter(l);if(o=r[c],f.sort(s),0===f.length)throw"ERROR: missing pairwise overlap information";const h=[];for(let t=0;t<f.length;++t){const e=r[f[t].set],n=IR(o.radius,e.radius,f[t].size);h.push({x:e.x+n,y:e.y}),h.push({x:e.x-n,y:e.y}),h.push({y:e.y+n,x:e.x}),h.push({y:e.y-n,x:e.x});for(let i=t+1;i<f.length;++i){const t=r[f[i].set],a=IR(o.radius,t.radius,f[i].size),s=LR({x:e.x,y:e.y,radius:n},{x:t.x,y:t.y,radius:a});for(let t=0;t<s.length;++t)h.push(s[t])}}let d=1e50,p=h[0];for(let e=0;e<h.length;++e){r[c].x=h[e].x,r[c].y=h[e].y;const i=n(r,t);i<d&&(d=i,p=h[e])}u(p,c)}return r}(t,e);const r=e.lossFunction||DR;if(t.length>=8){const i=function(t,e){const n=(e=e||{}).restarts||10,r=[],i={};let o;for(o=0;o<t.length;++o){const e=t[o];1==e.sets.length&&(i[e.sets[0]]=r.length,r.push(e))}const a=function(t,e,n){const r=(0,_R.zerosM)(e.length,e.length),i=(0,_R.zerosM)(e.length,e.length);return t.filter((function(t){return 2==t.sets.length})).map((function(t){const o=n[t.sets[0]],a=n[t.sets[1]],s=IR(Math.sqrt(e[o].size/Math.PI),Math.sqrt(e[a].size/Math.PI),t.size);r[o][a]=r[a][o]=s;let c=0;t.size+1e-10>=Math.min(e[o].size,e[a].size)?c=1:t.size<=1e-10&&(c=-1),i[o][a]=i[a][o]=c})),{distances:r,constraints:i}}(t,r,i);let s=a.distances;const c=a.constraints,l=(0,_R.norm2)(s.map(_R.norm2))/s.length;s=s.map((function(t){return t.map((function(t){return t/l}))}));const u=function(t,e){return function(t,e,n,r){let i,o=0;for(i=0;i<e.length;++i)e[i]=0;for(i=0;i<n.length;++i){const a=t[2*i],s=t[2*i+1];for(let c=i+1;c<n.length;++c){const l=t[2*c],u=t[2*c+1],f=n[i][c],h=r[i][c],d=(l-a)*(l-a)+(u-s)*(u-s),p=Math.sqrt(d),g=d-f*f;h>0&&p<=f||h<0&&p>=f||(o+=2*g*g,e[2*i]+=4*g*(a-l),e[2*i+1]+=4*g*(s-u),e[2*c]+=4*g*(l-a),e[2*c+1]+=4*g*(u-s))}}return o}(t,e,s,c)};let f,h;for(o=0;o<n;++o){const t=(0,_R.zeros)(2*s.length).map(Math.random);h=(0,_R.conjugateGradient)(u,t,e),(!f||h.fx<f.fx)&&(f=h)}const d=f.x,p={};for(o=0;o<r.length;++o){const t=r[o];p[t.sets[0]]={x:d[2*o]*l,y:d[2*o+1]*l,radius:Math.sqrt(t.size/Math.PI)}}if(e.history)for(o=0;o<e.history.length;++o)(0,_R.scale)(e.history[o].x,l);return p}(t,e);r(i,t)+1e-8<r(n,t)&&(n=i)}return n}function DR(t,e){let n=0;for(let r=0;r<e.length;++r){const i=e[r];let o;if(1!=i.sets.length){if(2==i.sets.length){const e=t[i.sets[0]],n=t[i.sets[1]];o=NR(e.radius,n.radius,CR(e,n))}else o=jR(i.sets.map((function(e){return t[e]})));n+=(i.hasOwnProperty("weight")?i.weight:1)*(o-i.size)*(o-i.size)}}return n}const BR=t=>{const{sets:e="sets",size:n="size",as:r=["key","path"],padding:i=0}=t,[o,a]=r;return t=>{const r=t.map((t=>Object.assign(Object.assign({},t),{sets:t[e],size:t[n],[o]:t.sets.join("&")})));r.sort(((t,e)=>t.sets.length-e.sets.length));const s=function(t,e){(e=e||{}).maxIterations=e.maxIterations||500;const n=e.initialLayout||zR,r=e.lossFunction||DR;t=function(t){t=t.slice();const e=[],n={};let r,i,o,a;for(r=0;r<t.length;++r){const i=t[r];1==i.sets.length?e.push(i.sets[0]):2==i.sets.length&&(o=i.sets[0],a=i.sets[1],n[[o,a]]=!0,n[[a,o]]=!0)}for(e.sort(((t,e)=>t>e?1:-1)),r=0;r<e.length;++r)for(o=e[r],i=r+1;i<e.length;++i)a=e[i],[o,a]in n||t.push({sets:[o,a],size:0});return t}(t);const i=n(t,e),o=[],a=[];let s;for(s in i)i.hasOwnProperty(s)&&(o.push(i[s].x),o.push(i[s].y),a.push(s));const c=(0,_R.nelderMead)((function(e){const n={};for(let t=0;t<a.length;++t){const r=a[t];n[r]={x:e[2*t],y:e[2*t+1],radius:i[r].radius}}return r(n,t)}),o,e),l=c.x;for(let t=0;t<a.length;++t)s=a[t],i[s].x=l[2*t],i[s].y=l[2*t+1];return i}(r);let c;return r.map((t=>{const n=t[e];return Object.assign(Object.assign({},t),{[a]:({width:t,height:e})=>{c=c||function(t,e,n,r){const i=[],o=[];for(const e in t)t.hasOwnProperty(e)&&(o.push(e),i.push(t[e]));e-=2*r,n-=2*r;const a=function(t){const e=function(e){const n=Math.max.apply(null,t.map((function(t){return t[e]+t.radius}))),r=Math.min.apply(null,t.map((function(t){return t[e]-t.radius})));return{max:n,min:r}};return{xRange:e("x"),yRange:e("y")}}(i),s=a.xRange,c=a.yRange;if(s.max==s.min||c.max==c.min)return console.log("not scaling solution: zero size detected"),t;const l=e/(s.max-s.min),u=n/(c.max-c.min),f=Math.min(u,l),h=(e-(s.max-s.min)*f)/2,d=(n-(c.max-c.min)*f)/2,p={};for(let t=0;t<i.length;++t){const e=i[t];p[o[t]]={radius:f*e.radius,x:r+h+(e.x-s.min)*f,y:r+d+(e.y-c.min)*f}}return p}(s,t,e,i);const r=n.map((t=>c[t]));let o=function(t){const e={};jR(t,e);const n=e.arcs;if(0===n.length)return"M 0 0";if(1==n.length){const t=n[0].circle;return function(t,e,n){const r=[],i=t-n,o=e;return r.push("M",i,o),r.push("A",n,n,0,1,0,i+2*n,o),r.push("A",n,n,0,1,0,i,o),r.join(" ")}(t.x,t.y,t.radius)}{const t=["\nM",n[0].p2.x,n[0].p2.y];for(let e=0;e<n.length;++e){const r=n[e],i=r.circle.radius,o=r.width>i;t.push("\nA",i,i,0,o?1:0,1,r.p1.x,r.p1.y)}return t.join(" ")}}(r);return/[zZ]$/.test(o)||(o+=" Z"),o}})}))}};function FR(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 WR(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 $R(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,h=0,d=0,p=0,g=0,y=0;c&&yc(c)&&u&&(n=a-i,r=s-o,y=Math.atan2(r,n),h=Math.cos(y)*(u||0),d=Math.sin(y)*(u||0)),l&&yc(l)&&f&&(n=i-a,r=o-s,y=Math.atan2(r,n),p=Math.cos(y)*(f||0),g=Math.sin(y)*(f||0)),t.moveTo(i+h,o+d),t.lineTo(a+p,s+g)}function GR(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,h=0,d=0,p=0,g=0;if(i&&yc(i)&&a){var y=(0,Mt.zs)(i.parentNode.getStartTangent(),2),m=y[0],v=y[1];n=m[0]-v[0],r=m[1]-v[1],g=Math.atan2(r,n),f=Math.cos(g)*(a||0),h=Math.sin(g)*(a||0)}if(o&&yc(o)&&s){var b=(0,Mt.zs)(o.parentNode.getEndTangent(),2);m=b[0],v=b[1],n=m[0]-v[0],r=m[1]-v[1],g=Math.atan2(r,n),d=Math.cos(g)*(s||0),p=Math.sin(g)*(s||0)}for(var x=0;x<l.length;x++){var O=l[x],w=O[0],M=l[x+1],E=0===x&&(0!==f||0!==h),k=(x===l.length-1||M&&("M"===M[0]||"Z"===M[0]))&&0!==d&&0!==p;switch(w){case"M":E?(t.moveTo(O[1]+f,O[2]+h),t.lineTo(O[1],O[2])):t.moveTo(O[1],O[2]);break;case"L":k?t.lineTo(O[1]+d,O[2]+p):t.lineTo(O[1],O[2]);break;case"Q":t.quadraticCurveTo(O[1],O[2],O[3],O[4]),k&&t.lineTo(O[3]+d,O[4]+p);break;case"C":t.bezierCurveTo(O[1],O[2],O[3],O[4],O[5],O[6]),k&&t.lineTo(O[5]+d,O[6]+p);break;case"A":var S=u[x].arcParams,P=S.cx,_=S.cy,A=S.rx,j=S.ry,T=S.startAngle,C=S.endAngle,N=S.xRotation,L=S.sweepFlag;if(t.ellipse)t.ellipse(P,_,A,j,N,T,C,!!(1-L));else{var R=A>j?A:j,I=A>j?1:A/j,z=A>j?j/A:1;t.translate(P,_),t.rotate(N),t.scale(I,z),t.arc(0,0,R,T,C,!!(1-L)),t.scale(1/I,1/z),t.rotate(-N),t.translate(-P,-_)}k&&t.lineTo(O[6]+d,O[7]+p);break;case"Z":t.closePath()}}}function HR(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],h=c[l-1][0],d=c[l-1][1],p=0,g=0,y=0,m=0,v=0;i&&yc(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&&yc(o)&&s&&(n=c[l-1][0]-c[0][0],r=c[l-1][1]-c[0][1],v=Math.atan2(r,n),y=Math.cos(v)*(s||0),m=Math.sin(v)*(s||0)),t.moveTo(u+(p||y),f+(g||m));for(var b=1;b<l-1;b++){var x=c[b];t.lineTo(x[0],x[1])}t.lineTo(h,d)}function VR(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],h=c[l-1][0],d=c[l-1][1],p=0,g=0,y=0,m=0,v=0;i&&yc(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&&yc(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),y=Math.cos(v)*(s||0),m=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(h+y,d+m)}function qR(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,h=c>0?1:-1,d=f+h===0,p=(0,Mt.zs)(a.map((function(t){return rn(t,0,Math.min(Math.abs(l)/2,Math.abs(u)/2))})),4),g=p[0],y=p[1],m=p[2],v=p[3];t.moveTo(f*g+r,o),t.lineTo(l-f*y+r,o),0!==y&&t.arc(l-f*y+r,h*y+o,y,-h*Math.PI/2,f>0?0:Math.PI,d),t.lineTo(l+r,u-h*m+o),0!==m&&t.arc(l-f*m+r,u-h*m+o,m,f>0?0:Math.PI,h>0?Math.PI/2:1.5*Math.PI,d),t.lineTo(f*v+r,u+o),0!==v&&t.arc(f*v+r,u-h*v+o,v,h>0?Math.PI/2:-Math.PI/2,f>0?Math.PI:0,d),t.lineTo(r,h*g+o),0!==g&&t.arc(f*g+r,h*g+o,g,f>0?Math.PI:0,h>0?1.5*Math.PI:Math.PI/2,d)}else t.rect(r,o,l,u)}BR.props={};var XR=function(t){function e(){var e=t.apply(this,(0,Mt.fX)([],(0,Mt.zs)(arguments),!1))||this;return e.name="canvas-path-generator",e}return(0,Mt.C6)(e,t),e.prototype.init=function(){var t,e=((t={})[Wr.CIRCLE]=FR,t[Wr.ELLIPSE]=WR,t[Wr.RECT]=qR,t[Wr.LINE]=$R,t[Wr.POLYLINE]=VR,t[Wr.POLYGON]=HR,t[Wr.PATH]=GR,t[Wr.TEXT]=void 0,t[Wr.GROUP]=void 0,t[Wr.IMAGE]=void 0,t[Wr.HTML]=void 0,t[Wr.MESH]=void 0,t);this.context.pathGeneratorFactory=e},e.prototype.destroy=function(){delete this.context.pathGeneratorFactory},e}(Hr),YR=Pt(),UR=Pt(),KR=Pt(),ZR=Gt(),JR=function(){function t(){var t=this;this.isHit=function(e,n,r,i){var o=t.context.pointInPathPickerFactory[e.nodeName];if(o){var a=Kt(ZR,r),s=Bt(UR,Ct(KR,n[0],n[1],0),a);if(o(e,new gi(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(0,Mt.sH)(i,void 0,void 0,(function(){return(0,Mt.YH)(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=Ct(YR,a,s,0),l=t.elementsFromBBox(c[0],c[1],c[0],c[1]),u=[];try{for(var f=(0,Mt.Ju)(l),h=f.next();!h.done;h=f.next()){var d=h.value,p=d.getWorldTransform();if(this.isHit(d,c,p,!1)){var g=Ja(d);if(g){var y=g.parsedStyle.clipPath;if(this.isHit(y,c,y.getWorldTransform(),!0)){if(i)return e.picked=[d],e;u.push(d)}}else{if(i)return e.picked=[d],e;u.push(d)}}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return e.picked=u,e},t.tag="CanvasPicker",t}();function QR(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,h=void 0===f?1:f,d=r.increasedLineWidthForHitTesting,p=void 0===d?0:d,g=r.pointerEvents,y=void 0===g?"auto":g,m=(h+p)/2,v=Mr(o,s,e.x,e.y),b=(0,Mt.zs)(ns(y,l,u),2),x=b[0],O=b[1];return x&&O||n?v<=c+m:x?v<=c:!!O&&v>=c-m&&v<=c+m}function tI(t,e,n,r){return t/(n*n)+e/(r*r)}function eI(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,h=r.lineWidth,d=void 0===h?1:h,p=r.increasedLineWidthForHitTesting,g=void 0===p?0:p,y=r.pointerEvents,m=void 0===y?"auto":y,v=e.x,b=e.y,x=(0,Mt.zs)(ns(m,u,f),2),O=x[0],w=x[1],M=(d+g)/2,E=(v-o)*(v-o),k=(b-s)*(b-s);return O&&w||n?tI(E,k,c+M,l+M)<=1:O?tI(E,k,c,l)<=1:!!w&&tI(E,k,c-M,l-M)>=1&&tI(E,k,c+M,l+M)<=1}function nI(t,e,n,r,i,o){return i>=t&&i<=t+n&&o>=e&&o<=e+r}function rI(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 Mr(l.x,l.y,a,s)<=o/2}function iI(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&&function(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))}(t,e,n,r,o,a)<=i/2}function oI(t,e,n,r,i){var o=t.length;if(o<2)return!1;for(var a=0;a<o-1;a++)if(iI(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(iI(s[0],s[1],c[0],c[1],e,n,r))return!0}return!1}var aI=1e-6;function sI(t){return Math.abs(t)<aI?0:t<0?-1:1}function cI(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 lI(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(cI(a,s,[e,n]))return!0;sI(a[1]-n)>0!=sI(s[1]-n)>0&&sI(e-(n-a[1])*(a[0]-s[0])/(a[1]-s[1])-a[0])<0&&(r=!r)}return r}function uI(t,e,n){for(var r=!1,i=0;i<t.length&&!(r=lI(t[i],e,n));i++);return r}function fI(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,h=r.pointerEvents,d=void 0===h?"auto":h,p=r.fill,g=r.stroke;return!(!(0,Mt.zs)(ns(d,p,g),2)[1]&&!n||!l)&&iI(i,o,a,s,l+f,e.x,e.y)}function hI(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,h=a.fill,d=a.d,p=a.pointerEvents,g=void 0===p?"auto":p,y=d.segments,m=d.hasArc,v=d.polylines,b=d.polygons,x=(0,Mt.zs)(ns(g,(null==b?void 0:b.length)&&h,f),2),O=x[0],w=x[1],M=Wo(t),E=!1;return O||n?E=m?r(t,e):uI(b,e.x,e.y)||uI(v,e.x,e.y):((w||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,h=c.box;if(!h||nI(h.x-a,h.y-a,h.width+e,h.height+e,n,r))switch(c.command){case"L":case"Z":if(o=iI(f[0],f[1],l[0],l[1],e,n,r))return!0;break;case"Q":if(o=Br(f[0],f[1],u[1],u[2],u[3],u[4],n,r)<=e/2)return!0;break;case"C":if(o=Rr(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=zn(f[0],f[1],u[1],u[2],u[3],u[4],u[5],u[6],u[7],void 0));for(var d=c.cubicParams,p=f,g=0;g<d.length;g+=6){var y=Rr(p[0],p[1],d[g],d[g+1],d[g+2],d[g+3],d[g+4],d[g+5],n,r,i);if(p=[d[g+4],d[g+5]],o=y<=e/2)return!0}}}return o}(y,c+u,e.x,e.y,M)),E)}function dI(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,h=void 0===f?"auto":f,d=(0,Mt.zs)(ns(h,o,i),2),p=d[0],g=!1;return(d[1]||n)&&(g=oI(u.points,s+l,e.x,e.y,!0)),g||!p&&!n||(g=lI(u.points,e.x,e.y)),g}function pI(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,u=void 0===l?"auto":l,f=r.fill,h=r.stroke;return!(!(0,Mt.zs)(ns(u,f,h),2)[1]&&!n||!o)&&oI(c.points,o+s,e.x,e.y,!1)}function gI(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,h=void 0===f?0:f,d=o.x,p=void 0===d?0:d,g=o.y,y=void 0===g?0:g,m=o.width,v=o.height,b=o.pointerEvents,x=void 0===b?"auto":b,O=(0,Mt.zs)(ns(x,s,c),2),w=O[0],M=O[1],E=u+h;if(a&&a.some((function(t){return 0!==t}))){var k=!1;return(M||n)&&(k=function(t,e,n,r,i,o,a,s){var c=(0,Mt.zs)(i,4),l=c[0],u=c[1],f=c[2],h=c[3];return iI(t+l,e,t+n-u,e,o,a,s)||iI(t+n,e+u,t+n,e+r-f,o,a,s)||iI(t+n-f,e+r,t+h,e+r,o,a,s)||iI(t,e+r-h,t,e+l,o,a,s)||rI(t+n-u,e+u,u,Math.PI,Math.PI,o,a,s)||rI(t+n-f,e+r-f,f,0,Math.PI,o,a,s)||rI(t+h,e+r-h,h,Math.PI,Math.PI,o,a,s)||rI(t+l,e+l,l,Math.PI,Math.PI,o,a,s)}(p,y,m,v,a.map((function(t){return rn(t,0,Math.min(Math.abs(m)/2,Math.abs(v)/2))})),E,e.x,e.y)),k||!w&&!n||(k=r(t,e)),k}var S=E/2;return w&&M||n?nI(p-S,y-S,m+S,v+S,e.x,e.y):w?nI(p,y,m,v,e.x,e.y):!!M&&function(t,e,n,r,i,o,a){var s=i/2;return nI(t-s,e-s,n,i,o,a)||nI(t+n-s,e-s,i,r,o,a)||nI(t+s,e+r-s,n,i,o,a)||nI(t-s,e+s,i,r,o,a)}(p,y,m,v,E,e.x,e.y)}function yI(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,h=void 0===f?0:f,d=a.width,p=a.height;if("non-transparent-pixel"===c){var g=i.config.offscreenCanvas,y=o.offscreenCanvasCreator.getOrCreateCanvas(g),m=o.offscreenCanvasCreator.getOrCreateContext(g,{willReadFrequently:!0});return y.width=d,y.height=p,i.defaultStyleRendererFactory[Wr.IMAGE].render(m,(0,Mt.Cl)((0,Mt.Cl)({},t.parsedStyle),{x:0,y:0}),t,void 0,void 0,void 0),m.getImageData(e.x-u,e.y-h,1,1).data.every((function(t){return 0!==t}))}return!0}var mI=function(t){function e(){var e=t.apply(this,(0,Mt.fX)([],(0,Mt.zs)(arguments),!1))||this;return e.name="canvas-picker",e}return(0,Mt.C6)(e,t),e.prototype.init=function(){var t,e=((t={})[Wr.CIRCLE]=QR,t[Wr.ELLIPSE]=eI,t[Wr.RECT]=gI,t[Wr.LINE]=fI,t[Wr.POLYLINE]=pI,t[Wr.POLYGON]=dI,t[Wr.PATH]=hI,t[Wr.TEXT]=function(){return!0},t[Wr.GROUP]=null,t[Wr.IMAGE]=yI,t[Wr.HTML]=null,t[Wr.MESH]=null,t);this.context.pointInPathPickerFactory=e,this.addRenderingPlugin(new JR)},e.prototype.destroy=function(){delete this.context.pointInPathPickerFactory,this.removeAllRenderingPlugins()},e}(Hr),vI=function(){function t(t){this.canvasRendererPluginOptions=t,this.removedRBushNodeAABBs=[],this.renderQueue=[],this.restoreStack=[],this.clearFullScreenLastFrame=!1,this.clearFullScreen=!1,this.vpMatrix=Gt(),this.dprMatrix=Gt(),this.tmpMat4=Gt(),this.vec3a=Pt(),this.vec3b=Pt(),this.vec3c=Pt(),this.vec3d=Pt()}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,h=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)},d=function(t){var e=t.target.rBushNode;e.aabb&&r.removedRBushNodeAABBs.push(e.aabb)};a.hooks.init.tap(t.tag,(function(){f.addEventListener(qs.UNMOUNTED,h),f.addEventListener(qs.CULLED,d);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(qs.UNMOUNTED,h),f.removeEventListener(qs.CULLED,d),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,h=c.dirtyObjectRatioThreshold,d=a.getStats(),p=d.total,g=d.rendered,y=g/p;r.clearFullScreen=r.clearFullScreenLastFrame||!(null===(t=f.context.renderingPlugins[1])||void 0===t?void 0:t.isFirstTimeRenderingFinished)||a.disableDirtyRectangleRendering()||g>l&&y>h,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(se(r.dprMatrix,[e,e,1]),Qt(r.vpMatrix,r.dprMatrix,o.getOrthoMatrix()),r.clearFullScreen)p(s.root,t);else{var a=r.safeMergeAABB.apply(r,(0,Mt.fX)([r.mergeDirtyAABBs(r.renderQueue)],(0,Mt.zs)(r.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,r=t.maxX,i=t.maxY,o=new li;return o.setMinMax([e,n,0],[r,i,0]),o}))),!1));if(r.removedRBushNodeAABBs=[],li.isEmpty(a))return void(r.renderQueue=[]);var c=r.convertAABB2Rect(a),l=c.x,h=c.y,d=c.width,g=c.height,y=Bt(r.vec3a,[l,h,0],r.vpMatrix),m=Bt(r.vec3b,[l+d,h,0],r.vpMatrix),v=Bt(r.vec3c,[l,h+g,0],r.vpMatrix),b=Bt(r.vec3d,[l+d,h+g,0],r.vpMatrix),x=Math.min(y[0],m[0],b[0],v[0]),O=Math.min(y[1],m[1],b[1],v[1]),w=Math.max(y[0],m[0],b[0],v[0]),M=Math.max(y[1],m[1],b[1],v[1]),E=Math.floor(x),k=Math.floor(O),S=Math.ceil(w-x),P=Math.ceil(M-O);t.save(),r.clearRect(t,E,k,S,P,i.background),t.beginPath(),t.rect(E,k,S,P),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 Ws(mc.DIRTY_RECTANGLE,{dirtyRect:{x:E,y:k,width:S,height:P}})),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)&Gs.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!==Wr.LINE&&t.nodeName!==Wr.PATH&&t.nodeName!==Wr.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 li;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=(0,Mt.zs)(t.getMin(),2),n=e[0],r=e[1],i=(0,Mt.zs)(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 li);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),en(s)||(t.lineDashOffset=s),en(o)||(t.globalAlpha*=o),en(r)||Array.isArray(r)||r.isNone||(t.strokeStyle=e.attributes.stroke),en(i)||Array.isArray(i)||i.isNone||(t.fillStyle=e.attributes.fill)},t.prototype.applyWorldTransform=function(t,e,n){n?(Vt(this.tmpMat4,e.getLocalTransform()),Qt(this.tmpMat4,n,this.tmpMat4),Qt(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(Vt(this.tmpMat4,e.getWorldTransform()),Qt(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 li;return t.forEach((function(t){n.add(t)})),n},t.tag="CanvasRenderer",t}(),bI=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,h=e.stroke,d=e.strokeOpacity,p=void 0===d?1:d,g=e.lineWidth,y=void 0===g?1:g,m=e.lineCap,v=e.lineJoin,b=e.shadowType,x=e.shadowColor,O=e.shadowBlur,w=e.filter,M=e.miterLimit,E=!en(a)&&!a.isNone,k=!en(h)&&!h.isNone&&y>0,S=0===(null==a?void 0:a.alpha),P=!(!w||!w.length),_=!en(x)&&O>0,A=n.nodeName,j="inner"===b,T=k&&_&&(A===Wr.PATH||A===Wr.LINE||A===Wr.POLYLINE||S||j);E&&(t.globalAlpha=l*f,T||xI(n,t,_),this.fill(t,n,a,s,r,i,o),T||this.clearShadowAndFilter(t,P,_)),k&&(t.globalAlpha=l*p,t.lineWidth=y,en(M)||(t.miterLimit=M),en(m)||(t.lineCap=m),en(v)||(t.lineJoin=v),T&&(j&&(t.globalCompositeOperation="source-atop"),xI(n,t,!0),j&&(this.stroke(t,n,h,r,i,o),t.globalCompositeOperation="source-over",this.clearShadowAndFilter(t,P,!0))),this.stroke(t,n,h,r,i,o))},t.prototype.clearShadowAndFilter=function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var r=t.filter;!en(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()})):(mo(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()})):(mo(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 h=o.offscreenCanvasCreator.getOrCreateContext(f),d=[];t.image.forEach((function(t){i.renderDisplayObject(t,h,r,d,o)})),d.forEach((function(){h.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===ji.LinearGradient||t.type===ji.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((0,Mt.Cl)((0,Mt.Cl)({type:t.type},t.value),{min:s,width:o,height:a}),n)}return r},t}();function xI(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 OI,wI=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,h=e.shadowBlur,d=c,p=l;if(nn(u)?r=this.imagePool.getImageSync(u):(d||(d=u.width),p||(p=u.height),r=u),r){xI(n,t,!en(f)&&h>0);try{t.drawImage(r,o,s,d,p)}catch(t){}}},t}(),MI=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,h=void 0===f?"alphabetic":f,d=a.lineJoin,p=void 0===d?"miter":d,g=a.miterLimit,y=void 0===g?10:g,m=a.letterSpacing,v=void 0===m?0:m,b=a.stroke,x=a.fill,O=a.fillOpacity,w=void 0===O?1:O,M=a.strokeOpacity,E=void 0===M?1:M,k=a.opacity,S=void 0===k?1:k,P=a.metrics,_=a.x,A=void 0===_?0:_,j=a.y,T=void 0===j?0:j,C=a.dx,N=a.dy,L=a.shadowColor,R=a.shadowBlur,I=P.font,z=P.lines,D=P.height,B=P.lineHeight,F=P.lineMetrics;t.font=I,t.lineWidth=c,t.textAlign="middle"===u?"center":u;var W=h;o.enableCSSParsing||"alphabetic"!==W||(W="bottom"),t.lineJoin=p,en(y)||(t.miterLimit=y);var $=T;"middle"===h?$+=-D/2-B/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?$+=-D:"top"!==h&&"hanging"!==h||($+=-B);var G=A+(C||0);$+=N||0,1===z.length&&("bottom"===W?(W="middle",$-=.5*D):"top"===W&&(W="middle",$+=.5*D)),t.textBaseline=W,xI(n,t,!en(L)&&R>0);for(var H=0;H<z.length;H++){var V=c/2+G;$+=B,en(b)||b.isNone||!c||this.drawLetterSpacing(t,z[H],F[H],u,V,$,v,w,E,S,!0),en(x)||this.drawLetterSpacing(t,z[H],F[H],u,V,$,v,w,E,S)}},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 h=i;"center"===r||"middle"===r?h=i-n.width/2:"right"!==r&&"end"!==r||(h=i-n.width);for(var d=Array.from(e),p=t.measureText(e).width,g=0,y=0;y<d.length;++y){var m=d[y];u?this.strokeText(t,m,h,o,c):this.fillText(t,m,h,o,s,l),h+=p-(g=t.measureText(e.substring(y+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=!en(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=!en(i)&&1!==i;a&&(o=t.globalAlpha,t.globalAlpha=i),t.strokeText(e,n,r),a&&(t.globalAlpha=o)},t}(),EI=(OI=bI,(0,Mt.C6)((function(){return null!==OI&&OI.apply(this,arguments)||this}),OI),function(t){(0,Mt.C6)((function(){return null!==t&&t.apply(this,arguments)||this}),t)}(bI),function(t){(0,Mt.C6)((function(){return null!==t&&t.apply(this,arguments)||this}),t)}(bI),function(t){(0,Mt.C6)((function(){return null!==t&&t.apply(this,arguments)||this}),t)}(bI),function(t){(0,Mt.C6)((function(){return null!==t&&t.apply(this,arguments)||this}),t)}(bI),function(t){(0,Mt.C6)((function(){return null!==t&&t.apply(this,arguments)||this}),t)}(bI),function(t){(0,Mt.C6)((function(){return null!==t&&t.apply(this,arguments)||this}),t)}(bI),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(0,Mt.C6)(e,t),e.prototype.init=function(){var t,e=(0,Mt.Cl)({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,r=new bI(n),i=((t={})[Wr.CIRCLE]=r,t[Wr.ELLIPSE]=r,t[Wr.RECT]=r,t[Wr.IMAGE]=new wI(n),t[Wr.TEXT]=new MI,t[Wr.LINE]=r,t[Wr.POLYLINE]=r,t[Wr.POLYGON]=r,t[Wr.PATH]=r,t[Wr.GROUP]=void 0,t[Wr.HTML]=void 0,t[Wr.MESH]=void 0,t);this.context.defaultStyleRendererFactory=i,this.context.styleRendererFactory=i,this.addRenderingPlugin(new vI(e))},e.prototype.destroy=function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory},e}(Hr)),kI=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)},h=function(t){i.hooks.pointerOut.call(t)},d=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",h,!0),t.addEventListener("pointerover",f,!0),n.globalThis.addEventListener("pointerup",l,!0),n.globalThis.addEventListener("pointercancel",d,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",c,!0),t.addEventListener("mousedown",u,!0),t.addEventListener("mouseout",h,!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",d,!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",h,!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",h,!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",d,!0)}(t),a.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)}))},t.tag="DOMInteraction",t}(),SI=function(t){function e(){var e=t.apply(this,(0,Mt.fX)([],(0,Mt.zs)(arguments),!1))||this;return e.name="dom-interaction",e}return(0,Mt.C6)(e,t),e.prototype.init=function(){this.addRenderingPlugin(new kI)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Hr),PI=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===Wr.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===Wr.HTML&&r.$camera){var n=r.getOrCreateEl(e);n&&(n.remove(),c.delete(n))}},h=function(t){var e=t.target;if(e.nodeName===Wr.HTML){var n=t.attrName;r.updateAttribute(n,e)}},d=function(t){var e=t.target;if(e.nodeName===Wr.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(mc.RESIZE,p),s.addEventListener(qs.MOUNTED,u),s.addEventListener(qs.UNMOUNTED,f),s.addEventListener(qs.ATTR_MODIFIED,h),s.addEventListener(qs.BOUNDS_CHANGED,d)})),a.hooks.endFrame.tap(t.tag,(function(){r.$camera&&o.renderReasons.has(ks.CAMERA_CHANGED)&&(r.$camera.style.transform=r.joinTransformMatrix(i.getOrthoMatrix()))})),a.hooks.destroy.tap(t.tag,(function(){r.$camera&&r.$camera.remove(),s.removeEventListener(mc.RESIZE,p),s.removeEventListener(qs.MOUNTED,u),s.removeEventListener(qs.UNMOUNTED,f),s.removeEventListener(qs.ATTR_MODIFIED,h),s.removeEventListener(qs.BOUNDS_CHANGED,d)}))},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;nn(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=Qe(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=Qe(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 h=e.parsedStyle.fill,d="";vo(h)?d=h.isNone?"transparent":e.getAttribute("fill"):Array.isArray(h)?d=e.getAttribute("fill"):mo(h),n.style.background=d;break;case"stroke":var p=e.parsedStyle.stroke,g="";vo(p)?g=p.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(p)?g=e.getAttribute("stroke"):mo(p),n.style["border-color"]=g,n.style["border-style"]="solid";break;case"lineWidth":var y=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(y||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var m=e.style.filter;n.style.filter=m;break;default:en(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}},t.tag="HTMLRendering",t}(),_I=function(t){function e(){var e=t.apply(this,(0,Mt.fX)([],(0,Mt.zs)(arguments),!1))||this;return e.name="html-renderer",e}return(0,Mt.C6)(e,t),e.prototype.init=function(){this.addRenderingPlugin(new PI)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Hr),AI=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):Ua&&(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;nn(c)?s=this.getImageSync(c,o):n?(s=n,f=!0):s=c;var h=s&&e.createPattern(s,l);if(h){var d;d=u?Es(fa(u),new Ec({})):Yt(Gt()),f&&ee(d,d,[1/r,1/r,1]),h.setTransform({a:d[0],b:d[1],c:d[4],d:d[5],e:d[12]+i[0],f:d[13]+i[1]})}return a&&h&&(this.patternCache[a]=h),h},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 h=null;if(r===ji.LinearGradient){var d=function(t,e,n,r){var i=Jr(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=d.x1,g=d.y1,y=d.x2,m=d.y2;h=e.createLinearGradient(p,g,y,m)}else if(r===ji.RadialGradient){var v=function(t,e,n,r,i,o){var a=r.value,s=i.value;r.unit===bi.kPercentage&&(a=r.value/100*e),i.unit===bi.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 Gi?c=o.value:o instanceof Ii&&("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,O=v.r;h=e.createRadialGradient(b,x,0,b,x,O)}return h&&(i.forEach((function(t){var e=t.offset,n=t.color;e.unit===bi.kPercentage&&(null==h||h.addColorStop(e.value/100,n.toString()))})),this.gradientCache[n]=h),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 nn(e)?"pattern-".concat(e,"-").concat(n):"rect"===e.nodeName?"pattern-".concat(e.entity,"-").concat(n):void 0},t}(),jI=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===Wr.IMAGE){var s=o.src,c=o.keepAspectRatio;nn(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===Wr.IMAGE&&"src"===r&&nn(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(qs.MOUNTED,s),o.addEventListener(qs.ATTR_MODIFIED,c)})),n.hooks.destroy.tap(t.tag,(function(){o.removeEventListener(qs.MOUNTED,s),o.removeEventListener(qs.ATTR_MODIFIED,c)}))},t.tag="LoadImage",t}(),TI=function(t){function e(){var e=t.apply(this,(0,Mt.fX)([],(0,Mt.zs)(arguments),!1))||this;return e.name="image-loader",e}return(0,Mt.C6)(e,t),e.prototype.init=function(){this.context.imagePool=new AI(this.context.config),this.addRenderingPlugin(new jI)},e.prototype.destroy=function(){this.removeAllRenderingPlugins()},e}(Hr),CI=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=nn(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||Ua&&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){Ua&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(ks.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={}),(0,Mt.sH)(this,void 0,void 0,(function(){var e,n;return(0,Mt.YH)(this,(function(r){return e=t.type,n=t.encoderOptions,[2,this.context.canvas.toDataURL(e,n)]}))}))},t}(),NI=function(t){function e(){var e=t.apply(this,(0,Mt.fX)([],(0,Mt.zs)(arguments),!1))||this;return e.name="canvas-context-register",e}return(0,Mt.C6)(e,t),e.prototype.init=function(){this.context.ContextService=CI},e.prototype.destroy=function(){delete this.context.ContextService},e}(Hr),LI=function(t){function e(e){var n=t.call(this,e)||this;return n.registerPlugin(new NI),n.registerPlugin(new TI),n.registerPlugin(new XR),n.registerPlugin(new EI),n.registerPlugin(new SI),n.registerPlugin(new mI),n.registerPlugin(new _I),n}return(0,Mt.C6)(e,t),e}(Vr),RI=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],h=function(t){return(0,Mt.sH)(n,void 0,void 0,(function(){var n,o,h,d,p,g;return(0,Mt.YH)(this,(function(y){switch(y.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]:(h="pointer"===this.dragndropPluginOptions.overlap?[t.canvasX,t.canvasY]:e.getBounds().center,[4,i.elementsFromPoint(h[0],h[1])]);case 1:d=y.sent(),p=d[d.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))),y.label=2;case 2:return[2]}}))}))};o.addEventListener("pointermove",h);var d=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",h)};e.addEventListener("pointerup",d,{once:!0}),e.addEventListener("pointerupoutside",d,{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}(),II=function(t){function e(e){void 0===e&&(e={});var n=t.call(this)||this;return n.options=e,n.name="dragndrop",n}return(0,Mt.C6)(e,t),e.prototype.init=function(){this.addRenderingPlugin(new RI((0,Mt.Cl)({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}(Hr),zI=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}();const DI=zI,BI=[["legendCategory",[[["color","discrete"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["shape","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","discrete"]],[["color","discrete"],["opacity","discrete"],["size","constant"]],[["color","discrete"],["opacity","constant"],["shape","discrete"]],[["color","discrete"],["opacity","constant"],["size","constant"]],[["color","discrete"],["shape","constant"],["size","constant"]],[["color","discrete"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["opacity","constant"],["shape","constant"]],[["color","constant"],["shape","discrete"],["size","constant"]],[["color","constant"],["opacity","discrete"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["size","constant"]],[["color","constant"],["opacity","constant"],["shape","discrete"]],[["color","constant"],["opacity","discrete"],["shape","constant"]],[["color","discrete"],["shape","discrete"]],[["color","discrete"],["size","constant"]],[["color","discrete"],["opacity","discrete"]],[["color","discrete"],["opacity","constant"]],[["color","discrete"],["shape","constant"]],[["color","constant"],["shape","discrete"]],[["color","constant"],["size","constant"]],[["color","constant"],["opacity","discrete"]],[["color","discrete"]]]],["legendContinuousSize",[[["color","continuous"],["opacity","continuous"],["size","continuous"]],[["color","constant"],["opacity","continuous"],["size","continuous"]],[["color","continuous"],["size","continuous"]],[["color","constant"],["size","continuous"]],[["size","continuous"],["opacity","continuous"]],[["size","continuous"]]]],["legendContinuousBlockSize",[[["color","distribution"],["opacity","distribution"],["size","distribution"]],[["color","distribution"],["size","distribution"]]]],["legendContinuousBlock",[[["color","distribution"],["opacity","continuous"]],[["color","distribution"]]]],["legendContinuous",[[["color","continuous"],["opacity","continuous"]],[["color","continuous"]],[["opacity","continuous"]]]]];var FI=n(3976);function WI(t,e,n,r){const{radar:i}=t,[o]=r,a=o.getOptions().name,[s,c]=wt(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))})}const $I=t=>{const{important:e={}}=t,n=function(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}(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return Qx(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({},WI(t,i,o,a)),e)}))(r)}};$I.props=Object.assign(Object.assign({},Qx.props),{defaultPosition:"center"});const GI=t=>(...e)=>YO(Object.assign({},{block:!0},t))(...e);GI.props=Object.assign(Object.assign({},YO.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const HI=t=>e=>{const{scales:n}=e,r=$x(n,"size");return YO(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};HI.props=Object.assign(Object.assign({},YO.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const VI=t=>HI(Object.assign({},{block:!0},t));VI.props=Object.assign(Object.assign({},YO.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const qI=({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:h,insetRight:d,insetBottom:p,margin:g,marginLeft:y,marginBottom:m,marginTop:v,marginRight:b,data:x,coordinate:O,theme:w,component:M,interaction:E,x:k,y:S,z:P,key:_,frame:A,labelTransform:j,parentKey:T,clip:C,viewStyle:N,title:L}=e,R=function(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}(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:P,key:_,width:n,height:r,depth:i,padding:l,paddingLeft:o,paddingRight:a,paddingTop:s,inset:u,insetLeft:f,insetTop:h,insetRight:d,insetBottom:p,paddingBottom:c,theme:w,coordinate:O,component:M,interaction:E,frame:A,labelTransform:j,margin:g,marginLeft:y,marginBottom:m,marginTop:v,marginRight:b,parentKey:T,clip:C,style:N},!t&&{title:L}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${_}-0`,data:x}),t&&{title:L})]})]};qI.props={};var XI=function(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};const YI=()=>t=>{const{children:e}=t,n=XI(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:c=[]}=n,l=XI(n,["data","scale","axis","legend","encode","transform"]),u=e.map((t=>{var{data:e,scale:n={},axis:l={},legend:u={},encode:f={},transform:h=[]}=t,d=XI(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:xS(e,r),scale:A({},i,n),encode:A({},s,f),transform:[...c,...h],axis:!(!l||!o)&&A({},o,l),legend:!(!u||!a)&&A({},a,u)},d)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};function UI(t,e,n,r){const i=e.length/2,o=e.slice(0,i),a=e.slice(i);let s=KS(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=zu(Lu(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}}function KI(t,e,n,r){const{bounds:i}=n,[[o,a],[s,c]]=i,l=s-o,u=c-a;return(t=>{const{x:e,y:r}=t,i=_u(n.x,l),s=_u(n.y,u);return Object.assign(Object.assign({},t),{x:(i||e)+o,y:(s||r)+a})})("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 ZI(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=Gf(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:h,endAngle:d}=l,p="inside"===t?(h+d)/2:d,g=QI(p,a,s),y=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?JI(c,p,i):Wu(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},y),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function JI(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function QI(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function tz(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=Gf(r,e,[i,o]),{startAngle:f,endAngle:h}=u,d=r.getCenter(),p=(f+h)/2,g={textAlign:"center",textBaseline:"middle",rotate:QI(p,a,s)},{innerRadius:y,outerRadius:m}=u,v=y+(m-y)*c+l,[b,x]=JI(d,p,v);return Object.assign({x:b,y:x},g)}function ez(t){return void 0===t?null:t}function nz(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:ez(o[0]),y:ez(o[1])}}function rz(t,e,n,r){const{bounds:i}=n;return 1===i.length?nz(0,0,n):(yt(r)?ZI:xt(r)?tz:KI)(t,e,n,r)}function iz(t,e,n){const r=Gf(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function oz(t,e,n){const r=Gf(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function az(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(),h=oz(e,n,r),d=Math.sin(h)>0?1:-1,p=QI(h,i,o),g={textAlign:d>0||yt(r)?"start":"end",textBaseline:"middle",rotate:p},y=iz(e,n,r),m=y+(s?c:a),[[v,b],[x,O],[w,M]]=function(t,e,n,r,i){const[o,a]=JI(t,e,n),[s,c]=JI(t,e,r);return[[o,a],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,h,y,m,s?l:0),E=s?+u*d:0,k=w+E,S={connector:s,connectorPoints:[[x-k,O-M],[w-k,M-M]]};return Object.assign(Object.assign({x0:v,y0:b,x:w+E,y:M},g),S)}function sz(t,e,n,r){const{bounds:i}=n;return 1===i.length?nz(0,0,n):(yt(r)?ZI:xt(r)?az:KI)(t,e,n,r)}YI.props={};var cz=function(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 lz(t,e,n,r){if(!xt(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=cz(az(0,e,n,r),[]),c=r.getCenter(),l=iz(e,n,r),u=oz(e,n,r),f=l+i+o,h=Math.sin(u)>0?1:-1,d=c[0]+(f+ +a)*h,{x:p}=s,g=d-p;return s.x+=g,s.connectorPoints[0][0]-=g,s}var uz=function(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 fz(t,e,n,r){if(!xt(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=uz(az(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if(xt(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),h=f+i,d=Du([c-u[0],l-u[1]]),p=Math.sin(d)>0?1:-1,[g,y]=JI(u,d,h);return s.x=g+(o+a)*p,s.y=y,s}var hz=function(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};const dz=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,o)=>{const{text:s,x:c,y:l,transform:u="",transformOrigin:f,className:h=""}=o,d=hz(o,["text","x","y","transform","transformOrigin","className"]),p=function(t,e,n,r,i){const{position:o}=e,{render:s}=i,c=function(t,e){return void 0!==t?t:xt(e)?"inside":pt(e)?"right":"top"}(o,n),l=r[s?"htmlLabel":"inside"===c?"innerLabel":"label"],u=Object.assign({},l,e),f=a[wk(c)];if(!f)throw new Error(`Unknown position: ${c}`);return Object.assign(Object.assign({},l),f(c,t,u,n,i))}(e,o,n,r,t),{rotate:g=0,transform:y=""}=p,m=hz(p,["rotate","transform"]);return Cu(new Xp).call(Bf,m).style("text",`${s}`).style("className",`${h} g2-label`).style("innerHTML",i?i(s,o.datum,o.index):void 0).style("labelTransform",`${y} rotate(${+g}) ${u}`.trim()).style("labelTransformOrigin",f).style("coordCenter",n.getCenter()).call(Bf,d).node()}};dz.props={defaultMarker:"point"};var pz=function(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 gz(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":$I,"component.axisLinear":Qx,"component.axisArc":tO,"component.legendContinuousBlock":GI,"component.legendContinuousBlockSize":VI,"component.legendContinuousSize":HI,"interaction.event":hE,"composition.mark":qI,"composition.view":YI,"shape.label.label":dz}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||Ou(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=pz(t,["type"]);n||Ou("Plot type is required!");const o=r(n);return null==o?void 0:o(i,e)},r]}function yz(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||Ou("Cannot find library document")}var mz=function(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 vz(t,e){const{coordinate:n={}}=t,r=mz(t,["coordinate"]),{type:i,transform:o=[]}=n,a=mz(n,["type","transform"]);if(!i)return Object.assign(Object.assign({},r),{coordinates:o});const[,s]=gz("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 bz(t,e){return t.filter((t=>t.type===e))}function xz(t){return bz(t,"polar").length>0}function Oz(t){return bz(t,"transpose").length%2==1}function wz(t){return bz(t,"theta").length>0}function Mz(t){return bz(t,"radial").length>0}function Ez(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}const kz=Ez("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),Sz=Ez("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),Pz=Ez("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),_z=Ez("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),Az=Ez("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),jz=Ez("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),Tz=Ez("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),Cz=Ez("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),Nz=Ez("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),Lz=Ez("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),Rz=Ez("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function Iz(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function zz(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Dz(){}var Bz=.7,Fz=1/Bz,Wz="\\s*([+-]?\\d+)\\s*",$z="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Gz="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Hz=/^#([0-9a-f]{3,8})$/,Vz=new RegExp(`^rgb\\(${Wz},${Wz},${Wz}\\)$`),qz=new RegExp(`^rgb\\(${Gz},${Gz},${Gz}\\)$`),Xz=new RegExp(`^rgba\\(${Wz},${Wz},${Wz},${$z}\\)$`),Yz=new RegExp(`^rgba\\(${Gz},${Gz},${Gz},${$z}\\)$`),Uz=new RegExp(`^hsl\\(${$z},${Gz},${Gz}\\)$`),Kz=new RegExp(`^hsla\\(${$z},${Gz},${Gz},${$z}\\)$`),Zz={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 Jz(){return this.rgb().formatHex()}function Qz(){return this.rgb().formatRgb()}function tD(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Hz.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?eD(e):3===n?new oD(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?nD(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?nD(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=Vz.exec(t))?new oD(e[1],e[2],e[3],1):(e=qz.exec(t))?new oD(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Xz.exec(t))?nD(e[1],e[2],e[3],e[4]):(e=Yz.exec(t))?nD(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Uz.exec(t))?fD(e[1],e[2]/100,e[3]/100,1):(e=Kz.exec(t))?fD(e[1],e[2]/100,e[3]/100,e[4]):Zz.hasOwnProperty(t)?eD(Zz[t]):"transparent"===t?new oD(NaN,NaN,NaN,0):null}function eD(t){return new oD(t>>16&255,t>>8&255,255&t,1)}function nD(t,e,n,r){return r<=0&&(t=e=n=NaN),new oD(t,e,n,r)}function rD(t){return t instanceof Dz||(t=tD(t)),t?new oD((t=t.rgb()).r,t.g,t.b,t.opacity):new oD}function iD(t,e,n,r){return 1===arguments.length?rD(t):new oD(t,e,n,null==r?1:r)}function oD(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function aD(){return`#${uD(this.r)}${uD(this.g)}${uD(this.b)}`}function sD(){const t=cD(this.opacity);return`${1===t?"rgb(":"rgba("}${lD(this.r)}, ${lD(this.g)}, ${lD(this.b)}${1===t?")":`, ${t})`}`}function cD(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function lD(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function uD(t){return((t=lD(t))<16?"0":"")+t.toString(16)}function fD(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new dD(t,e,n,r)}function hD(t){if(t instanceof dD)return new dD(t.h,t.s,t.l,t.opacity);if(t instanceof Dz||(t=tD(t)),!t)return new dD;if(t instanceof dD)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 dD(a,s,c,t.opacity)}function dD(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function pD(t){return(t=(t||0)%360)<0?t+360:t}function gD(t){return Math.max(0,Math.min(1,t||0))}function yD(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 mD(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}Iz(Dz,tD,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Jz,formatHex:Jz,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return hD(this).formatHsl()},formatRgb:Qz,toString:Qz}),Iz(oD,iD,zz(Dz,{brighter(t){return t=null==t?Fz:Math.pow(Fz,t),new oD(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Bz:Math.pow(Bz,t),new oD(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new oD(lD(this.r),lD(this.g),lD(this.b),cD(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:aD,formatHex:aD,formatHex8:function(){return`#${uD(this.r)}${uD(this.g)}${uD(this.b)}${uD(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:sD,toString:sD})),Iz(dD,(function(t,e,n,r){return 1===arguments.length?hD(t):new dD(t,e,n,null==r?1:r)}),zz(Dz,{brighter(t){return t=null==t?Fz:Math.pow(Fz,t),new dD(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Bz:Math.pow(Bz,t),new dD(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 oD(yD(t>=240?t-240:t+120,i,r),yD(t,i,r),yD(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new dD(pD(this.h),gD(this.s),gD(this.l),cD(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=cD(this.opacity);return`${1===t?"hsl(":"hsla("}${pD(this.h)}, ${100*gD(this.s)}%, ${100*gD(this.l)}%${1===t?")":`, ${t})`}`}}));const vD=t=>()=>t;function bD(t,e){return function(n){return t+n*e}}function xD(t,e){var n=e-t;return n?bD(t,n):vD(isNaN(t)?e:t)}function OD(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=iD(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}!function t(e){var n=function(t){return 1==(t=+t)?xD: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):vD(isNaN(e)?n:e)}}(e);function r(t,e){var r=n((t=iD(t)).r,(e=iD(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=xD(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 wD=OD((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 mD((n-r/e)*e,a,i,o,s)}}));OD((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return mD((n-r/e)*e,i,o,a,s)}}));const MD=t=>wD(t[t.length-1]);var ED=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Ez);const kD=MD(ED);var SD=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Ez);const PD=MD(SD);var _D=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Ez);const AD=MD(_D);var jD=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Ez);const TD=MD(jD);var CD=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Ez);const ND=MD(CD);var LD=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Ez);const RD=MD(LD);var ID=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Ez);const zD=MD(ID);var DD=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Ez);const BD=MD(DD);var FD=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Ez);const WD=MD(FD);var $D=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Ez);const GD=MD($D);var HD=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Ez);const VD=MD(HD);var qD=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Ez);const XD=MD(qD);var YD=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Ez);const UD=MD(YD);var KD=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Ez);const ZD=MD(KD);var JD=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Ez);const QD=MD(JD);var tB=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Ez);const eB=MD(tB);var nB=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Ez);const rB=MD(nB);var iB=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Ez);const oB=MD(iB);var aB=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Ez);const sB=MD(aB);var cB=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Ez);const lB=MD(cB);var uB=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Ez);const fB=MD(uB);var hB=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Ez);const dB=MD(hB);var pB=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Ez);const gB=MD(pB);var yB=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Ez);const mB=MD(yB);var vB=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Ez);const bB=MD(vB);var xB=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Ez);const OB=MD(xB);var wB=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Ez);const MB=MD(wB);function EB(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)))))))+")"}const kB=Math.PI/180,SB=180/Math.PI;var PB=-.14861,_B=1.78277,AB=-.29227,jB=-.90649,TB=1.97294,CB=TB*jB,NB=TB*_B,LB=_B*AB-jB*PB;function RB(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof IB)return new IB(t.h,t.s,t.l,t.opacity);t instanceof oD||(t=rD(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(LB*r+CB*e-NB*n)/(LB+CB-NB),o=r-i,a=(TB*(n-i)-AB*o)/jB,s=Math.sqrt(a*a+o*o)/(TB*i*(1-i)),c=s?Math.atan2(a,o)*SB-120:NaN;return new IB(c<0?c+360:c,s,i,t.opacity)}(t):new IB(t,e,n,null==r?1:r)}function IB(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function zB(t){return function e(n){function r(e,r){var i=t((e=RB(e)).h,(r=RB(r)).h),o=xD(e.s,r.s),a=xD(e.l,r.l),s=xD(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)}Iz(IB,RB,zz(Dz,{brighter(t){return t=null==t?Fz:Math.pow(Fz,t),new IB(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Bz:Math.pow(Bz,t),new IB(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*kB,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new oD(255*(e+n*(PB*r+_B*i)),255*(e+n*(AB*r+jB*i)),255*(e+n*(TB*r)),this.opacity)}})),zB((function(t,e){var n=e-t;return n?bD(t,n>180||n<-180?n-360*Math.round(n/360):n):vD(isNaN(t)?e:t)}));var DB=zB(xD);const BB=DB(RB(300,.5,0),RB(-240,.5,1));var FB=DB(RB(-100,.75,.35),RB(80,1.5,.8)),WB=DB(RB(260,.75,.35),RB(80,1.5,.8)),$B=RB();function GB(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return $B.h=360*t-100,$B.s=1.5-1.5*e,$B.l=.8-.9*e,$B+""}var HB=iD(),VB=Math.PI/3,qB=2*Math.PI/3;function XB(t){var e;return t=(.5-t)*Math.PI,HB.r=255*(e=Math.sin(t))*e,HB.g=255*(e=Math.sin(t+VB))*e,HB.b=255*(e=Math.sin(t+qB))*e,HB+""}function YB(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)))))))+")"}function UB(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}const KB=UB(Ez("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var ZB=UB(Ez("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),JB=UB(Ez("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),QB=UB(Ez("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function tF(t,e,n,r,i,o){const{guide:a={}}=n,c=function(t,e,n){const{type:r,domain:i,range:o,quantitative:a,ordinal:s}=n;return void 0!==r?r:function(t){return yF(t,Au)}(e)?"identity":"string"==typeof o?"linear":(i||o||[]).length>2?fF(t,s):void 0!==i?pF([i])?fF(t,s):gF(e)?"time":hF(t,o,a):pF(e)?fF(t,s):gF(e)?"time":hF(t,o,a)}(t,e,n);if("string"!=typeof c)return n;const l=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 dF(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)Mu(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 dF(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)Mu(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(c,0,e,n),u=function(t,e,n){const{ratio:r}=n;return null==r?e:sF({type:t})?function(t,e,n){const r=t.map(Number),i=new Tf({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):cF({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(c,l,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=mf,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?wz(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=xx(e),i=s[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(c,t,0,n,r)),{domain:u,range:lF(c,t,e,n,u,i,o),expectedDomain:l,guide:a,name:t,type:c})}function eF(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 nF(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=Sy(i)+1,a=`${e}${o}`;t[a]=r,r.getOptions().key=a}else t[e]=r}return t}function rF(t,e){const[n]=gz("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[vu,vu];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 iF(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));aF(e,"x"),aF(e,"y")}function oF(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 aF(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(sF)?Cf(r):n.every(cF)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function sF(t){const{type:e}=t;return"string"==typeof e&&["linear","log","pow","time"].includes(e)}function cF(t){const{type:e}=t;return"string"==typeof e&&["band","point","ordinal"].includes(e)}function lF(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=uF(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?[Rf(e),If(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 uF(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function uF(t,e,n,r,i){const[o]=gz("palette",i),{category10:a,category20:c}=r,l=function(t){return Array.from(new Set(t))}(t.flat()).length<=a.length?a:c,{palette:u=l,offset:f}=e;if(Array.isArray(u))return u;try{return o({type:u})}catch(t){const e=function(t,e,n=(t=>t)){if(!t)return null;const r=xx(t),i=s[`scheme${r}`],o=s[`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))))}(u,n,f);if(e)return e;throw new Error(`Unknown Component: ${u} `)}}function fF(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function hF(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function dF(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 pF(t){return yF(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function gF(t){return yF(t,(t=>t instanceof Date))}function yF(t,e){for(const n of t)if(n.some(e))return!0;return!1}const mF={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},vF={threshold:"threshold",quantize:"quantize",quantile:"quantile"},bF={ordinal:"ordinal",band:"band",point:"point"},xF={constant:"constant"};var OF=function(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 wF(t,e,n,r,i){const[o]=gz("component",r),{scaleInstances:a,scale:s,bbox:c}=t,l={bbox:c,library:r};return o(OF(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:a,theme:n,value:l,scale:s})}function MF(t,e){const n=["left","right","bottom","top"],r=fu(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=MP(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=Sy(t,(t=>t.size)),r=Sy(t,(t=>t.order)),i=Sy(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function EF(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=fu(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(...Df(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,kF(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 BI)for(const{option:r,combination:i}of n)if(e.some((t=>ow(s(t),s(r)))))return[t,i];return null})).filter(Mu);return c}function kF(t){const{type:e}=t;return"string"!=typeof e?null:e in mF?"continuous":e in bF?"discrete":e in vF?"distribution":e in xF?"constant":null}function SF(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return bz(t,"helix").length>0}(e)||wz(e))return null;if(Oz(e)&&(xz(e)||Mz(e)))return null;if(n.startsWith("x"))return xz(e)?["axisArc",[t]]:Mz(e)?["axisLinear",[t]]:[Oz(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return xz(e)?["axisLinear",[t]]:Mz(e)?["axisArc",[t]]:[Oz(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if(function(t){return bz(t,"radar").length>0}(e))return["axisRadar",[t]];if(!xz(e))return["axisY",[t]]}return null})).filter(Mu)}function PF(t){const e=bz(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:n,endAngle:r}=l(t);return[n,r]}const n=bz(t,"radial");if(n.length){const t=n[n.length-1],{startAngle:e,endAngle:r}=g(t);return[e,r]}return[-Math.PI/2,Math.PI/2*3]}function _F(t,e,n,r,i,o,a){const[s]=PF(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?function(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]=PF(i);return["center",(a-n)/(t.length-1)*e+n]}if("axisY"===t&&function(t){return bz(t,"parallel").length>0}(i))return Oz(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=PF(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:xz(i)||Mz(i)?["center",null]:"axisX"===t&&function(t){return bz(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return bz(t,"reflectY").length>0}(i)?["top",null]:e}(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&xz(a)&&"center"===r.position?["center","vertical"]:c}function AF(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")?LF:s.startsWith("group")?jF:s.startsWith("legendContinuous")?RF:"legendCategory"===s?IF:s.startsWith("slider")?NF:"title"===s?CF:s.startsWith("scrollbar")?TF:()=>{})(t,e,n,r,i,o)}function jF(t,e,n,r,i,o){const{children:a}=t,s=Sy(a,(t=>t.crossPadding));a.forEach((t=>t.crossPadding=s)),a.forEach((t=>AF(t,e,n,r,i,o)));const c=Sy(a,(t=>t.size));t.size=c,a.forEach((t=>t.size=c))}function TF(t,e,n,r,i,o){const{trackSize:a=6}=A({},i.scrollbar,t);t.size=a}function CF(t,e,n,r,i,o){const a=A({},i.title,t),{title:s,subtitle:c,spacing:l=0}=a,u=OF(a,["title","subtitle","spacing"]);if(s){const e=$F(s,ku(u,"title"));t.size=e.height}if(c){const e=$F(c,ku(u,"subtitle"));t.size+=l+e.height}}function NF(t,e,n,r,i,o){const{trackSize:a,handleIconSize:s}=(()=>{const{slider:e}=i;return A({},e,t)})(),c=Math.max(a,2.4*s);t.size=c}function LF(t,e,n,r,i,o){t.transform=t.transform||[{type:"hide"}];const a="left"===r||"right"===r,s=FF(t,r,i),{tickLength:c=0,labelSpacing:l=0,titleSpacing:u=0,labelAutoRotate:f}=s,h=OF(s,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),d=zF(t,o),p=DF(h,d),g=c+l;if(p&&p.length){const r=Sy(p,(t=>t.width)),i=Sy(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=MP(e,(t=>t.width));if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=WF(t,i),c=s.map((t=>a.map(t)+function(t,e){if(!t.getBandWidth)return 0;return t.getBandWidth(e)/2}(a,t))),l=s.map(((t,e)=>e)),u=-r[0],f=n+r[1],h=(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]=h(n,e[t]);if(r<u||i>f)return!0;const o=c[t+1];if(o){const[n]=h(o,e[t+1]);if(i>n)return!0}}return!1}(d,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 y=BF(h);y&&(t.size+=a?u+y.width:u+y.height)}function RF(t,e,n,r,i,o){const a=(()=>{const{legendContinuous:e}=i;return A({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=a,l=OF(a,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=ku(l,"ribbon"),{size:h}=f,d=ku(l,"handleIcon"),{size:p}=d,g=Math.max(h,2.4*p);t.size=g;const y=DF(l,zF(t,o));if(y){const e=u?"width":"height",n=Sy(y,(t=>t[e]));t.size+=n+s}const m=BF(l);m&&(u?t.size=Math.max(t.size,m.width):t.size+=c+m.height)}function IF(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 A({title:r},e,Object.assign(Object.assign({},t),{title:o}))})(),{itemSpacing:s,itemMarkerSize:c,titleSpacing:l,rowPadding:u,colPadding:f,maxCols:h=1/0,maxRows:d=1/0}=a,p=OF(a,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:y}=t,m=t=>Math.min(t,d),v=t=>Math.min(t,h),b="left"===r||"right"===r,x=void 0===y?e+(b?0:n[0]+n[1]):y,O=BF(p),w=DF(p,zF(t,o),"itemLabel"),M=Math.max(w[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=O?O.height:0,c=x-s;for(const{width:t}of w){const s=E(t,f);e=Math.max(e,s),n+M>c?(r++,o=Math.max(o,i),a=Math.max(a,n),i=1,n=M):(n+=M,i++)}r<=1&&(o=i,a=n),t.size=e*v(r),t.length=a+s,A(t,{cols:v(r),gridRow:o})})():"number"==typeof g?(()=>{const e=Math.ceil(w.length/g),n=Sy(w,(t=>E(t.width)))*g;t.size=M*m(e)-u,t.length=Math.min(n,x)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of w){const i=E(t,f);n+i>x?(r=Math.max(r,n),n=i,e++):n+=i}1===e&&(r=n),t.size=M*m(e)-u,t.length=r})(),O&&(b?t.size=Math.max(t.size,O.width):t.size+=l+O.height)}function zF(t,e){const[n]=gz("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 DF(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=OF(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=function(t,e,n){const r=WF(t,n).map((t=>"number"==typeof t?Gu(t):t)),i=e?"string"==typeof e?jx(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return r.map(i)}(e,r,i),c=ku(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)=>$F(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 BF(t){const{title:e}=t,n=OF(t,["title"]);if(!1===(r=e)||null===r||void 0===e)return null;var r;const i=ku(n,"title"),{direction:o,transform:a}=i,s=Array.isArray(e)?e.join(","):e;return"string"!=typeof s?null:$F(s,Object.assign(Object.assign({},i),{transform:a||("vertical"===o?"rotate(-90)":"")}))}function FF(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${xu(e)}`]:s}=n;return A({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function WF(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function $F(t,e){const n=function(t){return t instanceof Ec?t:new Ic({style:{text:`${t}`}})}(t),{filter:r}=e,i=OF(e,["filter"]);return n.attr(Object.assign(Object.assign({},i),{visibility:"none"})),n.getBBox()}function GF(t,e,n,r,i,o,a){const s=uu(t,(t=>t.position)),{padding:c=o.padding,paddingLeft:l=c,paddingRight:u=c,paddingBottom:f=c,paddingTop:h=c}=i,d={paddingBottom:f,paddingLeft:l,paddingTop:h,paddingRight:u};for(const t of r){const r=`padding${xu(wk(t))}`,i=s.get(t)||[],c=d[r],l=t=>{void 0===t.size&&(t.size=t.defaultSize)},u=t=>{"group"===t.type?(t.children.forEach(l),t.size=Sy(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(AF(r,e,n,t,o,a),l(r)))},h=t=>{t.type.startsWith("axis")&&void 0===t.labelAutoHide&&(t.labelAutoHide=!0)},p="bottom"===t||"top"===t,g=ky(i,(t=>t.order)),y=i.filter((t=>t.type.startsWith("axis")&&t.order==g));if(y.length&&(y[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(h);else if(0===i.length)d[r]=0;else{const t=MF(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);d[r]=o}}return d}function HF({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:h,insetLeft:d,insetRight:p,insetTop:g}){const y=n+a,m=i+s,v=r+l,b=o+c,x=t-a-l,O=[y+d,m+g,f-d-p,u-g-h,"center",null,null];return{top:[y,0,f,m,"vertical",!0,gw,a,x],right:[t-v,m,v,u,"horizontal",!1,gw],bottom:[y,e-b,f,b,"vertical",!1,gw,a,x],left:[0,m,y,u,"horizontal",!0,gw],"top-left":[y,0,f,m,"vertical",!0,gw],"top-right":[y,0,f,m,"vertical",!0,gw],"bottom-left":[y,e-b,f,b,"vertical",!1,gw],"bottom-right":[y,e-b,f,b,"vertical",!1,gw],center:O,inner:O,outer:O}}function VF(t,e,n,r){const[i,o]=zf(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return vt(t)&&gt(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):gt(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):vt(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).filter(((t,e)=>e%2==1)).map((t=>t+i));for(let e=0;e<t.length;e++){const n=t[e],i=s[e],a=s[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).filter(((t,e)=>e%2==0)).map((t=>t+r));for(let e=0;e<t.length;e++){const n=t[e],r=s[e],a=s[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]=Ot(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]=Ot(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 qF(t,e,n){const[r,i,o,a,s,c,l,u,f]=n,[h,d,p,g,y,m,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"),O=(t,e,n)=>void 0===n?e:x(t)?n:e,w=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?d+m:d;e<t.length;e++){const r=t[e],{crossPadding:i=0,type:o}=r,{size:a}=r;r.bbox={[h]:c?n-a-i:n+i,[p]:w(o,g,u),[y]:a,[v]:O(o,b,f)},n+=(a+i)*(c?-1:1)}const M=t.filter((t=>"group"===t.type));for(const t of M){const{bbox:e,children:n}=t,r=e[v],i=r/n.length,o=n.reduce(((t,e)=>{var n;return(null===(n=e.layout)||void 0===n?void 0:n.justifyContent)||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-MP(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={[y]:e[y],[h]:e[h],[p]:r,[v]:a[t]-c},A(i,{layout:{justifyContent:o}}),r+=a[t]}}}var XF=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))},YF=function(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 UF(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=YF(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function KF(t,e,n){return XF(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=gz("data",t),o=function(t){if(Qe(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=YF(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:a=[]}=o,s=[YF(o,["transform"]),...a].map(i),c=yield function(t){return t.reduce(((t,e)=>n=>mu(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),vu)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?Lf(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function ZF(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 JF(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=Nf(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return Mu(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 QF(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=Nf(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 tW(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=gz("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:lW(n)})}(o),s=Nf(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function eW(t,e,n){const{tooltip:r={}}=e;return ju(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:Au(r)&&aT(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function nW(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(ju(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(Au(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:c=(t=>t)}=e,l="string"==typeof c?jx(c):c,u=o&&i[o],f=u&&i[o].field,h=s||f||o,d=[];for(const e of t){const t=n?r[e][n]:u?i[o].value[e]:null;d[e]={name:h,color:a,value:l(t)}}return d}if("function"==typeof e){const n=[];for(const o of t){const t=e(r[o],o,r,i);Au(t)?n[o]=t:n[o]={value:t}}return n}return e},{title:s,items:c=[]}=o,l=YF(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 rW(t,e,n){const{encode:r}=e,i=YF(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=YF(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 iW(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 A(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 oW(t,e,n){const{animate:r}=e;return r||void 0===r||A(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}var aW=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))},sW=function(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 cW(t,e,n){return aW(this,void 0,void 0,(function*(){const r={library:n},[i,o]=yield function(t,e,n){return aW(this,void 0,void 0,(function*(){const{library:r}=n,[i]=gz("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[UF,KF,ZF,JF,QF,tW,rW,oW,iW,eW,...o.map(i),...s.map(i),...a.map(i),nW];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=du(Object.entries(a).filter((([,t])=>Mu(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})),h=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:h=!1,key:d=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=sW(f,["independent","key","type"]),y="constant"===p,m=y?void 0:i;return{name:t,values:e,scaleKey:h||y?Symbol("independent"):d,scale:Object.assign(Object.assign({type:p,range:m},g),{quantitative:o,ordinal:a})}}))}));return[o,Object.assign(Object.assign({},e),{index:i,channels:h,tooltip:l})]}))}function lW(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}var uW=function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{c(r.next(t))}catch(t){o(t)}}function s(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){t.done?i(t.value):function(t){return t instanceof n?t:new n((function(e){e(t)}))}(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())}))},fW=function(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 hW(t,e,n,r){var i;return uW(this,void 0,void 0,(function*(){const[o]=gz("composition",n),[a]=gz("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(Mu)),c=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Mu)),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),h=t=>{const{type:e}=t;return"string"==typeof e&&!!c.has(e)},d=t=>{if(f(t))return[t];const e=l(t);return o({type:e,static:h(t)})(t)},p=[],g=new Map,y=new Map,m=[t],v=[];for(;m.length;){const t=m.shift();if(f(t)){const e=y.get(t),[r,i]=e?vW(e,t,n):yield gW(t,n);g.set(r,t),p.push(r);const o=i.flatMap(d).map((t=>vz(t,n)));if(m.push(...o),o.every(f)){const t=yield Promise.all(o.map((t=>yW(t,n))));iF(t);for(let e=0;e<o.length;e++){const n=o[e],r=t[e];y.set(n,r)}}}else{const e=d(u(t)?t:yield NW(t,n));Array.isArray(e)?m.push(...e):"function"==typeof e&&v.push(e())}}r.emitter.emit(lE.BEFORE_PAINT);const b=new Map,x=new Map,O=[];e.selectAll(zW(fM)).data(p,(t=>t.key)).join((t=>t.append("g").attr("className",fM).attr("id",(t=>t.key)).call(dW).each((function(t,e,i){bW(t,Cu(i),O,n,r),b.set(t,i)}))),(t=>t.call(dW).each((function(t,e,i){bW(t,Cu(i),O,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 w=(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]=gz("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(n),o=CW(e).map(i).filter((t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate)).map((t=>t[0]));return(e,i,a)=>uW(this,void 0,void 0,(function*(){const[s,c]=yield gW(e,n);bW(s,t,[],n,r);for(const a of o.filter((t=>t!==i)))pW(a,t,e,s,n,r);for(const e of c)hW(e,t,n,r);return a(),{options:e,view:s}}))}(Cu(a),c,n,r);return{view:o,container:a,options:c,setState:(t,e=(t=>t))=>s.set(t,e),update:(n,r)=>uW(this,void 0,void 0,(function*(){const i=bu(Array.from(s.values()))(c);return yield l(i,n,(()=>{E(r)&&e(t,r,s)}))}))}})),M=(t=x,e,n)=>{var i;const o=w(t,M,n);for(const t of o){const{options:n,container:s}=t,c=s.nameInteraction;let l=CW(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=mW(t.view,n,s,a)(t,o,r.emitter);c.set(n,{destroy:e})}}}},k=w(b,M);for(const t of k){const{options:e}=t,n=new Map;t.container.nameInteraction=n;for(const i of CW(e)){const[e,o]=i;if(o){const i=mW(t.view,e,o,a)(t,k,r.emitter);n.set(e,{destroy:i})}}}M();const{width:S,height:P}=t,_=[];for(const t of v){const i=new Promise((i=>uW(this,void 0,void 0,(function*(){for(const i of t){const t=Object.assign({width:S,height:P},i);yield hW(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=O,r.emitter.emit(lE.AFTER_PAINT);const A=O.filter(Mu).map(_W).map((t=>t.finished));return Promise.all([...A,..._])}))}function dW(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function pW(t,e,n,r,i,o){var a;const[s]=gz("interaction",i),c=e.node().nameInteraction,l=CW(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=mW(r,t,l[1],s),h={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},d=f(h,[],o.emitter);c.set(t,{destroy:d})}function gW(t,e){return uW(this,void 0,void 0,(function*(){const n=yield function(t,e){return uW(this,void 0,void 0,(function*(){const[n,r]=gz("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(Mu)),{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:h=c,inset:d=0,insetLeft:p=d,insetRight:g=d,insetTop:y=d,insetBottom:m=d}=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-h-y-m}}(t),f={options:t,width:l,height:u};for(;c.length;){const[t]=c.splice(0,1),o=yield NW(t,e),{type:l=Ou("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=fW(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)=>A(t,e)),{}),u=[n,...s].reduce(((t,e)=>A(t,e)),{}),f=[...c,r].reduce(((t,e)=>A(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=vz(r,e);return vW(yield yW(i,e),i,e)}))}function yW(t,e){return uW(this,void 0,void 0,(function*(){const[n]=gz("theme",e),[,r]=gz("mark",e),{theme:i,marks:o,coordinates:a=[]}=t,s=n(TW(i)),c=new Map;for(const t of o){const{type:n}=t,{props:i={}}=r(n),o=yield cW(t,i,e);if(o){const[t,e]=o;c.set(t,e)}}const l=uu(Array.from(c.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of l.values()){const n=t.reduce(((t,{scale:e})=>A(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],o=Array.from(new Set(i.map((t=>t.field)).filter(Mu))),c=A({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({},tF(l,u,c,a,s,e)),{key:r});t.forEach((t=>t.scale=f))}return c}))}function mW(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(A(o,Object.assign({type:e},n)))}function vW(t,e,n){const[r]=gz("mark",n),[i]=gz("theme",n),[o]=gz("labelTransform",n),{key:a,frame:s=!1,theme:c,clip:l,style:u={},labelTransform:f=[]}=e,h=i(TW(c)),d=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=oF(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=A({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:bx(t,i)});o.push(e)}}}return o}(d,e),g=function(t){return t.map((t=>{const e=A(t,t.style);return delete e.style,e}))}(function(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=gz("component",n),a=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=gz("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?Oz(n)?`${e}Y`:`${e}X`:"y"===t?Oz(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[...EF(n),...SF(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:h,defaultPadding:d=[0,0],defaultCrossPadding:p=[0,0]}=n,g=A({},...e),{guide:y,field:m}=g,v=Array.isArray(y)?y:[y];for(const n of v){const[o,g]=_F(t,i,l,n,e,a,r);if(!o&&!g)continue;const y="left"===o||"right"===o,v=y?d[1]:d[0],b=y?p[1]:p[0],{size:x,order:O=f,length:w=h,padding:M=v,crossPadding:E=b}=n;s.push(Object.assign(Object.assign({title:m},n),{defaultSize:u,length:w,position:o,plane:c,orientation:g,padding:M,order:O,crossPadding:E,size:x,type:t,scales:e}))}})),s}(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=(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,a={field:o,name:"shape",type:"constant",domain:[],range:[{point:"point",line:"hyphen",rect:"square",hollow:"hollow"}[i]]};return[...t,a]}(Array.from(p),d,t),e,n)),y=function(t,e,n,r){var i,o;const{width:a,height:s,depth:c,x:l=0,y:u=0,z:f=0,inset:h=(null!==(i=n.inset)&&void 0!==i?i:0),insetLeft:d=h,insetTop:p=h,insetBottom:g=h,insetRight:y=h,margin:m=(null!==(o=n.margin)&&void 0!==o?o:0),marginLeft:v=m,marginBottom:b=m,marginTop:x=m,marginRight:O=m,padding:w=n.padding,paddingBottom:M=w,paddingLeft:E=w,paddingRight:k=w,paddingTop:S=w}=function(t,e,n,r){const{coordinates:i}=e;if(!xz(i)&&!Mz(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=>FF(t,"axisArc"===t.type?"arc":"linear",n))),s=Sy(a,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=Sy(o.flatMap(((t,e)=>DF(a[e],zF(t,r)))).filter(Mu),(t=>t.height))+s,l=o.flatMap(((t,e)=>BF(a[e]))).filter((t=>null!==t)),u=0===l.length?0:Sy(l,(t=>t.height)),{inset:f=c,insetLeft:h=f,insetBottom:d=f,insetTop:p=f+u,insetRight:g=f}=e;return Object.assign(Object.assign({},e),{insetLeft:h,insetBottom:d,insetTop:p,insetRight:g})}(t,e,n,r),P=(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,A=_(S),j=_(M),T=GF(t,s-A-j,[A+x,j+b],["left","right"],e,n,r),{paddingLeft:C,paddingRight:N}=T,L=a-v-O,[R,I]=P(L,E,k,C,N),z=L-R-I,D=GF(t,z,[R+v,I+O],["bottom","top"],e,n,r),{paddingTop:B,paddingBottom:F}=D,W=s-b-x,[$,G]=P(W,M,S,F,B);return{width:a,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:g,insetRight:y,innerWidth:z,innerHeight:W-$-G,paddingLeft:R,paddingRight:I,paddingTop:G,paddingBottom:$,marginLeft:v,marginBottom:b,marginTop:x,marginRight:O,x:l,y:u,z:f}}(g,e,h,n),m=function(t,e,n){const[r]=gz("coordinate",n),{innerHeight:i,innerWidth:o,insetLeft:a,insetTop:s,insetRight:c,insetBottom:l}=t,{coordinates:u=[]}=e,f=(h=u).find((t=>"cartesian"===t.type||"cartesian3D"===t.type))?h:[...h,{type:"cartesian"}];var h;const d="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 d?new FI.Coordinate3D(p):new FI.Coordinate(p)}(y,e,n),v=s?A({mainLineWidth:1,mainStroke:"#000"},u):u;!function(t,e,n){const r=uu(t,(t=>`${t.plane||"xy"}-${t.position}`)),{paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:y,insetTop:m,height:v,width:b,depth:x}=n,O={xy:HF({width:b,height:v,paddingLeft:i,paddingRight:o,paddingTop:a,paddingBottom:s,marginLeft:c,marginTop:l,marginBottom:u,marginRight:f,innerHeight:h,innerWidth:d,insetBottom:p,insetLeft:g,insetRight:y,insetTop:m}),yz:HF({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:HF({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=O[r][i],[a,s]=zf(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));a.length&&VF(a,e,o,i),s.length&&qF(n,0,o)}}(MF(g),m,y),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=rF(t,n);r.push(i),"y"===e&&i.update(Object.assign(Object.assign({},i.getOptions()),{xScale:b.x})),nF(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,h=Nf(Object.fromEntries(u.map((({name:t,scale:e})=>[t,e]))),(t=>rF(t,n)));nF(b,h);const d=eF(u,h),p=r(e),[g,v,O]=xW(p(l,h,d,m)),w=o||g.length,M=s?s(v,w,y):[],E=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},k=t=>f.items.map((e=>e[t])),S=g.map(((t,e)=>{const n=Object.assign({points:v[e],transform:M[e],index:t,markKey:c,viewKey:a},f&&{title:E(t),items:k(t)});for(const[r,i]of Object.entries(d))n[r]=i[t],O&&(n[`series${xx(r)}`]=O[e].map((t=>i[t])));return O&&(n.seriesIndex=O[e]),O&&f&&(n.seriesItems=O[e].map((t=>k(t))),n.seriesTitle=O[e].map((t=>E(t)))),n}));i.data=S,i.index=g;const P=null==t?void 0:t(S,h,y);x.push(...P||[])}return[{layout:y,theme:h,coordinate:m,markState:t,key:a,clip:l,scale:b,style:v,components:g,labelTransform:bu(f.map(o))},x]}function bW(t,e,n,r,i){return uW(this,void 0,void 0,(function*(){const{components:o,theme:a,layout:s,markState:c,coordinate:l,key:u,style:f,clip:h,scale:d}=t,{x:p,y:g,width:y,height:m}=s,v=fW(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),O=b.map((t=>Su(Object.assign({},a.view,f),t))),w=["a","margin","padding","inset"].map((t=>ku(v,t))),M=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)}(Cu(n),O[t])}));let E=0,k=0,S=y,P=m;const _=x.map((t=>{const e=w[t],{left:n=0,top:r=0,bottom:i=0,right:o=0}=e;return E+=n,k+=r,S-=n+o,P-=r+i,{x:E,y:k,width:S,height:P}}));e.selectAll(zW(gM)).data(x.filter((t=>Mu(O[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",gM).style("zIndex",-2).call(M)),(t=>t.call(M)),(t=>t.remove()));const j=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:h,duration:d=300,delay:p=0}=a,{type:g,duration:y=300,delay:m=0}=c;for(const t of o){const{updateType:r=l,updateDuration:i=u,updateDelay:o=f,enterType:a=h,enterDuration:s=d,enterDelay:c=p,exitDuration:v=y,exitDelay:b=m,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),T=!!j&&{duration:j[1]};for(const[,t]of fu(o,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const C=e.selectAll(zW(dM)).data(o,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",dM).append((t=>wF(A({animate:T,scale:d},t),l,a,r,c)))),(t=>t.transition((function(t,e,n){const{preserve:i=!1}=t;if(i)return;const o=wF(A({animate:T,scale:d},t),l,a,r,c),{attributes:s}=o,[u]=n.childNodes;return u.update(s,!1)})))).transitions();n.push(...C.flat().filter(Mu));const N=e.selectAll(zW(hM)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",hM).call(LW).call(IW,Array.from(c.keys())).call(DW,h)),(t=>t.call(IW,Array.from(c.keys())).call((t=>j?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:h,marginTop:d}=t,p=[{transform:o,width:a,height:s},{transform:`translate(${c+h}, ${l+d})`,width:u,height:f}];return i.animate(p,{delay:n,duration:r,fill:"both"})}))}(t,j):LW(t))).call(DW,h))).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}`),h=EW(o,a,t,r,i),d=PW(o,a,t,r),p=AW(o,a,t,r),g=jW(o,a,t,r),y=wW(e,f,l,"element"),m=f.selectAll(zW(uM)).selectFacetAll(y).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(h).attr("className",uM).attr("markType",u).transition((function(t,e,n){return d(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=Eu((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){MW(i,e,n);const o=h(t,r),a=p(t,[i],[o]);return null!==a||(i.nodeName===o.nodeName&&"g"!==o.nodeName?wu(i,o):(i.parentNode.replaceChild(o,i),o.className=uM,o.markType=u,o.__data__=i.__data__)),a})).attr("markType",u).attr("className",uM)}))),(t=>t.each((function(t,e,n){n.__removed__=!0})).transition((function(t,e,n){return g(t,[n])})).remove()),(t=>t.append(h).attr("className",uM).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new Nu(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new Nu([],n.__toData__,n.parentNode).append(h).attr("className",uM).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...m.flat())}!function(t,e,n,r,i){const[o]=gz("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(zW(lM)).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]=gz("shape",r),{data:a}=t,{data:s,defaultLabelShape:c}=e,l=s.map((t=>t.points)),{theme:u,coordinate:f}=n,h=Object.assign(Object.assign({},i),{document:yz(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:d}=t,p=fW(t,["formatter","transform","style","render"]),g=Nf(Object.assign(Object.assign({},p),f),(t=>OW(t,r,e,a))),{shape:y=c,text:m}=g,v=fW(g,["shape","text"]),b="string"==typeof i?jx(i):i,x=Object.assign(Object.assign({},v),{text:b(m,r,e,a),datum:r}),O=Object.assign({type:`label.${y}`,render:d},v);return o(O,h)(n,x,kW(u,"label",y,"label"),l)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(zW(uM)).nodes().filter((t=>!t.__removed__));return a.flatMap(((t,e)=>{const{transform:n=[]}=t,r=fW(t,["transform"]);return f.flatMap((n=>{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}(r,e,n);return i.forEach((e=>{l.set(e,c),u.set(e,t)})),i}))}))})),h=Cu(c).selectAll(zW(pM)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",pM)),(t=>t.each((function(t,e,n){wu(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),d=uu(h,(t=>u.get(t.__data__))),{coordinate:p}=t;for(const[t,e]of d){const{transform:n=[]}=t;bu(n.map(o))(e,p)}s&&s(h,p)}(t,e,0,r,i)}))}function xW([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])=>Mu(t)&&Mu(e)))&&(r.push(o),i.push(a))}return[r,i]}function OW(t,e,n,r){return"function"==typeof t?t(e,n,r):"string"!=typeof t?t:void 0!==e[t]?e[t]:t}function wW(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 MW(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 EW(t,e,n,r,i){const[o]=gz("shape",r),{data:a}=t,{defaultShape:s,data:c,shape:l}=e,u=c.map((t=>t.points)),{theme:f,coordinate:h}=n,{type:d,style:p={}}=t,g=Object.assign(Object.assign({},i),{document:yz(i),coordinate:h,theme:f});return e=>{const{shape:n=s}=p,{shape:r=n,points:i,seriesIndex:c,index:h}=e,y=fW(e,["shape","points","seriesIndex","index"]),m=Object.assign(Object.assign({},y),{index:h}),v=c?c.map((t=>a[t])):a[h],b=c||h,x=Nf(p,(t=>OW(t,v,b,a)));return(l[r]?l[r](x,g):o(Object.assign(Object.assign({},x),{type:RW(t,r)}),g))(i,m,kW(f,d,r,s),u)}}function kW(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 SW(t,e,n,r,i){var o,a;const[,s]=gz("shape",i),[c]=gz("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:h}=r,d=`default${xx(t)}Animation`,{[d]:p}=(null===(o=u[l])||void 0===o?void 0:o.props)||s(RW(e,l)).props,{[t]:g={}}=f,y=(null===(a=e.animate)||void 0===a?void 0:a[t])||{},m={coordinate:h};return(e,n,r)=>{const{[`${t}Type`]:i,[`${t}Delay`]:o,[`${t}Duration`]:a,[`${t}Easing`]:s}=e,l=Object.assign({type:i||p},y);if(!l.type)return null;const u=c(l,m)(n,r,A(g,{delay:o,duration:a,easing:s}));return Array.isArray(u)?u:[u]}}function PW(t,e,n,r){return SW("enter",t,e,n,r)}function _W(t){return t.finished.then((()=>{t.cancel()})),t}function AW(t,e,n,r){return SW("update",t,e,n,r)}function jW(t,e,n,r){return SW("exit",t,e,n,r)}function TW(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=fW(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function CW(t){const{interaction:e={}}=t;return Object.entries(A({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function NW(t,e){return uW(this,void 0,void 0,(function*(){const n={library:e},{data:r}=t,i=fW(t,["data"]);if(null==r)return t;const[,{data:o}]=yield KF(0,{data:r},n);return Object.assign({data:o},i)}))}function LW(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 RW(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function IW(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";0!==t.nodes().length&&(t.selectAll(zW(cM)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",cM).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(zW(lM)).node()||t.append("g").attr("className",lM).style("zIndex",0))}function zW(...t){return t.map((t=>`.${t}`)).join("")}function DW(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 Rc({style:{x:r+i,y:n+o,width:a,height:s}})}))}function BW(t,e){const n=new LI;return n.registerPlugin(new II),new Kc({width:t,height:e,container:document.createElement("div"),renderer:n})}function FW(t,e={},n=(()=>{}),r=(t=>{throw t})){const{width:i=640,height:o=480,depth:a=0}=t,s=function(t){const e=A({},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=A({},e[o]);e[o]=a,n.set(a,t),r.set(a,o),i.push(a)}}return e}(t),{canvas:c=BW(i,o),emitter:l=new DI,library:u}=e;e.canvas=c,e.emitter=l;const{width:f,height:h}=c.getConfig();f===i&&h===o||c.resize(i,o),l.emit(lE.BEFORE_RENDER);const d=Cu(c.document.documentElement);return c.ready.then((()=>hW(Object.assign(Object.assign({},s),{width:i,height:o,depth:a}),d,u,e))).then((()=>{if(a){const[t,e]=c.document.documentElement.getPosition();c.document.documentElement.setPosition(t,e,-a/2)}c.requestAnimationFrame((()=>{l.emit(lE.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),"string"==typeof(p=c.getConfig().container)?document.getElementById(p):p;var p}function WW(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(function(t){const e=t.getRoot().querySelectorAll(`.${fM}`);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 $W=t=>t?parseInt(t):0;function GW(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 HW{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 GW(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return GW(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return GW(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}}var VW=function(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};const qW=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title"],XW="__remove__",YW="__callback__";function UW(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function KW(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||$W(e.width),r=t.clientHeight||$W(e.height);return{width:n-($W(e.paddingLeft)+$W(e.paddingRight)),height:r-($W(e.paddingTop)+$W(e.paddingBottom))}}(e);a=t||a,s=n||s}return a=n||a,s=r||s,{width:Math.max(Qe(a)?a:1,1),height:Math.max(Qe(s)?s:1,1),depth:o}}function ZW(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 qW)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 qW)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function JW(t,e,n){if("function"==typeof t){const e=new HW;return e.value=t,e.type=YW,e}const{type:r,children:i}=t,o=VW(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 QW(t,e){const{type:n,children:r}=e,i=VW(e,["type","children"]);t.type===n||void 0===n?Tu(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function t$(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=JW(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 e$(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function n$(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 r$(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 i$(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(Au(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 o$(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function a$(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function s$(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?e$(e,n,r):"array"===t?n$(e,n,r):"object"===t?r$(e,n,r):"node"===t?o$(e,n,r):"container"===t?a$(e,n,r):"mix"===t&&i$(e,n)}return e}}function c$(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const l$={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"}},u$=Object.assign(Object.assign({},l$),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),f$=Object.assign(Object.assign({},l$),{labelTransform:{type:"array"}});let h$=class extends HW{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 this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&xM(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&bM(t)}};h$=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}([s$(f$)],h$);let d$=class extends HW{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 this.getRoot().getContext().canvas.getRoot().getElementById(t)}};d$=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}([s$(u$)],d$);const p$={};const g$="G2_CHART_KEY",y$=Object.assign({},Object.assign(Object.assign(Object.assign(Object.assign({},{"composition.geoView":zC,"composition.geoPath":DC}),{"data.arc":HL,"data.cluster":qN,"mark.forceGraph":NN,"mark.tree":JN,"mark.pack":vL,"mark.sankey":DL,"mark.chord":KL,"mark.treemap":tR}),{"data.venn":BR,"mark.boxplot":uR,"mark.gauge":vR,"mark.wordCloud":Ny,"mark.liquid":PR}),{"data.fetch":M_,"data.inline":E_,"data.sortBy":k_,"data.sort":S_,"data.filter":__,"data.pick":A_,"data.rename":j_,"data.fold":T_,"data.slice":C_,"data.custom":N_,"data.map":L_,"data.join":I_,"data.kde":B_,"data.log":F_,"data.wordCloud":lA,"transform.stackY":aP,"transform.binX":IP,"transform.bin":RP,"transform.dodgeX":zP,"transform.jitter":FP,"transform.jitterX":WP,"transform.jitterY":$P,"transform.symmetryY":GP,"transform.diffY":HP,"transform.stackEnter":VP,"transform.normalizeY":qP,"transform.select":ZP,"transform.selectX":JP,"transform.selectY":QP,"transform.groupX":e_,"transform.groupY":n_,"transform.groupColor":r_,"transform.group":t_,"transform.sortX":a_,"transform.sortY":s_,"transform.sortColor":c_,"transform.flexX":l_,"transform.pack":f_,"transform.sample":d_,"transform.filter":p_,"coordinate.cartesian":c,"coordinate.polar":u,"coordinate.transpose":f,"coordinate.theta":h,"coordinate.parallel":d,"coordinate.fisheye":p,"coordinate.radial":y,"coordinate.radar":m,"encode.constant":v,"encode.field":b,"encode.transform":x,"encode.column":O,"mark.interval":Ch,"mark.rect":Lh,"mark.line":Od,"mark.point":Ep,"mark.text":rg,"mark.cell":ag,"mark.area":yg,"mark.link":Ag,"mark.image":Cg,"mark.polygon":zg,"mark.box":Wg,"mark.vector":Gg,"mark.lineX":Yg,"mark.lineY":Zg,"mark.connector":ny,"mark.range":ay,"mark.rangeX":ly,"mark.rangeY":hy,"mark.path":vy,"mark.shape":Oy,"mark.density":Ey,"mark.heatmap":Cy,"mark.wordCloud":Ny,"palette.category10":Ly,"palette.category20":Ry,"scale.linear":Iy,"scale.ordinal":$y,"scale.band":Yy,"scale.identity":am,"scale.point":cm,"scale.time":Jm,"scale.log":ov,"scale.pow":cv,"scale.sqrt":uv,"scale.threshold":hv,"scale.quantile":gv,"scale.quantize":mv,"scale.sequential":xv,"scale.constant":wv,"theme.classic":Sv,"theme.classicDark":Av,"theme.academy":Tv,"theme.light":kv,"theme.dark":_v,"component.axisX":eO,"component.axisY":nO,"component.legendCategory":kO,"component.legendContinuous":YO,"component.legends":UO,"component.title":QO,"component.sliderX":Rw,"component.sliderY":Iw,"component.scrollbarX":Bw,"component.scrollbarY":Fw,"animation.scaleInX":Ww,"animation.scaleOutX":(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]=pt(n)?["left bottom","scale(1, 0.0001)"]:["left top","scale(0.0001, 1)"],h=[{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(h,Object.assign(Object.assign({},i),t))}},"animation.scaleInY":$w,"animation.scaleOutY":(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]=pt(n)?["left top","scale(0.0001, 1)"]:["left bottom","scale(1, 0.0001)"],h=[{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(h,Object.assign(Object.assign({},i),t))}},"animation.waveIn":Gw,"animation.fadeIn":Hw,"animation.fadeOut":Vw,"animation.zoomIn":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))},"animation.zoomOut":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))},"animation.pathIn":qw,"animation.morphing":iM,"animation.growInX":oM,"animation.growInY":aM,"interaction.elementHighlight":XM,"interaction.elementHighlightByX":YM,"interaction.elementHighlightByColor":UM,"interaction.elementSelect":ZM,"interaction.elementSelectByX":JM,"interaction.elementSelectByColor":QM,"interaction.fisheye":function({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=kM(s),l=tE((t=>{const e=PM(c,t);if(!e)return a("fisheye"),void o();a("fisheye",(t=>{const n=A({},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)}}},"interaction.chartIndex":eE,"interaction.tooltip":AE,"interaction.legendFilter":function(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),o=i.length>0,a=t=>WE(t).scales.map((t=>t.name)),s=[...BE(r),...FE(r)],c=s.flatMap(a),l=tE(o?GE:$E,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=WE(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===TE?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:h={markerStroke:"#aaa",markerFill:"#aaa",labelFill:"#aaa"}}=c,d={unselected:ku(h,"marker")},p={unselected:ku(h,"label")},{setState:g,removeState:y}=CM(d,void 0),{setState:m,removeState:v}=CM(p,void 0),b=Array.from(e(t));let x=b.map(i);const O=()=>{for(const t of b){const e=i(t),o=n(t),a=r(t);x.includes(e)?(y(o,"unselected"),v(a,"unselected")):(g(o,"unselected"),m(a,"unselected"))}};for(const e of b){const n=()=>{BM(t,"pointer")},r=()=>{FM(t)},c=t=>jE(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),O();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 w=t=>jE(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),O())})),M=t=>jE(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;e||(x=b.map(i),yield o(x),O())}));return a.on("legend:filter",w),a.on("legend:reset",M),()=>{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",w),a.off("legend:reset",M)}}(r,{legends:DE,marker:IE,label:zE,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()))}}},"interaction.legendHighlight":function(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=BE(r),s=wM(r),c=t=>WE(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=LM(o,["active","inactive"]),f=RM(s,TM(i)),h=[];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=DE(t),o=l(r),a=uu(s,(t=>o.invert(t.__data__[r]))),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:y}=CM(u,f),m={inactive:ku(p,"marker")},v={inactive:ku(p,"label")},{setState:b,removeState:x}=CM(m),{setState:O,removeState:w}=CM(v),M=t=>{for(const e of i){const n=IE(e),r=zE(e);e===t||null===t?(x(n,"inactive"),w(r,"inactive")):(b(n,"inactive"),O(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");M(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)y(t,"inactive","active");M(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},P=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",P),n.on("legend:unhighlight",_);const A=()=>{t.removeEventListener(S),n.off("legend:highlight",P),n.off("legend:unhighlight",_);for(const[t,e]of k)t.removeEventListener(e)};h.push(A)}return()=>h.forEach((t=>t()))}},"interaction.brushHighlight":QE,"interaction.brushXHighlight":function(t){return QE(Object.assign(Object.assign({},t),{brushRegion:tk,selectedHandles:["handle-e","handle-w"]}))},"interaction.brushYHighlight":function(t){return QE(Object.assign(Object.assign({},t),{brushRegion:ek,selectedHandles:["handle-n","handle-s"]}))},"interaction.brushAxisHighlight":function(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=kM(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:h}=e,d=nk(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),y=RM(p,a),{setState:m,removeState:v}=CM(u,y),b=new Map,x=ku(d,"mask"),O=t=>Array.from(b.values()).every((([e,n,r,i])=>t.some((([t,o])=>t>=e&&t<=r&&o>=n&&o<=i)))),w=g.map((t=>t.attributes.scale)),M=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=w[t],{domain:n}=e.getOptions();E.set(t,M(n))}};k();const S=(t,e)=>{const n=[];for(const t of p){const e=i(t);O(e)?(m(t,"active"),n.push(t)):m(t,"inactive")}E.set(t,_(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!A)return Array.from(E.values());const t=[];for(const[e,n]of E){const r=w[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},P=t=>{for(const t of p)v(t,"active","inactive");k(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},_=(t,e)=>{const n=w[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return M(jw(n,i))},A=g.some(o)&&g.some((t=>!o(t))),j=[];for(let t=0;t<g.length;t++){const e=g[t],n=o(e)?fk:uk,{hotZone:r,brushRegion:i,extent:a}=n(e,{offsetY:s,offsetX:c,cross:A,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=UE(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?P(n):S(t,n)},brushed(n,r,i,o,s){b.set(e,a(n,r,i,o)),S(t,s)}}));j.push(u)}const T=(t={})=>{const{nativeEvent:e}=t;e||j.forEach((t=>t.remove(!1)))},C=(t,e,n)=>{const[r,i]=t,a=N(r,e,n),s=N(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]},N=(t,e,n)=>{const{height:r,width:i}=h.getOptions(),a=e.clone();return o(n)?a.update({range:[0,i]}):a.update({range:[r,0]}),a.map(t)},L=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<j.length;t++){const e=n[t],r=j[t],i=g[t];if(e){const n=w[t];r.move(...C(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",T),f.on("brushAxis:highlight",L),()=>{j.forEach((t=>t.destroy())),f.off("brushAxis:remove",T),f.off("brushAxis:highlight",L)}}(i,Object.assign({elements:wM,axes:sk,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:TM(o),state:LM(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}},"interaction.brushFilter":pk,"interaction.brushXFilter":function(t){return pk(Object.assign(Object.assign({hideX:!0},t),{brushRegion:tk}))},"interaction.brushYFilter":function(t){return pk(Object.assign(Object.assign({hideY:!0},t),{brushRegion:ek}))},"interaction.sliderFilter":xk,"interaction.scrollbarFilter":function(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(Ok).length)return()=>{};const{scale:a}=i,{x:s,y:c}=a,l={x:[...s.getOptions().domain],y:[...c.getOptions().domain]};return s.update({domain:s.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain}),xk(Object.assign(Object.assign({},t),{initDomain:l,className:Ok,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)}},"interaction.poptip":Sk,"interaction.treemapDrillDown":function(t={}){const{originData:e=[],layout:n}=t,r=function(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}(t,["originData","layout"]),i=A({},cS,r),o=ku(i,"breadCrumb"),a=ku(i,"active");return t=>{const{update:r,setState:i,container:s,options:c}=t,l=function(t){return Cu(t).select(`.${hM}`).node()}(s),u=c.marks[0],{state:f}=u,h=new _c;l.appendChild(h);const d=(t,c)=>{return u=this,f=void 0,g=function*(){if(h.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 Ic({name:e.replace(/\/$/,""),style:Object.assign(Object.assign({text:a,x:r,path:[...i],depth:c},o),{y:n})});h.appendChild(l),r+=l.getBBox().width;const u=new Ic({style:Object.assign(Object.assign({x:r,text:" / "},o),{y:n})});return h.appendChild(u),r+=u.getBBox().width,r>s&&(n=h.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===Pk(t)-1&&u.remove(),l}));c.forEach(((t,e)=>{if(e===Pk(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",(()=>{d(fb(t,["style","path"]),fb(t,["style","depth"]))}))}))}!function(t,e){[...BE(t),...FE(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=fb(t,["id"]);return e&&(e.match(`${o}/`)||o.match(e))})).map((t=>({value:0===t.height?fb(t,["value"]):void 0,name:fb(t,["id"])}))),{paddingLeft:i,paddingBottom:a,paddingRight:s}=n,l=Object.assign(Object.assign({},n),{paddingTop:(n.paddingTop||h.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=sS(t,l,{value:"value"})[0]}else r=e.filter((t=>1===t.depth));const i=[];return r.forEach((({path:t})=>{i.push(wO(t))})),A({},t,{data:r,scale:{color:{domain:i}}})}));return Object.assign(Object.assign({},r),{marks:a})})),yield r(void 0,["legendFilter"])},new((p=void 0)||(p=Promise))((function(t,e){function n(t){try{i(g.next(t))}catch(t){e(t)}}function r(t){try{i(g.throw(t))}catch(t){e(t)}}function i(e){e.done?t(e.value):function(t){return t instanceof p?t:new p((function(e){e(t)}))}(e.value).then(n,r)}i((g=g.apply(u,f||[])).next())}));var u,f,p,g},p=t=>{const n=t.target;if("rect"!==fb(n,["markType"]))return;const r=fb(n,["__data__","key"]),i=Ak(e,(t=>t.id===r));fb(i,"height")&&d(fb(i,"path"),fb(i,"depth"))};l.addEventListener("click",p);const g=_k(Object.assign(Object.assign({},f.active),f.inactive)),y=()=>{HM(l).forEach((t=>{const n=fb(t,["style","cursor"]),r=Ak(e,(e=>e.id===fb(t,["__data__","key"])));if("pointer"!==n&&(null==r?void 0:r.height)){t.style.cursor="pointer";const e=function(t,e){if(null===t||!S(t))return{};var n={};return vx(e,(function(e){jk.call(t,e)&&(n[e]=t[e])})),n}(t.attributes,g);t.addEventListener("mouseenter",(()=>{t.attr(f.active)})),t.addEventListener("mouseleave",(()=>{t.attr(A(e,f.inactive))}))}}))};return y(),l.addEventListener("mousemove",y),()=>{h.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",y)}}},"interaction.elementPointMove":function(t={}){const{selection:e=[],precision:n=2}=t,r=function(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}(t,["selection","precision"]),i=Object.assign(Object.assign({},uS),r||{}),o=ku(i,"path"),a=ku(i,"label"),s=ku(i,"point");return(t,r,i)=>{const{update:c,setState:l,container:u,view:f,options:{marks:h,coordinate:d}}=t,p=kM(u);let g,y=HM(p),m=e;const{transform:v=[],type:b}=d,x=!!Ak(v,(({type:t})=>"transpose"===t)),O="polar"===b,w="theta"===b,M=!!Ak(y,(({markType:t})=>"area"===t));M&&(y=y.filter((({markType:t})=>"area"===t)));const E=new _c({style:{zIndex:2}});p.appendChild(E);const k=()=>{i.emit("element-point:select",{nativeEvent:!0,data:{selection:m}})},S=t=>{const e=t.target;m=[e.parentNode.childNodes.indexOf(e)],k(),_(e)},P=t=>{const{data:{selection:e},nativeEvent:n}=t;if(n)return;m=e;const r=fb(y,[null==m?void 0:m[0]]);r&&_(r)},_=t=>{const{attributes:e,markType:r,__data__:d}=t,{stroke:p}=e,{points:y,seriesTitle:v,color:b,title:S,seriesX:P,y1:j}=d;if(x&&"interval"!==r)return;const{scale:T,coordinate:C}=(null==g?void 0:g.view)||f,{color:N,y:L,x:R}=T,I=C.getCenter();let z;E.removeChildren();const D=(t,e,n,r)=>lS(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)||h).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=((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})))(c,a,s);return((t,e)=>{i.emit("element-point:moved",{nativeEvent:!0,data:{changeData:t,data:e}})})(c,l),A({},o,{data:l,animate:!1})}));return Object.assign(Object.assign({},o),{marks:s})})),yield c("elementPointMove")}));if(["line","area"].includes(r))y.forEach(((e,r)=>{const i=R.invert(P[r]);if(!i)return;const c=new kc({name:fS,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),l=((t,e)=>{const n=fb(t,["__data__","seriesItems",e,"0","value"]),r=fb(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:o,transform:a}}=t.parentNode,s=Ak(a,(({type:t})=>"normalizeY"===t)),c=fb(o,["y","field"]),l=i[r][c];return t=>s?1===n?t:t/(1-t)/(n/(1-n))*l:t})(t,r);c.addEventListener("mousedown",(f=>{const h=C.output([P[r],0]),d=null==v?void 0:v.length;u.attr("cursor","move"),m[1]!==r&&(m[1]=r,k()),pS(E.childNodes,m,s);const[p,x]=gS(E,c,o,a),w=t=>{const i=e[1]+t.clientY-z[1];if(M)if(O){const o=e[0]+t.clientX-z[0],[a,s]=mS(I,h,[o,i]),[,u]=C.output([1,L.output(0)]),[,f]=C.invert([a,u-(y[r+d][1]-s)]),g=(r+1)%d,m=GM([y[(r-1+d)%d],[a,s],v[g]&&y[g]]);x.attr("text",l(L.invert(f)).toFixed(n)),p.attr("d",m),c.attr("cx",a),c.attr("cy",s)}else{const[,t]=C.output([1,L.output(0)]),[,o]=C.invert([e[0],t-(y[r+d][1]-i)]),a=GM([y[r-1],[e[0],i],v[r+1]&&y[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=GM([y[r-1],[e[0],i],y[r+1]]);x.attr("text",L.invert(t).toFixed(n)),p.attr("d",o),c.attr("cy",i)}};z=[f.clientX,f.clientY],window.addEventListener("mousemove",w);const S=()=>lS(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",w),u.removeEventListener("mouseup",S),Vn(x.attr("text")))return;const e=Number(x.attr("text")),n=yS(N,b);g=yield D(i,e,n,["line","area"]),x.remove(),p.remove(),_(t)}));u.addEventListener("mouseup",S)})),E.appendChild(c)})),pS(E.childNodes,m,s);else if("interval"===r){let e=[(y[0][0]+y[1][0])/2,y[0][1]];x?e=[y[0][0],(y[0][1]+y[1][1])/2]:w&&(e=y[0]);const i=(t=>{const e=fb(t,["__data__","y"]),n=fb(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:o},childNodes:a}=t.parentNode,s=Ak(o,(({type:t})=>"normalizeY"===t)),c=fb(i,["y","field"]),l=r[a.indexOf(t)][c];return(t,e=!1)=>s||e?t/(1-t)/(n/(1-n))*l:t})(t),c=new kc({name:fS,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=yS(N,b),[f,h]=gS(E,c,o,a),d=t=>{if(x){const r=e[0]+t.clientX-z[0],[o]=C.output([L.output(0),L.output(0)]),[,a]=C.invert([o+(r-y[2][0]),e[1]]),s=GM([[r,y[0][1]],[r,y[1][1]],y[2],y[3]],!0);h.attr("text",i(L.invert(a)).toFixed(n)),f.attr("d",s),c.attr("cx",r)}else if(w){const r=e[1]+t.clientY-z[1],o=e[0]+t.clientX-z[0],[a,s]=mS(I,[o,r],e),[l,u]=mS(I,[o,r],y[1]),d=C.invert([a,s])[1],p=j-d;if(p<0)return;const g=function(t,e,n=0){const r=[["M",...e[1]]],i=$M(t,e[1]),o=$M(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}(I,[[a,s],[l,u],y[2],y[3]],p>.5?1:0);h.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-z[1],[,o]=C.output([1,L.output(0)]),[,a]=C.invert([e[0],o-(y[2][1]-r)]),s=GM([[y[0][0],r],[y[1][0],r],y[2],y[3]],!0);h.attr("text",i(L.invert(a)).toFixed(n)),f.attr("d",s),c.attr("cy",r)}};z=[s.clientX,s.clientY],window.addEventListener("mousemove",d);const p=()=>lS(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",d),Vn(h.attr("text")))return;const e=Number(h.attr("text"));g=yield D(S,e,l,[r]),h.remove(),f.remove(),_(t)}));u.addEventListener("mouseup",p)})),E.appendChild(c)}};y.forEach(((t,e)=>{m[0]===e&&_(t),t.addEventListener("click",S),t.addEventListener("mouseenter",hS),t.addEventListener("mouseleave",dS)}));const j=t=>{const e=null==t?void 0:t.target;e&&(e.name===fS||y.includes(e))||(m=[],k(),E.removeChildren())};return i.on("element-point:select",P),i.on("element-point:unselect",j),u.addEventListener("mousedown",j),()=>{E.remove(),i.off("element-point:select",P),i.off("element-point:unselect",j),u.removeEventListener("mousedown",j),y.forEach((t=>{t.removeEventListener("click",S),t.removeEventListener("mouseenter",hS),t.removeEventListener("mouseleave",dS)}))}}},"composition.spaceLayer":OS,"composition.spaceFlex":MS,"composition.facetRect":zS,"composition.repeatMatrix":()=>t=>[ES.of(t).call(AS).call(SS).call(FS).call(WS).call(PS).call(_S).call(BS).value()],"composition.facetCircle":()=>t=>[ES.of(t).call(AS).call(VS).call(SS).call(HS).call(jS).call(TS,XS,qS,qS,{frame:!1}).call(PS).call(_S).call(GS).value()],"composition.timingKeyframe":US,"labelTransform.overlapHide":t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{xM(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]}(uA(e),uA(t.getLocalBounds()))));r?bM(t):n.push(t)})),t}},"labelTransform.overlapDodgeY":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]=dA(),[s,c]=dA(),[l,u]=dA(),[f,h]=dA();for(const e of t){const{min:t,max:n}=pA(e),[r,i]=t,[o,s]=n;a(e,i),c(e,i),u(e,s-i),h(e,[r,o])}for(let o=0;o<e;o++){t.sort(((t,e)=>gw(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])&&!hA(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}},"labelTransform.overflowHide":()=>t=>(t.forEach((t=>{xM(t);const e=t.attr("bounds"),n=function(t,e){const[n,r]=t;return!(fA(n,e)&&fA(r,e))}(uA(t.getLocalBounds()),e);n&&bM(t)})),t),"labelTransform.contrastReverse":t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;mA(t.parsedStyle.fill,r)<e&&t.attr("fill",function(t,e){const n=KS(e,(e=>mA(t,function(t){return"object"==typeof t?t:bo(t)}(e))));return e[n]}(r,n))})),t)}})),m$=function(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}(class extends h${constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:o}=t;super(function(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}(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=iO((()=>{this.forceFit()}),300),this._renderer=r||new LI,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[XW]=!0,t}return"string"==typeof t?document.getElementById(t):t}(e),this._emitter=new DI,this._context={library:Object.assign(Object.assign({},o),p$),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)=>FW(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 function(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of qW)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,UW(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===YW)e.children=t.value;else{const i=UW(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,ZW(t,e,n,r,i)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){QW(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 t$(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(lE.BEFORE_CLEAR),this._reset(),WW(0,this._context,!1),this.emit(lE.AFTER_CLEAR)}destroy(){this.options(),this.emit(lE.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),WW(0,this._context,!0),this._container[XW]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(lE.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=KW(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(lE.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(lE.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(lE.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(lE.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 d${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 h${constructor(){super({},e)}};return n=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}([s$(c$(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))s$(c$(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=g$}=t,{width:n,height:r,depth:i}=KW(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}=KW(this.options(),this._container);this._plugins.push(new II),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new Kc({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;return null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0,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))}},y$)},6931:t=>{"use strict";t.exports={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]}},3269:(t,e,n)=>{var r=n(6931),i=n(9975),o=Object.hasOwnProperty,a=Object.create(null);for(var s in r)o.call(r,s)&&(a[r[s]]=s);var c=t.exports={to:{},get:{}};function l(t,e,n){return Math.min(Math.max(e,t),n)}function u(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}c.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=c.get.hsl(t),n="hsl";break;case"hwb":e=c.get.hwb(t),n="hwb";break;default:e=c.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},c.get.rgb=function(t){if(!t)return null;var e,n,i,a=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=e[2],e=e[1],n=0;n<3;n++){var s=2*n;a[n]=parseInt(e.slice(s,s+2),16)}i&&(a[3]=parseInt(i,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(i=(e=e[1])[3],n=0;n<3;n++)a[n]=parseInt(e[n]+e[n],16);i&&(a[3]=parseInt(i+i,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++)a[n]=parseInt(e[n+1],0);e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[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(r,e[1])?((a=r[e[1]])[3]=1,a):null:null;for(n=0;n<3;n++)a[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?a[3]=.01*parseFloat(e[4]):a[3]=parseFloat(e[4]))}for(n=0;n<3;n++)a[n]=l(a[n],0,255);return a[3]=l(a[3],0,1),a},c.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,l(parseFloat(e[2]),0,100),l(parseFloat(e[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},c.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,l(parseFloat(e[2]),0,100),l(parseFloat(e[3]),0,100),l(isNaN(n)?1:n,0,1)]}return null},c.to.hex=function(){var t=i(arguments);return"#"+u(t[0])+u(t[1])+u(t[2])+(t[3]<1?u(Math.round(255*t[3])):"")},c.to.rgb=function(){var t=i(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]+")"},c.to.rgb.percent=function(){var t=i(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]+")"},c.to.hsl=function(){var t=i(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},c.to.hwb=function(){var t=i(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},c.to.keyword=function(t){return a[t.slice(0,3)]}},9561:function(t,e){!function(t){"use strict";function e(t){for(var e=new Array(t),n=0;n<t;++n)e[n]=0;return e}function n(t,e){for(var n=0,r=0;r<t.length;++r)n+=t[r]*e[r];return n}function r(t){return Math.sqrt(n(t,t))}function i(t,e,n){for(var r=0;r<e.length;++r)t[r]=e[r]*n}function o(t,e,n,r,i){for(var o=0;o<t.length;++o)t[o]=e*n[o]+r*i[o]}function a(t,e,r,i,a,s,c){var l=r.fx,u=n(r.fxprime,e),f=l,h=l,d=u,p=0;function g(h,p,g){for(var y=0;y<16;++y)if(a=(h+p)/2,o(i.x,1,r.x,a,e),f=i.fx=t(i.x,i.fxprime),d=n(i.fxprime,e),f>l+s*a*u||f>=g)p=a;else{if(Math.abs(d)<=-c*u)return a;d*(p-h)>=0&&(p=h),h=a,g=f}return 0}a=a||1,s=s||1e-6,c=c||.1;for(var y=0;y<10;++y){if(o(i.x,1,r.x,a,e),f=i.fx=t(i.x,i.fxprime),d=n(i.fxprime,e),f>l+s*a*u||y&&f>=h)return g(p,a,h);if(Math.abs(d)<=-c*u)return a;if(d>=0)return g(a,p,f);h=f,p=a,a*=2}return a}t.bisect=function(t,e,n,r){var i=(r=r||{}).maxIterations||100,o=r.tolerance||1e-10,a=t(e),s=t(n),c=n-e;if(a*s>0)throw"Initial bisect points must have opposite signs";if(0===a)return e;if(0===s)return n;for(var l=0;l<i;++l){var u=e+(c/=2),f=t(u);if(f*a>=0&&(e=u),Math.abs(c)<o||0===f)return u}return e+c},t.nelderMead=function(t,e,n){var r,i=(n=n||{}).maxIterations||200*e.length,a=n.nonZeroDelta||1.05,s=n.zeroDelta||.001,c=n.minErrorDelta||1e-6,l=n.minErrorDelta||1e-5,u=void 0!==n.rho?n.rho:1,f=void 0!==n.chi?n.chi:2,h=void 0!==n.psi?n.psi:-.5,d=void 0!==n.sigma?n.sigma:.5,p=e.length,g=new Array(p+1);g[0]=e,g[0].fx=t(e),g[0].id=0;for(var y=0;y<p;++y){var m=e.slice();m[y]=m[y]?m[y]*a:s,g[y+1]=m,g[y+1].fx=t(m),g[y+1].id=y+1}function v(t){for(var e=0;e<t.length;e++)g[p][e]=t[e];g[p].fx=t.fx}for(var b=function(t,e){return t.fx-e.fx},x=e.slice(),O=e.slice(),w=e.slice(),M=e.slice(),E=0;E<i;++E){if(g.sort(b),n.history){var k=g.map((function(t){var e=t.slice();return e.fx=t.fx,e.id=t.id,e}));k.sort((function(t,e){return t.id-e.id})),n.history.push({x:g[0].slice(),fx:g[0].fx,simplex:k})}for(r=0,y=0;y<p;++y)r=Math.max(r,Math.abs(g[0][y]-g[1][y]));if(Math.abs(g[0].fx-g[p].fx)<c&&r<l)break;for(y=0;y<p;++y){x[y]=0;for(var S=0;S<p;++S)x[y]+=g[S][y];x[y]/=p}var P=g[p];if(o(O,1+u,x,-u,P),O.fx=t(O),O.fx<g[0].fx)o(M,1+f,x,-f,P),M.fx=t(M),M.fx<O.fx?v(M):v(O);else if(O.fx>=g[p-1].fx){var _=!1;if(O.fx>P.fx?(o(w,1+h,x,-h,P),w.fx=t(w),w.fx<P.fx?v(w):_=!0):(o(w,1-h*u,x,h*u,P),w.fx=t(w),w.fx<O.fx?v(w):_=!0),_){if(d>=1)break;for(y=1;y<g.length;++y)o(g[y],1-d,g[0],d,g[y]),g[y].fx=t(g[y])}}else v(O)}return g.sort(b),{fx:g[0].fx,x:g[0]}},t.conjugateGradient=function(t,e,s){var c,l,u,f={x:e.slice(),fx:0,fxprime:e.slice()},h={x:e.slice(),fx:0,fxprime:e.slice()},d=e.slice(),p=1;u=(s=s||{}).maxIterations||20*e.length,f.fx=t(f.x,f.fxprime),i(c=f.fxprime.slice(),f.fxprime,-1);for(var g=0;g<u;++g){if(p=a(t,c,f,h,p),s.history&&s.history.push({x:f.x.slice(),fx:f.fx,fxprime:f.fxprime.slice(),alpha:p}),p){o(d,1,h.fxprime,-1,f.fxprime);var y=n(f.fxprime,f.fxprime);o(c,Math.max(0,n(d,h.fxprime)/y),c,-1,h.fxprime),l=f,f=h,h=l}else i(c,f.fxprime,-1);if(r(f.fxprime)<=1e-5)break}return s.history&&s.history.push({x:f.x.slice(),fx:f.fx,fxprime:f.fxprime.slice(),alpha:p}),f},t.gradientDescent=function(t,e,n){for(var i=(n=n||{}).maxIterations||100*e.length,a=n.learnRate||.001,s={x:e.slice(),fx:0,fxprime:e.slice()},c=0;c<i&&(s.fx=t(s.x,s.fxprime),n.history&&n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice()}),o(s.x,1,s.x,-a,s.fxprime),!(r(s.fxprime)<=1e-5));++c);return s},t.gradientDescentLineSearch=function(t,e,n){n=n||{};var o,s={x:e.slice(),fx:0,fxprime:e.slice()},c={x:e.slice(),fx:0,fxprime:e.slice()},l=n.maxIterations||100*e.length,u=n.learnRate||1,f=e.slice(),h=n.c1||.001,d=n.c2||.1,p=[];if(n.history){var g=t;t=function(t,e){return p.push(t.slice()),g(t,e)}}s.fx=t(s.x,s.fxprime);for(var y=0;y<l&&(i(f,s.fxprime,-1),u=a(t,f,s,c,u,h,d),n.history&&(n.history.push({x:s.x.slice(),fx:s.fx,fxprime:s.fxprime.slice(),functionCalls:p,learnRate:u,alpha:u}),p=[]),o=s,s=c,c=o,!(0===u||r(s.fxprime)<1e-5));++y);return s},t.zeros=e,t.zerosM=function(t,n){return e(t).map((function(){return e(n)}))},t.norm2=r,t.weightedSum=o,t.scale=i}(e)},7529:t=>{"use strict";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}},3761:(t,e,n)=>{"use strict";var r=Math.log(2),i=t.exports,o=n(7529);function a(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return i.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,r=!1,i=o.isNumber(e.width)?e.width:2,a=o.isNumber(e.size)?e.size:50,s=o.isNumber(e.min)?e.min:(n=!0,o.findMinMulti(t)),c=o.isNumber(e.max)?e.max:(r=!0,o.findMaxMulti(t)),l=(c-s)/(a-1);return n&&(s-=2*i*l),r&&(c+=2*i*l),{min:s,max:c}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var n=o.isNumber(e.size)?e.size:50,r=o.isNumber(e.width)?e.width:2,s=i.getUnifiedMinMax(t,{size:n,width:r,min:e.min,max:e.max}),c=s.min,l=s.max-c,u=l/(n-1);if(0===l)return[{x:c,y:1}];for(var f=[],h=0;h<n;h++)f.push({x:c+h*u,y:0});var d=function(t,e){for(var n={},r=0,i=-e;i<=e;i++)r+=t(i/e),n[i]=r;return n}(a,r),p=d[r],g=d[r-1]-d[r-2],y=0;t.forEach((function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+r<0||e-r>=f.length)){var n=Math.max(e-r,0),i=e,a=Math.min(e+r,f.length-1),s=n-(e-r),l=e+r-a,h=d[-r-1+s]||0,m=d[-r-1+l]||0,v=p/(p-h-m);s>0&&(y+=v*(s-1)*g);var b=Math.max(0,e-r+1);o.inside(0,f.length-1,b)&&(f[b].y+=1*v*g),o.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*v*g),o.inside(0,f.length-1,a+1)&&(f[a+1].y+=1*v*g)}}));var m=y,v=0,b=0;return f.forEach((function(t){v+=t.y,m+=v,t.y=m,b+=m})),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 e=0;return t.forEach((function(t){var n=Math.log(t.y);isFinite(n)&&(e+=t.y*n)})),e=-e/r,Math.pow(2,e)}}},9975:(t,e,n)=>{"use strict";var r=n(7101),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n<a;n++){var s=t[n];r(s)?e=i.call(e,o.call(s)):e.push(s)}return e};a.wrap=function(t){return function(){return t(a(arguments))}}},7101:t=>{t.exports=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))}},5608:(t,e,n)=>{"use strict";n.d(e,{C6:()=>i,Cl:()=>o,Ju:()=>l,Tt:()=>a,YH:()=>c,aN:()=>f,fX:()=>h,gn:()=>d,sH:()=>s,zs:()=>u});var r=function(t,e){return r=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])},r(t,e)};function i(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}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return o=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},o.apply(this,arguments)};function a(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 s(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 c(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=(i=a.trys).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 l(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 u(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 f(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}function h(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 d(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)}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError}}]);
2
+ //# sourceMappingURL=6645.f1ac9b65.js.map