@antv/g2 5.3.3 → 5.3.4-beta.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.
- package/README.md +9 -0
- package/README.zh-CN.md +8 -0
- package/dist/g2.lite.min.js +5 -5
- package/dist/g2.min.js +5 -5
- package/esm/api/runtime.d.ts +2 -1
- package/esm/api/runtime.js +26 -3
- package/esm/api/runtime.js.map +1 -1
- package/esm/data/fetch.d.ts +2 -2
- package/esm/data/fetch.js +2 -2
- package/esm/data/fetch.js.map +1 -1
- package/esm/interaction/tooltip.js +5 -3
- package/esm/interaction/tooltip.js.map +1 -1
- package/esm/runtime/plot.js +2 -0
- package/esm/runtime/plot.js.map +1 -1
- package/esm/runtime/render.d.ts +1 -1
- package/esm/runtime/render.js +4 -2
- package/esm/runtime/render.js.map +1 -1
- package/lib/api/runtime.d.ts +2 -1
- package/lib/api/runtime.js +26 -3
- package/lib/api/runtime.js.map +1 -1
- package/lib/data/fetch.d.ts +2 -2
- package/lib/data/fetch.js +1 -1
- package/lib/data/fetch.js.map +1 -1
- package/lib/interaction/tooltip.js +5 -3
- package/lib/interaction/tooltip.js.map +1 -1
- package/lib/runtime/plot.js +2 -0
- package/lib/runtime/plot.js.map +1 -1
- package/lib/runtime/render.d.ts +1 -1
- package/lib/runtime/render.js +4 -2
- package/lib/runtime/render.js.map +1 -1
- package/package.json +19 -19
- package/src/api/runtime.ts +29 -3
- package/src/data/fetch.ts +5 -4
- package/src/interaction/tooltip.ts +3 -3
- package/src/runtime/plot.ts +1 -0
- package/src/runtime/render.ts +5 -1
package/dist/g2.min.js
CHANGED
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
* @date 5/9/2025, 8:18:51 AM
|
|
7
7
|
* @author AntVis
|
|
8
8
|
* @docs https://g.antv.antgroup.com/
|
|
9
|
-
*/function Tl(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Pl(t,e){var n=Math.min.apply(Math,yl(t)),r=Math.min.apply(Math,yl(e));return{x:n,y:r,width:Math.max.apply(Math,yl(t))-n,height:Math.max.apply(Math,yl(e))-r}}function Nl(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Cl(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function Ll(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(var d=0;d<u.length;d++){var p=Nl(t,0,n,r,i,u[d]);p<c&&(c=p),p>l&&(l=p)}for(var g=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),v=1/0,y=-1/0,m=[o,a],b=2*-Math.PI;b<=2*Math.PI;b+=Math.PI){var x=g+b;o<a?o<x&&x<a&&m.push(x):a<x&&x<o&&m.push(x)}for(var w=0;w<m.length;w++){var k=Cl(0,e,n,r,i,m[w]);k<v&&(v=k),k>y&&(y=k)}return{x:c,y:v,width:l-c,height:y-v}}function jl(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,yl(t.concat([d]))),i.apply(void 0,yl(e.concat([d])))],g=Tl(c[0],c[1],p[0],p[1]);g<s&&(a=d,s=g)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var v=t.length;return{x:t[v-1],y:e[v-1]}}s=1/0;for(var y=0;y<32&&!(f<1e-4);y++){var m=a-f,b=a+f,x=[i.apply(void 0,yl(t.concat([m]))),i.apply(void 0,yl(e.concat([m])))],w=Tl(c[0],c[1],x[0],x[1]);if(m>=0&&w<s)a=m,s=w;else{var k=[i.apply(void 0,yl(t.concat([b]))),i.apply(void 0,yl(e.concat([b])))],M=Tl(c[0],c[1],k[0],k[1]);b<=1&&M<s?(a=b,s=M):f*=.5}}return{x:i.apply(void 0,yl(t.concat([a]))),y:i.apply(void 0,yl(e.concat([a])))}}function Rl(t,e,n,r){return Tl(t,e,n,r)}function Il(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Dl(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var c=[i-t,o-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(c,s))}function Bl(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 Fl(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(D(s,0))D(c,0)||(i=-l/c)>=0&&i<=1&&u.push(i);else{var f=c*c-4*s*l;D(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 zl(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],u=Fl(t,n,i,a),f=Fl(e,r,o,s),h=0;h<u.length;h++)c.push(Bl(t,n,i,a,u[h]));for(var d=0;d<f.length;d++)l.push(Bl(e,r,o,s,f[d]));return Pl(c,l)}function $l(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 jl([t,n,i,a],[e,r,o,s],c,l,Bl,u)}(t,e,n,r,i,o,a,s,c,l,u);return Tl(f.x,f.y,c,l)}function Wl(t){return function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=Tl(r[0],r[1],i[0],i[1])}return e}(t)}function Gl(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Hl(t,e,n){var r=t+n-2*e;if(D(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function Yl(t,e,n,r,i,o){var a=Hl(t,n,i)[0],s=Hl(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(Gl(t,n,i,a)),void 0!==s&&l.push(Gl(e,r,o,s)),Pl(c,l)}function ql(t,e,n,r,i,o,a,s){var c=function(t,e,n,r,i,o,a,s){return jl([t,n,i],[e,r,o],a,s,Gl)}(t,e,n,r,i,o,a,s);return Tl(c.x,c.y,a,s)}function Vl(){Vl=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,n,r){return Object.defineProperty(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r})}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(e,n,r,i){var o=n&&n.prototype instanceof h?n:h,a=Object.create(o.prototype);return c(a,"_invoke",function(e,n,r){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=w(s,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(1===i)throw i=4,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=3;var l=u(e,n,r);if("normal"===l.type){if(i=r.done?4:2,l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=4,r.method="throw",r.arg=l.arg)}}}(e,r,new E(i||[])),!0),a}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f={};function h(){}function d(){}function p(){}var g={};c(g,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(O([])));y&&y!==n&&r.call(y,o)&&(g=y);var m=p.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==sl(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var i;c(this,"_invoke",(function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}),!0)}function w(e,n){var r=n.method,i=e.i[r];if(i===t)return n.delegate=null,"throw"===r&&e.i.return&&(n.method="return",n.arg=t,w(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=u(i,e.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,f;var a=o.arg;return a?a.done?(n[e.r]=a.value,n.next=e.n,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,f):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,f)}function k(t){this.tryEntries.push(t)}function M(e){var n=e[4]||{};n.type="normal",n.arg=t,e[4]=n}function E(t){this.tryEntries=[[-1]],t.forEach(k,this),this.reset(!0)}function O(e){if(null!=e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(sl(e)+" is not iterable")}return d.prototype=p,c(m,"constructor",p),c(p,"constructor",d),d.displayName=c(p,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,s,"GeneratorFunction")),t.prototype=Object.create(m),t},e.awrap=function(t){return{__await:t}},b(x.prototype),c(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new x(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(m),c(m,s,"Generator"),c(m,o,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function t(){for(;n.length;)if((r=n.pop())in e)return t.value=r,t.done=!1,t;return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(M),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(t){a.type="throw",a.arg=e,n.next=t}for(var i=n.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,c=o[1],l=o[2];if(-1===o[0])return r("end"),!1;if(!c&&!l)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<c)return this.method="next",this.arg=t,r(c),!0;if(s<l)return r(l),!1}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r[0]>-1&&r[0]<=this.prev&&this.prev<r[2]){var i=r;break}}i&&("break"===t||"continue"===t)&&i[0]<=e&&e<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i[2],f):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[2]===t)return this.complete(n[4],n[3]),M(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[0]===t){var r=n[4];if("throw"===r.type){var i=r.arg;M(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={i:O(e),r:n,n:r},"next"===this.method&&(this.arg=t),f}},e}function Ul(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Xl(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Ul(o,r,i,a,s,"next",t)}function s(t){Ul(o,r,i,a,s,"throw",t)}a(void 0)}))}}function Zl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=vl(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Kl(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==al||"undefined"!=typeof self&&self;var Ql={exports:{}};!function(t){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,c=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*u*(s-u)/s)*(c-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-c*u/s+f)),Math.min(o,Math.floor(r+(s-c)*u/s+f)),a)}var 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=y(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var a=t.children[o];c(i,t.leaf?r(a):a)}return i}function c(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function 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 v(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(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(!v(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;v(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(!v(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(v(t,o)){if(e.leaf||g(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=y([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),c=[],l=[];a||c.length;){if(a||(a=c.pop(),r=c[c.length-1],n=l.pop(),i=!0),a.leaf){var u=o(t,a.children,e);if(-1!==u)return a.children.splice(u,1),c.push(a),this._condense(c),this}i||a.leaf||!g(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(c.push(a),l.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return a(i=y(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=y([])).leaf=!1,i.height=r;var c=Math.ceil(o/s),l=c*Math.ceil(Math.sqrt(s));m(t,e,n,l,this.compareMinX);for(var u=e;u<=n;u+=l){var f=Math.min(u+l-1,n);m(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=y(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;a<=n-e;a++){var c=s(t,0,a,this.toBBox),l=s(t,a,n,this.toBBox),u=p(c,l),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}()}(Ql);var Jl=Ql.exports,tu=function(t){return t.GROUP="g",t.FRAGMENT="fragment",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",t}({}),eu=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),nu=function(){return pl((function t(){hl(this,t),this.plugins=[]}),[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)}))}}])}(),ru=function(){return pl((function t(e){hl(this,t),this.clipSpaceNearZ=eu.NEGATIVE_ONE,this.plugins=[],this.config=fl({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)}),[{key:"registerPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));-1===e&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find((function(e){return e.name===t}))}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),iu=re,ou=ee,au=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},su=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},cu=oe,lu=de,uu=function(){function t(){hl(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return pl(t,[{key:"update",value:function(t,e){ou(this.center,t),ou(this.halfExtents,e),lu(this.min,this.center,this.halfExtents),iu(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){iu(this.center,e,t),cu(this.center,this.center,.5),lu(this.halfExtents,e,t),cu(this.halfExtents,this.halfExtents,.5),ou(this.min,t),ou(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value: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,v=e.center,y=v[0],m=v[1],b=v[2],x=e.halfExtents,w=x[0],k=x[1],M=x[2],E=y-w,O=y+w,_=m-k,S=m+k,A=b-M,T=b+M;E<u&&(u=E),O>f&&(f=O),_<h&&(h=_),S>d&&(d=S),A<p&&(p=A),T>g&&(g=T),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}}},{key:"setFromTransformedAABB",value: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),v=Math.abs(s),y=Math.abs(c),m=Math.abs(l),b=Math.abs(u),x=Math.abs(f),w=Math.abs(h),k=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]+v*o[1]+y*o[2],r[1]=m*o[0]+b*o[1]+x*o[2],r[2]=w*o[0]+k*o[1]+M*o[2],lu(this.min,n,r),iu(this.max,n,r)}},{key:"intersects",value: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]}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,r=au([0,0,0],this.getMin(),e.getMin()),i=su([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?ou([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]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?ou([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]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),fu=function(){return pl((function t(e,n){hl(this,t),this.distance=e||0,this.normal=n||te(0,1,0),this.updatePNVertexFlag()}),[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return se(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/ge(this.normal);oe(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&le(n,t,e,i),o}}])}(),hu=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),du=function(){return pl((function t(e){if(hl(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new fu)}),[{key:"extractFromVPMatrix",value:function(t){var e=El(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],v=e[14],y=e[15];ne(this.planes[0].normal,o-n,l-a,d-u),this.planes[0].distance=y-p,ne(this.planes[1].normal,o+n,l+a,d+u),this.planes[1].distance=y+p,ne(this.planes[2].normal,o+r,l+s,d+f),this.planes[2].distance=y+g,ne(this.planes[3].normal,o-r,l-s,d-f),this.planes[3].distance=y-g,ne(this.planes[4].normal,o-i,l-c,d-h),this.planes[4].distance=y-v,ne(this.planes[5].normal,o+i,l+c,d+h),this.planes[5].distance=y+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}])}(),pu=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;hl(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return pl(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),gu=function(){function t(e,n,r,i){hl(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return pl(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var r=ye(e.x,e.y,0,1),i=ye(e.x+e.width,e.y,0,1),o=ye(e.x,e.y+e.height,0,1),a=ye(e.x+e.width,e.y+e.height,0,1),s=ve(),c=ve(),l=ve(),u=ve();me(s,r,n),me(c,i,n),me(l,o,n),me(u,a,n);var f=Math.min(s[0],c[0],l[0],u[0]),h=Math.min(s[1],c[1],l[1],u[1]),d=Math.max(s[0],c[0],l[0],u[0]),p=Math.max(s[1],c[1],l[1],u[1]);return t.fromRect({x:f,y:h,width:d-f,height:p-h})}}])}(),vu="Method not implemented.",yu="Use document.documentElement instead.";function mu(t){return void 0===t?0:t>360||t<-360?t%360:t}var bu=Kt();function xu(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return Array.isArray(t)&&3===t.length?r?Qt(t):ee(bu,t):I(t)?r?te(t,e,n):ne(bu,t,e,n):r?te(t[0],t[1]||e,t[2]||n):ne(bu,t[0],t[1]||e,t[2]||n)}var wu=Math.PI/180;function ku(t){return t*wu}var Mu=180/Math.PI;function Eu(t){return t*Mu}var Ou=Math.PI/2;function _u(t,e){return 16===e.length?function(t,e){var n,r,i=El(It(Kt(),e),3),o=i[0],a=i[1],s=i[2],c=Math.asin(-e[2]/o);return c<Ou?c>-Ou?(n=Math.atan2(e[6]/a,e[10]/s),r=Math.atan2(e[1]/o,e[0]/o)):(r=0,n=-Math.atan2(e[4]/a,e[5]/a)):(r=0,n=Math.atan2(e[4]/a,e[5]/a)),t[0]=n,t[1]=c,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]=Ou,t[1]=2*Math.atan2(r,n),t[2]=0):u<-.499995*l?(t[0]=-Ou,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 Su(t,e,n,r,i){var o,a,s,c,l,u,f,h,d,p,g=Math.cos(t),v=Math.sin(t);return o=r*g,a=i*v,s=0,c=-r*v,l=i*g,u=0,f=e,h=n,d=1,(p=new ft(9))[0]=o,p[1]=a,p[2]=s,p[3]=c,p[4]=l,p[5]=u,p[6]=f,p[7]=h,p[8]=d,p}function Au(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);if(e*i-n*r<0&&(e<i?o=-o:a=-a),o){var s=1/o;e*=s,n*=s}if(a){var c=1/a;r*=c,i*=c}var l=Eu(Math.atan2(n,e));return[t[6],t[7],o,a,l]}var Tu=pt(),Pu=pt(),Nu=ve(),Cu=[Kt(),Kt(),Kt()],Lu=Kt();function ju(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 Ru=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),Iu=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),Du=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),Bu="updated",Fu=2e-4,zu=function(){return pl((function t(){hl(this,t),this.clipSpaceNearZ=eu.NEGATIVE_ONE,this.eventEmitter=new _l,this.matrix=pt(),this.right=te(1,0,0),this.up=te(0,1,0),this.forward=te(0,0,1),this.position=te(0,0,1),this.focalPoint=te(0,0,0),this.distanceVector=te(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=pt(),this.projectionMatrixInverse=pt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Ru.EXPLORING,this.trackingMode=Iu.DEFAULT,this.projectionMode=Du.PERSPECTIVE,this.frustum=new du,this.orthoMatrix=pt()}),[{key:"isOrtho",value:function(){return this.projectionMode===Du.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,e){return this.type=t,this.type===Ru.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Ru.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==Ru.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return wt(pt(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=At(pt(),[t,e,0]);this.jitteredProjectionMatrix=Mt(pt(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===Du.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===Du.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value: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===Du.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}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Du.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}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===Du.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Du.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value: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=te(a.x-r,a.y-i,0),c=se(s,this.right)/Jt(this.right),l=se(s,this.up)/Jt(this.up),u=El(this.getPosition(),2),f=u[0],h=u[1],d=El(this.getFocalPoint(),2),p=d[0],g=d[1];return this.setPosition(f-c,h-l),this.setFocalPoint(p-c,g-l),this}},{key:"setPerspective",value:function(t,e,n,r){var i;this.projectionMode=Du.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(ku(.5*this.fov))/this.zoom,a=2*o,s=this.aspect*a,c=-.5*s;if(null!==(i=this.view)&&void 0!==i&&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){var s,c,l=2*o,u=n-e,f=r-i,h=l/u,d=l/f,p=(n+e)/u,g=(r+i)/f,v=a-o,y=a*o;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(s=-a/v,c=-y/v):(s=-(a+o)/v,c=-2*y/v),t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=d,t[6]=0,t[7]=0,t[8]=p,t[9]=g,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=c,t[15]=0}(this.projectionMatrix,c,c+s,o-a,o,t,this.far,this.clipSpaceNearZ===eu.ZERO),wt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,r,i,o){var a;this.projectionMode=Du.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&&a.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h=(f+=g*this.view.offsetX)+g*this.view.width,p=(d-=v*this.view.offsetY)-v*this.view.height}return this.clipSpaceNearZ===eu.NEGATIVE_ONE?Gt(this.projectionMatrix,f,h,d,p,i,o):Ht(this.projectionMatrix,f,h,d,p,i,o),wt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=xu(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(e),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],r=te(0,1,0);if(this.focalPoint=xu(t,e,n),this.trackingMode===Iu.CINEMATIC){var i=ie(Kt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=Jt(i),a=Eu(Math.asin(e/o)),s=90+Eu(Math.atan2(n,t)),c=pt();St(c,c,ku(s)),_t(c,c,ku(a)),r=ue(Kt(),[0,1,0],c)}return wt(this.matrix,Yt(pt(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<Fu&&(this.distance=Fu),this.dollyingStep=this.distance/100;var e=Kt();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}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=mu(t),this.computeMatrix(),this._getAxes(),this.type===Ru.ORBITING||this.type===Ru.EXPLORING?this._getPosition():this.type===Ru.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=mu(t),this.computeMatrix(),this._getAxes(),this.type===Ru.ORBITING||this.type===Ru.EXPLORING?this._getPosition():this.type===Ru.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=mu(t),this.computeMatrix(),this._getAxes(),this.type===Ru.ORBITING||this.type===Ru.EXPLORING?this._getPosition():this.type===Ru.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=xe(be(),[0,0,1],ku(this.roll));bt(this.matrix);var e=xe(be(),[1,0,0],ku((this.rotateWorld&&this.type!==Ru.TRACKING||this.type===Ru.TRACKING?1:-1)*this.elevation)),n=xe(be(),[0,1,0],ku((this.rotateWorld&&this.type!==Ru.TRACKING||this.type===Ru.TRACKING?1:-1)*this.azimuth)),r=we(be(),n,e);r=we(be(),r,t);var i=Ft(pt(),r);this.type===Ru.ORBITING||this.type===Ru.EXPLORING?(Et(this.matrix,this.matrix,this.focalPoint),Mt(this.matrix,this.matrix,i),Et(this.matrix,this.matrix,[0,0,this.distance])):this.type===Ru.TRACKING&&(Et(this.matrix,this.matrix,this.position),Mt(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=xu(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()}},{key:"_getAxes",value:function(){ee(this.right,xu(me(ve(),[1,0,0,0],this.matrix))),ee(this.up,xu(me(ve(),[0,1,0,0],this.matrix))),ee(this.forward,xu(me(ve(),[0,0,1,0],this.matrix))),ae(this.right,this.right),ae(this.up,this.up),ae(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Jt(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===Ru.TRACKING||this.rotateWorld?(this.elevation=Eu(Math.asin(e/r)),this.azimuth=Eu(Math.atan2(-t,-n))):(this.elevation=-Eu(Math.asin(e/r)),this.azimuth=-Eu(Math.atan2(-t,-n)))}},{key:"_getPosition",value:function(){ee(this.position,xu(me(ve(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){fe(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}(ht(),this.matrix)),re(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=ie(Kt(),this.focalPoint,this.position),this.distance=Jt(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===Du.ORTHOGRAPHIC){var t=this.position,e=xe(be(),[0,0,1],-this.roll*Math.PI/180);Bt(this.orthoMatrix,e,te((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),te(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=Mt(pt(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Bu)}}},{key:"rotate",value:function(t,e,n){throw new Error(vu)}},{key:"pan",value:function(t,e){throw new Error(vu)}},{key:"dolly",value:function(t){throw new Error(vu)}},{key:"createLandmark",value:function(t,e){throw new Error(vu)}},{key:"gotoLandmark",value:function(t,e){throw new Error(vu)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(vu)}}])}(),$u=function(t){return t[t.Standard=0]="Standard",t}({}),Wu=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),Gu={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new gu(0,0,0,0)},Hu=function(t){return 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>",t}({});function Yu(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function qu(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Vu(){}var Uu=.7,Xu=1/Uu,Zu="\\s*([+-]?\\d+)\\s*",Ku="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ju=/^#([0-9a-f]{3,8})$/,tf=new RegExp(`^rgb\\(${Zu},${Zu},${Zu}\\)$`),ef=new RegExp(`^rgb\\(${Qu},${Qu},${Qu}\\)$`),nf=new RegExp(`^rgba\\(${Zu},${Zu},${Zu},${Ku}\\)$`),rf=new RegExp(`^rgba\\(${Qu},${Qu},${Qu},${Ku}\\)$`),of=new RegExp(`^hsl\\(${Ku},${Qu},${Qu}\\)$`),af=new RegExp(`^hsla\\(${Ku},${Qu},${Qu},${Ku}\\)$`),sf={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 cf(){return this.rgb().formatHex()}function lf(){return this.rgb().formatRgb()}function uf(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ju.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ff(e):3===n?new df(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?hf(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?hf(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=tf.exec(t))?new df(e[1],e[2],e[3],1):(e=ef.exec(t))?new df(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=nf.exec(t))?hf(e[1],e[2],e[3],e[4]):(e=rf.exec(t))?hf(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=of.exec(t))?bf(e[1],e[2]/100,e[3]/100,1):(e=af.exec(t))?bf(e[1],e[2]/100,e[3]/100,e[4]):sf.hasOwnProperty(t)?ff(sf[t]):"transparent"===t?new df(NaN,NaN,NaN,0):null}function ff(t){return new df(t>>16&255,t>>8&255,255&t,1)}function hf(t,e,n,r){return r<=0&&(t=e=n=NaN),new df(t,e,n,r)}function df(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function pf(){return`#${mf(this.r)}${mf(this.g)}${mf(this.b)}`}function gf(){const t=vf(this.opacity);return`${1===t?"rgb(":"rgba("}${yf(this.r)}, ${yf(this.g)}, ${yf(this.b)}${1===t?")":`, ${t})`}`}function vf(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function yf(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function mf(t){return((t=yf(t))<16?"0":"")+t.toString(16)}function bf(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new wf(t,e,n,r)}function xf(t){if(t instanceof wf)return new wf(t.h,t.s,t.l,t.opacity);if(t instanceof Vu||(t=uf(t)),!t)return new wf;if(t instanceof wf)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 wf(a,s,c,t.opacity)}function wf(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function kf(t){return(t=(t||0)%360)<0?t+360:t}function Mf(t){return Math.max(0,Math.min(1,t||0))}function Ef(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 Of(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=e?e.apply(this,i):i[0],s=n.cache;if(s.has(a))return s.get(a);var c=t.apply(this,i);return n.cache=s.set(a,c)||s,c};return n.cache=new(Of.Cache||Map),Of.cacheList.push(n.cache),n}Yu(Vu,uf,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:cf,formatHex:cf,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return xf(this).formatHsl()},formatRgb:lf,toString:lf}),Yu(df,(function(t,e,n,r){return 1===arguments.length?function(t){return t instanceof Vu||(t=uf(t)),t?new df((t=t.rgb()).r,t.g,t.b,t.opacity):new df}(t):new df(t,e,n,null==r?1:r)}),qu(Vu,{brighter(t){return t=null==t?Xu:Math.pow(Xu,t),new df(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Uu:Math.pow(Uu,t),new df(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new df(yf(this.r),yf(this.g),yf(this.b),vf(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:pf,formatHex:pf,formatHex8:function(){return`#${mf(this.r)}${mf(this.g)}${mf(this.b)}${mf(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:gf,toString:gf})),Yu(wf,(function(t,e,n,r){return 1===arguments.length?xf(t):new wf(t,e,n,null==r?1:r)}),qu(Vu,{brighter(t){return t=null==t?Xu:Math.pow(Xu,t),new wf(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Uu:Math.pow(Uu,t),new wf(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 df(Ef(t>=240?t-240:t+120,i,r),Ef(t,i,r),Ef(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new wf(kf(this.h),Mf(this.s),Mf(this.l),vf(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=vf(this.opacity);return`${1===t?"hsl(":"hsla("}${kf(this.h)}, ${100*Mf(this.s)}%, ${100*Mf(this.l)}%${1===t?")":`, ${t})`}`}})),Of.Cache=Map,Of.cacheList=[],Of.clearCache=function(){Of.cacheList.forEach((function(t){return t.clear()}))};var _f=function(t){return 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",t}({}),Sf=function(t){return 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",t}({}),Af=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Tf=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Pf=[{name:"em",unit_type:_f.kEms},{name:"px",unit_type:_f.kPixels},{name:"deg",unit_type:_f.kDegrees},{name:"rad",unit_type:_f.kRadians},{name:"grad",unit_type:_f.kGradians},{name:"ms",unit_type:_f.kMilliseconds},{name:"s",unit_type:_f.kSeconds},{name:"rem",unit_type:_f.kRems},{name:"turn",unit_type:_f.kTurns}],Nf=function(t){return 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",t}({}),Cf=function(t){return t?"number"===t?_f.kNumber:"percent"===t||"%"===t?_f.kPercentage:function(t){return Pf.find((function(e){return e.name===t})).unit_type}(t):_f.kUnknown},Lf=function(t){var e=1;switch(t){case _f.kPixels:case _f.kDegrees:case _f.kSeconds:break;case _f.kMilliseconds:e=.001;break;case _f.kRadians:e=180/Math.PI;break;case _f.kGradians:e=.9;break;case _f.kTurns:e=360}return e},jf=function(t){switch(t){case _f.kNumber:case _f.kInteger:return"";case _f.kPercentage:return"%";case _f.kEms:return"em";case _f.kRems:return"rem";case _f.kPixels:return"px";case _f.kDegrees:return"deg";case _f.kRadians:return"rad";case _f.kGradians:return"grad";case _f.kMilliseconds:return"ms";case _f.kSeconds:return"s";case _f.kTurns:return"turn"}return""},Rf=function(){return pl((function t(){hl(this,t)}),[{key:"toString",value:function(){return this.buildCSSText(Af.kNo,Tf.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=Nf.kUnitType&&this.getType()<=Nf.kClampType}}],[{key:"isAngle",value:function(t){return t===_f.kDegrees||t===_f.kRadians||t===_f.kGradians||t===_f.kTurns}},{key:"isLength",value:function(t){return t>=_f.kEms&&t<_f.kDegrees}},{key:"isRelativeUnit",value:function(t){return t===_f.kPercentage||t===_f.kEms||t===_f.kRems}},{key:"isTime",value:function(t){return t===_f.kSeconds||t===_f.kMilliseconds}}])}(),If=function(t){function e(t){var n;return hl(this,e),(n=wl(this,e)).colorSpace=t,n}return Ml(e,t),pl(e,[{key:"getType",value:function(){return Nf.kColorType}},{key:"to",value:function(t){return this}}])}(Rf),Df=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({}),Bf=function(t){function e(t,n){var r;return hl(this,e),(r=wl(this,e)).type=t,r.value=n,r}return Ml(e,t),pl(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return Nf.kColorType}}])}(Rf),Ff=function(t){function e(t){var n;return hl(this,e),(n=wl(this,e)).value=t,n}return Ml(e,t),pl(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return Nf.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}])}(Rf),zf=function(t){return function(t){switch(t){case Sf.kUNumber:return _f.kNumber;case Sf.kULength:return _f.kPixels;case Sf.kUPercent:return _f.kPercentage;case Sf.kUTime:return _f.kSeconds;case Sf.kUAngle:return _f.kDegrees;default:return _f.kUnknown}}(function(t){switch(t){case _f.kNumber:case _f.kInteger:return Sf.kUNumber;case _f.kPercentage:return Sf.kUPercent;case _f.kPixels:return Sf.kULength;case _f.kMilliseconds:case _f.kSeconds:return Sf.kUTime;case _f.kDegrees:case _f.kRadians:case _f.kGradians:case _f.kTurns:return Sf.kUAngle;default:return Sf.kUOther}}(t))},$f=function(t){function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_f.kNumber;return hl(this,e),n=wl(this,e),r="string"==typeof i?Cf(i):i,n.unit=r,n.value=t,n}return Ml(e,t),pl(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){var e=t;return this.value===e.value&&this.unit===e.unit}},{key:"getType",value:function(){return Nf.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=zf(this.unit);if(n!==zf(t)||n===_f.kUnknown)return null;var r=Lf(this.unit)/Lf(t);return new e(this.value*r,t)}},{key:"buildCSSText",value:function(t,e,n){var r;switch(this.unit){case _f.kUnknown:break;case _f.kInteger:r=Number(this.value).toFixed(0);break;case _f.kNumber:case _f.kPercentage:case _f.kEms:case _f.kRems:case _f.kPixels:case _f.kDegrees:case _f.kRadians:case _f.kGradians:case _f.kMilliseconds:case _f.kSeconds:case _f.kTurns:var i=this.value,o=jf(this.unit);if(i<-999999||i>999999){var a=jf(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r}}])}(Rf),Wf=new $f(0,"px");new $f(1,"px");var Gf=new $f(0,"deg"),Hf=function(t){function e(t,n,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return hl(this,e),(i=wl(this,e,["rgb"])).r=t,i.g=n,i.b=r,i.alpha=o,i.isNone=a,i}return Ml(e,t),pl(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(If),Yf=new Ff("unset"),qf={"":Yf,unset:Yf,initial:new Ff("initial"),inherit:new Ff("inherit")},Vf=new Hf(0,0,0,0,!0),Uf=new Hf(0,0,0,0),Xf=Of((function(t,e,n,r){return new Hf(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Zf=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_f.kNumber;return new $f(t,e)};function Kf(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new $f(50,"%");var Qf=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,a=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,f=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,h=/^\(/,d=/^\)/,p=/^,/,g=/^\#([0-9a-fA-F]+)/,v=/^([a-zA-Z]+)/,y=/^rgb/i,m=/^rgba/i,b=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,x="";function w(t){throw new Error("".concat(x,": ").concat(t))}function k(){var t=C(M);return x.length>0&&w("Invalid input not EOF"),t}function M(){return E("linear-gradient",t,_)||E("repeating-linear-gradient",e,_)||E("radial-gradient",n,S)||E("repeating-radial-gradient",r,S)||E("conic-gradient",i,S)}function E(t,e,n){return O(e,(function(e){var r=n();return r&&(B(p)||w("Missing comma before color stops")),{type:t,orientation:r,colorStops:C(L)}}))}function O(t,e){var n=B(t);if(n){B(h)||w("Missing (");var r=e(n);return B(d)||w("Missing )"),r}}function _(){return D("directional",o,1)||D("angular",f,1)}function S(){var t,e,n=A();return n&&((t=[]).push(n),e=x,B(p)&&((n=A())?t.push(n):x=e)),t}function A(){var t=function(){var t=D("shape",/^(circle)/i,0);t&&(t.style=I()||T());return t}()||function(){var t=D("shape",/^(ellipse)/i,0);t&&(t.style=R()||T());return t}();if(t)t.at=P();else{var e=T();if(e){t=e;var n=P();n&&(t.at=n)}else{var r=N();r&&(t={type:"default-radial",at:r})}}return t}function T(){return D("extent-keyword",a,1)}function P(){if(D("position",/^at/,0)){var t=N();return t||w("Missing positioning value"),t}}function N(){var t={x:R(),y:R()};if(t.x||t.y)return{type:"position",value:t}}function C(t){var e=t(),n=[];if(e)for(n.push(e);B(p);)(e=t())?n.push(e):w("One extra comma");return n}function L(){var t=D("hex",g,1)||O(m,(function(){return{type:"rgba",value:C(j)}}))||O(y,(function(){return{type:"rgb",value:C(j)}}))||D("literal",v,0);return t||w("Expected color definition"),t.length=R(),t}function j(){return B(b)[1]}function R(){return D("%",l,1)||D("position-keyword",s,1)||I()}function I(){return D("px",c,1)||D("em",u,1)}function D(t,e,n){var r=B(e);if(r)return{type:t,value:r[n]}}function B(t){var e=/^[\n\r\t\s]+/.exec(x);e&&F(e[0].length);var n=t.exec(x);return n&&F(n[0].length),n}function F(t){x=x.substring(t)}return function(t){return x=t,k()}}();var Jf=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,th=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,eh=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,nh=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var rh={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},ih=Of((function(t){var e;return e="angular"===t.type?Number(t.value):rh[t.value]||0,Zf(e,"deg")})),oh=Of((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:Zf(e,r),cy:Zf(n,i)}})),ah=Of((function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Qf(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,o=Number(t[0].length.value),a=1;a<r;a++){var s,c=null===(s=t[a].length)||void 0===s?void 0:s.value;if(!b(c)&&!b(o)){for(var l=1;l<a-i;l++)t[i+l].length={type:"%",value:"".concat(o+(Number(c)-o)*l/(a-i))};i=a,o=Number(c)}}}(r);var i=r.map((function(t){return{offset:Zf(Number(t.length.value),"%"),color:Kf(t)}}));if("linear-gradient"===e)return new Bf(Df.LinearGradient,{angle:n?ih(n):Gf,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o,a=oh(n[0].at),s=a.cx,c=a.cy;if(n[0].style){var l=n[0].style,u=l.type,f=l.value;o="extent-keyword"===u?function(t){return qf[t]||(qf[t]=new Ff(t)),qf[t]}(f):Zf(f,u)}return new Bf(Df.RadialGradient,{cx:s,cy:c,size:o,steps:i})}}));var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=Jf.exec(t);if(n){var r,i=(null===(r=n[2].match(nh))||void 0===r?void 0:r.map((function(t){return t.split(":")})))||[];return[new Bf(Df.LinearGradient,{angle:Zf(parseFloat(n[1]),"deg"),steps:i.map((function(t){var e=El(t,2),n=e[0],r=e[1];return{offset:Zf(100*Number(n),"%"),color:r}}))})]}}else if("r"===e){var o=function(t){var e=th.exec(t);if(e){var n,r=(null===(n=e[4].match(nh))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:Zf(50,"%"),cy:Zf(50,"%"),steps:r.map((function(t){var e=El(t,2),n=e[0],r=e[1];return{offset:Zf(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!L(o))return[new Bf(Df.RadialGradient,o)];t=o}}else if("p"===e)return function(t){var e=eh.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 sh(t){return t&&!!t.image}function ch(t){return t&&!b(t.r)&&!b(t.g)&&!b(t.b)}var lh=Of((function(t){if(sh(t))return fl({repetition:"repeat"},t);if(b(t)&&(t=""),"transparent"===t)return Uf;if("currentColor"===t)t="black";else if("none"===t)return Vf;var e=ah(t);if(e)return e;var n=uf(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Xf.apply(void 0,r)}));function uh(t,e){if(ch(t)&&ch(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(R(e[n],0,255));return e[3]=R(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function fh(t,e){if(b(e))return Zf(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Zf(Number(e),"px");if("deg".search(t)>=0)return Zf(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U".concat(t)}));var r="U(".concat(t.source,")");return n.map((function(t){return Zf(Number(e.replace(new RegExp("U".concat(t),"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var hh=function(t){return fh(new RegExp("px","g"),t)},dh=Of(hh);Of((function(t){return fh(new RegExp("%","g"),t)}));var ph=function(t){return I(t)||isFinite(Number(t))?Zf(Number(t)||0,"px"):fh(new RegExp("px|%|em|rem","g"),t)},gh=Of(ph),vh=function(t){return fh(new RegExp("deg|rad|grad|turn","g"),t)},yh=Of(vh);function mh(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o="",a=t.value||0,s=e.value||0,c=zf(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(a=l.value,s=u.value,o=jf(t.unit)):($f.isLength(t.unit)||$f.isLength(e.unit))&&(a=wh(t,i,n),s=wh(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function bh(t){var e=0;return t.unit===_f.kDegrees?e=t.value:t.unit===_f.kRadians?e=Eu(Number(t.value)):t.unit===_f.kTurns?e=360*Number(t.value):t.value&&(e=t.value),e}function xh(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):L(t)?n=t.split(" ").map((function(t){return Number(t)})):I(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:4===e?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]]:"even"===e&&n.length%2==1?[].concat(yl(n),yl(n)):n}function wh(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===_f.kPixels)return Number(t.value);if(t.unit===_f.kPercentage&&n){var i=n.nodeName===tu.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var kh=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Mh(t){return t.toString()}var Eh=function(t){return"number"==typeof t?Zf(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Zf(Number(t)):Zf(0)},Oh=Of(Eh);function _h(t,e){return[t,e,Mh]}function Sh(t,e){return function(n,r){return[n,r,function(n){return Mh(R(n,t,e))}]}}function Ah(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Th(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=xn(t.parsedStyle.d.absolutePath,void 0,Ce(Ce({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Ph(t,e){return t[0]===e[0]&&t[1]===e[1]}function Nh(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)||D(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 Ch(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Of((function(t){return L(t)?t.split(" ").map(Oh):t.map(Oh)}));var Lh=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)},jh=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var c=ku(r=z(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),n*=Math.sqrt(h));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),v=p*(-n*f.x/e),y={x:Math.cos(c)*g-Math.sin(c)*v+(t.x+a.x)/2,y:Math.sin(c)*g+Math.cos(c)*v+(t.y+a.y)/2},m={x:(f.x-g)/e,y:(f.y-v)/n},b=Lh({x:1,y:0},m),x=Lh(m,{x:(-f.x-g)/e,y:(-f.y-v)/n});!o&&x>0?x-=2*Math.PI:o&&x<0&&(x+=2*Math.PI);var w=b+(x%=2*Math.PI)*s,k=e*Math.cos(w),M=n*Math.sin(w);return{x:Math.cos(c)*k-Math.sin(c)*M+y.x,y:Math.sin(c)*k+Math.cos(c)*M+y.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:w,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function Rh(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],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=jh({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),h=jh({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 Ih(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Dh(t,e){return Ih(t)*Ih(e)?(t[0]*e[0]+t[1]*e[1])/(Ih(t)*Ih(e)):1}function Bh(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Dh(t,e))}function Fh(t,e){var n=e[1],r=e[2],i=z(ku(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 v=r?g*n*h/r:0,y=n?g*-r*f/n:0,m=(s+l)/2+Math.cos(i)*v-Math.sin(i)*y,b=(c+u)/2+Math.sin(i)*v+Math.cos(i)*y,x=[(f-v)/n,(h-y)/r],w=[(-1*f-v)/n,(-1*h-y)/r],k=Bh([1,0],x),M=Bh(x,w);return Dh(x,w)<=-1&&(M=Math.PI),Dh(x,w)>=1&&(M=0),0===a&&M>0&&(M-=2*Math.PI),1===a&&M<0&&(M+=2*Math.PI),{cx:m,cy:b,rx:Ph(t,[l,u])?0:n,ry:Ph(t,[l,u])?0:r,startAngle:k,endAngle:k+M,xRotation:i,arcFlag:o,sweepFlag:a}}function zh(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 $h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),n=[];switch(t.nodeName){case tu.LINE:var r=t.parsedStyle,i=r.x1,o=void 0===i?0:i,a=r.y1,s=void 0===a?0:a,c=r.x2,l=void 0===c?0:c,u=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(o,s,l,void 0===u?0:u);break;case tu.CIRCLE:var f=t.parsedStyle,h=f.r,d=void 0===h?0:h,p=f.cx,g=void 0===p?0:p,v=f.cy;n=zh(d,d,g,void 0===v?0:v);break;case tu.ELLIPSE:var y=t.parsedStyle,m=y.rx,b=void 0===m?0:m,x=y.ry,w=void 0===x?0:x,k=y.cx,M=void 0===k?0:k,E=y.cy;n=zh(b,w,M,void 0===E?0:E);break;case tu.POLYLINE:case tu.POLYGON:n=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===tu.POLYGON);break;case tu.RECT:var O=t.parsedStyle,_=O.width,S=void 0===_?0:_,A=O.height,T=void 0===A?0:A,P=O.x,N=void 0===P?0:P,C=O.y,L=void 0===C?0:C,j=O.radius,I=j&&j.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var o=El(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"]]}(S,T,N,L,I&&j.map((function(t){return R(t,0,Math.min(Math.abs(S)/2,Math.abs(T)/2))})));break;case tu.PATH:n=yl(t.parsedStyle.d.absolutePath)}if(n.length)return function(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=te(e[1],e[2],0);n&&ue(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=te(e[1],e[2],0),a=te(e[3],e[4],0),s=te(e[5],e[6],0);n&&(ue(o,o,n),ue(a,a,n),ue(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=te(e[6],e[7],0);n&&ue(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 if("Q"===e[0]){var l=te(e[1],e[2],0),u=te(e[3],e[4],0);n&&(ue(l,l,n),ue(u,u,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r}),"")}(n,0,e)}var Wh=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=rn(t)}catch(n){e=rn(""),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&&Ph(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=Fh(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]&&Ph(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){var v=e[s-1],y=Ch(v.currentPoint,p);"Q"===v.command?(u.command="Q",u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===l){var m=[c[1],c[2]],b=[c[3],c[4]];u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[m[0]-b[0],m[1]-b[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[b[0]-m[0],b[1]-m[1]])}else if("S"===l){var x=e[s-1],w=Ch(x.currentPoint,p),k=[c[1],c[2]];"C"===x.command?(u.command="C",u.startTangent=[p[0]-w[0],p[1]-w[1]],u.endTangent=[n[0]-k[0],n[1]-k[1]]):(u.command="SQ",u.startTangent=[p[0]-k[0],p[1]-k[1]],u.endTangent=[n[0]-k[0],n[1]-k[1]])}else if("A"===l){var M=Rh(u,0),E=M.x,O=M.y,_=Rh(u,1,!1),S=_.x,A=_.y;u.startTangent=[E,O],u.endTangent=[S,A]}e.push(u)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=t[o],s=a.currentPoint,c=a.params,l=a.prePoint,u=void 0;switch(a.command){case"Q":u=Yl(l[0],l[1],c[1],c[2],c[3],c[4]);break;case"C":u=zl(l[0],l[1],c[1],c[2],c[3],c[4],c[5],c[6]);break;case"A":var f=a.arcParams;u=Ll(f.cx,f.cy,f.rx,f.ry,f.xRotation,f.startAngle,f.endAngle);break;default:n.push(s[0]),r.push(s[1])}u&&(a.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height)),e&&("L"===a.command||"M"===a.command)&&a.prePoint&&a.nextPoint&&i.push(a)}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 h=N(n),d=N(r),p=P(n),g=P(r);if(0===i.length)return{x:h,y:d,width:p-h,height:g-d};for(var v=0;v<i.length;v++){var y=i[v],m=y.currentPoint;m[0]===h?h-=Nh(y,e).xExtra:m[0]===p&&(p+=Nh(y,e).xExtra),m[1]===d?d-=Nh(y,e).yExtra:m[1]===g&&(g+=Nh(y,e).yExtra)}return{x:h,y:d,width:p-h,height:g-d}}(a,0),c=s.x,l=s.y,u=s.width,f=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(c)?c:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(f)?f:0}}},Gh=Of(Wh);function Hh(t){return L(t)?Gh(t):Wh(t)}function Yh(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=un(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=un(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=En(r,i));var a,s,c=kn(o[0])!==kn(o[1])?(a=o[0],s=a.slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):function(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}(o[0]);return[c,wn(o[1],c),function(t){return t}]}function qh(t,e){return[t.points,e.points,function(t){return t}]}var Vh=null,Uh=/\s*(\w+)\(([^)]*)\)/g;function Xh(t){return function(e){var n=0;return t.map((function(t){return t===Vh?e[n++]:t}))}}function Zh(t){return t}var Kh={matrix:["NNNNNN",[Vh,Vh,0,0,Vh,Vh,0,0,0,0,1,0,Vh,Vh,0,1],Zh],matrix3d:["NNNNNNNNNNNNNNNN",Zh],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Xh([Vh,Vh,new $f(1)]),Zh],scaleX:["N",Xh([Vh,new $f(1),new $f(1)]),Xh([Vh,new $f(1)])],scaleY:["N",Xh([new $f(1),Vh,new $f(1)]),Xh([new $f(1),Vh])],scaleZ:["N",Xh([new $f(1),new $f(1),Vh])],scale3d:["NNN",Zh],skew:["Aa",null,Zh],skewX:["A",null,Xh([Vh,Gf])],skewY:["A",null,Xh([Gf,Vh])],translate:["Tt",Xh([Vh,Vh,Wf]),Zh],translateX:["T",Xh([Vh,Wf,Wf]),Xh([Vh,Wf])],translateY:["T",Xh([Wf,Vh,Wf]),Xh([Wf,Vh])],translateZ:["L",Xh([Wf,Wf,Vh])],translate3d:["TTL",Zh]};function Qh(t){for(var e=[],n=t.length,r=0;r<n;r++){var i=t[r],o=i[0],a=i.slice(1);if("translate"===o||"skew"===o?1===a.length&&a.push(0):"scale"===o&&1===a.length&&a.push(a[0]),!Kh[o])return[];var s=a.map((function(t){return Zf(t)}));e.push({t:o,d:s})}return e}function Jh(t){if(Array.isArray(t))return Qh(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Uh.lastIndex=0;e=Uh.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],o=Kh[i];if(!o)return[];var a=e[2].split(","),s=o[0];if(s.length<a.length)return[];for(var c=[],l=0;l<s.length;l++){var u=a[l],f=s[l],h=void 0;if(h=u?{A:function(t){return"0"===t.trim()?Gf:yh(t)},N:Oh,T:gh,L:dh}[f.toUpperCase()](u):{a:Gf,n:c[0],t:Wf}[f],void 0===h)return[];c.push(h)}if(n.push({t:i,d:c}),Uh.lastIndex===t.length)return n}return[]}function td(t){if(Array.isArray(t))return Qh(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Uh.lastIndex=0;e=Uh.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],o=Kh[i];if(!o)return[];var a=e[2].split(","),s=o[0];if(s.length<a.length)return[];for(var c=[],l=0;l<s.length;l++){var u=a[l],f=s[l],h=void 0;if(h=u?{A:function(t){return"0"===t.trim()?Gf:vh(t)},N:Eh,T:ph,L:hh}[f.toUpperCase()](u):{a:Gf,n:c[0],t:Wf}[f],void 0===h)return[];c.push(h)}if(n.push({t:i,d:c}),Uh.lastIndex===t.length)return n}return[]}function ed(t){var e,n,r,i;switch(t.t){case"rotateX":return i=ku(bh(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=ku(bh(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=ku(bh(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=ku(bh(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=ku(bh(t.d[0])),f=ku(bh(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=ku(bh(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=ku(bh(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=wh(t.d[0],0,null)||0,n=wh(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=wh(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=wh(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=wh(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=wh(t.d[0],0,null)||0,n=wh(t.d[1],0,null)||0,r=wh(t.d[2],0,null)||0,1];case"perspective":var h=wh(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 nd(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 rd(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}(Tu,t))return!1;if(vt(Pu,Tu),Pu[3]=0,Pu[7]=0,Pu[11]=0,Pu[15]=1,Math.abs(kt(Pu))<1e-8)return!1;var a,s,c=Tu[3],l=Tu[7],u=Tu[11],f=Tu[12],h=Tu[13],d=Tu[14],p=Tu[15];if(0!==c||0!==l||0!==u){if(Nu[0]=c,Nu[1]=l,Nu[2]=u,Nu[3]=p,!wt(Pu,Pu))return!1;xt(Pu,Pu),me(i,Nu,Pu)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=h,e[2]=d,s=Tu,(a=Cu)[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]=Jt(Cu[0]),ae(Cu[0],Cu[0]),r[0]=se(Cu[0],Cu[1]),ju(Cu[1],Cu[1],Cu[0],1,-r[0]),n[1]=Jt(Cu[1]),ae(Cu[1],Cu[1]),r[0]/=n[1],r[1]=se(Cu[0],Cu[2]),ju(Cu[2],Cu[2],Cu[0],1,-r[1]),r[2]=se(Cu[1],Cu[2]),ju(Cu[2],Cu[2],Cu[1],1,-r[2]),n[2]=Jt(Cu[2]),ae(Cu[2],Cu[2]),r[1]/=n[2],r[2]/=n[2],ce(Lu,Cu[1],Cu[2]),se(Cu[0],Lu)<0)for(var g=0;g<3;g++)n[g]*=-1,Cu[g][0]*=-1,Cu[g][1]*=-1,Cu[g][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+Cu[0][0]-Cu[1][1]-Cu[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-Cu[0][0]+Cu[1][1]-Cu[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-Cu[0][0]-Cu[1][1]+Cu[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+Cu[0][0]+Cu[1][1]+Cu[2][2],0)),Cu[2][1]>Cu[1][2]&&(o[0]=-o[0]),Cu[0][2]>Cu[2][0]&&(o[1]=-o[1]),Cu[1][0]>Cu[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(ed).reduce(nd)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var id=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(var c=0;c<3;c++)for(var l=0;l<3;l++)a[3][c]+=e[l]*a[l][c];var u=i[0],f=i[1],h=i[2],d=i[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(f*f+h*h),p[0][1]=2*(u*f-h*d),p[0][2]=2*(u*h+f*d),p[1][0]=2*(u*f+h*d),p[1][1]=1-2*(u*u+h*h),p[1][2]=2*(f*h-u*d),p[2][0]=2*(u*h-f*d),p[2][1]=2*(f*h+u*d),p[2][2]=1-2*(u*u+f*f),a=t(a,p);var g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(g[2][1]=r[2],a=t(a,g)),r[1]&&(g[2][1]=0,g[2][0]=r[0],a=t(a,g)),r[0]&&(g[2][0]=0,g[1][0]=r[0],a=t(a,g));for(var v=0;v<3;v++)for(var y=0;y<3;y++)a[v][y]*=n[v];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 od(t){return t.toFixed(6).replace(".000000","")}function ad(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=rd(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=rd(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}(t,e);r=R(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return id(t[0],t[1],t[2],e,t[4]).map(od).join(",")}])}function sd(t){return t.replace(/[XY]/,"")}function cd(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function ld(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[o],r=n.t,i=n.d,a="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map((function(t){return"number"==typeof t?Zf(a):Zf(a,t.unit)}))})},o=0;o<t.length;o++)i()}var a,s,c=[],l=[],u=[];if(t.length!==e.length){var f=ad(t,e);c=[f[0]],l=[f[1]],u=[["matrix",[f[2]]]]}else for(var h=0;h<t.length;h++){var d=t[h].t,p=e[h].t,g=t[h].d,v=e[h].d,y=Kh[d],m=Kh[p],b=void 0;if(s=p,"perspective"===(a=d)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var x=ad([t[h]],[e[h]]);c.push(x[0]),l.push(x[1]),u.push(["matrix",[x[2]]])}else{if(d===p)b=d;else if(y[2]&&m[2]&&sd(d)===sd(p))b=sd(d),g=y[2](g),v=m[2](v);else{if(!y[1]||!m[1]||cd(d)!==cd(p)){var w=ad(t,e);c=[w[0]],l=[w[1]],u=[["matrix",[w[2]]]];break}b=cd(d),g=y[1](g),v=m[1](v)}for(var k=[],M=[],E=[],O=0;O<g.length;O++){var _=mh(g[O],v[O],n,!1,O);k[O]=_[0],M[O]=_[1],E.push(_[2])}c.push(k),l.push(M),u.push([b,E])}}if(r){var S=c;c=l,l=S}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"),"".concat(u[e][0],"(").concat(n,")")})).join(" ")}]}var ud=Of((function(t){if(L(t)){if("text-anchor"===t)return[Zf(0,"px"),Zf(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:[gh(fd(e[0])),gh(fd(e[1]))]}return[Zf(t[0]||0,"px"),Zf(t[1]||0,"px")]}));function fd(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var hd=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Hu.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Hu.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Hu.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Hu.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Hu.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Hu.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Hu.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Hu.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Hu.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:Hu.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Hu.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Hu.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Hu.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Hu.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:Hu.FILTER},{n:"clipPath",syntax:Hu.DEFINED_PATH},{n:"textPath",syntax:Hu.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Hu.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:Hu.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:Hu.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:Hu.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:Hu.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:Hu.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:Hu.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:Hu.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Hu.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Hu.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Hu.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Hu.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Hu.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Hu.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:Hu.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Hu.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Hu.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Hu.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Hu.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:Hu.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Hu.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Hu.NUMBER,d:function(t){return t===tu.PATH||t===tu.POLYGON||t===tu.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:Hu.MARKER},{n:"markerEnd",syntax:Hu.MARKER},{n:"markerMid",syntax:Hu.MARKER},{n:"markerStartOffset",syntax:Hu.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Hu.LENGTH,l:!0,int:!0,d:"0"}],dd=new Set(hd.filter((function(t){return!!t.l})).map((function(t){return t.n}))),pd={},gd=function(){return pl((function t(e){var n=this;hl(this,t),this.runtime=e,hd.forEach((function(t){n.registerMetadata(t)}))}),[{key:"registerMetadata",value:function(t){[t.n].concat(yl(t.a||[])).forEach((function(e){pd[e]=t}))}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var r=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;!function(t,e){var n=vd(t);for(var r in e)n.has(r)&&(t.parsedStyle[r]=e[r])}(t,e);var o=!!n.forceUpdateGeometry;if(!o)for(var a in e)if(dd.has(a)){o=!0;break}var s,c,l=vd(t);l.has("fill")&&e.fill&&(t.parsedStyle.fill=lh(e.fill)),l.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=lh(e.stroke)),l.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=lh(e.shadowColor)),l.has("filter")&&e.filter&&(t.parsedStyle.filter=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("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,kh.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return fh(/deg|rad|grad|turn|px|%/g,t)||lh(t)}))}),n.lastIndex===t.length)return r}return[]}(e.filter)),l.has("radius")&&!b(e.radius)&&(t.parsedStyle.radius=xh(e.radius,4)),l.has("lineDash")&&!b(e.lineDash)&&(t.parsedStyle.lineDash=xh(e.lineDash,"even")),l.has("points")&&e.points&&(t.parsedStyle.points=(s=e.points,c=L(s)?s.split(" ").map((function(t){var e=El(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]})):s,{points:c,totalLength:0,segments:[]})),l.has("d")&&""===e.d&&(t.parsedStyle.d=fl({},Gu)),l.has("d")&&e.d&&(t.parsedStyle.d=Hh(e.d)),l.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[Hu.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),l.has("clipPath")&&!Y(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[Hu.DEFINED_PATH].calculator("clipPath",r,e.clipPath,t,this.runtime),l.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[Hu.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),l.has("transform")&&e.transform&&(t.parsedStyle.transform=Jh(e.transform)),l.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=ud(e.transformOrigin)),l.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[Hu.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),l.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[Hu.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),l.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[Hu.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),l.has("zIndex")&&!b(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[Hu.Z_INDEX].postProcessor(t),l.has("offsetDistance")&&!b(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[Hu.OFFSET_DISTANCE].postProcessor(t),l.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[Hu.TRANSFORM].postProcessor(t),l.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[Hu.TRANSFORM_ORIGIN].postProcessor(t),o&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new uu),r.renderBounds||(r.renderBounds=new uu);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,v=o.hdepth,y=void 0===v?0:v,m=[Math.abs(d),Math.abs(g),y],b=i.stroke,x=i.lineWidth,w=void 0===x?1:x,k=i.increasedLineWidthForHitTesting,M=void 0===k?0:k,E=i.shadowType,O=void 0===E?"outer":E,_=i.shadowColor,S=i.filter,A=void 0===S?[]:S,T=i.transformOrigin,P=[s,l,f];r.contentBounds.update(P,m);var N=e===tu.POLYLINE||e===tu.POLYGON||e===tu.PATH?Math.SQRT2:.5;if(b&&!b.isNone){var C=((w||0)+(M||0))*N;m[0]+=C,m[1]+=C}if(r.renderBounds.update(P,m),_&&O&&"inner"!==O){var L=r.renderBounds,j=L.min,R=L.max,I=i.shadowBlur||0,D=i.shadowOffsetX||0,B=i.shadowOffsetY||0,F=j[0]-I+D,z=R[0]+I+D,$=j[1]-I+B,W=R[1]+I+B;j[0]=Math.min(j[0],F),R[0]=Math.max(R[0],z),j[1]=Math.min(j[1],$),R[1]=Math.max(R[1],W),r.renderBounds.setMinMax(j,R)}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,re(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 G=g<0,H=(d<0?-1:1)*(T?wh(T[0],0,t,!0):0),Y=(G?-1:1)*(T?wh(T[1],1,t,!0):0);(H||Y)&&t.setOrigin(H,Y)}}},{key:"updateSizeAttenuation",value: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===tu.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===tu.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function vd(t){return t.constructor.PARSED_STYLE_LIST}var yd=function(){return pl((function t(){hl(this,t),this.mixer=_h}),[{key:"calculator",value:function(t,e,n,r){return bh(n)}}])}(),md=function(){return pl((function t(){hl(this,t)}),[{key:"calculator",value:function(t,e,n,r,i){return n instanceof Ff&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n}}])}(),bd=function(){return pl((function t(){hl(this,t),this.parser=lh,this.mixer=uh}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Ff?"none"===n.value?Vf:Uf:n}}])}(),xd=function(){return pl((function t(){hl(this,t)}),[{key:"calculator",value:function(t,e,n){return n instanceof Ff?[]:n}}])}();function wd(t){var e=t.parsedStyle.fontSize;return b(e)?null:e}var kd=function(){return pl((function t(){hl(this,t),this.mixer=_h}),[{key:"calculator",value:function(t,e,n,r,i){if(I(n))return n;if(!$f.isRelativeUnit(n.unit))return n.value;if(n.unit===_f.kPercentage)return 0;if(n.unit===_f.kEms){if(r.parentNode){var o=wd(r.parentNode);if(o)return o*=n.value}return 0}if(n.unit===_f.kRems){var a;if(null!=r&&null!==(a=r.ownerDocument)&&void 0!==a&&a.documentElement){var s=wd(r.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),Md=function(){return pl((function t(){hl(this,t),this.mixer=Ah}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),Ed=function(){return pl((function t(){hl(this,t),this.mixer=Ah}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),Od=function(){return pl((function t(){hl(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i;n instanceof Ff&&(n=null);var o=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return o&&(o.style.isMarker=!0),o}}])}(),_d=function(){return pl((function t(){hl(this,t),this.mixer=_h}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Sd=function(){return pl((function t(){hl(this,t),this.mixer=Sh(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===tu.LINE||i===tu.PATH||i===tu.POLYLINE){var o=n.getPoint(r);o&&t.setLocalPosition(o.x,o.y)}}}}])}(),Ad=function(){return pl((function t(){hl(this,t),this.mixer=Sh(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Td=function(){return pl((function t(){hl(this,t),this.parser=Hh,this.mixer=Yh}),[{key:"calculator",value:function(t,e,n){return n instanceof Ff&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new gu(0,0,0,0)}:n}}])}(),Pd=pl((function t(){hl(this,t),this.mixer=qh})),Nd=function(t){function e(){var t;hl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=wl(this,e,[].concat(r))).mixer=Sh(0,1/0),t}return Ml(e,t),pl(e)}(kd),Cd=function(){return pl((function t(){hl(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Ff?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),Ld=function(){return pl((function t(){hl(this,t)}),[{key:"calculator",value: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}}])}(),jd=new WeakMap;var Rd="undefined"!=typeof window&&void 0!==window.document;function Id(t){return!!t.getAttribute}function Dd(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 Bd(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function Fd(t,e){if(Rd)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var zd={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},$d="object"==typeof performance&&performance.now?performance:Date;function Wd(t){return t.nodeName===tu.FRAGMENT||t.getRootNode().nodeName===tu.FRAGMENT}function Gd(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,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 Hd=1,Yd="object"==typeof self&&self.self===self?self:"object"==typeof al&&al.global===al?al:{},qd=Date.now(),Vd={},Ud=Date.now(),Xd=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Ud,r=n>16?0:16-n,i=Hd++;return Vd[i]=t,Object.keys(Vd).length>1||setTimeout((function(){Ud=e;var t=Vd;Vd={},Object.keys(t).forEach((function(e){return t[e](Yd.performance&&"function"==typeof Yd.performance.now?Yd.performance.now():Date.now()-qd)}))}),r),i},Zd=function(t){delete Vd[t]},Kd=function(t){return"string"!=typeof t?Xd:""===t?Yd.requestAnimationFrame:Yd["".concat(t,"RequestAnimationFrame")]},Qd=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!!Kd(t)})),Jd=Kd(Qd),tp=function(t){return"string"!=typeof t?Zd:""===t?Yd.cancelAnimationFrame:Yd["".concat(t,"CancelAnimationFrame")]||Yd["".concat(t,"CancelRequestAnimationFrame")]}(Qd);Yd.requestAnimationFrame=Jd,Yd.cancelAnimationFrame=tp;var ep=function(){return pl((function t(){hl(this,t),this.callbacks=[]}),[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map((function(t){return t.apply(void 0,e)})))}}])}(),np=function(){return pl((function t(){hl(this,t),this.callbacks=[]}),[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=Xl(Vl().mark((function t(){var e,n,r,i,o=arguments;return Vl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=14;break}return t.next=3,(e=this.callbacks)[0].apply(e,o);case 3:n=t.sent,r=0;case 5:if(!(r<this.callbacks.length-1)){t.next=13;break}return i=this.callbacks[r],t.next=9,i(n);case 9:n=t.sent;case 10:r++,t.next=5;break;case 13:return t.abrupt("return",n);case 14:return t.abrupt("return",null);case 15:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),rp=function(){return pl((function t(){hl(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=arguments;this.callbacks.forEach((function(t){t.apply(void 0,r)}))}}])}(),ip=function(){return pl((function t(){hl(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(this.callbacks.length){for(var r=arguments,i=this.callbacks[0].apply(void 0,r),o=0;o<this.callbacks.length-1;o++){i=(0,this.callbacks[o])(i)}return i}return null}}])}(),op=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],ap=/([\"\'])[^\'\"]+\1/;function sp(t,e,n){return bt(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var cp=pt(),lp=pt(),up={scale:function(t){Tt(cp,[t[0].value,t[1].value,1])},scaleX:function(t){Tt(cp,[t[0].value,1,1])},scaleY:function(t){Tt(cp,[1,t[0].value,1])},scaleZ:function(t){Tt(cp,[1,1,t[0].value])},scale3d:function(t){Tt(cp,[t[0].value,t[1].value,t[2].value])},translate:function(t){At(cp,[t[0].value,t[1].value,0])},translateX:function(t){At(cp,[t[0].value,0,0])},translateY:function(t){At(cp,[0,t[0].value,0])},translateZ:function(t){At(cp,[0,0,t[0].value])},translate3d:function(t){At(cp,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Lt(cp,ku(bh(t[0])))},rotateX:function(t){Nt(cp,ku(bh(t[0])))},rotateY:function(t){Ct(cp,ku(bh(t[0])))},rotateZ:function(t){Lt(cp,ku(bh(t[0])))},rotate3d:function(t){Pt(cp,ku(bh(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){sp(cp,ku(t[0].value),ku(t[1].value))},skewX:function(t){sp(cp,ku(t[0].value),0)},skewY:function(t){sp(cp,0,ku(t[0].value))},matrix:function(t){mt(cp,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){mt.apply(Zt,[cp].concat(yl(t.map((function(t){return t.value})))))}},fp=te(1,1,1),hp=Kt(),dp={translate:function(t,e){mg.sceneGraphService.setLocalScale(t,fp,!1),mg.sceneGraphService.setLocalEulerAngles(t,hp,void 0,void 0,!1),mg.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),mg.sceneGraphService.dirtifyLocal(t,t.transformable)}};function pp(t,e){if(t.length){if(1===t.length&&dp[t[0].t])return void dp[t[0].t](e,t[0].d);for(var n=bt(lp),r=0;r<t.length;r++){var i=t[r],o=i.t,a=i.d,s=up[o];s&&(s(a),Ut(n,n,cp))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var gp=function(){return pl((function t(){hl(this,t),this.parser=td,this.mixer=ld}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Ff?[]:n}},{key:"postProcessor",value:function(t){pp(t.parsedStyle.transform,t)}}])}(),vp=function(){return pl((function t(){hl(this,t)}),[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===_f.kPixels&&e[1].unit===_f.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),yp=function(){return pl((function t(){hl(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n.value}},{key:"postProcessor",value: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=Wu.Z_INDEX_CHANGED)}}}])}(),mp=function(){return pl((function t(){hl(this,t)}),[{key:"update",value: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}}}])}(),bp=function(){return pl((function t(){hl(this,t)}),[{key:"update",value: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}}}])}(),xp=function(){return pl((function t(){hl(this,t)}),[{key:"update",value: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}}}])}(),wp=function(){return pl((function t(){hl(this,t)}),[{key:"update",value: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}}}])}(),kp=function(){return pl((function t(){hl(this,t)}),[{key:"update",value:function(t){if(t.points&&x(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,yl(e.map((function(t){return t[0]})))),r=Math.max.apply(Math,yl(e.map((function(t){return t[0]})))),i=Math.min.apply(Math,yl(e.map((function(t){return t[1]})))),o=Math.max.apply(Math,yl(e.map((function(t){return t[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}}}])}(),Mp=function(){return pl((function t(){hl(this,t)}),[{key:"update",value: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&&!L(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}}}])}(),Ep=function(){return pl((function t(e){hl(this,t),this.globalRuntime=e}),[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,r=t.text,i=t.textAlign,o=void 0===i?"start":i,a=t.lineWidth,s=void 0===a?1:a,c=t.textBaseline,l=void 0===c?"alphabetic":c,u=t.dx,f=void 0===u?0:u,h=t.dy,d=void 0===h?0:h,p=t.x,g=void 0===p?0:p,v=t.y,y=void 0===v?0:v;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 m=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{}).offscreenCanvas,b=this.globalRuntime.textService.measureText(r,t,m);t.metrics=b;var x=b.width/2,w=b.height/2,k=g+x;"center"===o||"middle"===o?k+=s/2-x:"right"!==o&&"end"!==o||(k+=s-2*x);var M=y-w;return"middle"===l?M+=w:"top"===l||"hanging"===l?M+=2*w:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(M+=0),f&&(k+=f),d&&(M+=d),{cx:k,cy:M,hwidth:x,hheight:w}}}])}(),Op=function(){return pl((function t(){hl(this,t)}),[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),_p=function(){return pl((function t(){hl(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.width,s=void 0===a?0:a,c=t.height,l=void 0===c?0:c;return{cx:r+s/2,cy:o+l/2,hwidth:s/2,hheight:l/2}}}])}(),Sp=function(){return pl((function t(e){hl(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new pu,this.page=new pu,this.canvas=new pu,this.viewport=new pu,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}),[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error(vu)}}])}(),Ap=function(t){function e(){var t;hl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=wl(this,e,[].concat(r))).client=new pu,t.movement=new pu,t.offset=new pu,t.global=new pu,t.screen=new pu,t}return Ml(e,t),pl(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw new Error(vu)}}])}(Sp),Tp=function(t){function e(){var t;hl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=wl(this,e,[].concat(r))).width=0,t.height=0,t.isPrimary=!1,t}return Ml(e,t),pl(e,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Ap),Pp=function(t){function e(){return hl(this,e),wl(this,e,arguments)}return Ml(e,t),pl(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Ap),Np=function(t){function e(t,n){var r;return hl(this,e),(r=wl(this,e,[null])).type=t,r.detail=n,Object.assign(r,n),r}return Ml(e,t),pl(e)}(Sp),Cp=new WeakMap,Lp=function(){return pl((function t(){hl(this,t),this.emitter=new _l}),[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=!1,i=!1;if(H(n))r=n;else if(n){var o=n.capture;r=void 0!==o&&o;var a=n.once;i=void 0!==a&&a}r&&(t+="capture"),e=m(e)?e:e.handleEvent;var s=m(e)?void 0:e;return i?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r;if(!this.emitter)return this;(H(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=m(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent;var i=m(e)?void 0:e;return this.emitter.off(t,e,i),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new Np(t,e))}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Cp.get(this);r||(r=this.document?this:this.defaultView?this.defaultView:null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView)&&Cp.set(this,r);if(r){if(t.manager=r.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.emitter.emit(t.type,t);return!t.defaultPrevented}}])}(),jp=function(t){function e(){var t;hl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=wl(this,e,[].concat(r))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return Ml(e,t),pl(e,[{key:"textContent",get:function(){var t="";this.nodeName===tu.TEXT&&(t+=this.style.text);var e,n=Zl(this.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.nodeName===tu.TEXT?t+=r.nodeValue:t+=r.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===tu.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw new Error(vu)}},{key:"lookupNamespaceURI",value:function(t){throw new Error(vu)}},{key:"lookupPrefix",value:function(t){throw new Error(vu)}},{key:"normalize",value:function(){throw new Error(vu)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,r=this,i=[n],o=[r];null!==(a=n.parentNode)&&void 0!==a?a:r.parentNode;){var a;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(o.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>o.length?i:o,c=s===i?o:i;if(s[s.length-c.length]===c[0])return s===i?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===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(Lp);jp.DOCUMENT_POSITION_DISCONNECTED=1,jp.DOCUMENT_POSITION_PRECEDING=2,jp.DOCUMENT_POSITION_FOLLOWING=4,jp.DOCUMENT_POSITION_CONTAINS=8,jp.DOCUMENT_POSITION_CONTAINED_BY=16,jp.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Rp=function(){return pl((function t(e,n){var r=this;hl(this,t),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=pt(),this.tmpVec3=Kt(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var n=2===e.button;r.dispatchEvent(e,n?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=$d.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){var i=2===n.button;r.dispatchEvent(n,i?"rightup":"mouseup")}var o=r.trackingData(t.pointerId),a=r.findMountedTarget(o.pressTargetsByButton[t.button]),s=a;if(a&&!n.composedPath().includes(a)){for(var c=a;c&&!n.composedPath().includes(c);){if(n.currentTarget=c,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){var l=2===n.button;r.notifyTarget(n,l?"rightupoutside":"mouseupoutside")}jp.isNode(c)&&(c=c.parentNode)}delete o.pressTargetsByButton[t.button],s=c}if(s){var u,f=r.clonePointerEvent(n,"click");f.target=s,f.path=[],o.clicksByButton[t.button]||(o.clicksByButton[t.button]={clickCount:0,target:f.target,timeStamp:e});var h=r.context.renderingContext.root.ownerDocument.defaultView,d=o.clicksByButton[t.button];d.target===f.target&&e-d.timeStamp<h.getConfig().dblClickSpeed?++d.clickCount:d.clickCount=1,d.target=f.target,d.timeStamp=e,f.detail=d.clickCount,null!==(u=n.detail)&&void 0!==u&&u.preventClick||(r.context.config.useNativeClickEvent||"mouse"!==f.pointerType&&"touch"!==f.pointerType||r.dispatchEvent(f,"click"),r.dispatchEvent(f,"pointertap")),r.freeEvent(f)}r.freeEvent(n)},this.onPointerMove=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,i=r.trackingData(t.pointerId),o=r.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a="mousemove"===t.type?"mouseout":"pointerout",s=r.createPointerEvent(t,a,o||void 0);if(r.dispatchEvent(s,"pointerout"),n&&r.dispatchEvent(s,"mouseout"),!e.composedPath().includes(o)){var c=r.createPointerEvent(t,"pointerleave",o||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!e.composedPath().includes(c.target);)c.currentTarget=c.target,r.notifyTarget(c),n&&r.notifyTarget(c,"mouseleave"),jp.isNode(c.target)&&(c.target=c.target.parentNode);r.freeEvent(c)}r.freeEvent(s)}if(o!==e.target){var l="mousemove"===t.type?"mouseover":"pointerover",u=r.clonePointerEvent(e,l);r.dispatchEvent(u,"pointerover"),n&&r.dispatchEvent(u,"mouseover");for(var f=o&&jp.isNode(o)&&o.parentNode;f&&f!==(jp.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(jp.isNode(r.rootTarget)&&r.rootTarget.parentNode)){var h=r.clonePointerEvent(e,"pointerenter");for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==o&&h.target!==(jp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)h.currentTarget=h.target,r.notifyTarget(h),n&&r.notifyTarget(h,"mouseenter"),jp.isNode(h.target)&&(h.target=h.target.parentNode);r.freeEvent(h)}r.freeEvent(u)}r.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&r.dispatchEvent(e,"touchmove"),n&&(r.dispatchEvent(e,"mousemove"),r.cursor=r.getCursor(e.target)),i.overTargets=e.composedPath(),r.freeEvent(e)},this.onPointerOut=function(t){var e=r.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,i=r.findMountedTarget(e.overTargets),o=r.createPointerEvent(t,"pointerout",i||void 0);r.dispatchEvent(o),n&&r.dispatchEvent(o,"mouseout");var a=r.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(jp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),n&&r.notifyTarget(a,"mouseleave"),jp.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,r.freeEvent(o),r.freeEvent(a)}r.cursor=null},this.onPointerOver=function(t){var e=r.trackingData(t.pointerId),n=r.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;r.dispatchEvent(n,"pointerover"),i&&r.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(r.cursor=r.getCursor(n.target));var o=r.clonePointerEvent(n,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(jp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),i&&r.notifyTarget(o,"mouseenter"),jp.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=n.composedPath(),r.freeEvent(n),r.freeEvent(o)},this.onPointerUpOutside=function(t){var e=r.trackingData(t.pointerId),n=r.findMountedTarget(e.pressTargetsByButton[t.button]),i=r.createPointerEvent(t);if(n){for(var o=n;o;)i.currentTarget=o,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),jp.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}r.freeEvent(i)},this.onWheel=function(t){var e=r.createWheelEvent(t);r.dispatchEvent(e),r.freeEvent(e)},this.onClick=function(t){if(r.context.config.useNativeClickEvent){var e=r.createPointerEvent(t);r.dispatchEvent(e),r.freeEvent(e)}},this.onPointerCancel=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(e),r.freeEvent(e)},this.globalRuntime=e,this.context=n}),[{key:"init",value: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)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,o=r.offsetHeight;i&&o&&(e=t.width/i,n=t.height/o)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new pu((t.x-((null==i?void 0:i.left)||0))/n,(t.y-((null==i?void 0:i.top)||0))/r)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new pu((t.x+((null==i?void 0:i.left)||0))*n,(t.y+((null==i?void 0:i.top)||0))*r)}},{key:"viewport2Canvas",value: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=Mt(this.tmpMatrix,c,s),u=ne(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return ue(u,u,l),new pu(u[0],u[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=Mt(this.tmpMatrix,n,r),o=ne(this.tmpVec3,t.x,t.y,0);ue(this.tmpVec3,this.tmpVec3,i);var a=this.context.config,s=a.width,c=a.height;return new pu((o[0]+1)/2*s,(1-(o[1]+1)/2)*c)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value: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}))}},{key:"mapEvent",value: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))}}},{key:"dispatchEvent",value: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)}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=i+1;o<n.length;o++)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value: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++)jp.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value: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}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,r=null==e?void 0:e.target;if(null!==(n=r)&&void 0!==n&&n.shadowRoot&&(r=e.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();e<n.length;e++){var r=n[e],i=this.nativeHTMLMap.get(r);if(i)return i}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,r){var i=this.allocateEvent(Tp);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}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(Pp);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}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(Pp);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}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(Tp);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}},{key:"copyPointerData",value: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}},{key:"copyMouseData",value: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)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=$d.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value: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}},{key:"freeEvent",value: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)}},{key:"notifyTarget",value: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)}},{key:"notifyListeners",value: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)}},{key:"findMountedTarget",value: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||jp.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=Id(e)&&e.getAttribute("cursor");if(n)return n;e=jp.isNode(e)&&e.parentNode}}}])}(),Ip=function(){return pl((function t(){hl(this,t)}),[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||mg.offscreenCanvas)this.canvas=t||mg.offscreenCanvas,this.context=this.canvas.getContext("2d",fl({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",fl({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",fl({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),Dp=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),Bp=function(){return pl((function t(e,n){hl(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new rp,initAsync:new ep,dirtycheck:new ip,cull:new ip,beginFrame:new rp,beforeRender:new rp,render:new rp,afterRender:new rp,endFrame:new rp,destroy:new rp,pick:new np,pickSync:new ip,pointerDown:new rp,pointerUp:new rp,pointerMove:new rp,pointerOut:new rp,pointerOver:new rp,pointerWheel:new rp,pointerCancel:new rp,click:new rp},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(t){var e=this,n=fl(fl({},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()})).catch((function(t){}))}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Dp.CAMERA_CHANGED)}},{key:"render",value: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(Dp.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()}}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;function s(t){var e=t.renderable,i=t.sortable,s=o?e.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var c=a?r.hooks.cull.call(s,r.context.camera):s;c&&(r.stats.rendered+=1,n.renderListCurrentFrame.push(c))}e.dirty=!1,i.renderOrder=r.zIndexCounter,r.zIndexCounter+=1,r.stats.total+=1,i.dirty&&(r.sort(t,i),i.dirty=!1,i.dirtyChildren=[],i.dirtyReason=void 0)}for(var c=[t];c.length>0;){var l,u=c.pop();s(u);for(var f=(null===(l=u.sortable)||void 0===l||null===(l=l.sorted)||void 0===l?void 0:l.length)>0?u.sortable.sorted:u.childNodes,h=f.length-1;h>=0;h--)c.push(f[h])}}},{key:"sort",value:function(t,e){var n,r;(null==e||null===(n=e.sorted)||void 0===n?void 0:n.length)>0&&e.dirtyReason!==Wu.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){var r=e.sorted.indexOf(n);if(r>-1&&e.sorted.splice(r,1),t.childNodes.indexOf(n)>-1)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;Dd(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(Dd),(null===(r=e.sorted)||void 0===r?void 0:r.length)>0&&0===t.childNodes.filter((function(t){return t.parsedStyle.zIndex})).length&&(e.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(Dp.DISPLAY_OBJECT_CHANGED)}}])}(),Fp=/\[\s*(.*)=(.*)\s*\]/,zp=function(){return pl((function t(){hl(this,t)}),[{key:"selectOne",value: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}))}},{key:"selectAll",value: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}))}},{key:"is",value: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}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(Fp),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return b(n)?"":n.toString?n.toString():""}}])}(),$p=function(t){return t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.MOUNTED="DOMNodeInsertedIntoDocument",t.REMOVED="removed",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.REPARENT="reparent",t.DESTROY="destroy",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),Wp=function(t){function e(t,n,r,i,o,a,s,c){var l;return hl(this,e),(l=wl(this,e,[null])).relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=o,l.attrChange=a,l.prevParsedValue=s,l.newParsedValue=c,l.type=t,l}return Ml(e,t),pl(e)}(Sp);function Gp(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}Wp.ADDITION=2,Wp.MODIFICATION=1,Wp.REMOVAL=3;var Hp,Yp,qp,Vp=new Wp($p.REPARENT,null,"","","",0,"",""),Up=Te(),Xp=Kt(),Zp=te(1,1,1),Kp=pt(),Qp=Te(),Jp=Kt(),tg=pt(),eg=be(),ng=Kt(),rg=be(),ig=Kt(),og=Kt(),ag=Kt(),sg=pt(),cg=be(),lg=be(),ug=be(),fg={affectChildren:!0},hg=function(){return pl((function t(e){hl(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new Np($p.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}),[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var o=t.nodeName===tu.FRAGMENT,a=Wd(e);t.parentNode=e;var s=o?t.childNodes:[t];I(n)?s.forEach((function(t){e.childNodes.splice(n,0,t),t.parentNode=e})):s.forEach((function(t){e.childNodes.push(t),t.parentNode=e}));var c=e.sortable;if((null!=c&&null!==(r=c.sorted)&&void 0!==r&&r.length||c.dirty||t.parsedStyle.zIndex)&&(-1===c.dirtyChildren.indexOf(t)&&c.dirtyChildren.push(t),c.dirty=!0,c.dirtyReason=Wu.ADDED),!a){if(o)this.dirtifyFragment(t);else{var l=t.transformable;l&&this.dirtifyWorld(t,l)}i&&t.dispatchEvent(Vp)}}},{key:"detach",value:function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=Wu.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"setOrigin",value:function(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var n=t.transformable;if(e[0]!==n.origin[0]||e[1]!==n.origin[1]||e[2]!==n.origin[2]){var r=n.origin;r[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtifyLocal(t,n)}}},{key:"rotate",value:function(t,e){"number"==typeof e&&(e=te(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var r=eg;Me(r,e[0],e[1],e[2]);var i=this.getRotation(t),o=this.getRotation(t.parentNode);Oe(ug,o),ke(ug,ug),we(r,ug,r),we(n.localRotation,r,i),Ae(n.localRotation,n.localRotation),this.dirtifyLocal(t,n)}else this.rotateLocal(t,e)}},{key:"rotateLocal",value:function(t,e){"number"==typeof e&&(e=te(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;Me(lg,e[0],e[1],e[2]),Se(n.localRotation,n.localRotation,lg),this.dirtifyLocal(t,n)}},{key:"setEulerAngles",value:function(t,e){"number"==typeof e&&(e=te(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Me(n.localRotation,e[0],e[1],e[2]);var r=this.getRotation(t.parentNode);Oe(cg,ke(eg,r)),Se(n.localRotation,n.localRotation,cg),this.dirtifyLocal(t,n)}else this.setLocalEulerAngles(t,e)}},{key:"setLocalEulerAngles",value:function(t,e){var n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];"number"==typeof e&&(e=te(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;Me(r.localRotation,e[0],e[1],e[2]),n&&this.dirtifyLocal(t,r)}},{key:"translateLocal",value:function(t,e){"number"==typeof e&&(e=te(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;he(e,Xp)||(!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,v=2*a;u*=v,f*=v,h*=v,d*=2,p*=2,g*=2,t[0]=s+u+d,t[1]=c+f+p,t[2]=l+h+g}(e,e,n.localRotation),re(n.localPosition,n.localPosition,e),this.dirtifyLocal(t,n))}},{key:"setPosition",value:function(t,e){var n,r=t.transformable;if(ag[0]=e[0],ag[1]=e[1],ag[2]=null!==(n=e[2])&&void 0!==n?n:0,!he(this.getPosition(t),ag)){if(ee(r.position,ag),null!==t.parentNode&&t.parentNode.transformable){var i=t.parentNode.transformable;vt(sg,i.worldTransform),wt(sg,sg),ue(r.localPosition,ag,sg)}else ee(r.localPosition,ag);this.dirtifyLocal(t,r)}}},{key:"setLocalPosition",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;og[0]=e[0],og[1]=e[1],og[2]=null!==(n=e[2])&&void 0!==n?n:0,he(i.localPosition,og)||(ee(i.localPosition,og),r&&this.dirtifyLocal(t,i))}},{key:"scaleLocal",value:function(t,e){var n,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,ne(Jp,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1)),this.dirtifyLocal(t,r)}},{key:"setLocalScale",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;ne(Jp,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),he(Jp,i.localScale)||(ee(i.localScale,Jp),r&&this.dirtifyLocal(t,i))}},{key:"translate",value:function(t,e){"number"==typeof e&&(e=ne(Jp,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),he(e,Xp)||(re(Jp,this.getPosition(t),e),this.setPosition(t,Jp))}},{key:"setRotation",value:function(t,e,n,r,i){var o=t.transformable;if("number"==typeof e&&(e=Ee(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var a=this.getRotation(t.parentNode);Oe(eg,a),ke(eg,eg),we(o.localRotation,eg,e),Ae(o.localRotation,o.localRotation),this.dirtifyLocal(t,o)}else this.setLocalRotation(t,e)}},{key:"setLocalRotation",value:function(t,e,n,r,i){var o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];"number"==typeof e&&(e=_e(eg,e,n,r,i));var a=t.transformable;Oe(a.localRotation,e),o&&this.dirtifyLocal(t,a)}},{key:"setLocalSkew",value:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(Qp,e,n));var i=t.transformable;!function(t,e){t[0]=e[0],t[1]=e[1]}(i.localSkew,e),r&&this.dirtifyLocal(t,i)}},{key:"dirtifyLocal",value:function(t,e){Wd(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))}},{key:"dirtifyWorld",value:function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)}},{key:"dirtifyFragment",value:function(t){var e=t.transformable;e&&(e.frozen=!1,e.dirtyFlag=!0,e.localDirtyFlag=!0);var n=t.renderable;n&&(n.renderBoundsDirty=!0,n.boundsDirty=!0,n.dirty=!0);for(var r=t.childNodes.length,i=0;i<r;i++)this.dirtifyFragment(t.childNodes[i]);t.nodeName===tu.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n)&&n.nodeName!==tu.FRAGMENT&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n))};this.pendingEvents.forEach((function(t,e){e.nodeName!==tu.FRAGMENT&&(fg.affectChildren=t,t?e.forEach((function(t){n(t,fg)})):n(e,fg))})),e.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"dirtifyToRoot",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Gp(n),n=n.parentNode;e&&t.forEach((function(t){Gp(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)}},{key:"updateDisplayObjectDependency",value: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)}}},{key:"informDependentDisplayObjects",value: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 Wp($p.ATTR_MODIFIED,n,e,e,t,Wp.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))}},{key:"getPosition",value:function(t){var e=t.transformable;return Rt(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return Dt(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return It(e.scaling,this.getWorldTransform(t,e))}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"calcLocalTransform",value:function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){Bt(t.localTransform,t.localRotation,t.localPosition,te(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(bt(tg),tg[4]=Math.tan(t.localSkew[0]),tg[1]=Math.tan(t.localSkew[1]),Mt(t.localTransform,t.localTransform,tg));var e=Bt(tg,_e(eg,0,0,0,1),ne(Jp,1,1,1),t.localScale,t.origin);Mt(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,o=t.localScale,a=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2],c=1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2],l=1!==o[0]||1!==o[1]||1!==o[2],u=0!==a[0]||0!==a[1]||0!==a[2];c||l||u?Bt(n,i,r,o,a):s?At(n,r):bt(n)}}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform}},{key:"setLocalTransform",value:function(t,e){var n=Rt(ng,e),r=Dt(rg,e),i=It(ig,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)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,Zp,!1),this.setLocalPosition(t,Xp,!1),this.setLocalEulerAngles(t,Xp,void 0,void 0,!1),this.setLocalSkew(t,Up,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this.getGeometryBounds(t,e);if(!uu.isEmpty(r)){var i=n||new uu;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry;return n.dirty&&mg.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new uu}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=n?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,n,i);if(t.childNodes.forEach((function(t){var r=e.getBounds(t,n);r&&(o?o.add(r):(o=i||new uu).update(r.center,r.halfExtents))})),o||(o=new uu),n){var a=Bd(t);if(a){var s=a.parsedStyle.clipPath.getBounds(n);o?s&&(o=s.intersection(o)):o.update(s.center,s.halfExtents)}}return n?(r.renderBounds=o,r.renderBoundsDirty=!1):(r.bounds=o,r.boundsDirty=!1),o}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=Kp;t.parentNode.transformable&&(e=wt(tg,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!uu.isEmpty(n)){var r=new uu;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);uu.isEmpty(r)||(n=new uu).setFromTransformedAABB(r,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var o=El(n.getMin(),2),a=o[0],s=o[1],c=El(n.getMax(),2),l=c[0],u=c[1];return new gu(a+((null==i?void 0:i.left)||0),s+((null==i?void 0:i.top)||0),l-a,u-s)}return new gu((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"dirtifyWorldInternal",value: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)}}},{key:"syncHierarchy",value: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])}}},{key:"sync",value: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?Mt(e.worldTransform,r.worldTransform,e.localTransform):vt(e.worldTransform,e.localTransform),e.dirtyFlag=!1}}},{key:"unfreezeParentToRoot",value:function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}}}])}(),dg={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]},pg=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,gg=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),vg=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),yg=function(){return pl((function t(e){var n=this;hl(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!vg.exec(e)&&!gg.exec(t))},this.trimByKinsokuShorui=function(t){var e=yl(t),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},this.runtime=e}),[{key:"measureFont",value: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=dg.MetricsString+dg.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(dg.BaselineSymbol).width),c=dg.HeightMultiplier*s;s=s*dg.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(var v=0;v<f;v+=4)if(255!==l[d+v]){p=!0;break}if(p)break;d-=f}return n.descent=h-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value: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,v=e.textPath,y=e.leading,m=void 0===y?0:y,b=function(t){for(var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,o=t.fontStyle,a=void 0===o?"normal":o,s=t.fontVariant,c=void 0===s?"normal":s,l=t.fontWeight,u=void 0===l?"normal":l,f=I(n)&&"".concat(n,"px")||"16px",h=i.split(","),d=h.length-1;d>=0;d--){var p=h[d].trim();!ap.test(p)&&op.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 w=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);w.font=b,e.isOverflowing=!1;var k=(a?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),M=new Array(k.length),E=0;if(!v){for(var O=0;O<k.length;O++){var _=w.measureText(k[O]).width+(k[O].length-1)*g;M[O]=_,E=Math.max(E,_)}var S=E+l,A=s||x.fontSize+l,T=Math.max(A,x.fontSize+l)+(k.length-1)*(A+m),P=0;return"middle"===f?P=-T/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?P=-T:"top"!==f&&"hanging"!==f||(P=0),{font:b,width:S,height:T,lines:k,lineWidths:M,lineHeight:A+=m,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 gu(n-l/2,P+e*A,t+l,A)}))}}v.getTotalLength();for(var N=0;N<k.length;N++)w.measureText(k[N]).width,k[N].length}},{key:"wordWrap",value:function(t,e,n){var r=this,i=this,o=e.wordWrapWidth,a=void 0===o?0:o,s=e.letterSpacing,c=void 0===s?0:s,l=e.maxLines,u=void 0===l?1/0:l,f=e.textOverflow,h=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),d=a+c,p="";"ellipsis"===f?p="...":f&&"clip"!==f&&(p=f);var g=Array.from(t),v=[],y=0,m=0,b=-1,x={},w=function(t){return r.getFromCache(t,c,x,h)},k=w(p);function M(t,e,n,r){for(;w(t)<r&&e<g.length-1&&!i.isNewline(g[e+1]);)t+=g[e+=1];for(;w(t)>r&&e>=n;)e-=1,t=t.slice(0,-1);return{lineTxt:t,txtLastCharIndex:e}}function E(t,e){if(!(k<=0||k>d))if(v[t]){var n=M(v[t],e,b+1,d-k);v[t]=n.lineTxt+p}else v[t]=p}for(var O=0;O<g.length;O++){var _=g[O],S=g[O-1],A=g[O+1],T=w(_);if(this.isNewline(_)){if(y+1>=u){e.isOverflowing=!0,O<g.length-1&&E(y,O-1);break}b=O-1,m=0,v[y+=1]=""}else{if(m>0&&m+T>d){var P=M(v[y],O-1,b+1,d);if(P.txtLastCharIndex!==O-1){if(v[y]=P.lineTxt,P.txtLastCharIndex===g.length-1)break;O=P.txtLastCharIndex+1,_=g[O],S=g[O-1],A=g[O+1],T=w(_)}if(y+1>=u){e.isOverflowing=!0,E(y,O-1);break}if(b=O-1,m=0,v[y+=1]="",this.isBreakingSpace(_))continue;this.canBreakInLastChar(_)||(v=this.trimToBreakable(v),m=this.sumTextWidthByCache(v[y]||"",w)),this.shouldBreakByKinsokuShorui(_,A)&&(v=this.trimByKinsokuShorui(v),m+=w(S||""))}m+=T,v[y]=(v[y]||"")+_}}return v.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&dg.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&dg.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=yl(t),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}},{key:"canBreakInLastChar",value:function(t){return!t||!pg.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce((function(t,n){return t+e(n)}),0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!pg.test(t[e]))return e;return-1}},{key:"getFromCache",value: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}}])}(),mg={},bg=(Yp=new Mp,qp=new kp,ll(ll(ll(ll(ll(ll(ll(ll(ll(ll(Hp={},tu.FRAGMENT,null),tu.CIRCLE,new mp),tu.ELLIPSE,new bp),tu.RECT,Yp),tu.IMAGE,Yp),tu.GROUP,new Op),tu.LINE,new xp),tu.TEXT,new Ep(mg)),tu.POLYLINE,qp),tu.POLYGON,qp),ll(ll(ll(Hp,tu.PATH,new wp),tu.HTML,new _p),tu.MESH,null)),xg=function(t){var e=new bd,n=new kd;return ll(ll(ll(ll(ll(ll(ll(ll(ll(ll(t={},Hu.PERCENTAGE,null),Hu.NUMBER,new _d),Hu.ANGLE,new yd),Hu.DEFINED_PATH,new md),Hu.PAINT,e),Hu.COLOR,e),Hu.FILTER,new xd),Hu.LENGTH,n),Hu.LENGTH_PERCENTAGE,n),Hu.LENGTH_PERCENTAGE_12,new Md),ll(ll(ll(ll(ll(ll(ll(ll(ll(ll(t,Hu.LENGTH_PERCENTAGE_14,new Ed),Hu.COORDINATE,new kd),Hu.OFFSET_DISTANCE,new Sd),Hu.OPACITY_VALUE,new Ad),Hu.PATH,new Td),Hu.LIST_OF_POINTS,new Pd),Hu.SHADOW_BLUR,new Nd),Hu.TEXT,new Cd),Hu.TEXT_TRANSFORM,new Ld),Hu.TRANSFORM,new gp),ll(ll(ll(t,Hu.TRANSFORM_ORIGIN,new vp),Hu.Z_INDEX,new yp),Hu.MARKER,new Od)}();mg.CameraContribution=zu,mg.AnimationTimeline=null,mg.EasingFunction=null,mg.offscreenCanvasCreator=new Ip,mg.sceneGraphSelector=new zp,mg.sceneGraphService=new hg(mg),mg.textService=new yg(mg),mg.geometryUpdaterFactory=bg,mg.CSSPropertySyntaxFactory=xg,mg.styleValueRegistry=new gd(mg),mg.layoutRegistry=null,mg.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==al?al:{},mg.enableStyleSyntax=!0,mg.enableSizeAttenuation=!1;var wg=0,kg=new Wp($p.INSERTED,null,"","","",0,"",""),Mg=new Wp($p.REMOVED,null,"","","",0,"",""),Eg=new Np($p.DESTROY),Og=function(t){function e(){var t;hl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=wl(this,e,[].concat(r))).entity=wg++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.cullable={strategy:$u.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.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]},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return Ml(e,t),pl(e,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw new Error(vu)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return mg.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(Wd(this)||t.nodeName!==tu.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(kg.relatedNode=this,t.dispatchEvent(kg)),t}},{key:"insertBefore",value: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}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e;return Mg.relatedNode=this,t.dispatchEvent(Mg),null!==(e=t.ownerDocument)&&void 0!==e&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),mg.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return mg.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return mg.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return mg.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return mg.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return mg.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return mg.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return mg.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(mg.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach((function(r){return r===e||!t(r)||(n=r,!1)})),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)}))}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var o=r[0],a=r.slice(1);this.parentNode.appendChild(o,e),(t=o).after.apply(t,yl(a))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){this.destroyChildren(),this.dispatchEvent(Eg),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return mg.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return mg.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return mg.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return mg.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return mg.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e,n,r){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw new Error(vu)}},{key:"getAttributeNode",value:function(t){throw new Error(vu)}},{key:"getAttributeNodeNS",value:function(t,e){throw new Error(vu)}},{key:"hasAttributeNS",value:function(t,e){throw new Error(vu)}},{key:"removeAttributeNS",value:function(t,e){throw new Error(vu)}},{key:"removeAttributeNode",value:function(t){throw new Error(vu)}},{key:"setAttributeNS",value:function(t,e,n){throw new Error(vu)}},{key:"setAttributeNode",value:function(t){throw new Error(vu)}},{key:"setAttributeNodeNS",value:function(t){throw new Error(vu)}},{key:"toggleAttribute",value:function(t,e){throw new Error(vu)}}])}(jp);function _g(t){return!(null==t||!t.nodeName)}var Sg=mg.globalThis.Proxy?mg.globalThis.Proxy:function(){},Ag=new Wp($p.ATTR_MODIFIED,null,null,null,null,Wp.MODIFICATION,null,null),Tg=Kt(),Pg=be(),Ng=function(t){function e(t){var n;return hl(this,e),(n=wl(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||tu.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),mg.enableStyleSyntax&&(n.style=new Sg({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 Ml(e,t),pl(e,[{key:"destroy",value:function(){Al(e,"destroy",this,3)([]),this.getAnimations().forEach((function(t){t.cancel()}))}},{key:"cloneNode",value:function(t,e){var n=fl({},this.attributes);for(var r in n){var i=n[r];_g(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor(fl(fl({},this.config),{},{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}},{key:"initAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};mg.styleValueRegistry.processProperties(this,t,{forceUpdateGeometry:!0}),this.renderable.dirty=!0}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];Y(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),Al(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.renderable,i=this.attributes[t],o=this.parsedStyle[t];mg.styleValueRegistry.processProperties(this,ll({},t,e),n),r.dirty=!0;var a,s=this.parsedStyle[t];(this.isConnected&&(Ag.relatedNode=this,Ag.prevValue=i,Ag.newValue=e,Ag.attrName=t,Ag.prevParsedValue=o,Ag.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(Ag):(Ag.target=this,this.ownerDocument.defaultView.dispatchEvent(Ag,!0))),this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(a=this.attributeChangedCallback)||void 0===a||a.call(this,t,i,e,o,s))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=El(t.getMin(),2),n=e[0],r=e[1],i=El(t.getMax(),2),o=i[0],a=i[1];return new gu(n,r,o-n,a-r)}},{key:"setOrigin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return mg.sceneGraphService.setOrigin(this,xu(t,e,n,!1)),this}},{key:"getOrigin",value:function(){return mg.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return mg.sceneGraphService.setPosition(this,xu(t,e,n,!1)),this}},{key:"setLocalPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return mg.sceneGraphService.setLocalPosition(this,xu(t,e,n,!1)),this}},{key:"translate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return mg.sceneGraphService.translate(this,xu(t,e,n,!1)),this}},{key:"translateLocal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return mg.sceneGraphService.translateLocal(this,xu(t,e,n,!1)),this}},{key:"getPosition",value:function(){return mg.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return mg.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=xu(t,e=e||t,n=n||t,!1)),mg.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=xu(t,e=e||t,n=n||t,!1)),mg.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return mg.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return mg.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return Eu(El(_u(Tg,mg.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return Eu(El(_u(Tg,mg.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return mg.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return mg.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return b(e)&&b(n)?mg.sceneGraphService.rotateLocal(this,0,0,t):mg.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return b(e)&&b(n)?mg.sceneGraphService.rotate(this,0,0,t):mg.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return mg.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return mg.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return mg.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return mg.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return mg.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return mg.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return mg.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return mg.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return mg.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){mg.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value: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}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,yl(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,yl(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0],o=n[1];return i?w(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=El(Rt(Tg,e),2),r=n[0],i=n[1],o=El(It(Tg,e),2),a=o[0],s=o[1],c=Dt(Pg,e),l=El(_u(Tg,c),3),u=l[0],f=l[2];return Su(u||f,r,i,a,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=El(Au(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)}},{key:"setLocalMatrix",value:function(t){var e=El(Au(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)}},{key:"show",value:function(){this.forEach((function(t){t.style.visibility="visible"}))}},{key:"hide",value:function(){this.forEach((function(t){t.style.visibility="hidden"}))}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(Og);Ng.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var Cg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hl(this,e),wl(this,e,[fl({type:tu.CIRCLE},t)])}return Ml(e,t),pl(e)}(Ng);Cg.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var Lg=["style"],jg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Kl(n,Lg);return hl(this,e),(t=wl(this,e,[fl({style:r},i)])).isCustomElement=!0,t}return Ml(e,t),pl(e)}(Ng);jg.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Rg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hl(this,e),wl(this,e,[fl({type:tu.ELLIPSE},t)])}return Ml(e,t),pl(e)}(Ng);Rg.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"])),(function(t){function e(){return hl(this,e),wl(this,e,[{type:tu.FRAGMENT}])}return Ml(e,t),pl(e)}(Ng)).PARSED_STYLE_LIST=new Set(["class","className"]);var Ig=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hl(this,e),wl(this,e,[fl({type:tu.GROUP},t)])}return Ml(e,t),pl(e)}(Ng);Ig.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Dg=["style"],Bg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Kl(n,Dg);return hl(this,e),(t=wl(this,e,[fl({type:tu.HTML,style:r},i)])).cullable.enable=!1,t}return Ml(e,t),pl(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=wt(pt(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!uu.isEmpty(e)){var n=new uu;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(Ng);Bg.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var Fg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hl(this,e),wl(this,e,[fl({type:tu.IMAGE},t)])}return Ml(e,t),pl(e)}(Ng);Fg.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var zg=["style"],$g=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Kl(n,zg);hl(this,e),(t=wl(this,e,[fl({type:tu.LINE,style:fl({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var o=t.parsedStyle,a=o.markerStart,s=o.markerEnd;return a&&_g(a)&&(t.markerStartAngle=a.getLocalEulerAngles(),t.appendChild(a)),s&&_g(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return Ml(e,t),pl(e,[{key:"attributeChangedCallback",value: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&&_g(r)&&(this.markerStartAngle=0,r.remove()),i&&_g(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&_g(r)&&(this.markerEndAngle=0,r.remove()),i&&_g(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.x1,s=e.x2,c=e.y1,l=e.y2,u=t?n:r;if(u&&_g(u)){var f,h,d,p,g,v,y;t?(p=a,g=c,h=s-a,d=l-c,v=i||0,y=this.markerStartAngle):(p=s,g=l,h=a-s,d=c-l,v=o||0,y=this.markerEndAngle),f=Math.atan2(d,h),u.setLocalEulerAngles(180*f/Math.PI+y),u.setLocalPosition(p+Math.cos(f)*v,g+Math.sin(f)*v)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=Il(n.x1,n.y1,n.x2,n.y2,t),i=r.x,o=r.y,a=ue(Kt(),te(i,o,0),e?this.getWorldTransform():this.getLocalTransform());return new pu(a[0],a[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return Rl(t.x1,t.y1,t.x2,t.y2)}}])}(Ng);$g.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var Wg=["style"],Gg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Kl(n,Wg);hl(this,e),(t=wl(this,e,[fl({type:tu.PATH,style:r,initialParsedStyle:{miterLimit:4,d:fl({},Gu)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var o=t.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&_g(a)&&(t.markerStartAngle=a.getLocalEulerAngles(),t.appendChild(a)),c&&_g(c)&&t.placeMarkerMid(c),s&&_g(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return Ml(e,t),pl(e,[{key:"attributeChangedCallback",value: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&&_g(r)&&(this.markerStartAngle=0,r.remove()),i&&_g(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&_g(r)&&(this.markerEndAngle=0,r.remove()),i&&_g(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=t?n:r;if(a&&_g(a)){var s,c,l,u,f,h,d;if(t){var p=El(this.getStartTangent(),2),g=p[0],v=p[1];u=v[0],f=v[1],c=g[0]-v[0],l=g[1]-v[1],h=i||0,d=this.markerStartAngle}else{var y=El(this.getEndTangent(),2),m=y[0],b=y[1];u=b[0],f=b[1],c=m[0]-b[0],l=m[1]-b[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)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&_g(t))for(var n=1;n<e.length-1;n++){var r=El(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)}}},{key:"getTotalLength",value:function(){return Th(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e,n){return xn(t,e,Ce(Ce({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,o=ue(Kt(),te(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new pu(o[0],o[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*Th(this),e)}},{key:"getStartTangent",value: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}},{key:"getEndTangent",value: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}}])}(Ng);Gg.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var Hg=["style"],Yg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Kl(n,Hg);hl(this,e),(t=wl(this,e,[fl({type:tu.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var o=t.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&_g(a)&&(t.markerStartAngle=a.getLocalEulerAngles(),t.appendChild(a)),c&&_g(c)&&t.placeMarkerMid(c),s&&_g(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return Ml(e,t),pl(e,[{key:"attributeChangedCallback",value: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&&_g(r)&&(this.markerStartAngle=0,r.remove()),i&&_g(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&_g(r)&&(this.markerEndAngle=0,r.remove()),i&&_g(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value: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&&_g(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)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&_g(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)}}}])}(Ng);Yg.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var qg=["style"],Vg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Kl(t,qg);return hl(this,e),wl(this,e,[fl({type:tu.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return Ml(e,t),pl(e,[{key:"getTotalLength",value:function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=Wl(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],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=Rl(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=Il(n[l][0],n[l][1],n[l+1][0],n[l+1][1],c),f=u.x,h=u.y,d=ue(Kt(),te(f,h,0),e?this.getWorldTransform():this.getLocalTransform());return new pu(d[0],d[1])}},{key:"getStartTangent",value: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}},{key:"getEndTangent",value: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}}])}(Yg);Vg.PARSED_STYLE_LIST=new Set([].concat(yl(Yg.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var Ug=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hl(this,e),wl(this,e,[fl({type:tu.RECT},t)])}return Ml(e,t),pl(e)}(Ng);Ug.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var Xg=["style"],Zg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Kl(t,Xg);return hl(this,e),wl(this,e,[fl({type:tu.TEXT,style:fl({fill:"black"},n)},r)])}return Ml(e,t),pl(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(Ng);Zg.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var Kg=function(){return pl((function t(){hl(this,t),this.registry={},this.define(tu.CIRCLE,Cg),this.define(tu.ELLIPSE,Rg),this.define(tu.RECT,Ug),this.define(tu.IMAGE,Fg),this.define(tu.LINE,$g),this.define(tu.GROUP,Ig),this.define(tu.PATH,Gg),this.define(tu.POLYGON,Yg),this.define(tu.POLYLINE,Vg),this.define(tu.TEXT,Zg),this.define(tu.HTML,Bg)}),[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),Qg=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;mg.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},Jg=function(t){function e(){var t;hl(this,e),(t=wl(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new mg.AnimationTimeline(t)}catch(t){}var n={};return hd.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=m(i)?i(tu.GROUP):i)})),t.documentElement=new Ig({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return Ml(e,t),pl(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value: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?Zg:Ig);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw new Error(vu)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value: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}},{key:"elementFromPointSync",value: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}},{key:"elementFromPoint",value:(r=Xl(Vl().mark((function t(e,n){var r,i,o,a,s,c,l,u,f,h,d;return Vl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,c=a.height,!(i<0||o<0||i>s||o>c)){t.next=4;break}return t.abrupt("return",null);case 4:return l=this.defaultView.viewport2Client({x:i,y:o}),u=l.x,f=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:u,clientY:f},picked:[]});case 7:return h=t.sent,d=h.picked,t.abrupt("return",d&&d[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value: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}},{key:"elementsFromPoint",value:(n=Xl(Vl().mark((function t(e,n){var r,i,o,a,s,c,l,u,f,h,d;return Vl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,c=a.height,!(i<0||o<0||i>s||o>c)){t.next=4;break}return t.abrupt("return",[]);case 4:return l=this.defaultView.viewport2Client({x:i,y:o}),u=l.x,f=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:u,clientY:f},picked:[]});case 7:return h=t.sent,(d=h.picked)[d.length-1]!==this.documentElement&&d.push(this.documentElement),t.abrupt("return",d);case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw new Error(yu)}},{key:"insertBefore",value:function(t,e){throw new Error(yu)}},{key:"removeChild",value:function(t,e){throw new Error(yu)}},{key:"replaceChild",value:function(t,e,n){throw new Error(yu)}},{key:"append",value:function(){throw new Error(yu)}},{key:"prepend",value:function(){throw new Error(yu)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,r}(jp),tv=function(){function t(e){hl(this,t),this.strategies=e}return pl(t,[{key:"apply",value: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 Np($p.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}])}();tv.tag="Culling";var ev=function(){function t(){var e=this;hl(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new Tp(null),this.rootWheelEvent=new Pp(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,o=Zl(e.normalizeToPointerEvent(t,r));try{for(o.s();!(i=o.n()).done;){var a=i.value,s=e.bootstrapEvent(e.rootPointerEvent,a,r,t);e.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,o=Zl(e.normalizeToPointerEvent(t,i));try{for(o.s();!(r=o.n()).done;){var a=r.value,s=e.bootstrapEvent(e.rootPointerEvent,a,i,t);e.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}e.setCursor(e.context.eventService.cursor)}}return pl(t,[{key:"apply",value: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){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,o=Zl(e);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=n.bootstrapEvent(n.rootPointerEvent,a,i,t);n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),o=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",a=Zl(n.normalizeToPointerEvent(t,i));try{for(a.s();!(e=a.n()).done;){var s=e.value,c=n.bootstrapEvent(n.rootPointerEvent,s,i,t);c.type+=o,n.context.eventService.mapEvent(c)}}catch(t){a.e(t)}finally{a.f()}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=Zl(n.normalizeToPointerEvent(t,i));try{for(r.s();!(e=r.n()).done;){var o=e.value,a=n.bootstrapEvent(n.rootPointerEvent,o,i,t);n.context.eventService.mapEvent(a)}}catch(t){r.e(t)}finally{r.f()}n.setCursor(n.context.eventService.cursor)}))}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),o=i.x,a=i.y;t.viewport.x=o,t.viewport.y=a;var s=this.context.eventService.viewport2Canvas(t.viewport),c=s.x,l=s.y;return t.canvas.x=c,t.canvas.y=l,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=zd[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var o=this.context.eventService.viewport2Canvas(e.viewport),a=o.x,s=o.y;return e.canvas.x=a,e.canvas.y=s,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=$d.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}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];Y(i.button)&&(i.button=0),Y(i.buttons)&&(i.buttons=1),Y(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Y(i.width)&&(i.width=i.radiusX||1),Y(i.height)&&(i.height=i.radiusY||1),Y(i.tiltX)&&(i.tiltX=0),Y(i.tiltY)&&(i.tiltY=0),Y(i.pointerType)&&(i.pointerType="touch"),Y(i.pointerId)&&(i.pointerId=i.identifier||0),Y(i.pressure)&&(i.pressure=i.force||.5),Y(i.twist)&&(i.twist=0),Y(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;Y(o.isPrimary)&&(o.isPrimary=!0),Y(o.width)&&(o.width=1),Y(o.height)&&(o.height=1),Y(o.tiltX)&&(o.tiltX=0),Y(o.tiltY)&&(o.tiltY=0),Y(o.pointerType)&&(o.pointerType="mouse"),Y(o.pointerId)&&(o.pointerId=1),Y(o.pressure)&&(o.pressure=.5),Y(o.twist)&&(o.twist=0),Y(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n}}])}();ev.tag="Event";var nv=[tu.CIRCLE,tu.ELLIPSE,tu.IMAGE,tu.RECT,tu.LINE,tu.POLYLINE,tu.POLYGON,tu.TEXT,tu.PATH,tu.HTML],rv=function(){return pl((function t(){hl(this,t)}),[{key:"isVisible",value:function(t,e){var n,r=e.cullable;if(!r.enable)return!0;var i=e.getRenderBounds();if(uu.isEmpty(i))return!1;var o=t.getFrustum(),a=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return r.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,i,a||hu.INDETERMINATE,o.planes),r.visible=r.visibilityPlaneMask!==hu.OUTSIDE,r.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,r){if(n===hu.OUTSIDE||n===hu.INSIDE)return n;for(var i=hu.INSIDE,o=nv.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(se(u,e.getPositiveFarPoint(r[a]))+f<0)return hu.OUTSIDE;se(u,e.getNegativeFarPoint(r[a]))+f<0&&(i|=c)}}return i}}])}(),iv=function(){function t(){hl(this,t),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return pl(t,[{key:"apply",value: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){r.syncTasks.set(t.target,t.detail.affectChildren),i.dirtify()},u=function(t){var e=t.target;mg.enableSizeAttenuation&&mg.styleValueRegistry.updateSizeAttenuation(e,s.getCamera().getZoom())},f=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.syncTasks.delete(e),mg.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(t.tag,(function(){s.addEventListener($p.MOUNTED,u),s.addEventListener($p.UNMOUNTED,f),s.addEventListener($p.ATTR_MODIFIED,c),s.addEventListener($p.BOUNDS_CHANGED,l)})),i.hooks.destroy.tap(t.tag,(function(){s.removeEventListener($p.MOUNTED,u),s.removeEventListener($p.UNMOUNTED,f),s.removeEventListener($p.ATTR_MODIFIED,c),s.removeEventListener($p.BOUNDS_CHANGED,l),r.syncTasks.clear()}));var h=null!==(n=mg.globalThis.requestIdleCallback)&&void 0!==n?n:Jd.bind(mg.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()}))}},{key:"syncNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new uu),i.dirtyRenderBounds.update(r.center,r.halfExtents));var o=El(r.getMin(),2),a=o[0],s=o[1],c=El(r.getMax(),2),l=c[0],u=c[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=a,n.aabb.minY=s,n.aabb.maxX=l,n.aabb.maxY=u}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var o=t.syncNode(i,e);o&&(n.push(o),r.add(i))}};this.syncTasks.forEach((function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement})),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();iv.tag="Prepare";var ov=function(t){return 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",t}({}),av=new Np($p.MOUNTED),sv=new Np($p.UNMOUNTED),cv=new Np(ov.BEFORE_RENDER),lv=new Np(ov.RERENDER),uv=new Np(ov.AFTER_RENDER),fv=function(t){function e(t){var n;hl(this,e),(n=wl(this,e)).Element=Ng,n.inited=!1,n.context={};var r=t.container,i=t.canvas,o=t.renderer,a=t.width,s=t.height,c=t.background,l=t.cursor,u=t.supportsMutipleCanvasesInOneContainer,f=t.cleanUpOnDestroy,h=void 0===f||f,d=t.offscreenCanvas,p=t.devicePixelRatio,g=t.requestAnimationFrame,v=t.cancelAnimationFrame,y=t.createImage,m=t.supportsTouchEvents,b=t.supportsPointerEvents,x=t.isTouchEvent,w=t.isMouseEvent,k=t.dblClickSpeed,M=a,E=s,O=p||Rd&&window.devicePixelRatio||1;return O=O>=1?Math.ceil(O):1,i&&(M=a||function(t){var e=Fd(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/O,E=s||function(t){var e=Fd(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/O),n.customElements=new Kg,n.devicePixelRatio=O,n.requestAnimationFrame=null!=g?g:Jd.bind(mg.globalThis),n.cancelAnimationFrame=null!=v?v:tp.bind(mg.globalThis),n.supportsTouchEvents=null!=m?m:"ontouchstart"in mg.globalThis,n.supportsPointerEvents=null!=b?b:!!mg.globalThis.PointerEvent,n.isTouchEvent=null!=x?x:function(t){return n.supportsTouchEvents&&t instanceof mg.globalThis.TouchEvent},n.isMouseEvent=null!=w?w:function(t){return!mg.globalThis.MouseEvent||t instanceof mg.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof mg.globalThis.PointerEvent))},d&&(mg.offscreenCanvas=d),n.document=new Jg,n.document.defaultView=n,u||function(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;jd.has(r)&&jd.get(r).destroy(n),jd.set(r,e)}}(r,n,h),n.initRenderingContext(fl(fl({},t),{},{width:M,height:E,background:null!=c?c:"transparent",cursor:null!=l?l:"default",cleanUpOnDestroy:h,devicePixelRatio:O,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:null!=k?k:200,createImage:null!=y?y:function(){return new window.Image}})),n.initDefaultCamera(M,E,o.clipSpaceNearZ),n.initRenderer(o,!0),n}return Ml(e,t),pl(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var r=this,i=new mg.CameraContribution;i.clipSpaceNearZ=n,i.setType(Ru.EXPLORING,Iu.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(Bu,(function(){r.context.renderingContext.renderReasons.add(Dp.CAMERA_CHANGED),mg.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()})),this.context.camera=i}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){mg.styleValueRegistry.updateSizeAttenuation(e,t)}))}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"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}},{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;Of.clearCache(),e||this.dispatchEvent(new Np(ov.BEFORE_DESTROY)),this.frameId&&this.cancelAnimationFrame(this.frameId);var n=this.getRoot();t&&(this.unmountChildren(n),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&this.context.rBushRoot.clear(),e||this.dispatchEvent(new Np(ov.AFTER_DESTROY));var r=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};r(av),r(sv),r(cv),r(lv),r(uv),r(Ag),r(kg),r(Mg),r(Eg)}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value: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===Du.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new Np(ov.RESIZE,{width:t,height:e}))}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e=this;t&&(cv.detail=t,uv.detail=t),this.dispatchEvent(cv),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(lv)})),this.dispatchEvent(uv)}},{key:"run",value:function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new Jl,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new ev,new iv,new tv([new rv])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(fl(fl({},mg),this.context)),this.context.renderingService=new Bp(mg,this.context),this.context.eventService=new Rp(mg,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then((function(){e.initRenderingService(t,n)})).catch((function(t){console.error(t)}))}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init((function(){e.inited=!0,n?r?e.requestAnimationFrame((function(){e.dispatchEvent(new Np(ov.READY))})):e.dispatchEvent(new Np(ov.READY)):e.dispatchEvent(new Np(ov.RENDERER_CHANGED)),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()}))}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(mg)}))}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),yl((null==n?void 0:n.getPlugins())||[]).reverse().forEach((function(t){t.destroy(mg)})),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(sv):(sv.target=t,this.dispatchEvent(sv,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wd(t);this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,n||(t.isMutationObserved?t.dispatchEvent(av):(av.target=t,this.dispatchEvent(av,!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,n)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(Lp),hv=function(t){function e(){var t;hl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=wl(this,e,[].concat(r))).landmarks=[],t}return Ml(e,t),pl(e,[{key:"rotate",value:function(t,e,n){if(this.relElevation=mu(e),this.relAzimuth=mu(t),this.relRoll=mu(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Ru.EXPLORING){var r=xe(be(),[1,0,0],ku((this.rotateWorld?1:-1)*this.relElevation)),i=xe(be(),[0,1,0],ku((this.rotateWorld?1:-1)*this.relAzimuth)),o=xe(be(),[0,0,1],ku(this.relRoll)),a=we(be(),i,r);a=we(be(),a,o);var s=Ft(pt(),a);Et(this.matrix,this.matrix,[0,0,-this.distance]),Mt(this.matrix,this.matrix,s),Et(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===Ru.ORBITING||this.type===Ru.EXPLORING?this._getPosition():this.type===Ru.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=xu(t,e,0),r=Qt(this.position);return re(r,r,oe(Kt(),this.right,n[0])),re(r,r,oe(Kt(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var e=this.forward,n=Qt(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===Ru.ORBITING||this.type===Ru.EXPLORING?this._getDistance():this.type===Ru.TRACKING&&re(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(t){var e,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=o.position,s=void 0===a?this.position:a,c=o.focalPoint,l=void 0===c?this.focalPoint:c,u=o.roll,f=o.zoom,h=new mg.CameraContribution;h.setType(this.type,void 0),h.setPosition(s[0],null!==(e=s[1])&&void 0!==e?e:this.position[1],null!==(n=s[2])&&void 0!==n?n:this.position[2]),h.setFocalPoint(l[0],null!==(r=l[1])&&void 0!==r?r:this.focalPoint[1],null!==(i=l[2])&&void 0!==i?i:this.focalPoint[2]),h.setRoll(null!=u?u:this.roll),h.setZoom(null!=f?f:this.zoom);var d={name:t,matrix:gt(h.getWorldTransform()),right:Qt(h.right),up:Qt(h.up),forward:Qt(h.forward),position:Qt(h.getPosition()),focalPoint:Qt(h.getFocalPoint()),distanceVector:Qt(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}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=L(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=I(n)?{duration:n}:n,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;this.cancelLandmarkAnimation();var g,v=r.position,y=r.focalPoint,m=r.zoom,b=r.roll,x=u||mg.EasingFunction(a),w=function(){e.setFocalPoint(y),e.setPosition(v),e.setRoll(b),e.setZoom(m),e.computeMatrix(),e.triggerUpdate(),null==h||h()};if(0===c)return w();var k=function(t){void 0===g&&(g=t);var n=t-g;if(n>=c)w();else{var r,i,o=x(n/c),a=Kt(),s=Kt();if(le(a,e.focalPoint,y,o),le(s,e.position,v,o),i=e.roll*(1-o)+b*o,r=e.zoom*(1-o)+m*o,e.setFocalPoint(a),e.setPosition(s),e.setRoll(i),e.setZoom(r),pe(a,y)+pe(s,v)<=.01&&void 0===m&&void 0===b)return w();e.computeMatrix(),e.triggerUpdate(),n<c&&(null==p||p(o),e.landmarkAnimationID=e.canvas.requestAnimationFrame(k))}};this.canvas.requestAnimationFrame(k)}}}])}(zu);mg.CameraContribution=hv;
|
|
9
|
+
*/function Tl(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function Pl(t,e){var n=Math.min.apply(Math,yl(t)),r=Math.min.apply(Math,yl(e));return{x:n,y:r,width:Math.max.apply(Math,yl(t))-n,height:Math.max.apply(Math,yl(e))-r}}function Nl(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function Cl(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}function Ll(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(var d=0;d<u.length;d++){var p=Nl(t,0,n,r,i,u[d]);p<c&&(c=p),p>l&&(l=p)}for(var g=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),v=1/0,y=-1/0,m=[o,a],b=2*-Math.PI;b<=2*Math.PI;b+=Math.PI){var x=g+b;o<a?o<x&&x<a&&m.push(x):a<x&&x<o&&m.push(x)}for(var w=0;w<m.length;w++){var k=Cl(0,e,n,r,i,m[w]);k<v&&(v=k),k>y&&(y=k)}return{x:c,y:v,width:l-c,height:y-v}}function jl(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,yl(t.concat([d]))),i.apply(void 0,yl(e.concat([d])))],g=Tl(c[0],c[1],p[0],p[1]);g<s&&(a=d,s=g)}if(0===a)return{x:t[0],y:e[0]};if(1===a){var v=t.length;return{x:t[v-1],y:e[v-1]}}s=1/0;for(var y=0;y<32&&!(f<1e-4);y++){var m=a-f,b=a+f,x=[i.apply(void 0,yl(t.concat([m]))),i.apply(void 0,yl(e.concat([m])))],w=Tl(c[0],c[1],x[0],x[1]);if(m>=0&&w<s)a=m,s=w;else{var k=[i.apply(void 0,yl(t.concat([b]))),i.apply(void 0,yl(e.concat([b])))],M=Tl(c[0],c[1],k[0],k[1]);b<=1&&M<s?(a=b,s=M):f*=.5}}return{x:i.apply(void 0,yl(t.concat([a]))),y:i.apply(void 0,yl(e.concat([a])))}}function Rl(t,e,n,r){return Tl(t,e,n,r)}function Il(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}}function Dl(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];!function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s);var c=[i-t,o-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(c,s))}function Bl(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 Fl(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(D(s,0))D(c,0)||(i=-l/c)>=0&&i<=1&&u.push(i);else{var f=c*c-4*s*l;D(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 zl(t,e,n,r,i,o,a,s){for(var c=[t,a],l=[e,s],u=Fl(t,n,i,a),f=Fl(e,r,o,s),h=0;h<u.length;h++)c.push(Bl(t,n,i,a,u[h]));for(var d=0;d<f.length;d++)l.push(Bl(e,r,o,s,f[d]));return Pl(c,l)}function $l(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 jl([t,n,i,a],[e,r,o,s],c,l,Bl,u)}(t,e,n,r,i,o,a,s,c,l,u);return Tl(f.x,f.y,c,l)}function Wl(t){return function(t){if(t.length<2)return 0;for(var e=0,n=0;n<t.length-1;n++){var r=t[n],i=t[n+1];e+=Tl(r[0],r[1],i[0],i[1])}return e}(t)}function Gl(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Hl(t,e,n){var r=t+n-2*e;if(D(r,0))return[.5];var i=(t-e)/r;return i<=1&&i>=0?[i]:[]}function Yl(t,e,n,r,i,o){var a=Hl(t,n,i)[0],s=Hl(e,r,o)[0],c=[t,i],l=[e,o];return void 0!==a&&c.push(Gl(t,n,i,a)),void 0!==s&&l.push(Gl(e,r,o,s)),Pl(c,l)}function ql(t,e,n,r,i,o,a,s){var c=function(t,e,n,r,i,o,a,s){return jl([t,n,i],[e,r,o],a,s,Gl)}(t,e,n,r,i,o,a,s);return Tl(c.x,c.y,a,s)}function Vl(){Vl=function(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(t,e,n,r){Object.defineProperty(t,e,{value:n,enumerable:!r,configurable:!r,writable:!r})}try{c({},"")}catch(t){c=function(t,e,n){return t[e]=n}}function l(e,n,r,i){var o=n&&n.prototype instanceof h?n:h,a=Object.create(o.prototype);return c(a,"_invoke",function(e,n,r){var i=1;return function(o,a){if(3===i)throw Error("Generator is already running");if(4===i){if("throw"===o)throw a;return{value:t,done:!0}}for(r.method=o,r.arg=a;;){var s=r.delegate;if(s){var c=w(s,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(1===i)throw i=4,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=3;var l=u(e,n,r);if("normal"===l.type){if(i=r.done?4:2,l.arg===f)continue;return{value:l.arg,done:r.done}}"throw"===l.type&&(i=4,r.method="throw",r.arg=l.arg)}}}(e,r,new E(i||[])),!0),a}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f={};function h(){}function d(){}function p(){}var g={};c(g,o,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(O([])));y&&y!==n&&r.call(y,o)&&(g=y);var m=p.prototype=h.prototype=Object.create(g);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(i,o,a,s){var c=u(t[i],t,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==sl(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){n("next",t,a,s)}),(function(t){n("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return n("throw",t,a,s)}))}s(c.arg)}var i;c(this,"_invoke",(function(t,r){function o(){return new e((function(e,i){n(t,r,e,i)}))}return i=i?i.then(o,o):o()}),!0)}function w(e,n){var r=n.method,i=e.i[r];if(i===t)return n.delegate=null,"throw"===r&&e.i.return&&(n.method="return",n.arg=t,w(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=u(i,e.i,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,f;var a=o.arg;return a?a.done?(n[e.r]=a.value,n.next=e.n,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,f):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,f)}function k(t){this.tryEntries.push(t)}function M(e){var n=e[4]||{};n.type="normal",n.arg=t,e[4]=n}function E(t){this.tryEntries=[[-1]],t.forEach(k,this),this.reset(!0)}function O(e){if(null!=e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}throw new TypeError(sl(e)+" is not iterable")}return d.prototype=p,c(m,"constructor",p),c(p,"constructor",d),c(p,s,d.displayName="GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,s,"GeneratorFunction")),t.prototype=Object.create(m),t},e.awrap=function(t){return{__await:t}},b(x.prototype),c(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new x(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(m),c(m,s,"Generator"),c(m,o,(function(){return this})),c(m,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.unshift(r);return function t(){for(;n.length;)if((r=n.pop())in e)return t.value=r,t.done=!1,t;return t.done=!0,t}},e.values=O,E.prototype={constructor:E,reset:function(e){if(this.prev=this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(M),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(t){a.type="throw",a.arg=e,n.next=t}for(var i=n.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o[4],s=this.prev,c=o[1],l=o[2];if(-1===o[0])return r("end"),!1;if(!c&&!l)throw Error("try statement without catch or finally");if(null!=o[0]&&o[0]<=s){if(s<c)return this.method="next",this.arg=t,r(c),!0;if(s<l)return r(l),!1}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r[0]>-1&&r[0]<=this.prev&&this.prev<r[2]){var i=r;break}}i&&("break"===t||"continue"===t)&&i[0]<=e&&e<=i[2]&&(i=null);var o=i?i[4]:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i[2],f):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[2]===t)return this.complete(n[4],n[3]),M(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n[0]===t){var r=n[4];if("throw"===r.type){var i=r.arg;M(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={i:O(e),r:n,n:r},"next"===this.method&&(this.arg=t),f}},e}function Ul(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function Xl(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Ul(o,r,i,a,s,"next",t)}function s(t){Ul(o,r,i,a,s,"throw",t)}a(void 0)}))}}function Zl(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=vl(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function Kl(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;n[r]=t[r]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],-1===e.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==al||"undefined"!=typeof self&&self;var Ql={exports:{}};!function(t){t.exports=function(){function t(t,n,i,o,a){e(t,n,i||0,o||t.length-1,a||r)}function e(t,r,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,c=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),f=.5*Math.sqrt(l*u*(s-u)/s)*(c-s/2<0?-1:1);e(t,r,Math.max(i,Math.floor(r-c*u/s+f)),Math.min(o,Math.floor(r+(s-c)*u/s+f)),a)}var 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=y(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var o=e;o<n;o++){var a=t.children[o];c(i,t.leaf?r(a):a)}return i}function c(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function 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 v(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function m(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(!v(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;v(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(!v(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(v(t,o)){if(e.leaf||g(t,o))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=y([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,a=this.data,s=this.toBBox(t),c=[],l=[];a||c.length;){if(a||(a=c.pop(),r=c[c.length-1],n=l.pop(),i=!0),a.leaf){var u=o(t,a.children,e);if(-1!==u)return a.children.splice(u,1),c.push(a),this._condense(c),this}i||a.leaf||!g(a,s)?r?(n++,a=r.children[n],i=!1):a=null:(c.push(a),l.push(n),n=0,r=a,a=a.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,o=n-e+1,s=this._maxEntries;if(o<=s)return a(i=y(t.slice(e,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),(i=y([])).leaf=!1,i.height=r;var c=Math.ceil(o/s),l=c*Math.ceil(Math.sqrt(s));m(t,e,n,l,this.compareMinX);for(var u=e;u<=n;u+=l){var f=Math.min(u+l-1,n);m(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=y(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,o=1/0,a=e;a<=n-e;a++){var c=s(t,0,a,this.toBBox),l=s(t,a,n,this.toBBox),u=p(c,l),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}()}(Ql);var Jl=Ql.exports,tu=function(t){return t.GROUP="g",t.FRAGMENT="fragment",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",t}({}),eu=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),nu=function(){return pl((function t(){hl(this,t),this.plugins=[]}),[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)}))}}])}(),ru=function(){return pl((function t(e){hl(this,t),this.clipSpaceNearZ=eu.NEGATIVE_ONE,this.plugins=[],this.config=fl({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)}),[{key:"registerPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));-1===e&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find((function(e){return e.name===t}))}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),iu=re,ou=ee,au=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},su=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},cu=oe,lu=de,uu=function(){function t(){hl(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return pl(t,[{key:"update",value:function(t,e){ou(this.center,t),ou(this.halfExtents,e),lu(this.min,this.center,this.halfExtents),iu(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){iu(this.center,e,t),cu(this.center,this.center,.5),lu(this.halfExtents,e,t),cu(this.halfExtents,this.halfExtents,.5),ou(this.min,t),ou(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value: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,v=e.center,y=v[0],m=v[1],b=v[2],x=e.halfExtents,w=x[0],k=x[1],M=x[2],E=y-w,O=y+w,_=m-k,S=m+k,A=b-M,T=b+M;E<u&&(u=E),O>f&&(f=O),_<h&&(h=_),S>d&&(d=S),A<p&&(p=A),T>g&&(g=T),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}}},{key:"setFromTransformedAABB",value: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),v=Math.abs(s),y=Math.abs(c),m=Math.abs(l),b=Math.abs(u),x=Math.abs(f),w=Math.abs(h),k=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]+v*o[1]+y*o[2],r[1]=m*o[0]+b*o[1]+x*o[2],r[2]=w*o[0]+k*o[1]+M*o[2],lu(this.min,n,r),iu(this.max,n,r)}},{key:"intersects",value: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]}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,r=au([0,0,0],this.getMin(),e.getMin()),i=su([0,0,0],this.getMax(),e.getMax());return n.setMinMax(r,i),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?ou([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]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?ou([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]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),fu=function(){return pl((function t(e,n){hl(this,t),this.distance=e||0,this.normal=n||te(0,1,0),this.updatePNVertexFlag()}),[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return se(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/ge(this.normal);oe(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&i<=1;return o&&n&&le(n,t,e,i),o}}])}(),hu=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),du=function(){return pl((function t(e){if(hl(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new fu)}),[{key:"extractFromVPMatrix",value:function(t){var e=El(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],v=e[14],y=e[15];ne(this.planes[0].normal,o-n,l-a,d-u),this.planes[0].distance=y-p,ne(this.planes[1].normal,o+n,l+a,d+u),this.planes[1].distance=y+p,ne(this.planes[2].normal,o+r,l+s,d+f),this.planes[2].distance=y+g,ne(this.planes[3].normal,o-r,l-s,d-f),this.planes[3].distance=y-g,ne(this.planes[4].normal,o-i,l-c,d-h),this.planes[4].distance=y-v,ne(this.planes[5].normal,o+i,l+c,d+h),this.planes[5].distance=y+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}])}(),pu=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;hl(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return pl(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),gu=function(){function t(e,n,r,i){hl(this,t),this.x=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return pl(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var r=ye(e.x,e.y,0,1),i=ye(e.x+e.width,e.y,0,1),o=ye(e.x,e.y+e.height,0,1),a=ye(e.x+e.width,e.y+e.height,0,1),s=ve(),c=ve(),l=ve(),u=ve();me(s,r,n),me(c,i,n),me(l,o,n),me(u,a,n);var f=Math.min(s[0],c[0],l[0],u[0]),h=Math.min(s[1],c[1],l[1],u[1]),d=Math.max(s[0],c[0],l[0],u[0]),p=Math.max(s[1],c[1],l[1],u[1]);return t.fromRect({x:f,y:h,width:d-f,height:p-h})}}])}(),vu="Method not implemented.",yu="Use document.documentElement instead.";function mu(t){return void 0===t?0:t>360||t<-360?t%360:t}var bu=Kt();function xu(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return Array.isArray(t)&&3===t.length?r?Qt(t):ee(bu,t):I(t)?r?te(t,e,n):ne(bu,t,e,n):r?te(t[0],t[1]||e,t[2]||n):ne(bu,t[0],t[1]||e,t[2]||n)}var wu=Math.PI/180;function ku(t){return t*wu}var Mu=180/Math.PI;function Eu(t){return t*Mu}var Ou=Math.PI/2;function _u(t,e){return 16===e.length?function(t,e){var n,r,i=El(It(Kt(),e),3),o=i[0],a=i[1],s=i[2],c=Math.asin(-e[2]/o);return c<Ou?c>-Ou?(n=Math.atan2(e[6]/a,e[10]/s),r=Math.atan2(e[1]/o,e[0]/o)):(r=0,n=-Math.atan2(e[4]/a,e[5]/a)):(r=0,n=Math.atan2(e[4]/a,e[5]/a)),t[0]=n,t[1]=c,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]=Ou,t[1]=2*Math.atan2(r,n),t[2]=0):u<-.499995*l?(t[0]=-Ou,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 Su(t,e,n,r,i){var o,a,s,c,l,u,f,h,d,p,g=Math.cos(t),v=Math.sin(t);return o=r*g,a=i*v,s=0,c=-r*v,l=i*g,u=0,f=e,h=n,d=1,(p=new ft(9))[0]=o,p[1]=a,p[2]=s,p[3]=c,p[4]=l,p[5]=u,p[6]=f,p[7]=h,p[8]=d,p}function Au(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);if(e*i-n*r<0&&(e<i?o=-o:a=-a),o){var s=1/o;e*=s,n*=s}if(a){var c=1/a;r*=c,i*=c}var l=Eu(Math.atan2(n,e));return[t[6],t[7],o,a,l]}var Tu=pt(),Pu=pt(),Nu=ve(),Cu=[Kt(),Kt(),Kt()],Lu=Kt();function ju(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 Ru=function(t){return t[t.ORBITING=0]="ORBITING",t[t.EXPLORING=1]="EXPLORING",t[t.TRACKING=2]="TRACKING",t}({}),Iu=function(t){return t[t.DEFAULT=0]="DEFAULT",t[t.ROTATIONAL=1]="ROTATIONAL",t[t.TRANSLATIONAL=2]="TRANSLATIONAL",t[t.CINEMATIC=3]="CINEMATIC",t}({}),Du=function(t){return t[t.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",t[t.PERSPECTIVE=1]="PERSPECTIVE",t}({}),Bu="updated",Fu=2e-4,zu=function(){return pl((function t(){hl(this,t),this.clipSpaceNearZ=eu.NEGATIVE_ONE,this.eventEmitter=new _l,this.matrix=pt(),this.right=te(1,0,0),this.up=te(0,1,0),this.forward=te(0,0,1),this.position=te(0,0,1),this.focalPoint=te(0,0,0),this.distanceVector=te(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=pt(),this.projectionMatrixInverse=pt(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=Ru.EXPLORING,this.trackingMode=Iu.DEFAULT,this.projectionMode=Du.PERSPECTIVE,this.frustum=new du,this.orthoMatrix=pt()}),[{key:"isOrtho",value:function(){return this.projectionMode===Du.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value:function(t,e){return this.type=t,this.type===Ru.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===Ru.TRACKING&&void 0!==e&&this.setTrackingMode(e),this}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(t){if(this.type!==Ru.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return wt(pt(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=At(pt(),[t,e,0]);this.jitteredProjectionMatrix=Mt(pt(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setProjectionMatrix",value:function(t){this.projectionMatrix=t}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value:function(t){return this.projectionMode===Du.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this}},{key:"setFar",value:function(t){return this.projectionMode===Du.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this}},{key:"setViewOffset",value: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===Du.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}},{key:"clearViewOffset",value:function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===Du.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}},{key:"setZoom",value:function(t){return this.zoom=t,this.projectionMode===Du.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===Du.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this}},{key:"setZoomByViewportPoint",value: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=te(a.x-r,a.y-i,0),c=se(s,this.right)/Jt(this.right),l=se(s,this.up)/Jt(this.up),u=El(this.getPosition(),2),f=u[0],h=u[1],d=El(this.getFocalPoint(),2),p=d[0],g=d[1];return this.setPosition(f-c,h-l),this.setFocalPoint(p-c,g-l),this}},{key:"setPerspective",value:function(t,e,n,r){var i;this.projectionMode=Du.PERSPECTIVE,this.fov=n,this.near=t,this.far=e,this.aspect=r;var o=this.near*Math.tan(ku(.5*this.fov))/this.zoom,a=2*o,s=this.aspect*a,c=-.5*s;if(null!==(i=this.view)&&void 0!==i&&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){var s,c,l=2*o,u=n-e,f=r-i,h=l/u,d=l/f,p=(n+e)/u,g=(r+i)/f,v=a-o,y=a*o;arguments.length>7&&void 0!==arguments[7]&&arguments[7]?(s=-a/v,c=-y/v):(s=-(a+o)/v,c=-2*y/v),t[0]=h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=d,t[6]=0,t[7]=0,t[8]=p,t[9]=g,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=c,t[15]=0}(this.projectionMatrix,c,c+s,o-a,o,t,this.far,this.clipSpaceNearZ===eu.ZERO),wt(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,r,i,o){var a;this.projectionMode=Du.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&&a.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,v=(this.top-this.bottom)/this.view.fullHeight/this.zoom;h=(f+=g*this.view.offsetX)+g*this.view.width,p=(d-=v*this.view.offsetY)-v*this.view.height}return this.clipSpaceNearZ===eu.NEGATIVE_ONE?Gt(this.projectionMatrix,f,h,d,p,i,o):Ht(this.projectionMatrix,f,h,d,p,i,o),wt(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=xu(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(e),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],r=te(0,1,0);if(this.focalPoint=xu(t,e,n),this.trackingMode===Iu.CINEMATIC){var i=ie(Kt(),this.focalPoint,this.position);t=i[0],e=i[1],n=i[2];var o=Jt(i),a=Eu(Math.asin(e/o)),s=90+Eu(Math.atan2(n,t)),c=pt();St(c,c,ku(s)),_t(c,c,ku(a)),r=ue(Kt(),[0,1,0],c)}return wt(this.matrix,Yt(pt(),this.position,this.focalPoint,r)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<Fu&&(this.distance=Fu),this.dollyingStep=this.distance/100;var e=Kt();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}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(t){return this.azimuth=mu(t),this.computeMatrix(),this._getAxes(),this.type===Ru.ORBITING||this.type===Ru.EXPLORING?this._getPosition():this.type===Ru.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(t){return this.elevation=mu(t),this.computeMatrix(),this._getAxes(),this.type===Ru.ORBITING||this.type===Ru.EXPLORING?this._getPosition():this.type===Ru.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(t){return this.roll=mu(t),this.computeMatrix(),this._getAxes(),this.type===Ru.ORBITING||this.type===Ru.EXPLORING?this._getPosition():this.type===Ru.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var t=xe(be(),[0,0,1],ku(this.roll));bt(this.matrix);var e=xe(be(),[1,0,0],ku((this.rotateWorld&&this.type!==Ru.TRACKING||this.type===Ru.TRACKING?1:-1)*this.elevation)),n=xe(be(),[0,1,0],ku((this.rotateWorld&&this.type!==Ru.TRACKING||this.type===Ru.TRACKING?1:-1)*this.azimuth)),r=we(be(),n,e);r=we(be(),r,t);var i=Ft(pt(),r);this.type===Ru.ORBITING||this.type===Ru.EXPLORING?(Et(this.matrix,this.matrix,this.focalPoint),Mt(this.matrix,this.matrix,i),Et(this.matrix,this.matrix,[0,0,this.distance])):this.type===Ru.TRACKING&&(Et(this.matrix,this.matrix,this.position),Mt(this.matrix,this.matrix,i))}},{key:"_setPosition",value:function(t,e,n){this.position=xu(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()}},{key:"_getAxes",value:function(){ee(this.right,xu(me(ve(),[1,0,0,0],this.matrix))),ee(this.up,xu(me(ve(),[0,1,0,0],this.matrix))),ee(this.forward,xu(me(ve(),[0,0,1,0],this.matrix))),ae(this.right,this.right),ae(this.up,this.up),ae(this.forward,this.forward)}},{key:"_getAngles",value:function(){var t=this.distanceVector[0],e=this.distanceVector[1],n=this.distanceVector[2],r=Jt(this.distanceVector);if(0===r)return this.elevation=0,void(this.azimuth=0);this.type===Ru.TRACKING||this.rotateWorld?(this.elevation=Eu(Math.asin(e/r)),this.azimuth=Eu(Math.atan2(-t,-n))):(this.elevation=-Eu(Math.asin(e/r)),this.azimuth=-Eu(Math.atan2(-t,-n)))}},{key:"_getPosition",value:function(){ee(this.position,xu(me(ve(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){fe(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}(ht(),this.matrix)),re(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=ie(Kt(),this.focalPoint,this.position),this.distance=Jt(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===Du.ORTHOGRAPHIC){var t=this.position,e=xe(be(),[0,0,1],-this.roll*Math.PI/180);Bt(this.orthoMatrix,e,te((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),te(this.zoom,this.zoom,1),t)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=Mt(pt(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Bu)}}},{key:"rotate",value:function(t,e,n){throw new Error(vu)}},{key:"pan",value:function(t,e){throw new Error(vu)}},{key:"dolly",value:function(t){throw new Error(vu)}},{key:"createLandmark",value:function(t,e){throw new Error(vu)}},{key:"gotoLandmark",value:function(t,e){throw new Error(vu)}},{key:"cancelLandmarkAnimation",value:function(){throw new Error(vu)}}])}(),$u=function(t){return t[t.Standard=0]="Standard",t}({}),Wu=function(t){return t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED",t}({}),Gu={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new gu(0,0,0,0)},Hu=function(t){return 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>",t}({});function Yu(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function qu(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Vu(){}var Uu=.7,Xu=1/Uu,Zu="\\s*([+-]?\\d+)\\s*",Ku="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ju=/^#([0-9a-f]{3,8})$/,tf=new RegExp(`^rgb\\(${Zu},${Zu},${Zu}\\)$`),ef=new RegExp(`^rgb\\(${Qu},${Qu},${Qu}\\)$`),nf=new RegExp(`^rgba\\(${Zu},${Zu},${Zu},${Ku}\\)$`),rf=new RegExp(`^rgba\\(${Qu},${Qu},${Qu},${Ku}\\)$`),of=new RegExp(`^hsl\\(${Ku},${Qu},${Qu}\\)$`),af=new RegExp(`^hsla\\(${Ku},${Qu},${Qu},${Ku}\\)$`),sf={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 cf(){return this.rgb().formatHex()}function lf(){return this.rgb().formatRgb()}function uf(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ju.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?ff(e):3===n?new df(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?hf(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?hf(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=tf.exec(t))?new df(e[1],e[2],e[3],1):(e=ef.exec(t))?new df(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=nf.exec(t))?hf(e[1],e[2],e[3],e[4]):(e=rf.exec(t))?hf(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=of.exec(t))?bf(e[1],e[2]/100,e[3]/100,1):(e=af.exec(t))?bf(e[1],e[2]/100,e[3]/100,e[4]):sf.hasOwnProperty(t)?ff(sf[t]):"transparent"===t?new df(NaN,NaN,NaN,0):null}function ff(t){return new df(t>>16&255,t>>8&255,255&t,1)}function hf(t,e,n,r){return r<=0&&(t=e=n=NaN),new df(t,e,n,r)}function df(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function pf(){return`#${mf(this.r)}${mf(this.g)}${mf(this.b)}`}function gf(){const t=vf(this.opacity);return`${1===t?"rgb(":"rgba("}${yf(this.r)}, ${yf(this.g)}, ${yf(this.b)}${1===t?")":`, ${t})`}`}function vf(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function yf(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function mf(t){return((t=yf(t))<16?"0":"")+t.toString(16)}function bf(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new wf(t,e,n,r)}function xf(t){if(t instanceof wf)return new wf(t.h,t.s,t.l,t.opacity);if(t instanceof Vu||(t=uf(t)),!t)return new wf;if(t instanceof wf)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 wf(a,s,c,t.opacity)}function wf(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function kf(t){return(t=(t||0)%360)<0?t+360:t}function Mf(t){return Math.max(0,Math.min(1,t||0))}function Ef(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 Of(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];var a=e?e.apply(this,i):i[0],s=n.cache;if(s.has(a))return s.get(a);var c=t.apply(this,i);return n.cache=s.set(a,c)||s,c};return n.cache=new(Of.Cache||Map),Of.cacheList.push(n.cache),n}Yu(Vu,uf,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:cf,formatHex:cf,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return xf(this).formatHsl()},formatRgb:lf,toString:lf}),Yu(df,(function(t,e,n,r){return 1===arguments.length?function(t){return t instanceof Vu||(t=uf(t)),t?new df((t=t.rgb()).r,t.g,t.b,t.opacity):new df}(t):new df(t,e,n,null==r?1:r)}),qu(Vu,{brighter(t){return t=null==t?Xu:Math.pow(Xu,t),new df(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?Uu:Math.pow(Uu,t),new df(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new df(yf(this.r),yf(this.g),yf(this.b),vf(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:pf,formatHex:pf,formatHex8:function(){return`#${mf(this.r)}${mf(this.g)}${mf(this.b)}${mf(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:gf,toString:gf})),Yu(wf,(function(t,e,n,r){return 1===arguments.length?xf(t):new wf(t,e,n,null==r?1:r)}),qu(Vu,{brighter(t){return t=null==t?Xu:Math.pow(Xu,t),new wf(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?Uu:Math.pow(Uu,t),new wf(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 df(Ef(t>=240?t-240:t+120,i,r),Ef(t,i,r),Ef(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new wf(kf(this.h),Mf(this.s),Mf(this.l),vf(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=vf(this.opacity);return`${1===t?"hsl(":"hsla("}${kf(this.h)}, ${100*Mf(this.s)}%, ${100*Mf(this.l)}%${1===t?")":`, ${t})`}`}})),Of.Cache=Map,Of.cacheList=[],Of.clearCache=function(){Of.cacheList.forEach((function(t){return t.clear()}))};var _f=function(t){return 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",t}({}),Sf=function(t){return 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",t}({}),Af=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Tf=function(t){return t[t.kYes=0]="kYes",t[t.kNo=1]="kNo",t}({}),Pf=[{name:"em",unit_type:_f.kEms},{name:"px",unit_type:_f.kPixels},{name:"deg",unit_type:_f.kDegrees},{name:"rad",unit_type:_f.kRadians},{name:"grad",unit_type:_f.kGradians},{name:"ms",unit_type:_f.kMilliseconds},{name:"s",unit_type:_f.kSeconds},{name:"rem",unit_type:_f.kRems},{name:"turn",unit_type:_f.kTurns}],Nf=function(t){return 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",t}({}),Cf=function(t){return t?"number"===t?_f.kNumber:"percent"===t||"%"===t?_f.kPercentage:function(t){return Pf.find((function(e){return e.name===t})).unit_type}(t):_f.kUnknown},Lf=function(t){var e=1;switch(t){case _f.kPixels:case _f.kDegrees:case _f.kSeconds:break;case _f.kMilliseconds:e=.001;break;case _f.kRadians:e=180/Math.PI;break;case _f.kGradians:e=.9;break;case _f.kTurns:e=360}return e},jf=function(t){switch(t){case _f.kNumber:case _f.kInteger:return"";case _f.kPercentage:return"%";case _f.kEms:return"em";case _f.kRems:return"rem";case _f.kPixels:return"px";case _f.kDegrees:return"deg";case _f.kRadians:return"rad";case _f.kGradians:return"grad";case _f.kMilliseconds:return"ms";case _f.kSeconds:return"s";case _f.kTurns:return"turn"}return""},Rf=function(){return pl((function t(){hl(this,t)}),[{key:"toString",value:function(){return this.buildCSSText(Af.kNo,Tf.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=Nf.kUnitType&&this.getType()<=Nf.kClampType}}],[{key:"isAngle",value:function(t){return t===_f.kDegrees||t===_f.kRadians||t===_f.kGradians||t===_f.kTurns}},{key:"isLength",value:function(t){return t>=_f.kEms&&t<_f.kDegrees}},{key:"isRelativeUnit",value:function(t){return t===_f.kPercentage||t===_f.kEms||t===_f.kRems}},{key:"isTime",value:function(t){return t===_f.kSeconds||t===_f.kMilliseconds}}])}(),If=function(t){function e(t){var n;return hl(this,e),(n=wl(this,e)).colorSpace=t,n}return Ml(e,t),pl(e,[{key:"getType",value:function(){return Nf.kColorType}},{key:"to",value:function(t){return this}}])}(Rf),Df=function(t){return t[t.Constant=0]="Constant",t[t.LinearGradient=1]="LinearGradient",t[t.RadialGradient=2]="RadialGradient",t}({}),Bf=function(t){function e(t,n){var r;return hl(this,e),(r=wl(this,e)).type=t,r.value=n,r}return Ml(e,t),pl(e,[{key:"clone",value:function(){return new e(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return Nf.kColorType}}])}(Rf),Ff=function(t){function e(t){var n;return hl(this,e),(n=wl(this,e)).value=t,n}return Ml(e,t),pl(e,[{key:"clone",value:function(){return new e(this.value)}},{key:"getType",value:function(){return Nf.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}])}(Rf),zf=function(t){return function(t){switch(t){case Sf.kUNumber:return _f.kNumber;case Sf.kULength:return _f.kPixels;case Sf.kUPercent:return _f.kPercentage;case Sf.kUTime:return _f.kSeconds;case Sf.kUAngle:return _f.kDegrees;default:return _f.kUnknown}}(function(t){switch(t){case _f.kNumber:case _f.kInteger:return Sf.kUNumber;case _f.kPercentage:return Sf.kUPercent;case _f.kPixels:return Sf.kULength;case _f.kMilliseconds:case _f.kSeconds:return Sf.kUTime;case _f.kDegrees:case _f.kRadians:case _f.kGradians:case _f.kTurns:return Sf.kUAngle;default:return Sf.kUOther}}(t))},$f=function(t){function e(t){var n,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_f.kNumber;return hl(this,e),n=wl(this,e),r="string"==typeof i?Cf(i):i,n.unit=r,n.value=t,n}return Ml(e,t),pl(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){var e=t;return this.value===e.value&&this.unit===e.unit}},{key:"getType",value:function(){return Nf.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=zf(this.unit);if(n!==zf(t)||n===_f.kUnknown)return null;var r=Lf(this.unit)/Lf(t);return new e(this.value*r,t)}},{key:"buildCSSText",value:function(t,e,n){var r;switch(this.unit){case _f.kUnknown:break;case _f.kInteger:r=Number(this.value).toFixed(0);break;case _f.kNumber:case _f.kPercentage:case _f.kEms:case _f.kRems:case _f.kPixels:case _f.kDegrees:case _f.kRadians:case _f.kGradians:case _f.kMilliseconds:case _f.kSeconds:case _f.kTurns:var i=this.value,o=jf(this.unit);if(i<-999999||i>999999){var a=jf(this.unit);r=!Number.isFinite(i)||Number.isNaN(i)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(i,a):i+(a||"")}else r="".concat(i).concat(o)}return n+=r}}])}(Rf),Wf=new $f(0,"px");new $f(1,"px");var Gf=new $f(0,"deg"),Hf=function(t){function e(t,n,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return hl(this,e),(i=wl(this,e,["rgb"])).r=t,i.g=n,i.b=r,i.alpha=o,i.isNone=a,i}return Ml(e,t),pl(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(If),Yf=new Ff("unset"),qf={"":Yf,unset:Yf,initial:new Ff("initial"),inherit:new Ff("inherit")},Vf=new Hf(0,0,0,0,!0),Uf=new Hf(0,0,0,0),Xf=Of((function(t,e,n,r){return new Hf(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),Zf=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_f.kNumber;return new $f(t,e)};function Kf(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new $f(50,"%");var Qf=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,a=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,f=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,h=/^\(/,d=/^\)/,p=/^,/,g=/^\#([0-9a-fA-F]+)/,v=/^([a-zA-Z]+)/,y=/^rgb/i,m=/^rgba/i,b=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,x="";function w(t){throw new Error("".concat(x,": ").concat(t))}function k(){var t=C(M);return x.length>0&&w("Invalid input not EOF"),t}function M(){return E("linear-gradient",t,_)||E("repeating-linear-gradient",e,_)||E("radial-gradient",n,S)||E("repeating-radial-gradient",r,S)||E("conic-gradient",i,S)}function E(t,e,n){return O(e,(function(e){var r=n();return r&&(B(p)||w("Missing comma before color stops")),{type:t,orientation:r,colorStops:C(L)}}))}function O(t,e){var n=B(t);if(n){B(h)||w("Missing (");var r=e(n);return B(d)||w("Missing )"),r}}function _(){return D("directional",o,1)||D("angular",f,1)}function S(){var t,e,n=A();return n&&((t=[]).push(n),e=x,B(p)&&((n=A())?t.push(n):x=e)),t}function A(){var t=function(){var t=D("shape",/^(circle)/i,0);t&&(t.style=I()||T());return t}()||function(){var t=D("shape",/^(ellipse)/i,0);t&&(t.style=R()||T());return t}();if(t)t.at=P();else{var e=T();if(e){t=e;var n=P();n&&(t.at=n)}else{var r=N();r&&(t={type:"default-radial",at:r})}}return t}function T(){return D("extent-keyword",a,1)}function P(){if(D("position",/^at/,0)){var t=N();return t||w("Missing positioning value"),t}}function N(){var t={x:R(),y:R()};if(t.x||t.y)return{type:"position",value:t}}function C(t){var e=t(),n=[];if(e)for(n.push(e);B(p);)(e=t())?n.push(e):w("One extra comma");return n}function L(){var t=D("hex",g,1)||O(m,(function(){return{type:"rgba",value:C(j)}}))||O(y,(function(){return{type:"rgb",value:C(j)}}))||D("literal",v,0);return t||w("Expected color definition"),t.length=R(),t}function j(){return B(b)[1]}function R(){return D("%",l,1)||D("position-keyword",s,1)||I()}function I(){return D("px",c,1)||D("em",u,1)}function D(t,e,n){var r=B(e);if(r)return{type:t,value:r[n]}}function B(t){var e=/^[\n\r\t\s]+/.exec(x);e&&F(e[0].length);var n=t.exec(x);return n&&F(n[0].length),n}function F(t){x=x.substring(t)}return function(t){return x=t,k()}}();var Jf=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,th=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,eh=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,nh=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var rh={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},ih=Of((function(t){var e;return e="angular"===t.type?Number(t.value):rh[t.value]||0,Zf(e,"deg")})),oh=Of((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:Zf(e,r),cy:Zf(n,i)}})),ah=Of((function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Qf(t).map((function(t){var e=t.type,n=t.orientation,r=t.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,o=Number(t[0].length.value),a=1;a<r;a++){var s,c=null===(s=t[a].length)||void 0===s?void 0:s.value;if(!b(c)&&!b(o)){for(var l=1;l<a-i;l++)t[i+l].length={type:"%",value:"".concat(o+(Number(c)-o)*l/(a-i))};i=a,o=Number(c)}}}(r);var i=r.map((function(t){return{offset:Zf(Number(t.length.value),"%"),color:Kf(t)}}));if("linear-gradient"===e)return new Bf(Df.LinearGradient,{angle:n?ih(n):Gf,steps:i});if("radial-gradient"===e&&(n||(n=[{type:"shape",value:"circle"}]),"shape"===n[0].type&&"circle"===n[0].value)){var o,a=oh(n[0].at),s=a.cx,c=a.cy;if(n[0].style){var l=n[0].style,u=l.type,f=l.value;o="extent-keyword"===u?function(t){return qf[t]||(qf[t]=new Ff(t)),qf[t]}(f):Zf(f,u)}return new Bf(Df.RadialGradient,{cx:s,cy:c,size:o,steps:i})}}));var e=t[0];if("("===t[1]||"("===t[2])if("l"===e){var n=Jf.exec(t);if(n){var r,i=(null===(r=n[2].match(nh))||void 0===r?void 0:r.map((function(t){return t.split(":")})))||[];return[new Bf(Df.LinearGradient,{angle:Zf(parseFloat(n[1]),"deg"),steps:i.map((function(t){var e=El(t,2),n=e[0],r=e[1];return{offset:Zf(100*Number(n),"%"),color:r}}))})]}}else if("r"===e){var o=function(t){var e=th.exec(t);if(e){var n,r=(null===(n=e[4].match(nh))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:Zf(50,"%"),cy:Zf(50,"%"),steps:r.map((function(t){var e=El(t,2),n=e[0],r=e[1];return{offset:Zf(100*Number(n),"%"),color:r}}))}}return null}(t);if(o){if(!L(o))return[new Bf(Df.RadialGradient,o)];t=o}}else if("p"===e)return function(t){var e=eh.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 sh(t){return t&&!!t.image}function ch(t){return t&&!b(t.r)&&!b(t.g)&&!b(t.b)}var lh=Of((function(t){if(sh(t))return fl({repetition:"repeat"},t);if(b(t)&&(t=""),"transparent"===t)return Uf;if("currentColor"===t)t="black";else if("none"===t)return Vf;var e=ah(t);if(e)return e;var n=uf(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),Xf.apply(void 0,r)}));function uh(t,e){if(ch(t)&&ch(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(R(e[n],0,255));return e[3]=R(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function fh(t,e){if(b(e))return Zf(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return Zf(Number(e),"px");if("deg".search(t)>=0)return Zf(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U".concat(t)}));var r="U(".concat(t.source,")");return n.map((function(t){return Zf(Number(e.replace(new RegExp("U".concat(t),"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var hh=function(t){return fh(new RegExp("px","g"),t)},dh=Of(hh);Of((function(t){return fh(new RegExp("%","g"),t)}));var ph=function(t){return I(t)||isFinite(Number(t))?Zf(Number(t)||0,"px"):fh(new RegExp("px|%|em|rem","g"),t)},gh=Of(ph),vh=function(t){return fh(new RegExp("deg|rad|grad|turn","g"),t)},yh=Of(vh);function mh(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o="",a=t.value||0,s=e.value||0,c=zf(t.unit),l=t.convertTo(c),u=e.convertTo(c);return l&&u?(a=l.value,s=u.value,o=jf(t.unit)):($f.isLength(t.unit)||$f.isLength(e.unit))&&(a=wh(t,i,n),s=wh(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function bh(t){var e=0;return t.unit===_f.kDegrees?e=t.value:t.unit===_f.kRadians?e=Eu(Number(t.value)):t.unit===_f.kTurns?e=360*Number(t.value):t.value&&(e=t.value),e}function xh(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):L(t)?n=t.split(" ").map((function(t){return Number(t)})):I(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:4===e?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]]:"even"===e&&n.length%2==1?[].concat(yl(n),yl(n)):n}function wh(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===_f.kPixels)return Number(t.value);if(t.unit===_f.kPercentage&&n){var i=n.nodeName===tu.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[e]:0)+t.value/100*i.halfExtents[e]*2}return 0}var kh=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Mh(t){return t.toString()}var Eh=function(t){return"number"==typeof t?Zf(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Zf(Number(t)):Zf(0)},Oh=Of(Eh);function _h(t,e){return[t,e,Mh]}function Sh(t,e){return function(n,r){return[n,r,function(n){return Mh(R(n,t,e))}]}}function Ah(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function Th(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=xn(t.parsedStyle.d.absolutePath,void 0,Ce(Ce({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function Ph(t,e){return t[0]===e[0]&&t[1]===e[1]}function Nh(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)||D(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 Ch(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}Of((function(t){return L(t)?t.split(" ").map(Oh):t.map(Oh)}));var Lh=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)},jh=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var c=ku(r=z(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),n*=Math.sqrt(h));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),v=p*(-n*f.x/e),y={x:Math.cos(c)*g-Math.sin(c)*v+(t.x+a.x)/2,y:Math.sin(c)*g+Math.cos(c)*v+(t.y+a.y)/2},m={x:(f.x-g)/e,y:(f.y-v)/n},b=Lh({x:1,y:0},m),x=Lh(m,{x:(-f.x-g)/e,y:(-f.y-v)/n});!o&&x>0?x-=2*Math.PI:o&&x<0&&(x+=2*Math.PI);var w=b+(x%=2*Math.PI)*s,k=e*Math.cos(w),M=n*Math.sin(w);return{x:Math.cos(c)*k-Math.sin(c)*M+y.x,y:Math.sin(c)*k+Math.cos(c)*M+y.y,ellipticalArcStartAngle:b,ellipticalArcEndAngle:b+x,ellipticalArcAngle:w,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function Rh(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],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=jh({x:t.prePoint[0],y:t.prePoint[1]},o,s,c,!!l,!!u,{x:t.currentPoint[0],y:t.currentPoint[1]},e),h=jh({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 Ih(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Dh(t,e){return Ih(t)*Ih(e)?(t[0]*e[0]+t[1]*e[1])/(Ih(t)*Ih(e)):1}function Bh(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Dh(t,e))}function Fh(t,e){var n=e[1],r=e[2],i=z(ku(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 v=r?g*n*h/r:0,y=n?g*-r*f/n:0,m=(s+l)/2+Math.cos(i)*v-Math.sin(i)*y,b=(c+u)/2+Math.sin(i)*v+Math.cos(i)*y,x=[(f-v)/n,(h-y)/r],w=[(-1*f-v)/n,(-1*h-y)/r],k=Bh([1,0],x),M=Bh(x,w);return Dh(x,w)<=-1&&(M=Math.PI),Dh(x,w)>=1&&(M=0),0===a&&M>0&&(M-=2*Math.PI),1===a&&M<0&&(M+=2*Math.PI),{cx:m,cy:b,rx:Ph(t,[l,u])?0:n,ry:Ph(t,[l,u])?0:r,startAngle:k,endAngle:k+M,xRotation:i,arcFlag:o,sweepFlag:a}}function zh(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 $h(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.getLocalTransform(),n=[];switch(t.nodeName){case tu.LINE:var r=t.parsedStyle,i=r.x1,o=void 0===i?0:i,a=r.y1,s=void 0===a?0:a,c=r.x2,l=void 0===c?0:c,u=r.y2;n=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(o,s,l,void 0===u?0:u);break;case tu.CIRCLE:var f=t.parsedStyle,h=f.r,d=void 0===h?0:h,p=f.cx,g=void 0===p?0:p,v=f.cy;n=zh(d,d,g,void 0===v?0:v);break;case tu.ELLIPSE:var y=t.parsedStyle,m=y.rx,b=void 0===m?0:m,x=y.ry,w=void 0===x?0:x,k=y.cx,M=void 0===k?0:k,E=y.cy;n=zh(b,w,M,void 0===E?0:E);break;case tu.POLYLINE:case tu.POLYGON:n=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(t.parsedStyle.points.points,t.nodeName===tu.POLYGON);break;case tu.RECT:var O=t.parsedStyle,_=O.width,S=void 0===_?0:_,A=O.height,T=void 0===A?0:A,P=O.x,N=void 0===P?0:P,C=O.y,L=void 0===C?0:C,j=O.radius,I=j&&j.some((function(t){return 0!==t}));n=function(t,e,n,r,i){if(i){var o=El(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"]]}(S,T,N,L,I&&j.map((function(t){return R(t,0,Math.min(Math.abs(S)/2,Math.abs(T)/2))})));break;case tu.PATH:n=yl(t.parsedStyle.d.absolutePath)}if(n.length)return function(t,e,n){return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=te(e[1],e[2],0);n&&ue(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=te(e[1],e[2],0),a=te(e[3],e[4],0),s=te(e[5],e[6],0);n&&(ue(o,o,n),ue(a,a,n),ue(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=te(e[6],e[7],0);n&&ue(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 if("Q"===e[0]){var l=te(e[1],e[2],0),u=te(e[3],e[4],0);n&&(ue(l,l,n),ue(u,u,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r}),"")}(n,0,e)}var Wh=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=rn(t)}catch(n){e=rn(""),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&&Ph(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=Fh(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]&&Ph(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){var v=e[s-1],y=Ch(v.currentPoint,p);"Q"===v.command?(u.command="Q",u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===l){var m=[c[1],c[2]],b=[c[3],c[4]];u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-b[0],n[1]-b[1]],0===u.startTangent[0]&&0===u.startTangent[1]&&(u.startTangent=[m[0]-b[0],m[1]-b[1]]),0===u.endTangent[0]&&0===u.endTangent[1]&&(u.endTangent=[b[0]-m[0],b[1]-m[1]])}else if("S"===l){var x=e[s-1],w=Ch(x.currentPoint,p),k=[c[1],c[2]];"C"===x.command?(u.command="C",u.startTangent=[p[0]-w[0],p[1]-w[1]],u.endTangent=[n[0]-k[0],n[1]-k[1]]):(u.command="SQ",u.startTangent=[p[0]-k[0],p[1]-k[1]],u.endTangent=[n[0]-k[0],n[1]-k[1]])}else if("A"===l){var M=Rh(u,0),E=M.x,O=M.y,_=Rh(u,1,!1),S=_.x,A=_.y;u.startTangent=[E,O],u.endTangent=[S,A]}e.push(u)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;o<t.length;o++){var a=t[o],s=a.currentPoint,c=a.params,l=a.prePoint,u=void 0;switch(a.command){case"Q":u=Yl(l[0],l[1],c[1],c[2],c[3],c[4]);break;case"C":u=zl(l[0],l[1],c[1],c[2],c[3],c[4],c[5],c[6]);break;case"A":var f=a.arcParams;u=Ll(f.cx,f.cy,f.rx,f.ry,f.xRotation,f.startAngle,f.endAngle);break;default:n.push(s[0]),r.push(s[1])}u&&(a.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height)),e&&("L"===a.command||"M"===a.command)&&a.prePoint&&a.nextPoint&&i.push(a)}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 h=N(n),d=N(r),p=P(n),g=P(r);if(0===i.length)return{x:h,y:d,width:p-h,height:g-d};for(var v=0;v<i.length;v++){var y=i[v],m=y.currentPoint;m[0]===h?h-=Nh(y,e).xExtra:m[0]===p&&(p+=Nh(y,e).xExtra),m[1]===d?d-=Nh(y,e).yExtra:m[1]===g&&(g+=Nh(y,e).yExtra)}return{x:h,y:d,width:p-h,height:g-d}}(a,0),c=s.x,l=s.y,u=s.width,f=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(c)?c:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(f)?f:0}}},Gh=Of(Wh);function Hh(t){return L(t)?Gh(t):Wh(t)}function Yh(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=un(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=un(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=En(r,i));var a,s,c=kn(o[0])!==kn(o[1])?(a=o[0],s=a.slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):function(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}(o[0]);return[c,wn(o[1],c),function(t){return t}]}function qh(t,e){return[t.points,e.points,function(t){return t}]}var Vh=null,Uh=/\s*(\w+)\(([^)]*)\)/g;function Xh(t){return function(e){var n=0;return t.map((function(t){return t===Vh?e[n++]:t}))}}function Zh(t){return t}var Kh={matrix:["NNNNNN",[Vh,Vh,0,0,Vh,Vh,0,0,0,0,1,0,Vh,Vh,0,1],Zh],matrix3d:["NNNNNNNNNNNNNNNN",Zh],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Xh([Vh,Vh,new $f(1)]),Zh],scaleX:["N",Xh([Vh,new $f(1),new $f(1)]),Xh([Vh,new $f(1)])],scaleY:["N",Xh([new $f(1),Vh,new $f(1)]),Xh([new $f(1),Vh])],scaleZ:["N",Xh([new $f(1),new $f(1),Vh])],scale3d:["NNN",Zh],skew:["Aa",null,Zh],skewX:["A",null,Xh([Vh,Gf])],skewY:["A",null,Xh([Gf,Vh])],translate:["Tt",Xh([Vh,Vh,Wf]),Zh],translateX:["T",Xh([Vh,Wf,Wf]),Xh([Vh,Wf])],translateY:["T",Xh([Wf,Vh,Wf]),Xh([Wf,Vh])],translateZ:["L",Xh([Wf,Wf,Vh])],translate3d:["TTL",Zh]};function Qh(t){for(var e=[],n=t.length,r=0;r<n;r++){var i=t[r],o=i[0],a=i.slice(1);if("translate"===o||"skew"===o?1===a.length&&a.push(0):"scale"===o&&1===a.length&&a.push(a[0]),!Kh[o])return[];var s=a.map((function(t){return Zf(t)}));e.push({t:o,d:s})}return e}function Jh(t){if(Array.isArray(t))return Qh(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Uh.lastIndex=0;e=Uh.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],o=Kh[i];if(!o)return[];var a=e[2].split(","),s=o[0];if(s.length<a.length)return[];for(var c=[],l=0;l<s.length;l++){var u=a[l],f=s[l],h=void 0;if(h=u?{A:function(t){return"0"===t.trim()?Gf:yh(t)},N:Oh,T:gh,L:dh}[f.toUpperCase()](u):{a:Gf,n:c[0],t:Wf}[f],void 0===h)return[];c.push(h)}if(n.push({t:i,d:c}),Uh.lastIndex===t.length)return n}return[]}function td(t){if(Array.isArray(t))return Qh(t);if("none"===(t=(t||"none").trim()))return[];var e,n=[],r=0;for(Uh.lastIndex=0;e=Uh.exec(t);){if(e.index!==r)return[];r=e.index+e[0].length;var i=e[1],o=Kh[i];if(!o)return[];var a=e[2].split(","),s=o[0];if(s.length<a.length)return[];for(var c=[],l=0;l<s.length;l++){var u=a[l],f=s[l],h=void 0;if(h=u?{A:function(t){return"0"===t.trim()?Gf:vh(t)},N:Eh,T:ph,L:hh}[f.toUpperCase()](u):{a:Gf,n:c[0],t:Wf}[f],void 0===h)return[];c.push(h)}if(n.push({t:i,d:c}),Uh.lastIndex===t.length)return n}return[]}function ed(t){var e,n,r,i;switch(t.t){case"rotateX":return i=ku(bh(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=ku(bh(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=ku(bh(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=ku(bh(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=ku(bh(t.d[0])),f=ku(bh(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=ku(bh(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=ku(bh(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=wh(t.d[0],0,null)||0,n=wh(t.d[1],0,null)||0,0,1];case"translateX":return[1,0,0,0,0,1,0,0,0,0,1,0,e=wh(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=wh(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=wh(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=wh(t.d[0],0,null)||0,n=wh(t.d[1],0,null)||0,r=wh(t.d[2],0,null)||0,1];case"perspective":var h=wh(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 nd(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 rd(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}(Tu,t))return!1;if(vt(Pu,Tu),Pu[3]=0,Pu[7]=0,Pu[11]=0,Pu[15]=1,Math.abs(kt(Pu))<1e-8)return!1;var a,s,c=Tu[3],l=Tu[7],u=Tu[11],f=Tu[12],h=Tu[13],d=Tu[14],p=Tu[15];if(0!==c||0!==l||0!==u){if(Nu[0]=c,Nu[1]=l,Nu[2]=u,Nu[3]=p,!wt(Pu,Pu))return!1;xt(Pu,Pu),me(i,Nu,Pu)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=f,e[1]=h,e[2]=d,s=Tu,(a=Cu)[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]=Jt(Cu[0]),ae(Cu[0],Cu[0]),r[0]=se(Cu[0],Cu[1]),ju(Cu[1],Cu[1],Cu[0],1,-r[0]),n[1]=Jt(Cu[1]),ae(Cu[1],Cu[1]),r[0]/=n[1],r[1]=se(Cu[0],Cu[2]),ju(Cu[2],Cu[2],Cu[0],1,-r[1]),r[2]=se(Cu[1],Cu[2]),ju(Cu[2],Cu[2],Cu[1],1,-r[2]),n[2]=Jt(Cu[2]),ae(Cu[2],Cu[2]),r[1]/=n[2],r[2]/=n[2],ce(Lu,Cu[1],Cu[2]),se(Cu[0],Lu)<0)for(var g=0;g<3;g++)n[g]*=-1,Cu[g][0]*=-1,Cu[g][1]*=-1,Cu[g][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+Cu[0][0]-Cu[1][1]-Cu[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-Cu[0][0]+Cu[1][1]-Cu[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-Cu[0][0]-Cu[1][1]+Cu[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+Cu[0][0]+Cu[1][1]+Cu[2][2],0)),Cu[2][1]>Cu[1][2]&&(o[0]=-o[0]),Cu[0][2]>Cu[2][0]&&(o[1]=-o[1]),Cu[1][0]>Cu[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(ed).reduce(nd)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var id=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(var c=0;c<3;c++)for(var l=0;l<3;l++)a[3][c]+=e[l]*a[l][c];var u=i[0],f=i[1],h=i[2],d=i[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(f*f+h*h),p[0][1]=2*(u*f-h*d),p[0][2]=2*(u*h+f*d),p[1][0]=2*(u*f+h*d),p[1][1]=1-2*(u*u+h*h),p[1][2]=2*(f*h-u*d),p[2][0]=2*(u*h-f*d),p[2][1]=2*(f*h+u*d),p[2][2]=1-2*(u*u+f*f),a=t(a,p);var g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(g[2][1]=r[2],a=t(a,g)),r[1]&&(g[2][1]=0,g[2][0]=r[0],a=t(a,g)),r[0]&&(g[2][0]=0,g[1][0]=r[0],a=t(a,g));for(var v=0;v<3;v++)for(var y=0;y<3;y++)a[v][y]*=n[v];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 od(t){return t.toFixed(6).replace(".000000","")}function ad(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=rd(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=rd(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[r];return n}(t,e);r=R(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return id(t[0],t[1],t[2],e,t[4]).map(od).join(",")}])}function sd(t){return t.replace(/[XY]/,"")}function cd(t){return t.replace(/(X|Y|Z|3d)?$/,"3d")}function ld(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[o],r=n.t,i=n.d,a="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map((function(t){return"number"==typeof t?Zf(a):Zf(a,t.unit)}))})},o=0;o<t.length;o++)i()}var a,s,c=[],l=[],u=[];if(t.length!==e.length){var f=ad(t,e);c=[f[0]],l=[f[1]],u=[["matrix",[f[2]]]]}else for(var h=0;h<t.length;h++){var d=t[h].t,p=e[h].t,g=t[h].d,v=e[h].d,y=Kh[d],m=Kh[p],b=void 0;if(s=p,"perspective"===(a=d)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var x=ad([t[h]],[e[h]]);c.push(x[0]),l.push(x[1]),u.push(["matrix",[x[2]]])}else{if(d===p)b=d;else if(y[2]&&m[2]&&sd(d)===sd(p))b=sd(d),g=y[2](g),v=m[2](v);else{if(!y[1]||!m[1]||cd(d)!==cd(p)){var w=ad(t,e);c=[w[0]],l=[w[1]],u=[["matrix",[w[2]]]];break}b=cd(d),g=y[1](g),v=m[1](v)}for(var k=[],M=[],E=[],O=0;O<g.length;O++){var _=mh(g[O],v[O],n,!1,O);k[O]=_[0],M[O]=_[1],E.push(_[2])}c.push(k),l.push(M),u.push([b,E])}}if(r){var S=c;c=l,l=S}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"),"".concat(u[e][0],"(").concat(n,")")})).join(" ")}]}var ud=Of((function(t){if(L(t)){if("text-anchor"===t)return[Zf(0,"px"),Zf(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:[gh(fd(e[0])),gh(fd(e[1]))]}return[Zf(t[0]||0,"px"),Zf(t[1]||0,"px")]}));function fd(t){return"center"===t?"50%":"left"===t||"top"===t?"0%":"right"===t||"bottom"===t?"100%":t}var hd=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Hu.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Hu.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Hu.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Hu.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Hu.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Hu.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Hu.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Hu.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Hu.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:Hu.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Hu.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Hu.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Hu.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Hu.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:Hu.FILTER},{n:"clipPath",syntax:Hu.DEFINED_PATH},{n:"textPath",syntax:Hu.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Hu.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:Hu.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:Hu.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:Hu.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:Hu.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:Hu.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:Hu.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:Hu.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Hu.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Hu.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Hu.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Hu.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Hu.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Hu.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Hu.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Hu.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:Hu.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Hu.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Hu.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Hu.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Hu.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:Hu.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Hu.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Hu.NUMBER,d:function(t){return t===tu.PATH||t===tu.POLYGON||t===tu.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:Hu.MARKER},{n:"markerEnd",syntax:Hu.MARKER},{n:"markerMid",syntax:Hu.MARKER},{n:"markerStartOffset",syntax:Hu.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Hu.LENGTH,l:!0,int:!0,d:"0"}],dd=new Set(hd.filter((function(t){return!!t.l})).map((function(t){return t.n}))),pd={},gd=function(){return pl((function t(e){var n=this;hl(this,t),this.runtime=e,hd.forEach((function(t){n.registerMetadata(t)}))}),[{key:"registerMetadata",value:function(t){[t.n].concat(yl(t.a||[])).forEach((function(e){pd[e]=t}))}},{key:"getPropertySyntax",value:function(t){return this.runtime.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var r=t.parsedStyle.clipPath,i=t.parsedStyle.offsetPath;!function(t,e){var n=vd(t);for(var r in e)n.has(r)&&(t.parsedStyle[r]=e[r])}(t,e);var o=!!n.forceUpdateGeometry;if(!o)for(var a in e)if(dd.has(a)){o=!0;break}var s,c,l=vd(t);l.has("fill")&&e.fill&&(t.parsedStyle.fill=lh(e.fill)),l.has("stroke")&&e.stroke&&(t.parsedStyle.stroke=lh(e.stroke)),l.has("shadowColor")&&e.shadowColor&&(t.parsedStyle.shadowColor=lh(e.shadowColor)),l.has("filter")&&e.filter&&(t.parsedStyle.filter=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("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,kh.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return fh(/deg|rad|grad|turn|px|%/g,t)||lh(t)}))}),n.lastIndex===t.length)return r}return[]}(e.filter)),l.has("radius")&&!b(e.radius)&&(t.parsedStyle.radius=xh(e.radius,4)),l.has("lineDash")&&!b(e.lineDash)&&(t.parsedStyle.lineDash=xh(e.lineDash,"even")),l.has("points")&&e.points&&(t.parsedStyle.points=(s=e.points,c=L(s)?s.split(" ").map((function(t){var e=El(t.split(","),2),n=e[0],r=e[1];return[Number(n),Number(r)]})):s,{points:c,totalLength:0,segments:[]})),l.has("d")&&""===e.d&&(t.parsedStyle.d=fl({},Gu)),l.has("d")&&e.d&&(t.parsedStyle.d=Hh(e.d)),l.has("textTransform")&&e.textTransform&&this.runtime.CSSPropertySyntaxFactory[Hu.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),l.has("clipPath")&&!Y(e.clipPath)&&this.runtime.CSSPropertySyntaxFactory[Hu.DEFINED_PATH].calculator("clipPath",r,e.clipPath,t,this.runtime),l.has("offsetPath")&&e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[Hu.DEFINED_PATH].calculator("offsetPath",i,e.offsetPath,t,this.runtime),l.has("transform")&&e.transform&&(t.parsedStyle.transform=Jh(e.transform)),l.has("transformOrigin")&&e.transformOrigin&&(t.parsedStyle.transformOrigin=ud(e.transformOrigin)),l.has("markerStart")&&e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[Hu.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),l.has("markerEnd")&&e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[Hu.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),l.has("markerMid")&&e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[Hu.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),l.has("zIndex")&&!b(e.zIndex)&&this.runtime.CSSPropertySyntaxFactory[Hu.Z_INDEX].postProcessor(t),l.has("offsetDistance")&&!b(e.offsetDistance)&&this.runtime.CSSPropertySyntaxFactory[Hu.OFFSET_DISTANCE].postProcessor(t),l.has("transform")&&e.transform&&this.runtime.CSSPropertySyntaxFactory[Hu.TRANSFORM].postProcessor(t),l.has("transformOrigin")&&e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[Hu.TRANSFORM_ORIGIN].postProcessor(t),o&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var r=t.geometry;r.contentBounds||(r.contentBounds=new uu),r.renderBounds||(r.renderBounds=new uu);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,v=o.hdepth,y=void 0===v?0:v,m=[Math.abs(d),Math.abs(g),y],b=i.stroke,x=i.lineWidth,w=void 0===x?1:x,k=i.increasedLineWidthForHitTesting,M=void 0===k?0:k,E=i.shadowType,O=void 0===E?"outer":E,_=i.shadowColor,S=i.filter,A=void 0===S?[]:S,T=i.transformOrigin,P=[s,l,f];r.contentBounds.update(P,m);var N=e===tu.POLYLINE||e===tu.POLYGON||e===tu.PATH?Math.SQRT2:.5;if(b&&!b.isNone){var C=((w||0)+(M||0))*N;m[0]+=C,m[1]+=C}if(r.renderBounds.update(P,m),_&&O&&"inner"!==O){var L=r.renderBounds,j=L.min,R=L.max,I=i.shadowBlur||0,D=i.shadowOffsetX||0,B=i.shadowOffsetY||0,F=j[0]-I+D,z=R[0]+I+D,$=j[1]-I+B,W=R[1]+I+B;j[0]=Math.min(j[0],F),R[0]=Math.max(R[0],z),j[1]=Math.min(j[1],$),R[1]=Math.max(R[1],W),r.renderBounds.setMinMax(j,R)}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,re(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 G=g<0,H=(d<0?-1:1)*(T?wh(T[0],0,t,!0):0),Y=(G?-1:1)*(T?wh(T[1],1,t,!0):0);(H||Y)&&t.setOrigin(H,Y)}}},{key:"updateSizeAttenuation",value: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===tu.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===tu.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function vd(t){return t.constructor.PARSED_STYLE_LIST}var yd=function(){return pl((function t(){hl(this,t),this.mixer=_h}),[{key:"calculator",value:function(t,e,n,r){return bh(n)}}])}(),md=function(){return pl((function t(){hl(this,t)}),[{key:"calculator",value:function(t,e,n,r,i){return n instanceof Ff&&(n=null),i.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&i.sceneGraphService.dirtifyToRoot(t)})),n}}])}(),bd=function(){return pl((function t(){hl(this,t),this.parser=lh,this.mixer=uh}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Ff?"none"===n.value?Vf:Uf:n}}])}(),xd=function(){return pl((function t(){hl(this,t)}),[{key:"calculator",value:function(t,e,n){return n instanceof Ff?[]:n}}])}();function wd(t){var e=t.parsedStyle.fontSize;return b(e)?null:e}var kd=function(){return pl((function t(){hl(this,t),this.mixer=_h}),[{key:"calculator",value:function(t,e,n,r,i){if(I(n))return n;if(!$f.isRelativeUnit(n.unit))return n.value;if(n.unit===_f.kPercentage)return 0;if(n.unit===_f.kEms){if(r.parentNode){var o=wd(r.parentNode);if(o)return o*=n.value}return 0}if(n.unit===_f.kRems){var a;if(null!=r&&null!==(a=r.ownerDocument)&&void 0!==a&&a.documentElement){var s=wd(r.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),Md=function(){return pl((function t(){hl(this,t),this.mixer=Ah}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),Ed=function(){return pl((function t(){hl(this,t),this.mixer=Ah}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),Od=function(){return pl((function t(){hl(this,t)}),[{key:"calculator",value:function(t,e,n,r){var i;n instanceof Ff&&(n=null);var o=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return o&&(o.style.isMarker=!0),o}}])}(),_d=function(){return pl((function t(){hl(this,t),this.mixer=_h}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Sd=function(){return pl((function t(){hl(this,t),this.mixer=Sh(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath,r=e.offsetDistance;if(n){var i=n.nodeName;if(i===tu.LINE||i===tu.PATH||i===tu.POLYLINE){var o=n.getPoint(r);o&&t.setLocalPosition(o.x,o.y)}}}}])}(),Ad=function(){return pl((function t(){hl(this,t),this.mixer=Sh(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),Td=function(){return pl((function t(){hl(this,t),this.parser=Hh,this.mixer=Yh}),[{key:"calculator",value:function(t,e,n){return n instanceof Ff&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new gu(0,0,0,0)}:n}}])}(),Pd=pl((function t(){hl(this,t),this.mixer=qh})),Nd=function(t){function e(){var t;hl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=wl(this,e,[].concat(r))).mixer=Sh(0,1/0),t}return Ml(e,t),pl(e)}(kd),Cd=function(){return pl((function t(){hl(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Ff?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}])}(),Ld=function(){return pl((function t(){hl(this,t)}),[{key:"calculator",value: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}}])}(),jd=new WeakMap;var Rd="undefined"!=typeof window&&void 0!==window.document;function Id(t){return!!t.getAttribute}function Dd(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 Bd(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function Fd(t,e){if(Rd)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var zd={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},$d="object"==typeof performance&&performance.now?performance:Date;function Wd(t){return t.nodeName===tu.FRAGMENT||t.getRootNode().nodeName===tu.FRAGMENT}function Gd(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,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 Hd=1,Yd="object"==typeof self&&self.self===self?self:"object"==typeof al&&al.global===al?al:{},qd=Date.now(),Vd={},Ud=Date.now(),Xd=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Ud,r=n>16?0:16-n,i=Hd++;return Vd[i]=t,Object.keys(Vd).length>1||setTimeout((function(){Ud=e;var t=Vd;Vd={},Object.keys(t).forEach((function(e){return t[e](Yd.performance&&"function"==typeof Yd.performance.now?Yd.performance.now():Date.now()-qd)}))}),r),i},Zd=function(t){delete Vd[t]},Kd=function(t){return"string"!=typeof t?Xd:""===t?Yd.requestAnimationFrame:Yd["".concat(t,"RequestAnimationFrame")]},Qd=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!!Kd(t)})),Jd=Kd(Qd),tp=function(t){return"string"!=typeof t?Zd:""===t?Yd.cancelAnimationFrame:Yd["".concat(t,"CancelAnimationFrame")]||Yd["".concat(t,"CancelRequestAnimationFrame")]}(Qd);Yd.requestAnimationFrame=Jd,Yd.cancelAnimationFrame=tp;var ep=function(){return pl((function t(){hl(this,t),this.callbacks=[]}),[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map((function(t){return t.apply(void 0,e)})))}}])}(),np=function(){return pl((function t(){hl(this,t),this.callbacks=[]}),[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(t=Xl(Vl().mark((function t(){var e,n,r,i,o=arguments;return Vl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=14;break}return t.next=3,(e=this.callbacks)[0].apply(e,o);case 3:n=t.sent,r=0;case 5:if(!(r<this.callbacks.length-1)){t.next=13;break}return i=this.callbacks[r],t.next=9,i(n);case 9:n=t.sent;case 10:r++,t.next=5;break;case 13:return t.abrupt("return",n);case 14:return t.abrupt("return",null);case 15:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),rp=function(){return pl((function t(){hl(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=arguments;this.callbacks.forEach((function(t){t.apply(void 0,r)}))}}])}(),ip=function(){return pl((function t(){hl(this,t),this.callbacks=[]}),[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];if(this.callbacks.length){for(var r=arguments,i=this.callbacks[0].apply(void 0,r),o=0;o<this.callbacks.length-1;o++){i=(0,this.callbacks[o])(i)}return i}return null}}])}(),op=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],ap=/([\"\'])[^\'\"]+\1/;function sp(t,e,n){return bt(t),t[4]=Math.tan(e),t[1]=Math.tan(n),t}var cp=pt(),lp=pt(),up={scale:function(t){Tt(cp,[t[0].value,t[1].value,1])},scaleX:function(t){Tt(cp,[t[0].value,1,1])},scaleY:function(t){Tt(cp,[1,t[0].value,1])},scaleZ:function(t){Tt(cp,[1,1,t[0].value])},scale3d:function(t){Tt(cp,[t[0].value,t[1].value,t[2].value])},translate:function(t){At(cp,[t[0].value,t[1].value,0])},translateX:function(t){At(cp,[t[0].value,0,0])},translateY:function(t){At(cp,[0,t[0].value,0])},translateZ:function(t){At(cp,[0,0,t[0].value])},translate3d:function(t){At(cp,[t[0].value,t[1].value,t[2].value])},rotate:function(t){Lt(cp,ku(bh(t[0])))},rotateX:function(t){Nt(cp,ku(bh(t[0])))},rotateY:function(t){Ct(cp,ku(bh(t[0])))},rotateZ:function(t){Lt(cp,ku(bh(t[0])))},rotate3d:function(t){Pt(cp,ku(bh(t[3])),[t[0].value,t[1].value,t[2].value])},skew:function(t){sp(cp,ku(t[0].value),ku(t[1].value))},skewX:function(t){sp(cp,ku(t[0].value),0)},skewY:function(t){sp(cp,0,ku(t[0].value))},matrix:function(t){mt(cp,t[0].value,t[1].value,0,0,t[2].value,t[3].value,0,0,0,0,1,0,t[4].value,t[5].value,0,1)},matrix3d:function(t){mt.apply(Zt,[cp].concat(yl(t.map((function(t){return t.value})))))}},fp=te(1,1,1),hp=Kt(),dp={translate:function(t,e){mg.sceneGraphService.setLocalScale(t,fp,!1),mg.sceneGraphService.setLocalEulerAngles(t,hp,void 0,void 0,!1),mg.sceneGraphService.setLocalPosition(t,[e[0].value,e[1].value,0],!1),mg.sceneGraphService.dirtifyLocal(t,t.transformable)}};function pp(t,e){if(t.length){if(1===t.length&&dp[t[0].t])return void dp[t[0].t](e,t[0].d);for(var n=bt(lp),r=0;r<t.length;r++){var i=t[r],o=i.t,a=i.d,s=up[o];s&&(s(a),Ut(n,n,cp))}e.setLocalTransform(n)}else e.resetLocalTransform();return e.getLocalTransform()}var gp=function(){return pl((function t(){hl(this,t),this.parser=td,this.mixer=ld}),[{key:"calculator",value:function(t,e,n,r){return n instanceof Ff?[]:n}},{key:"postProcessor",value:function(t){pp(t.parsedStyle.transform,t)}}])}(),vp=function(){return pl((function t(){hl(this,t)}),[{key:"postProcessor",value:function(t){var e=t.parsedStyle.transformOrigin;e[0].unit===_f.kPixels&&e[1].unit===_f.kPixels?t.setOrigin(e[0].value,e[1].value):t.getGeometryBounds()}}])}(),yp=function(){return pl((function t(){hl(this,t)}),[{key:"calculator",value:function(t,e,n,r){return n.value}},{key:"postProcessor",value: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=Wu.Z_INDEX_CHANGED)}}}])}(),mp=function(){return pl((function t(){hl(this,t)}),[{key:"update",value: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}}}])}(),bp=function(){return pl((function t(){hl(this,t)}),[{key:"update",value: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}}}])}(),xp=function(){return pl((function t(){hl(this,t)}),[{key:"update",value: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}}}])}(),wp=function(){return pl((function t(){hl(this,t)}),[{key:"update",value: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}}}])}(),kp=function(){return pl((function t(){hl(this,t)}),[{key:"update",value:function(t){if(t.points&&x(t.points.points)){var e=t.points.points,n=Math.min.apply(Math,yl(e.map((function(t){return t[0]})))),r=Math.max.apply(Math,yl(e.map((function(t){return t[0]})))),i=Math.min.apply(Math,yl(e.map((function(t){return t[1]})))),o=Math.max.apply(Math,yl(e.map((function(t){return t[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}}}])}(),Mp=function(){return pl((function t(){hl(this,t)}),[{key:"update",value: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&&!L(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}}}])}(),Ep=function(){return pl((function t(e){hl(this,t),this.globalRuntime=e}),[{key:"isReadyToMeasure",value:function(t,e){return t.text}},{key:"update",value:function(t,e){var n,r=t.text,i=t.textAlign,o=void 0===i?"start":i,a=t.lineWidth,s=void 0===a?1:a,c=t.textBaseline,l=void 0===c?"alphabetic":c,u=t.dx,f=void 0===u?0:u,h=t.dy,d=void 0===h?0:h,p=t.x,g=void 0===p?0:p,v=t.y,y=void 0===v?0:v;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 m=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(n=n.defaultView)||void 0===n?void 0:n.getConfig())||{}).offscreenCanvas,b=this.globalRuntime.textService.measureText(r,t,m);t.metrics=b;var x=b.width/2,w=b.height/2,k=g+x;"center"===o||"middle"===o?k+=s/2-x:"right"!==o&&"end"!==o||(k+=s-2*x);var M=y-w;return"middle"===l?M+=w:"top"===l||"hanging"===l?M+=2*w:"alphabetic"===l||"bottom"!==l&&"ideographic"!==l||(M+=0),f&&(k+=f),d&&(M+=d),{cx:k,cy:M,hwidth:x,hheight:w}}}])}(),Op=function(){return pl((function t(){hl(this,t)}),[{key:"update",value:function(t,e){return{cx:0,cy:0,hwidth:0,hheight:0}}}])}(),_p=function(){return pl((function t(){hl(this,t)}),[{key:"update",value:function(t,e){var n=t.x,r=void 0===n?0:n,i=t.y,o=void 0===i?0:i,a=t.width,s=void 0===a?0:a,c=t.height,l=void 0===c?0:c;return{cx:r+s/2,cy:o+l/2,hwidth:s/2,hheight:l/2}}}])}(),Sp=function(){return pl((function t(e){hl(this,t),this.eventPhase=t.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new pu,this.page=new pu,this.canvas=new pu,this.viewport=new pu,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}),[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw new Error(vu)}}])}(),Ap=function(t){function e(){var t;hl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=wl(this,e,[].concat(r))).client=new pu,t.movement=new pu,t.offset=new pu,t.global=new pu,t.screen=new pu,t}return Ml(e,t),pl(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw new Error(vu)}}])}(Sp),Tp=function(t){function e(){var t;hl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=wl(this,e,[].concat(r))).width=0,t.height=0,t.isPrimary=!1,t}return Ml(e,t),pl(e,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw new Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}])}(Ap),Pp=function(t){function e(){return hl(this,e),wl(this,e,arguments)}return Ml(e,t),pl(e,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}])}(Ap),Np=function(t){function e(t,n){var r;return hl(this,e),(r=wl(this,e,[null])).type=t,r.detail=n,Object.assign(r,n),r}return Ml(e,t),pl(e)}(Sp),Cp=new WeakMap,Lp=function(){return pl((function t(){hl(this,t),this.emitter=new _l}),[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=!1,i=!1;if(H(n))r=n;else if(n){var o=n.capture;r=void 0!==o&&o;var a=n.once;i=void 0!==a&&a}r&&(t+="capture"),e=m(e)?e:e.handleEvent;var s=m(e)?void 0:e;return i?this.emitter.once(t,e,s):this.emitter.on(t,e,s),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){var t;null===(t=this.emitter)||void 0===t||t.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r;if(!this.emitter)return this;(H(n)?n:null==n?void 0:n.capture)&&(t+="capture"),e=m(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent;var i=m(e)?void 0:e;return this.emitter.off(t,e,i),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new Np(t,e))}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Cp.get(this);r||(r=this.document?this:this.defaultView?this.defaultView:null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView)&&Cp.set(this,r);if(r){if(t.manager=r.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.emitter.emit(t.type,t);return!t.defaultPrevented}}])}(),jp=function(t){function e(){var t;hl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=wl(this,e,[].concat(r))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return Ml(e,t),pl(e,[{key:"textContent",get:function(){var t="";this.nodeName===tu.TEXT&&(t+=this.style.text);var e,n=Zl(this.childNodes);try{for(n.s();!(e=n.n()).done;){var r=e.value;r.nodeName===tu.TEXT?t+=r.nodeValue:t+=r.textContent}}catch(t){n.e(t)}finally{n.f()}return t},set:function(t){var e=this;this.childNodes.slice().forEach((function(t){e.removeChild(t)})),this.nodeName===tu.TEXT&&(this.style.text="".concat(t))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw new Error(vu)}},{key:"lookupNamespaceURI",value:function(t){throw new Error(vu)}},{key:"lookupPrefix",value:function(t){throw new Error(vu)}},{key:"normalize",value:function(){throw new Error(vu)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var n=t,r=this,i=[n],o=[r];null!==(a=n.parentNode)&&void 0!==a?a:r.parentNode;){var a;n=n.parentNode?(i.push(n.parentNode),n.parentNode):n,r=r.parentNode?(o.push(r.parentNode),r.parentNode):r}if(n!==r)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=i.length>o.length?i:o,c=s===i?o:i;if(s[s.length-c.length]===c[0])return s===i?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===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING:s===i?e.DOCUMENT_POSITION_PRECEDING:e.DOCUMENT_POSITION_FOLLOWING}}return e.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var r=n.childNodes.length-1;r>=0;r--)e.push(n.childNodes[r])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(Lp);jp.DOCUMENT_POSITION_DISCONNECTED=1,jp.DOCUMENT_POSITION_PRECEDING=2,jp.DOCUMENT_POSITION_FOLLOWING=4,jp.DOCUMENT_POSITION_CONTAINS=8,jp.DOCUMENT_POSITION_CONTAINED_BY=16,jp.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Rp=function(){return pl((function t(e,n){var r=this;hl(this,t),this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=pt(),this.tmpVec3=Kt(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var n=2===e.button;r.dispatchEvent(e,n?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=$d.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){var i=2===n.button;r.dispatchEvent(n,i?"rightup":"mouseup")}var o=r.trackingData(t.pointerId),a=r.findMountedTarget(o.pressTargetsByButton[t.button]),s=a;if(a&&!n.composedPath().includes(a)){for(var c=a;c&&!n.composedPath().includes(c);){if(n.currentTarget=c,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){var l=2===n.button;r.notifyTarget(n,l?"rightupoutside":"mouseupoutside")}jp.isNode(c)&&(c=c.parentNode)}delete o.pressTargetsByButton[t.button],s=c}if(s){var u,f=r.clonePointerEvent(n,"click");f.target=s,f.path=[],o.clicksByButton[t.button]||(o.clicksByButton[t.button]={clickCount:0,target:f.target,timeStamp:e});var h=r.context.renderingContext.root.ownerDocument.defaultView,d=o.clicksByButton[t.button];d.target===f.target&&e-d.timeStamp<h.getConfig().dblClickSpeed?++d.clickCount:d.clickCount=1,d.target=f.target,d.timeStamp=e,f.detail=d.clickCount,null!==(u=n.detail)&&void 0!==u&&u.preventClick||(r.context.config.useNativeClickEvent||"mouse"!==f.pointerType&&"touch"!==f.pointerType||r.dispatchEvent(f,"click"),r.dispatchEvent(f,"pointertap")),r.freeEvent(f)}r.freeEvent(n)},this.onPointerMove=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,i=r.trackingData(t.pointerId),o=r.findMountedTarget(i.overTargets);if(i.overTargets&&o!==e.target){var a="mousemove"===t.type?"mouseout":"pointerout",s=r.createPointerEvent(t,a,o||void 0);if(r.dispatchEvent(s,"pointerout"),n&&r.dispatchEvent(s,"mouseout"),!e.composedPath().includes(o)){var c=r.createPointerEvent(t,"pointerleave",o||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&!e.composedPath().includes(c.target);)c.currentTarget=c.target,r.notifyTarget(c),n&&r.notifyTarget(c,"mouseleave"),jp.isNode(c.target)&&(c.target=c.target.parentNode);r.freeEvent(c)}r.freeEvent(s)}if(o!==e.target){var l="mousemove"===t.type?"mouseover":"pointerover",u=r.clonePointerEvent(e,l);r.dispatchEvent(u,"pointerover"),n&&r.dispatchEvent(u,"mouseover");for(var f=o&&jp.isNode(o)&&o.parentNode;f&&f!==(jp.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&f!==e.target;)f=f.parentNode;if(!f||f===(jp.isNode(r.rootTarget)&&r.rootTarget.parentNode)){var h=r.clonePointerEvent(e,"pointerenter");for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==o&&h.target!==(jp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)h.currentTarget=h.target,r.notifyTarget(h),n&&r.notifyTarget(h,"mouseenter"),jp.isNode(h.target)&&(h.target=h.target.parentNode);r.freeEvent(h)}r.freeEvent(u)}r.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&r.dispatchEvent(e,"touchmove"),n&&(r.dispatchEvent(e,"mousemove"),r.cursor=r.getCursor(e.target)),i.overTargets=e.composedPath(),r.freeEvent(e)},this.onPointerOut=function(t){var e=r.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,i=r.findMountedTarget(e.overTargets),o=r.createPointerEvent(t,"pointerout",i||void 0);r.dispatchEvent(o),n&&r.dispatchEvent(o,"mouseout");var a=r.createPointerEvent(t,"pointerleave",i||void 0);for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(jp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),n&&r.notifyTarget(a,"mouseleave"),jp.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=null,r.freeEvent(o),r.freeEvent(a)}r.cursor=null},this.onPointerOver=function(t){var e=r.trackingData(t.pointerId),n=r.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;r.dispatchEvent(n,"pointerover"),i&&r.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(r.cursor=r.getCursor(n.target));var o=r.clonePointerEvent(n,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(jp.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),i&&r.notifyTarget(o,"mouseenter"),jp.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=n.composedPath(),r.freeEvent(n),r.freeEvent(o)},this.onPointerUpOutside=function(t){var e=r.trackingData(t.pointerId),n=r.findMountedTarget(e.pressTargetsByButton[t.button]),i=r.createPointerEvent(t);if(n){for(var o=n;o;)i.currentTarget=o,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),jp.isNode(o)&&(o=o.parentNode);delete e.pressTargetsByButton[t.button]}r.freeEvent(i)},this.onWheel=function(t){var e=r.createWheelEvent(t);r.dispatchEvent(e),r.freeEvent(e)},this.onClick=function(t){if(r.context.config.useNativeClickEvent){var e=r.createPointerEvent(t);r.dispatchEvent(e),r.freeEvent(e)}},this.onPointerCancel=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(e),r.freeEvent(e)},this.globalRuntime=e,this.context=n}),[{key:"init",value: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)}},{key:"destroy",value:function(){this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"getScale",value:function(){var t=this.context.contextService.getBoundingClientRect(),e=1,n=1,r=this.context.contextService.getDomElement();if(r&&t){var i=r.offsetWidth,o=r.offsetHeight;i&&o&&(e=t.width/i,n=t.height/o)}return{scaleX:e,scaleY:n,bbox:t}}},{key:"client2Viewport",value:function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new pu((t.x-((null==i?void 0:i.left)||0))/n,(t.y-((null==i?void 0:i.top)||0))/r)}},{key:"viewport2Client",value:function(t){var e=this.getScale(),n=e.scaleX,r=e.scaleY,i=e.bbox;return new pu((t.x+((null==i?void 0:i.left)||0))*n,(t.y+((null==i?void 0:i.top)||0))*r)}},{key:"viewport2Canvas",value: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=Mt(this.tmpMatrix,c,s),u=ne(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return ue(u,u,l),new pu(u[0],u[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=Mt(this.tmpMatrix,n,r),o=ne(this.tmpVec3,t.x,t.y,0);ue(this.tmpVec3,this.tmpVec3,i);var a=this.context.config,s=a.width,c=a.height;return new pu((o[0]+1)/2*s,(1-(o[1]+1)/2)*c)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value: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}))}},{key:"mapEvent",value: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))}}},{key:"dispatchEvent",value: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)}},{key:"propagate",value:function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=i+1;o<n.length;o++)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value: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++)jp.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value: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}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,r=null==e?void 0:e.target;if(null!==(n=r)&&void 0!==n&&n.shadowRoot&&(r=e.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();e<n.length;e++){var r=n[e],i=this.nativeHTMLMap.get(r);if(i)return i}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,r){var i=this.allocateEvent(Tp);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}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(Pp);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}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(Pp);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}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(Tp);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}},{key:"copyPointerData",value: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}},{key:"copyMouseData",value: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)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value:function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=$d.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)}},{key:"allocateEvent",value: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}},{key:"freeEvent",value: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)}},{key:"notifyTarget",value: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)}},{key:"notifyListeners",value: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)}},{key:"findMountedTarget",value: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||jp.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=Id(e)&&e.getAttribute("cursor");if(n)return n;e=jp.isNode(e)&&e.parentNode}}}])}(),Ip=function(){return pl((function t(){hl(this,t)}),[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||mg.offscreenCanvas)this.canvas=t||mg.offscreenCanvas,this.context=this.canvas.getContext("2d",fl({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",fl({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",fl({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),Dp=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),Bp=function(){return pl((function t(e,n){hl(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new rp,initAsync:new ep,dirtycheck:new ip,cull:new ip,beginFrame:new rp,beforeRender:new rp,render:new rp,afterRender:new rp,endFrame:new rp,destroy:new rp,pick:new np,pickSync:new ip,pointerDown:new rp,pointerUp:new rp,pointerMove:new rp,pointerOut:new rp,pointerOver:new rp,pointerWheel:new rp,pointerCancel:new rp,click:new rp},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(t){var e=this,n=fl(fl({},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()})).catch((function(t){}))}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(Dp.CAMERA_CHANGED)}},{key:"render",value: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(Dp.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()}}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;function s(t){var e=t.renderable,i=t.sortable,s=o?e.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var c=a?r.hooks.cull.call(s,r.context.camera):s;c&&(r.stats.rendered+=1,n.renderListCurrentFrame.push(c))}e.dirty=!1,i.renderOrder=r.zIndexCounter,r.zIndexCounter+=1,r.stats.total+=1,i.dirty&&(r.sort(t,i),i.dirty=!1,i.dirtyChildren=[],i.dirtyReason=void 0)}for(var c=[t];c.length>0;){var l,u=c.pop();s(u);for(var f=(null===(l=u.sortable)||void 0===l||null===(l=l.sorted)||void 0===l?void 0:l.length)>0?u.sortable.sorted:u.childNodes,h=f.length-1;h>=0;h--)c.push(f[h])}}},{key:"sort",value:function(t,e){var n,r;(null==e||null===(n=e.sorted)||void 0===n?void 0:n.length)>0&&e.dirtyReason!==Wu.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){var r=e.sorted.indexOf(n);if(r>-1&&e.sorted.splice(r,1),t.childNodes.indexOf(n)>-1)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;Dd(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(Dd),(null===(r=e.sorted)||void 0===r?void 0:r.length)>0&&0===t.childNodes.filter((function(t){return t.parsedStyle.zIndex})).length&&(e.sorted=[])}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(Dp.DISPLAY_OBJECT_CHANGED)}}])}(),Fp=/\[\s*(.*)=(.*)\s*\]/,zp=function(){return pl((function t(){hl(this,t)}),[{key:"selectOne",value: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}))}},{key:"selectAll",value: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}))}},{key:"is",value: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}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(Fp),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return b(n)?"":n.toString?n.toString():""}}])}(),$p=function(t){return t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.MOUNTED="DOMNodeInsertedIntoDocument",t.REMOVED="removed",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.REPARENT="reparent",t.DESTROY="destroy",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),Wp=function(t){function e(t,n,r,i,o,a,s,c){var l;return hl(this,e),(l=wl(this,e,[null])).relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=o,l.attrChange=a,l.prevParsedValue=s,l.newParsedValue=c,l.type=t,l}return Ml(e,t),pl(e)}(Sp);function Gp(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}Wp.ADDITION=2,Wp.MODIFICATION=1,Wp.REMOVAL=3;var Hp,Yp,qp,Vp=new Wp($p.REPARENT,null,"","","",0,"",""),Up=Te(),Xp=Kt(),Zp=te(1,1,1),Kp=pt(),Qp=Te(),Jp=Kt(),tg=pt(),eg=be(),ng=Kt(),rg=be(),ig=Kt(),og=Kt(),ag=Kt(),sg=pt(),cg=be(),lg=be(),ug=be(),fg={affectChildren:!0},hg=function(){return pl((function t(e){hl(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new Np($p.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}),[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i=!1;t.parentNode&&(i=t.parentNode!==e,this.detach(t));var o=t.nodeName===tu.FRAGMENT,a=Wd(e);t.parentNode=e;var s=o?t.childNodes:[t];I(n)?s.forEach((function(t){e.childNodes.splice(n,0,t),t.parentNode=e})):s.forEach((function(t){e.childNodes.push(t),t.parentNode=e}));var c=e.sortable;if((null!=c&&null!==(r=c.sorted)&&void 0!==r&&r.length||c.dirty||t.parsedStyle.zIndex)&&(-1===c.dirtyChildren.indexOf(t)&&c.dirtyChildren.push(t),c.dirty=!0,c.dirtyReason=Wu.ADDED),!a){if(o)this.dirtifyFragment(t);else{var l=t.transformable;l&&this.dirtifyWorld(t,l)}i&&t.dispatchEvent(Vp)}}},{key:"detach",value:function(t){var e,n;if(t.parentNode){var r=t.transformable,i=t.parentNode.sortable;(null!=i&&null!==(e=i.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===i.dirtyChildren.indexOf(t)&&i.dirtyChildren.push(t),i.dirty=!0,i.dirtyReason=Wu.REMOVED);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"setOrigin",value:function(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var n=t.transformable;if(e[0]!==n.origin[0]||e[1]!==n.origin[1]||e[2]!==n.origin[2]){var r=n.origin;r[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtifyLocal(t,n)}}},{key:"rotate",value:function(t,e){"number"==typeof e&&(e=te(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var r=eg;Me(r,e[0],e[1],e[2]);var i=this.getRotation(t),o=this.getRotation(t.parentNode);Oe(ug,o),ke(ug,ug),we(r,ug,r),we(n.localRotation,r,i),Ae(n.localRotation,n.localRotation),this.dirtifyLocal(t,n)}else this.rotateLocal(t,e)}},{key:"rotateLocal",value:function(t,e){"number"==typeof e&&(e=te(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;Me(lg,e[0],e[1],e[2]),Se(n.localRotation,n.localRotation,lg),this.dirtifyLocal(t,n)}},{key:"setEulerAngles",value:function(t,e){"number"==typeof e&&(e=te(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Me(n.localRotation,e[0],e[1],e[2]);var r=this.getRotation(t.parentNode);Oe(cg,ke(eg,r)),Se(n.localRotation,n.localRotation,cg),this.dirtifyLocal(t,n)}else this.setLocalEulerAngles(t,e)}},{key:"setLocalEulerAngles",value:function(t,e){var n=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];"number"==typeof e&&(e=te(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var r=t.transformable;Me(r.localRotation,e[0],e[1],e[2]),n&&this.dirtifyLocal(t,r)}},{key:"translateLocal",value:function(t,e){"number"==typeof e&&(e=te(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;he(e,Xp)||(!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,v=2*a;u*=v,f*=v,h*=v,d*=2,p*=2,g*=2,t[0]=s+u+d,t[1]=c+f+p,t[2]=l+h+g}(e,e,n.localRotation),re(n.localPosition,n.localPosition,e),this.dirtifyLocal(t,n))}},{key:"setPosition",value:function(t,e){var n,r=t.transformable;if(ag[0]=e[0],ag[1]=e[1],ag[2]=null!==(n=e[2])&&void 0!==n?n:0,!he(this.getPosition(t),ag)){if(ee(r.position,ag),null!==t.parentNode&&t.parentNode.transformable){var i=t.parentNode.transformable;vt(sg,i.worldTransform),wt(sg,sg),ue(r.localPosition,ag,sg)}else ee(r.localPosition,ag);this.dirtifyLocal(t,r)}}},{key:"setLocalPosition",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;og[0]=e[0],og[1]=e[1],og[2]=null!==(n=e[2])&&void 0!==n?n:0,he(i.localPosition,og)||(ee(i.localPosition,og),r&&this.dirtifyLocal(t,i))}},{key:"scaleLocal",value:function(t,e){var n,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,ne(Jp,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1)),this.dirtifyLocal(t,r)}},{key:"setLocalScale",value:function(t,e){var n,r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.transformable;ne(Jp,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:i.localScale[2]),he(Jp,i.localScale)||(ee(i.localScale,Jp),r&&this.dirtifyLocal(t,i))}},{key:"translate",value:function(t,e){"number"==typeof e&&(e=ne(Jp,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),he(e,Xp)||(re(Jp,this.getPosition(t),e),this.setPosition(t,Jp))}},{key:"setRotation",value:function(t,e,n,r,i){var o=t.transformable;if("number"==typeof e&&(e=Ee(e,n,r,i)),null!==t.parentNode&&t.parentNode.transformable){var a=this.getRotation(t.parentNode);Oe(eg,a),ke(eg,eg),we(o.localRotation,eg,e),Ae(o.localRotation,o.localRotation),this.dirtifyLocal(t,o)}else this.setLocalRotation(t,e)}},{key:"setLocalRotation",value:function(t,e,n,r,i){var o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];"number"==typeof e&&(e=_e(eg,e,n,r,i));var a=t.transformable;Oe(a.localRotation,e),o&&this.dirtifyLocal(t,a)}},{key:"setLocalSkew",value:function(t,e,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];"number"==typeof e&&(e=function(t,e,n){return t[0]=e,t[1]=n,t}(Qp,e,n));var i=t.transformable;!function(t,e){t[0]=e[0],t[1]=e[1]}(i.localSkew,e),r&&this.dirtifyLocal(t,i)}},{key:"dirtifyLocal",value:function(t,e){Wd(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))}},{key:"dirtifyWorld",value:function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)}},{key:"dirtifyFragment",value:function(t){var e=t.transformable;e&&(e.frozen=!1,e.dirtyFlag=!0,e.localDirtyFlag=!0);var n=t.renderable;n&&(n.renderBoundsDirty=!0,n.boundsDirty=!0,n.dirty=!0);for(var r=t.childNodes.length,i=0;i<r;i++)this.dirtifyFragment(t.childNodes[i]);t.nodeName===tu.FRAGMENT&&this.pendingEvents.set(t,!1)}},{key:"triggerPendingEvents",value:function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n)&&n.nodeName!==tu.FRAGMENT&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n))};this.pendingEvents.forEach((function(t,e){e.nodeName!==tu.FRAGMENT&&(fg.affectChildren=t,t?e.forEach((function(t){n(t,fg)})):n(e,fg))})),e.clear(),this.clearPendingEvents()}},{key:"clearPendingEvents",value:function(){this.pendingEvents.clear()}},{key:"dirtifyToRoot",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Gp(n),n=n.parentNode;e&&t.forEach((function(t){Gp(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)}},{key:"updateDisplayObjectDependency",value: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)}}},{key:"informDependentDisplayObjects",value: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 Wp($p.ATTR_MODIFIED,n,e,e,t,Wp.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))}},{key:"getPosition",value:function(t){var e=t.transformable;return Rt(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return Dt(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return It(e.scaling,this.getWorldTransform(t,e))}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"calcLocalTransform",value:function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){Bt(t.localTransform,t.localRotation,t.localPosition,te(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(bt(tg),tg[4]=Math.tan(t.localSkew[0]),tg[1]=Math.tan(t.localSkew[1]),Mt(t.localTransform,t.localTransform,tg));var e=Bt(tg,_e(eg,0,0,0,1),ne(Jp,1,1,1),t.localScale,t.origin);Mt(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,r=t.localPosition,i=t.localRotation,o=t.localScale,a=t.origin,s=0!==r[0]||0!==r[1]||0!==r[2],c=1!==i[3]||0!==i[0]||0!==i[1]||0!==i[2],l=1!==o[0]||1!==o[1]||1!==o[2],u=0!==a[0]||0!==a[1]||0!==a[2];c||l||u?Bt(n,i,r,o,a):s?At(n,r):bt(n)}}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform}},{key:"setLocalTransform",value:function(t,e){var n=Rt(ng,e),r=Dt(rg,e),i=It(ig,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)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,Zp,!1),this.setLocalPosition(t,Xp,!1),this.setLocalEulerAngles(t,Xp,void 0,void 0,!1),this.setLocalSkew(t,Up,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,r=this.getGeometryBounds(t,e);if(!uu.isEmpty(r)){var i=n||new uu;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.geometry;return n.dirty&&mg.styleValueRegistry.updateGeometry(t),(e?n.renderBounds:n.contentBounds||null)||new uu}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=n?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,n,i);if(t.childNodes.forEach((function(t){var r=e.getBounds(t,n);r&&(o?o.add(r):(o=i||new uu).update(r.center,r.halfExtents))})),o||(o=new uu),n){var a=Bd(t);if(a){var s=a.parsedStyle.clipPath.getBounds(n);o?s&&(o=s.intersection(o)):o.update(s.center,s.halfExtents)}}return n?(r.renderBounds=o,r.renderBoundsDirty=!1):(r.bounds=o,r.boundsDirty=!1),o}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=Kp;t.parentNode.transformable&&(e=wt(tg,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!uu.isEmpty(n)){var r=new uu;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r=this.getGeometryBounds(t);uu.isEmpty(r)||(n=new uu).setFromTransformedAABB(r,this.getWorldTransform(t));var i=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var o=El(n.getMin(),2),a=o[0],s=o[1],c=El(n.getMax(),2),l=c[0],u=c[1];return new gu(a+((null==i?void 0:i.left)||0),s+((null==i?void 0:i.top)||0),l-a,u-s)}return new gu((null==i?void 0:i.left)||0,(null==i?void 0:i.top)||0,0,0)}},{key:"dirtifyWorldInternal",value: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)}}},{key:"syncHierarchy",value: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])}}},{key:"sync",value: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?Mt(e.worldTransform,r.worldTransform,e.localTransform):vt(e.worldTransform,e.localTransform),e.dirtyFlag=!1}}},{key:"unfreezeParentToRoot",value:function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}}}])}(),dg={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]},pg=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,gg=new RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),vg=new RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),yg=function(){return pl((function t(e){var n=this;hl(this,t),this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!vg.exec(e)&&!gg.exec(t))},this.trimByKinsokuShorui=function(t){var e=yl(t),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},this.runtime=e}),[{key:"measureFont",value: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=dg.MetricsString+dg.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(dg.BaselineSymbol).width),c=dg.HeightMultiplier*s;s=s*dg.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(var v=0;v<f;v+=4)if(255!==l[d+v]){p=!0;break}if(p)break;d-=f}return n.descent=h-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value: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,v=e.textPath,y=e.leading,m=void 0===y?0:y,b=function(t){for(var e=t.fontSize,n=void 0===e?16:e,r=t.fontFamily,i=void 0===r?"sans-serif":r,o=t.fontStyle,a=void 0===o?"normal":o,s=t.fontVariant,c=void 0===s?"normal":s,l=t.fontWeight,u=void 0===l?"normal":l,f=I(n)&&"".concat(n,"px")||"16px",h=i.split(","),d=h.length-1;d>=0;d--){var p=h[d].trim();!ap.test(p)&&op.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 w=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);w.font=b,e.isOverflowing=!1;var k=(a?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),M=new Array(k.length),E=0;if(!v){for(var O=0;O<k.length;O++){var _=w.measureText(k[O]).width+(k[O].length-1)*g;M[O]=_,E=Math.max(E,_)}var S=E+l,A=s||x.fontSize+l,T=Math.max(A,x.fontSize+l)+(k.length-1)*(A+m),P=0;return"middle"===f?P=-T/2:"bottom"===f||"alphabetic"===f||"ideographic"===f?P=-T:"top"!==f&&"hanging"!==f||(P=0),{font:b,width:S,height:T,lines:k,lineWidths:M,lineHeight:A+=m,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 gu(n-l/2,P+e*A,t+l,A)}))}}v.getTotalLength();for(var N=0;N<k.length;N++)w.measureText(k[N]).width,k[N].length}},{key:"wordWrap",value:function(t,e,n){var r=this,i=this,o=e.wordWrapWidth,a=void 0===o?0:o,s=e.letterSpacing,c=void 0===s?0:s,l=e.maxLines,u=void 0===l?1/0:l,f=e.textOverflow,h=this.runtime.offscreenCanvasCreator.getOrCreateContext(n),d=a+c,p="";"ellipsis"===f?p="...":f&&"clip"!==f&&(p=f);var g=Array.from(t),v=[],y=0,m=0,b=-1,x={},w=function(t){return r.getFromCache(t,c,x,h)},k=w(p);function M(t,e,n,r){for(;w(t)<r&&e<g.length-1&&!i.isNewline(g[e+1]);)t+=g[e+=1];for(;w(t)>r&&e>=n;)e-=1,t=t.slice(0,-1);return{lineTxt:t,txtLastCharIndex:e}}function E(t,e){if(!(k<=0||k>d))if(v[t]){var n=M(v[t],e,b+1,d-k);v[t]=n.lineTxt+p}else v[t]=p}for(var O=0;O<g.length;O++){var _=g[O],S=g[O-1],A=g[O+1],T=w(_);if(this.isNewline(_)){if(y+1>=u){e.isOverflowing=!0,O<g.length-1&&E(y,O-1);break}b=O-1,m=0,v[y+=1]=""}else{if(m>0&&m+T>d){var P=M(v[y],O-1,b+1,d);if(P.txtLastCharIndex!==O-1){if(v[y]=P.lineTxt,P.txtLastCharIndex===g.length-1)break;O=P.txtLastCharIndex+1,_=g[O],S=g[O-1],A=g[O+1],T=w(_)}if(y+1>=u){e.isOverflowing=!0,E(y,O-1);break}if(b=O-1,m=0,v[y+=1]="",this.isBreakingSpace(_))continue;this.canBreakInLastChar(_)||(v=this.trimToBreakable(v),m=this.sumTextWidthByCache(v[y]||"",w)),this.shouldBreakByKinsokuShorui(_,A)&&(v=this.trimByKinsokuShorui(v),m+=w(S||""))}m+=T,v[y]=(v[y]||"")+_}}return v.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&dg.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&dg.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=yl(t),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}},{key:"canBreakInLastChar",value:function(t){return!t||!pg.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce((function(t,n){return t+e(n)}),0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!pg.test(t[e]))return e;return-1}},{key:"getFromCache",value: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}}])}(),mg={},bg=(Yp=new Mp,qp=new kp,ll(ll(ll(ll(ll(ll(ll(ll(ll(ll(Hp={},tu.FRAGMENT,null),tu.CIRCLE,new mp),tu.ELLIPSE,new bp),tu.RECT,Yp),tu.IMAGE,Yp),tu.GROUP,new Op),tu.LINE,new xp),tu.TEXT,new Ep(mg)),tu.POLYLINE,qp),tu.POLYGON,qp),ll(ll(ll(Hp,tu.PATH,new wp),tu.HTML,new _p),tu.MESH,null)),xg=function(t){var e=new bd,n=new kd;return ll(ll(ll(ll(ll(ll(ll(ll(ll(ll(t={},Hu.PERCENTAGE,null),Hu.NUMBER,new _d),Hu.ANGLE,new yd),Hu.DEFINED_PATH,new md),Hu.PAINT,e),Hu.COLOR,e),Hu.FILTER,new xd),Hu.LENGTH,n),Hu.LENGTH_PERCENTAGE,n),Hu.LENGTH_PERCENTAGE_12,new Md),ll(ll(ll(ll(ll(ll(ll(ll(ll(ll(t,Hu.LENGTH_PERCENTAGE_14,new Ed),Hu.COORDINATE,new kd),Hu.OFFSET_DISTANCE,new Sd),Hu.OPACITY_VALUE,new Ad),Hu.PATH,new Td),Hu.LIST_OF_POINTS,new Pd),Hu.SHADOW_BLUR,new Nd),Hu.TEXT,new Cd),Hu.TEXT_TRANSFORM,new Ld),Hu.TRANSFORM,new gp),ll(ll(ll(t,Hu.TRANSFORM_ORIGIN,new vp),Hu.Z_INDEX,new yp),Hu.MARKER,new Od)}();mg.CameraContribution=zu,mg.AnimationTimeline=null,mg.EasingFunction=null,mg.offscreenCanvasCreator=new Ip,mg.sceneGraphSelector=new zp,mg.sceneGraphService=new hg(mg),mg.textService=new yg(mg),mg.geometryUpdaterFactory=bg,mg.CSSPropertySyntaxFactory=xg,mg.styleValueRegistry=new gd(mg),mg.layoutRegistry=null,mg.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==al?al:{},mg.enableStyleSyntax=!0,mg.enableSizeAttenuation=!1;var wg=0,kg=new Wp($p.INSERTED,null,"","","",0,"",""),Mg=new Wp($p.REMOVED,null,"","","",0,"",""),Eg=new Np($p.DESTROY),Og=function(t){function e(){var t;hl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=wl(this,e,[].concat(r))).entity=wg++,t.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},t.cullable={strategy:$u.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},t.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]},t.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},t.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},t.rBushNode={aabb:void 0},t.namespaceURI="g",t.scrollLeft=0,t.scrollTop=0,t.clientTop=0,t.clientLeft=0,t.destroyed=!1,t.style={},t.computedStyle={},t.parsedStyle={},t.attributes={},t}return Ml(e,t),pl(e,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}},{key:"cloneNode",value:function(t){throw new Error(vu)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return mg.sceneGraphService.attach(t,this,e),null!==(n=this.ownerDocument)&&void 0!==n&&n.defaultView&&(Wd(this)||t.nodeName!==tu.FRAGMENT?this.ownerDocument.defaultView.mountChildren(t):this.ownerDocument.defaultView.mountFragment(t)),this.isMutationObserved&&(kg.relatedNode=this,t.dispatchEvent(kg)),t}},{key:"insertBefore",value: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}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e;return Mg.relatedNode=this,t.dispatchEvent(Mg),null!==(e=t.ownerDocument)&&void 0!==e&&e.defaultView&&t.ownerDocument.defaultView.unmountChildren(t),mg.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];this.removeChild(e)}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return mg.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return mg.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return mg.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return mg.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return mg.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return mg.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return mg.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(mg.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach((function(r){return r===e||!t(r)||(n=r,!1)})),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)}))}}},{key:"before",value:function(){if(this.parentNode){for(var t,e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];var o=r[0],a=r.slice(1);this.parentNode.appendChild(o,e),(t=o).after.apply(t,yl(a))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){this.destroyChildren(),this.dispatchEvent(Eg),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return mg.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return mg.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return mg.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return mg.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return mg.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if("symbol"!=typeof t){var e=this.attributes[t];return e}}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e,n,r){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw new Error(vu)}},{key:"getAttributeNode",value:function(t){throw new Error(vu)}},{key:"getAttributeNodeNS",value:function(t,e){throw new Error(vu)}},{key:"hasAttributeNS",value:function(t,e){throw new Error(vu)}},{key:"removeAttributeNS",value:function(t,e){throw new Error(vu)}},{key:"removeAttributeNode",value:function(t){throw new Error(vu)}},{key:"setAttributeNS",value:function(t,e,n){throw new Error(vu)}},{key:"setAttributeNode",value:function(t){throw new Error(vu)}},{key:"setAttributeNodeNS",value:function(t){throw new Error(vu)}},{key:"toggleAttribute",value:function(t,e){throw new Error(vu)}}])}(jp);function _g(t){return!(null==t||!t.nodeName)}var Sg=mg.globalThis.Proxy?mg.globalThis.Proxy:function(){},Ag=new Wp($p.ATTR_MODIFIED,null,null,null,null,Wp.MODIFICATION,null,null),Tg=Kt(),Pg=be(),Ng=function(t){function e(t){var n;return hl(this,e),(n=wl(this,e)).isCustomElement=!1,n.isMutationObserved=!1,n.activeAnimations=[],n.config=t,n.id=t.id||"",n.name=t.name||"",(t.className||t.class)&&(n.className=t.className||t.class),n.nodeName=t.type||tu.GROUP,t.initialParsedStyle&&Object.assign(n.parsedStyle,t.initialParsedStyle),n.initAttributes(t.style),mg.enableStyleSyntax&&(n.style=new Sg({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 Ml(e,t),pl(e,[{key:"destroy",value:function(){Al(e,"destroy",this,3)([]),this.getAnimations().forEach((function(t){t.cancel()}))}},{key:"cloneNode",value:function(t,e){var n=fl({},this.attributes);for(var r in n){var i=n[r];_g(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var o=new this.constructor(fl(fl({},this.config),{},{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}},{key:"initAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};mg.styleValueRegistry.processProperties(this,t,{forceUpdateGeometry:!0}),this.renderable.dirty=!0}},{key:"setAttribute",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];Y(n)||(r||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:i}),Al(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.renderable,i=this.attributes[t],o=this.parsedStyle[t];mg.styleValueRegistry.processProperties(this,ll({},t,e),n),r.dirty=!0;var a,s=this.parsedStyle[t];(this.isConnected&&(Ag.relatedNode=this,Ag.prevValue=i,Ag.newValue=e,Ag.attrName=t,Ag.prevParsedValue=o,Ag.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(Ag):(Ag.target=this,this.ownerDocument.defaultView.dispatchEvent(Ag,!0))),this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(a=this.attributeChangedCallback)||void 0===a||a.call(this,t,i,e,o,s))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=El(t.getMin(),2),n=e[0],r=e[1],i=El(t.getMax(),2),o=i[0],a=i[1];return new gu(n,r,o-n,a-r)}},{key:"setOrigin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return mg.sceneGraphService.setOrigin(this,xu(t,e,n,!1)),this}},{key:"getOrigin",value:function(){return mg.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return mg.sceneGraphService.setPosition(this,xu(t,e,n,!1)),this}},{key:"setLocalPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return mg.sceneGraphService.setLocalPosition(this,xu(t,e,n,!1)),this}},{key:"translate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return mg.sceneGraphService.translate(this,xu(t,e,n,!1)),this}},{key:"translateLocal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return mg.sceneGraphService.translateLocal(this,xu(t,e,n,!1)),this}},{key:"getPosition",value:function(){return mg.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return mg.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=xu(t,e=e||t,n=n||t,!1)),mg.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=xu(t,e=e||t,n=n||t,!1)),mg.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return mg.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return mg.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return Eu(El(_u(Tg,mg.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return Eu(El(_u(Tg,mg.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return mg.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return mg.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return b(e)&&b(n)?mg.sceneGraphService.rotateLocal(this,0,0,t):mg.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return b(e)&&b(n)?mg.sceneGraphService.rotate(this,0,0,t):mg.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return mg.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return mg.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return mg.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return mg.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return mg.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return mg.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return mg.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return mg.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return mg.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){mg.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value: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}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,yl(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,yl(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var i=n[0],o=n[1];return i?w(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=El(Rt(Tg,e),2),r=n[0],i=n[1],o=El(It(Tg,e),2),a=o[0],s=o[1],c=Dt(Pg,e),l=El(_u(Tg,c),3),u=l[0],f=l[2];return Su(u||f,r,i,a,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=El(Au(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)}},{key:"setLocalMatrix",value:function(t){var e=El(Au(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)}},{key:"show",value:function(){this.forEach((function(t){t.style.visibility="visible"}))}},{key:"hide",value:function(){this.forEach((function(t){t.style.visibility="hidden"}))}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(Og);Ng.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","display","draggable","droppable","fill","fillOpacity","fillRule","filter","increasedLineWidthForHitTesting","lineCap","lineDash","lineDashOffset","lineJoin","lineWidth","miterLimit","hitArea","offsetDistance","offsetPath","offsetX","offsetY","opacity","pointerEvents","shadowColor","shadowType","shadowBlur","shadowOffsetX","shadowOffsetY","stroke","strokeOpacity","strokeWidth","strokeLinecap","strokeLineJoin","strokeDasharray","strokeDashoffset","transform","transformOrigin","textTransform","visibility","zIndex"]);var Cg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hl(this,e),wl(this,e,[fl({type:tu.CIRCLE},t)])}return Ml(e,t),pl(e)}(Ng);Cg.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var Lg=["style"],jg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Kl(n,Lg);return hl(this,e),(t=wl(this,e,[fl({style:r},i)])).isCustomElement=!0,t}return Ml(e,t),pl(e)}(Ng);jg.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Rg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hl(this,e),wl(this,e,[fl({type:tu.ELLIPSE},t)])}return Ml(e,t),pl(e)}(Ng);Rg.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"])),(function(t){function e(){return hl(this,e),wl(this,e,[{type:tu.FRAGMENT}])}return Ml(e,t),pl(e)}(Ng)).PARSED_STYLE_LIST=new Set(["class","className"]);var Ig=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hl(this,e),wl(this,e,[fl({type:tu.GROUP},t)])}return Ml(e,t),pl(e)}(Ng);Ig.PARSED_STYLE_LIST=new Set(["class","className","clipPath","cursor","draggable","droppable","opacity","pointerEvents","transform","transformOrigin","zIndex","visibility"]);var Dg=["style"],Bg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Kl(n,Dg);return hl(this,e),(t=wl(this,e,[fl({type:tu.HTML,style:r},i)])).cullable.enable=!1,t}return Ml(e,t),pl(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=wt(pt(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!uu.isEmpty(e)){var n=new uu;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(Ng);Bg.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var Fg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hl(this,e),wl(this,e,[fl({type:tu.IMAGE},t)])}return Ml(e,t),pl(e)}(Ng);Fg.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var zg=["style"],$g=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Kl(n,zg);hl(this,e),(t=wl(this,e,[fl({type:tu.LINE,style:fl({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},r)},i)])).markerStartAngle=0,t.markerEndAngle=0;var o=t.parsedStyle,a=o.markerStart,s=o.markerEnd;return a&&_g(a)&&(t.markerStartAngle=a.getLocalEulerAngles(),t.appendChild(a)),s&&_g(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return Ml(e,t),pl(e,[{key:"attributeChangedCallback",value: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&&_g(r)&&(this.markerStartAngle=0,r.remove()),i&&_g(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&_g(r)&&(this.markerEndAngle=0,r.remove()),i&&_g(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=e.x1,s=e.x2,c=e.y1,l=e.y2,u=t?n:r;if(u&&_g(u)){var f,h,d,p,g,v,y;t?(p=a,g=c,h=s-a,d=l-c,v=i||0,y=this.markerStartAngle):(p=s,g=l,h=a-s,d=c-l,v=o||0,y=this.markerEndAngle),f=Math.atan2(d,h),u.setLocalEulerAngles(180*f/Math.PI+y),u.setLocalPosition(p+Math.cos(f)*v,g+Math.sin(f)*v)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=Il(n.x1,n.y1,n.x2,n.y2,t),i=r.x,o=r.y,a=ue(Kt(),te(i,o,0),e?this.getWorldTransform():this.getLocalTransform());return new pu(a[0],a[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return Rl(t.x1,t.y1,t.x2,t.y2)}}])}(Ng);$g.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var Wg=["style"],Gg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Kl(n,Wg);hl(this,e),(t=wl(this,e,[fl({type:tu.PATH,style:r,initialParsedStyle:{miterLimit:4,d:fl({},Gu)}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var o=t.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&_g(a)&&(t.markerStartAngle=a.getLocalEulerAngles(),t.appendChild(a)),c&&_g(c)&&t.placeMarkerMid(c),s&&_g(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return Ml(e,t),pl(e,[{key:"attributeChangedCallback",value: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&&_g(r)&&(this.markerStartAngle=0,r.remove()),i&&_g(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&_g(r)&&(this.markerEndAngle=0,r.remove()),i&&_g(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,r=e.markerEnd,i=e.markerStartOffset,o=e.markerEndOffset,a=t?n:r;if(a&&_g(a)){var s,c,l,u,f,h,d;if(t){var p=El(this.getStartTangent(),2),g=p[0],v=p[1];u=v[0],f=v[1],c=g[0]-v[0],l=g[1]-v[1],h=i||0,d=this.markerStartAngle}else{var y=El(this.getEndTangent(),2),m=y[0],b=y[1];u=b[0],f=b[1],c=m[0]-b[0],l=m[1]-b[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)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&_g(t))for(var n=1;n<e.length-1;n++){var r=El(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)}}},{key:"getTotalLength",value:function(){return Th(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(t,e,n){return xn(t,e,Ce(Ce({},n),{bbox:!1,length:!0})).point}(this.parsedStyle.d.absolutePath,t),r=n.x,i=n.y,o=ue(Kt(),te(r,i,0),e?this.getWorldTransform():this.getLocalTransform());return new pu(o[0],o[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*Th(this),e)}},{key:"getStartTangent",value: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}},{key:"getEndTangent",value: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}}])}(Ng);Gg.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var Hg=["style"],Yg=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=n.style,i=Kl(n,Hg);hl(this,e),(t=wl(this,e,[fl({type:tu.POLYGON,style:r,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},i)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var o=t.parsedStyle,a=o.markerStart,s=o.markerEnd,c=o.markerMid;return a&&_g(a)&&(t.markerStartAngle=a.getLocalEulerAngles(),t.appendChild(a)),c&&_g(c)&&t.placeMarkerMid(c),s&&_g(s)&&(t.markerEndAngle=s.getLocalEulerAngles(),t.appendChild(s)),t.transformMarker(!0),t.transformMarker(!1),t}return Ml(e,t),pl(e,[{key:"attributeChangedCallback",value: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&&_g(r)&&(this.markerStartAngle=0,r.remove()),i&&_g(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&_g(r)&&(this.markerEndAngle=0,r.remove()),i&&_g(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value: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&&_g(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)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&_g(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)}}}])}(Ng);Yg.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var qg=["style"],Vg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Kl(t,qg);return hl(this,e),wl(this,e,[fl({type:tu.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},r)])}return Ml(e,t),pl(e,[{key:"getTotalLength",value:function(){return 0===(t=this).parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=Wl(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength;var t}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],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=Rl(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=Il(n[l][0],n[l][1],n[l+1][0],n[l+1][1],c),f=u.x,h=u.y,d=ue(Kt(),te(f,h,0),e?this.getWorldTransform():this.getLocalTransform());return new pu(d[0],d[1])}},{key:"getStartTangent",value: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}},{key:"getEndTangent",value: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}}])}(Yg);Vg.PARSED_STYLE_LIST=new Set([].concat(yl(Yg.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var Ug=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hl(this,e),wl(this,e,[fl({type:tu.RECT},t)])}return Ml(e,t),pl(e)}(Ng);Ug.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var Xg=["style"],Zg=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,r=Kl(t,Xg);return hl(this,e),wl(this,e,[fl({type:tu.TEXT,style:fl({fill:"black"},n)},r)])}return Ml(e,t),pl(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(Ng);Zg.PARSED_STYLE_LIST=new Set([].concat(yl(Ng.PARSED_STYLE_LIST),["x","y","z","isBillboard","billboardRotation","isSizeAttenuation","text","textAlign","textBaseline","fontStyle","fontSize","fontFamily","fontWeight","fontVariant","lineHeight","letterSpacing","leading","wordWrap","wordWrapWidth","maxLines","textOverflow","isOverflowing","textPath","textDecorationLine","textDecorationColor","textDecorationStyle","textPathSide","textPathStartOffset","metrics","dx","dy"]));var Kg=function(){return pl((function t(){hl(this,t),this.registry={},this.define(tu.CIRCLE,Cg),this.define(tu.ELLIPSE,Rg),this.define(tu.RECT,Ug),this.define(tu.IMAGE,Fg),this.define(tu.LINE,$g),this.define(tu.GROUP,Ig),this.define(tu.PATH,Gg),this.define(tu.POLYGON,Yg),this.define(tu.POLYLINE,Vg),this.define(tu.TEXT,Zg),this.define(tu.HTML,Bg)}),[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),Qg=function(t){var e=t.name,n=t.inherits,r=t.interpolable,i=t.initialValue,o=t.syntax;mg.styleValueRegistry.registerMetadata({n:e,inh:n,int:r,d:i,syntax:o})},Jg=function(t){function e(){var t;hl(this,e),(t=wl(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new mg.AnimationTimeline(t)}catch(t){}var n={};return hd.forEach((function(t){var e=t.n,r=t.inh,i=t.d;r&&i&&(n[e]=m(i)?i(tu.GROUP):i)})),t.documentElement=new Ig({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return Ml(e,t),pl(e,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"createElement",value: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?Zg:Ig);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw new Error(vu)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value: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}},{key:"elementFromPointSync",value: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}},{key:"elementFromPoint",value:(r=Xl(Vl().mark((function t(e,n){var r,i,o,a,s,c,l,u,f,h,d;return Vl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,c=a.height,!(i<0||o<0||i>s||o>c)){t.next=4;break}return t.abrupt("return",null);case 4:return l=this.defaultView.viewport2Client({x:i,y:o}),u=l.x,f=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:u,clientY:f},picked:[]});case 7:return h=t.sent,d=h.picked,t.abrupt("return",d&&d[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value: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}},{key:"elementsFromPoint",value:(n=Xl(Vl().mark((function t(e,n){var r,i,o,a,s,c,l,u,f,h,d;return Vl().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,c=a.height,!(i<0||o<0||i>s||o>c)){t.next=4;break}return t.abrupt("return",[]);case 4:return l=this.defaultView.viewport2Client({x:i,y:o}),u=l.x,f=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:u,clientY:f},picked:[]});case 7:return h=t.sent,(d=h.picked)[d.length-1]!==this.documentElement&&d.push(this.documentElement),t.abrupt("return",d);case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw new Error(yu)}},{key:"insertBefore",value:function(t,e){throw new Error(yu)}},{key:"removeChild",value:function(t,e){throw new Error(yu)}},{key:"replaceChild",value:function(t,e,n){throw new Error(yu)}},{key:"append",value:function(){throw new Error(yu)}},{key:"prepend",value:function(){throw new Error(yu)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,r}(jp),tv=function(){function t(e){hl(this,t),this.strategies=e}return pl(t,[{key:"apply",value: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 Np($p.CULLED)),null)}return t})),r.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}])}();tv.tag="Culling";var ev=function(){function t(){var e=this;hl(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new Tp(null),this.rootWheelEvent=new Pp(null),this.onPointerMove=function(t){var n,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r.supportsTouchEvents||"touch"!==t.pointerType){var i,o=Zl(e.normalizeToPointerEvent(t,r));try{for(o.s();!(i=o.n()).done;){var a=i.value,s=e.bootstrapEvent(e.rootPointerEvent,a,r,t);e.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,o=Zl(e.normalizeToPointerEvent(t,i));try{for(o.s();!(r=o.n()).done;){var a=r.value,s=e.bootstrapEvent(e.rootPointerEvent,a,i,t);e.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}e.setCursor(e.context.eventService.cursor)}}return pl(t,[{key:"apply",value: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){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var r,o=Zl(e);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=n.bootstrapEvent(n.rootPointerEvent,a,i,t);n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e,r=n.context.contextService.getDomElement(),o=n.context.eventService.isNativeEventFromCanvas(r,t)?"":"outside",a=Zl(n.normalizeToPointerEvent(t,i));try{for(a.s();!(e=a.n()).done;){var s=e.value,c=n.bootstrapEvent(n.rootPointerEvent,s,i,t);c.type+=o,n.context.eventService.mapEvent(c)}}catch(t){a.e(t)}finally{a.f()}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=Zl(n.normalizeToPointerEvent(t,i));try{for(r.s();!(e=r.n()).done;){var o=e.value,a=n.bootstrapEvent(n.rootPointerEvent,o,i,t);n.context.eventService.mapEvent(a)}}catch(t){r.e(t)}finally{r.f()}n.setCursor(n.context.eventService.cursor)}))}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var i=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),o=i.x,a=i.y;t.viewport.x=o,t.viewport.y=a;var s=this.context.eventService.viewport2Canvas(t.viewport),c=s.x,l=s.y;return t.canvas.x=c,t.canvas.y=l,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=zd[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),r=n.x,i=n.y;e.viewport.x=r,e.viewport.y=i;var o=this.context.eventService.viewport2Canvas(e.viewport),a=o.x,s=o.y;return e.canvas.x=a,e.canvas.y=s,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=$d.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}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;r<t.changedTouches.length;r++){var i=t.changedTouches[r];Y(i.button)&&(i.button=0),Y(i.buttons)&&(i.buttons=1),Y(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Y(i.width)&&(i.width=i.radiusX||1),Y(i.height)&&(i.height=i.radiusY||1),Y(i.tiltX)&&(i.tiltX=0),Y(i.tiltY)&&(i.tiltY=0),Y(i.pointerType)&&(i.pointerType="touch"),Y(i.pointerId)&&(i.pointerId=i.identifier||0),Y(i.pressure)&&(i.pressure=i.force||.5),Y(i.twist)&&(i.twist=0),Y(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;Y(o.isPrimary)&&(o.isPrimary=!0),Y(o.width)&&(o.width=1),Y(o.height)&&(o.height=1),Y(o.tiltX)&&(o.tiltX=0),Y(o.tiltY)&&(o.tiltY=0),Y(o.pointerType)&&(o.pointerType="mouse"),Y(o.pointerId)&&(o.pointerId=1),Y(o.pressure)&&(o.pressure=.5),Y(o.twist)&&(o.twist=0),Y(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n}}])}();ev.tag="Event";var nv=[tu.CIRCLE,tu.ELLIPSE,tu.IMAGE,tu.RECT,tu.LINE,tu.POLYLINE,tu.POLYGON,tu.TEXT,tu.PATH,tu.HTML],rv=function(){return pl((function t(){hl(this,t)}),[{key:"isVisible",value:function(t,e){var n,r=e.cullable;if(!r.enable)return!0;var i=e.getRenderBounds();if(uu.isEmpty(i))return!1;var o=t.getFrustum(),a=null===(n=e.parentNode)||void 0===n||null===(n=n.cullable)||void 0===n?void 0:n.visibilityPlaneMask;return r.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(e,i,a||hu.INDETERMINATE,o.planes),r.visible=r.visibilityPlaneMask!==hu.OUTSIDE,r.visible}},{key:"computeVisibilityWithPlaneMask",value:function(t,e,n,r){if(n===hu.OUTSIDE||n===hu.INSIDE)return n;for(var i=hu.INSIDE,o=nv.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(se(u,e.getPositiveFarPoint(r[a]))+f<0)return hu.OUTSIDE;se(u,e.getNegativeFarPoint(r[a]))+f<0&&(i|=c)}}return i}}])}(),iv=function(){function t(){hl(this,t),this.syncTasks=new Map,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return pl(t,[{key:"apply",value: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){r.syncTasks.set(t.target,t.detail.affectChildren),i.dirtify()},u=function(t){var e=t.target;mg.enableSizeAttenuation&&mg.styleValueRegistry.updateSizeAttenuation(e,s.getCamera().getZoom())},f=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.syncTasks.delete(e),mg.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tap(t.tag,(function(){s.addEventListener($p.MOUNTED,u),s.addEventListener($p.UNMOUNTED,f),s.addEventListener($p.ATTR_MODIFIED,c),s.addEventListener($p.BOUNDS_CHANGED,l)})),i.hooks.destroy.tap(t.tag,(function(){s.removeEventListener($p.MOUNTED,u),s.removeEventListener($p.UNMOUNTED,f),s.removeEventListener($p.ATTR_MODIFIED,c),s.removeEventListener($p.BOUNDS_CHANGED,l),r.syncTasks.clear()}));var h=null!==(n=mg.globalThis.requestIdleCallback)&&void 0!==n?n:Jd.bind(mg.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()}))}},{key:"syncNode",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var r=t.getRenderBounds();if(r){var i=t.renderable;e&&(i.dirtyRenderBounds||(i.dirtyRenderBounds=new uu),i.dirtyRenderBounds.update(r.center,r.halfExtents));var o=El(r.getMin(),2),a=o[0],s=o[1],c=El(r.getMax(),2),l=c[0],u=c[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=a,n.aabb.minY=s,n.aabb.maxX=l,n.aabb.maxY=u}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],r=new Set,i=function(i){if(!r.has(i)&&i.renderable){var o=t.syncNode(i,e);o&&(n.push(o),r.add(i))}};this.syncTasks.forEach((function(t,e){t&&e.forEach(i);for(var n=e;n;)i(n),n=n.parentElement})),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();iv.tag="Prepare";var ov=function(t){return 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",t}({}),av=new Np($p.MOUNTED),sv=new Np($p.UNMOUNTED),cv=new Np(ov.BEFORE_RENDER),lv=new Np(ov.RERENDER),uv=new Np(ov.AFTER_RENDER),fv=function(t){function e(t){var n;hl(this,e),(n=wl(this,e)).Element=Ng,n.inited=!1,n.context={};var r=t.container,i=t.canvas,o=t.renderer,a=t.width,s=t.height,c=t.background,l=t.cursor,u=t.supportsMutipleCanvasesInOneContainer,f=t.cleanUpOnDestroy,h=void 0===f||f,d=t.offscreenCanvas,p=t.devicePixelRatio,g=t.requestAnimationFrame,v=t.cancelAnimationFrame,y=t.createImage,m=t.supportsTouchEvents,b=t.supportsPointerEvents,x=t.isTouchEvent,w=t.isMouseEvent,k=t.dblClickSpeed,M=a,E=s,O=p||Rd&&window.devicePixelRatio||1;return O=O>=1?Math.ceil(O):1,i&&(M=a||function(t){var e=Fd(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/O,E=s||function(t){var e=Fd(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/O),n.customElements=new Kg,n.devicePixelRatio=O,n.requestAnimationFrame=null!=g?g:Jd.bind(mg.globalThis),n.cancelAnimationFrame=null!=v?v:tp.bind(mg.globalThis),n.supportsTouchEvents=null!=m?m:"ontouchstart"in mg.globalThis,n.supportsPointerEvents=null!=b?b:!!mg.globalThis.PointerEvent,n.isTouchEvent=null!=x?x:function(t){return n.supportsTouchEvents&&t instanceof mg.globalThis.TouchEvent},n.isMouseEvent=null!=w?w:function(t){return!mg.globalThis.MouseEvent||t instanceof mg.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof mg.globalThis.PointerEvent))},d&&(mg.offscreenCanvas=d),n.document=new Jg,n.document.defaultView=n,u||function(t,e,n){if(t){var r="string"==typeof t?document.getElementById(t):t;jd.has(r)&&jd.get(r).destroy(n),jd.set(r,e)}}(r,n,h),n.initRenderingContext(fl(fl({},t),{},{width:M,height:E,background:null!=c?c:"transparent",cursor:null!=l?l:"default",cleanUpOnDestroy:h,devicePixelRatio:O,requestAnimationFrame:n.requestAnimationFrame,cancelAnimationFrame:n.cancelAnimationFrame,supportsTouchEvents:n.supportsTouchEvents,supportsPointerEvents:n.supportsPointerEvents,isTouchEvent:n.isTouchEvent,isMouseEvent:n.isMouseEvent,dblClickSpeed:null!=k?k:200,createImage:null!=y?y:function(){return new window.Image}})),n.initDefaultCamera(M,E,o.clipSpaceNearZ),n.initRenderer(o,!0),n}return Ml(e,t),pl(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var r=this,i=new mg.CameraContribution;i.clipSpaceNearZ=n,i.setType(Ru.EXPLORING,Iu.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(Bu,(function(){r.context.renderingContext.renderReasons.add(Dp.CAMERA_CHANGED),mg.enableSizeAttenuation&&r.getConfig().renderer.getConfig().enableSizeAttenuation&&r.updateSizeAttenuation()})),this.context.camera=i}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){mg.styleValueRegistry.updateSizeAttenuation(e,t)}))}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{key:"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}},{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;Of.clearCache(),e||this.dispatchEvent(new Np(ov.BEFORE_DESTROY)),this.frameId&&this.cancelAnimationFrame(this.frameId);var n=this.getRoot();t&&(this.unmountChildren(n),this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),this.context.rBushRoot&&this.context.rBushRoot.clear(),e||this.dispatchEvent(new Np(ov.AFTER_DESTROY));var r=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};r(av),r(sv),r(cv),r(lv),r(uv),r(Ag),r(kg),r(Mg),r(Eg)}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value: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===Du.ORTHOGRAPHIC?r.setOrthographic(t/-2,t/2,e/2,e/-2,r.getNear(),r.getFar()):r.setAspect(t/e),this.dispatchEvent(new Np(ov.RESIZE,{width:t,height:e}))}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e=this;t&&(cv.detail=t,uv.detail=t),this.dispatchEvent(cv),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(lv)})),this.dispatchEvent(uv)}},{key:"run",value:function(){var t=this,e=function(n,r){t.render(r),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new Jl,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new ev,new iv,new tv([new rv])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService(fl(fl({},mg),this.context)),this.context.renderingService=new Bp(mg,this.context),this.context.eventService=new Rp(mg,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then((function(){e.initRenderingService(t,n)})).catch((function(t){console.error(t)}))}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init((function(){e.inited=!0,n?r?e.requestAnimationFrame((function(){e.dispatchEvent(new Np(ov.READY))})):e.dispatchEvent(new Np(ov.READY)):e.dispatchEvent(new Np(ov.RENDERER_CHANGED)),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()}))}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(mg)}))}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),yl((null==n?void 0:n.getPlugins())||[]).reverse().forEach((function(t){t.destroy(mg)})),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(sv):(sv.target=t,this.dispatchEvent(sv,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Wd(t);this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,n||(t.isMutationObserved?t.dispatchEvent(av):(av.target=t,this.dispatchEvent(av,!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,n)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(Lp),hv=function(t){function e(){var t;hl(this,e);for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=wl(this,e,[].concat(r))).landmarks=[],t}return Ml(e,t),pl(e,[{key:"rotate",value:function(t,e,n){if(this.relElevation=mu(e),this.relAzimuth=mu(t),this.relRoll=mu(n),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===Ru.EXPLORING){var r=xe(be(),[1,0,0],ku((this.rotateWorld?1:-1)*this.relElevation)),i=xe(be(),[0,1,0],ku((this.rotateWorld?1:-1)*this.relAzimuth)),o=xe(be(),[0,0,1],ku(this.relRoll)),a=we(be(),i,r);a=we(be(),a,o);var s=Ft(pt(),a);Et(this.matrix,this.matrix,[0,0,-this.distance]),Mt(this.matrix,this.matrix,s),Et(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===Ru.ORBITING||this.type===Ru.EXPLORING?this._getPosition():this.type===Ru.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=xu(t,e,0),r=Qt(this.position);return re(r,r,oe(Kt(),this.right,n[0])),re(r,r,oe(Kt(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var e=this.forward,n=Qt(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===Ru.ORBITING||this.type===Ru.EXPLORING?this._getDistance():this.type===Ru.TRACKING&&re(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(t){var e,n,r,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=o.position,s=void 0===a?this.position:a,c=o.focalPoint,l=void 0===c?this.focalPoint:c,u=o.roll,f=o.zoom,h=new mg.CameraContribution;h.setType(this.type,void 0),h.setPosition(s[0],null!==(e=s[1])&&void 0!==e?e:this.position[1],null!==(n=s[2])&&void 0!==n?n:this.position[2]),h.setFocalPoint(l[0],null!==(r=l[1])&&void 0!==r?r:this.focalPoint[1],null!==(i=l[2])&&void 0!==i?i:this.focalPoint[2]),h.setRoll(null!=u?u:this.roll),h.setZoom(null!=f?f:this.zoom);var d={name:t,matrix:gt(h.getWorldTransform()),right:Qt(h.right),up:Qt(h.up),forward:Qt(h.forward),position:Qt(h.getPosition()),focalPoint:Qt(h.getFocalPoint()),distanceVector:Qt(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}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=L(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=I(n)?{duration:n}:n,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;this.cancelLandmarkAnimation();var g,v=r.position,y=r.focalPoint,m=r.zoom,b=r.roll,x=u||mg.EasingFunction(a),w=function(){e.setFocalPoint(y),e.setPosition(v),e.setRoll(b),e.setZoom(m),e.computeMatrix(),e.triggerUpdate(),null==h||h()};if(0===c)return w();var k=function(t){void 0===g&&(g=t);var n=t-g;if(n>=c)w();else{var r,i,o=x(n/c),a=Kt(),s=Kt();if(le(a,e.focalPoint,y,o),le(s,e.position,v,o),i=e.roll*(1-o)+b*o,r=e.zoom*(1-o)+m*o,e.setFocalPoint(a),e.setPosition(s),e.setRoll(i),e.setZoom(r),pe(a,y)+pe(s,v)<=.01&&void 0===m&&void 0===b)return w();e.computeMatrix(),e.triggerUpdate(),n<c&&(null==p||p(o),e.landmarkAnimationID=e.canvas.requestAnimationFrame(k))}};this.canvas.requestAnimationFrame(k)}}}])}(zu);mg.CameraContribution=hv;
|
|
10
10
|
/*!
|
|
11
11
|
* @antv/g-web-animations-api
|
|
12
12
|
* @description A simple implementation of Web Animations API.
|
|
13
|
-
* @version 2.1.
|
|
14
|
-
* @date 5/
|
|
13
|
+
* @version 2.1.25
|
|
14
|
+
* @date 5/23/2025, 7:01:32 AM
|
|
15
15
|
* @author AntVis
|
|
16
16
|
* @docs https://g.antv.antgroup.com/
|
|
17
17
|
*/
|
|
18
|
-
var dv=function(t){function e(t,n,r,i){var o;return hl(this,e),(o=wl(this,e,[t])).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 Ml(e,t),pl(e)}(Sp),pv=0,gv=function(){return pl((function t(e,n){var r;hl(this,t),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=n,this.id="".concat(pv++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(r=this.effect)||void 0===r?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}),[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"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}},{key:"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}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(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))}}},{key:"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()}}},{key:"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()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value: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}},{key:"play",value: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()}},{key:"pause",value: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()}},{key:"finish",value: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())}},{key:"cancel",value: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 dv(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value: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))}},{key:"rewind",value: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}}},{key:"persist",value:function(){throw new Error(vu)}},{key:"addEventListener",value:function(t,e,n){throw new Error(vu)}},{key:"removeEventListener",value:function(t,e,n){throw new Error(vu)}},{key:"dispatchEvent",value:function(t){throw new Error(vu)}},{key:"commitStyles",value:function(){throw new Error(vu)}},{key:"ensureAlive",value:function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new dv(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 dv(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}}}])}(),vv=.1,yv="function"==typeof Float32Array,mv=function(t,e){return 1-3*e+3*t},bv=function(t,e){return 3*e-6*t},xv=function(t){return 3*t},wv=function(t,e,n){return((mv(e,n)*t+bv(e,n))*t+xv(e))*t},kv=function(t,e,n){return 3*mv(e,n)*t*t+2*bv(e,n)*t+xv(e)},Mv=function(t,e,n,r){if(!(t>=0&&t<=1&&n>=0&&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=yv?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=wv(o*vv,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=vv;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*vv,s=kv(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=kv(e,n,r);if(0===o)return e;e-=(wv(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=wv(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+vv,t,n)};return function(t){return 0===t||1===t?t:wv(a(t),e,r)}},Ev=function(t){return Math.pow(t,2)},Ov=function(t){return Math.pow(t,3)},_v=function(t){return Math.pow(t,4)},Sv=function(t){return Math.pow(t,5)},Av=function(t){return Math.pow(t,6)},Tv=function(t){return 1-Math.cos(t*Math.PI/2)},Pv=function(t){return 1-Math.sqrt(1-t*t)},Nv=function(t){return t*t*(3*t-2)},Cv=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)},Lv=function(t){var e=El(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?1:n,i=e[1],o=void 0===i?.5:i,a=R(Number(r),1,10),s=R(Number(o),.1,2);return 0===t||1===t?t:-a*Math.pow(2,10*(t-1))*Math.sin((t-1-s/(2*Math.PI)*Math.asin(1/a))*(2*Math.PI)/s)},jv=function(t){var e=arguments.length>2?arguments[2]:void 0,n=El(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?100:o,s=n[2],c=void 0===s?10:s,l=n[3],u=void 0===l?0:l;i=R(i,.1,1e3),a=R(a,.1,1e3),c=R(c,.1,1e3),u=R(u,.1,1e3);var f=Math.sqrt(a/i),h=c/(2*Math.sqrt(a*i)),d=h<1?f*Math.sqrt(1-h*h):0,p=h<1?(h*f-u)/d:-u+f,g=e?e*t/1e3:t;return g=h<1?Math.exp(-g*h*f)*(1*Math.cos(d*g)+p*Math.sin(d*g)):(1+p*g)*Math.exp(-g*f),0===t||1===t?t:1-g},Rv=function(t){var e=El(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?10:n;return("start"===e[1]?Math.ceil:Math.floor)(R(t,0,1)*r)/r},Iv=function(t){var e=El(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),n=e[0],r=e[1],i=e[2],o=e[3];return Mv(n,r,i,o)(t)},Dv=Mv(.42,0,1,1),Bv=function(t){return function(e){return 1-t(1-e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],arguments.length>2?arguments[2]:void 0)}},Fv=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},zv=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},$v={steps:Rv,"step-start":function(t){return Rv(t,[1,"start"])},"step-end":function(t){return Rv(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Iv,ease:function(t){return Iv(t,[.25,.1,.25,1])},in:Dv,out:Bv(Dv),"in-out":Fv(Dv),"out-in":zv(Dv),"in-quad":Ev,"out-quad":Bv(Ev),"in-out-quad":Fv(Ev),"out-in-quad":zv(Ev),"in-cubic":Ov,"out-cubic":Bv(Ov),"in-out-cubic":Fv(Ov),"out-in-cubic":zv(Ov),"in-quart":_v,"out-quart":Bv(_v),"in-out-quart":Fv(_v),"out-in-quart":zv(_v),"in-quint":Sv,"out-quint":Bv(Sv),"in-out-quint":Fv(Sv),"out-in-quint":zv(Sv),"in-expo":Av,"out-expo":Bv(Av),"in-out-expo":Fv(Av),"out-in-expo":zv(Av),"in-sine":Tv,"out-sine":Bv(Tv),"in-out-sine":Fv(Tv),"out-in-sine":zv(Tv),"in-circ":Pv,"out-circ":Bv(Pv),"in-out-circ":Fv(Pv),"out-in-circ":zv(Pv),"in-back":Nv,"out-back":Bv(Nv),"in-out-back":Fv(Nv),"out-in-back":zv(Nv),"in-bounce":Cv,"out-bounce":Bv(Cv),"in-out-bounce":Fv(Cv),"out-in-bounce":zv(Cv),"in-elastic":Lv,"out-elastic":Bv(Lv),"in-out-elastic":Fv(Lv),"out-in-elastic":zv(Lv),spring:jv,"spring-in":jv,"spring-out":Bv(jv),"spring-in-out":Fv(jv),"spring-out-in":zv(jv)},Wv=function(t){return t};function Gv(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Hv="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Yv=new RegExp("cubic-bezier\\(".concat(Hv,",").concat(Hv,",").concat(Hv,",").concat(Hv,"\\)")),qv=/steps\(\s*(\d+)\s*\)/,Vv=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Uv(t){var e=Yv.exec(t);if(e)return Mv.apply(void 0,yl(e.slice(1).map(Number)));var n=qv.exec(t);if(n)return Gv(Number(n[1]),0);var r=Vv.exec(t);return r?Gv(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):$v[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||$v.linear}function Xv(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function Zv(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)}function Kv(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(Qv(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Uv(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:ty(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)Qv(n)&&t.setAttribute(n,null)}}function Qv(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Jv=function(t,e,n){return function(r){var i=ey(t,e,r);return I(i)?i:n(i)}};function ty(t,e,n,r){var i=pd[t];if(i&&i.syntax&&i.int){var o=mg.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=o.parser,s=a?a(e,r):e,c=a?a(n,r):n,l=o.mixer(s,c,r);if(l){var u=Jv.apply(void 0,yl(l));return function(t){return 0===t?e:1===t?n:u(t)}}}}return Jv(!1,!0,(function(t){return t?n:e}))}function ey(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(ey(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments ".concat(t,":").concat(e))}var ny=function(){return pl((function t(){hl(this,t),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Wv,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}),[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Uv(t),this._easing=t}}])}();function ry(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&&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(b(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(!b(s)&&!b(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 iy="backwards|forwards|both|none".split("|"),oy="reverse|alternate|alternate-reverse".split("|");function ay(t,e){return function(t,e){var n=new ny;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===iy.indexOf(t[e]))return;if("direction"===e&&-1===oy.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),e)}var sy=function(){return pl((function t(e,n,r){var i=this;hl(this,t),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=ay(r,!1),this.timing.effect=this,this.timing.activeDuration=Xv(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=ry(n,this.timing),this.interpolations=Kv(this.normalizedKeyframes,this.timing,this.target);var o=mg.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}),[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return null!==t&&(this.timeFraction=Zv(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=ry(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))}}])}();function cy(t,e){return Number(t.id)-Number(e.id)}var ly=function(){return pl((function t(e){var n=this;hl(this,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){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(t){var e=n.rafCallbacks;n.rafCallbacks=[],t<Number(n.currentTime)&&(t=Number(n.currentTime)),n.animations.sort(cy),n.animations=n.tick(t,!0,n.animations)[0],e.forEach((function(e){e[1](t)})),n.applyPendingEffects()},this.document=e}),[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,e,n){var r=new sy(t,e,n),i=new gv(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i}},{key:"applyDirtiedAnimation",value:function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(cy),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()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value: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}},{key:"requestAnimationFrame",value:function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))}},{key:"tick",value: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,a),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,l]}}])}();function uy(t){return new fy([t],null,t,t.ownerDocument)}mg.EasingFunction=Uv,mg.AnimationTimeline=ly;class fy{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 fy(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new fy(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 fy([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 fy(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 fy(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new fy([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 fy([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=Jn(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 fy([],r,this._parent,this._document),new fy(i,null,this._parent,this._document),new fy(o,null,this._parent,this._document),new fy([],a,this._parent,this._document),new fy(s,null,this._parent,this._document)];return new fy(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new fy(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=fy.registry[t];return e?new e:Uo(`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 fy([],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 hy(t,e,n){return Math.max(e,Math.min(t,n))}function dy(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function py(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function gy(t,e,n,r,i){const o=Ts(_s(r,e))+Math.PI,a=Ts(_s(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function vy(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=aa(a),[l,u]=Vn(c,(t=>a[t])),f=new po({domain:[l,u],range:[0,100]}),h=t=>I(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 yy(t){const[e,n,r,i]=t;return[i,e,n,r]}function my(t,e,n){const[r,i,,o]=Kc(t)?yy(e):e,[a,s]=n,c=t.getCenter(),l=Ps(_s(r,c)),u=Ps(_s(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:As(o,c),outerRadius:As(r,c)}}function by(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function xy(t,e){if(!Qc(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function wy(t){if(1===t.length)return t[0];const[[e,n,r=0],[i,o,a=0]]=t;return[(e+i)/2,(n+o)/2,(r+a)/2]}function ky(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:v=1/0,minHeight:y=-1/0}=i,m=Le(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!Qc(r)&&!tl(r)){const n=!!Kc(r),[i,,o]=n?yy(e):e,[a,b]=i,[x,w]=_s(o,i),k=(x>0?a:a+x)+s,M=(w>0?b:b+w)+c,E=Math.abs(x)-(s+l),O=Math.abs(w)-(c+u),_=n?hy(E,y,1/0):hy(E,g,v),S=n?hy(O,g,v):hy(O,y,1/0),A=n?k:k-(_-E)/2,T=n?M-(S-O)/2:M-(S-O);return uy(t.createElement("rect",{})).style("x",A).style("y",T).style("width",_).style("height",S).style("radius",[d,p,h,f]).call(py,m).node()}const{y:b,y1:x}=n,w=r.getCenter(),k=my(r,e,[b,x]),M=vc().cornerRadius(a).padAngle(o*Math.PI/180);return uy(t.createElement("path",{})).style("d",M(k)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",a).style("inset",o).call(py,m).node()}fy.registry={g:Ig,rect:Ug,circle:Cg,path:Gg,text:Zg,ellipse:Rg,image:Fg,line:$g,polygon:Yg,polyline:Vg,html:Bg};const My=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=t,a=Le(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,h=Le(l,["color","radius"]),d=h.lineWidth||1,{stroke:p,radius:g=f,radiusTopLeft:v=g,radiusTopRight:y=g,radiusBottomRight:m=g,radiusBottomLeft:b=g,innerRadius:x=0,innerRadiusTopLeft:w=x,innerRadiusTopRight:k=x,innerRadiusBottomRight:M=x,innerRadiusBottomLeft:E=x,lineWidth:O=("stroke"===n||p?d:0),inset:_=0,insetLeft:S=_,insetRight:A=_,insetBottom:T=_,insetTop:P=_,minWidth:N,maxWidth:C,minHeight:L}=a,j=Le(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,D=[i?v:w,i?y:k,o?m:M,o?b:E],B=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];Kc(s)&&B.push(B.shift());const F=Object.assign(Object.assign({radius:g},Object.fromEntries(B.map(((t,e)=>[t,D[e]])))),{inset:_,insetLeft:S,insetRight:A,insetBottom:T,insetTop:P,minWidth:N,maxWidth:C,minHeight:L});return uy(ky(c,e,r,s,F)).call(py,h).style("fill","transparent").style(n,R).style(by(t),I).style("lineWidth",O).style("stroke",void 0===p?R:p).call(py,j).node()}};My.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ey=(t,e)=>My(Object.assign({colorAttribute:"fill"},t),e);Ey.props=Object.assign(Object.assign({},My.props),{defaultMarker:"square"});const Oy=(t,e)=>My(Object.assign({colorAttribute:"stroke"},t),e);function _y(t,e,n){const[r,i,o,a]=t;if(Kc(n)){return[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:o[0],o[1]],a]}return[r,[i[0],e?e[0][1]:i[1]],[o[0],e?e[3][1]:o[1]],a]}Oy.props=Object.assign(Object.assign({},My.props),{defaultMarker:"hollowSquare"});const Sy=(t,e)=>{const{adjustPoints:n=_y}=t,r=Le(t,["adjustPoints"]),{coordinate:i,document:o}=e;return(t,e,a,s)=>{const{index:c}=e,{color:l}=a,u=Le(a,["color"]),f=s[c+1],h=n(t,f,i),d=!!Kc(i),[p,g,v,y]=d?yy(h):h,{color:m=l,opacity:b}=e,x=kc().curve(Dc)([p,g,v,y]);return uy(o.createElement("path",{})).call(py,u).style("d",x).style("fill",m).style("fillOpacity",b).call(py,r).node()}};function Ay(t,e,n){const[r,i,o,a]=t;if(Kc(n)){return[r,[e?e[0][0]:(i[0]+o[0])/2,i[1]],[e?e[3][0]:(i[0]+o[0])/2,o[1]],a]}return[r,[i[0],e?e[0][1]:(i[1]+o[1])/2],[o[0],e?e[3][1]:(i[1]+o[1])/2],a]}Sy.props={defaultMarker:"square"};const Ty=(t,e)=>Sy(Object.assign({adjustPoints:Ay},t),e);function Py(t){const e="function"==typeof t?t:t.render;return class extends jg{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Ty.props={defaultMarker:"square"};const Ny=Py((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;uy(t).maybeAppend("line",(()=>o.createElement("path",{}))).style("d",e).call(py,r),uy(t).maybeAppend("line1",(()=>o.createElement("path",{}))).style("d",n).call(py,i)}));const Cy=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=t=>!Number.isNaN(t)&&null!=t,connect:a=!1}=t,s=Le(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:h}=u,d=Le(u,["color","lineWidth"]),{color:p=f,size:g=h,seriesColor:v,seriesX:y,seriesY:m}=e,b=xy(c,e),x=Kc(c),w=r&&v?vy(v,y,m,r,i,x):p,k=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),w&&{stroke:w}),g&&{lineWidth:g}),b&&{transform:b}),s);let M;if(Qc(c)){const t=c.getCenter();M=e=>Sc(kc().curve(Ec)).angle(((n,r)=>Ps(_s(e[r],t)))).radius(((n,r)=>As(e[r],t))).defined((([t,e])=>o(t)&&o(e))).curve(n)(e)}else M=kc().x((t=>t[0])).y((t=>t[1])).defined((([t,e])=>o(t)&&o(e))).curve(n);const[E,O]=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),_=Qo(k,"connect"),S=!!O.length;if(!S||a&&!Object.keys(_).length)return uy(l.createElement("path",{})).style("d",M(E)||[]).call(py,k).node();if(S&&!a)return uy(l.createElement("path",{})).style("d",M(t)).call(py,k).node();return uy(new Ny).style("style1",Object.assign(Object.assign({},k),_)).style("style2",k).style("d1",(A=O,A.map(M).join(","))).style("d2",M(t)).node();var A}};Cy.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ly=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Qc(n)?Dc:bc;return Cy(Object.assign({curve:i},t),e)(...r)}};Ly.props=Object.assign(Object.assign({},Cy.props),{defaultMarker:"line"});const jy=(t,e)=>{const n=Le(t,[]),{coordinate:r}=e;return(...t)=>{const i=Qc(r)?Rc:Kc(r)?qc:Yc;return Cy(Object.assign({curve:i},n),e)(...t)}};jy.props=Object.assign(Object.assign({},Cy.props),{defaultMarker:"smooth"});const Ry=(t,e)=>Cy(Object.assign({curve:Zc},t),e);Ry.props=Object.assign(Object.assign({},Cy.props),{defaultMarker:"hv"});const Iy=(t,e)=>Cy(Object.assign({curve:Xc},t),e);Iy.props=Object.assign(Object.assign({},Cy.props),{defaultMarker:"vh"});const Dy=(t,e)=>Cy(Object.assign({curve:Uc},t),e);function By(t,e,n,r,i){const o=Ts(_s(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=Ss(e,s),h=Ss(n,c),d=Ss(h,l),p=Ss(n,l),g=_s(p,c),v=_s(n,c),y=_s(e,s),m=_s(y,u),b=_s(e,u),x=_s(f,u);t.moveTo(...f),t.lineTo(...h),t.arcTo(...d,...p,i/2),t.arcTo(...g,...v,i/2),t.lineTo(...y),t.arcTo(...m,...b,r/2),t.arcTo(...x,...f,r/2),t.closePath()}Dy.props=Object.assign(Object.assign({},Cy.props),{defaultMarker:"hvh"});const Fy=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=Le(i,["color"]),l=cc();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(Zo)&&By(l,n,r,i,a)}return uy(n.createElement("path",{})).call(py,c).style("fill",a||s).style("d",l.toString()).call(py,t).node()}};Fy.props=Object.assign(Object.assign({},Cy.props),{defaultMarker:"line"});const zy=(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"]];zy.style=["fill"];const $y=zy.bind(void 0);$y.style=["stroke","lineWidth"];const Wy=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];Wy.style=["fill"];const Gy=Wy.bind(void 0);Gy.style=["fill"];const Hy=Wy.bind(void 0);Hy.style=["stroke","lineWidth"];const Yy=(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"]]};Yy.style=["fill"];const qy=Yy.bind(void 0);qy.style=["stroke","lineWidth"];const Vy=(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"]]};Vy.style=["fill"];const Uy=Vy.bind(void 0);Uy.style=["stroke","lineWidth"];const Xy=(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"]]};Xy.style=["fill"];const Zy=Xy.bind(void 0);Zy.style=["stroke","lineWidth"];const Ky=(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"]]};Ky.style=["fill"];const Qy=Ky.bind(void 0);Qy.style=["stroke","lineWidth"];const Jy=(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"]]};Jy.style=["fill"];const tm=Jy.bind(void 0);tm.style=["stroke","lineWidth"];const em=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];em.style=["stroke","lineWidth"];const nm=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];nm.style=["stroke","lineWidth"];const rm=(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]];rm.style=["stroke","lineWidth"];const im=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];im.style=["stroke","lineWidth"];const om=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];om.style=["stroke","lineWidth"];const am=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];am.style=["stroke","lineWidth"];const sm=am.bind(void 0);sm.style=["stroke","lineWidth"];const cm=(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]];cm.style=["stroke","lineWidth"];const lm=(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]];lm.style=["stroke","lineWidth"];const um=(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]];um.style=["stroke","lineWidth"];const fm=(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]];fm.style=["stroke","lineWidth"];const hm=(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]];hm.style=["stroke","lineWidth"];const dm=new Map([["bowtie",Jy],["cross",nm],["dash",sm],["diamond",Yy],["dot",am],["hexagon",Ky],["hollowBowtie",tm],["hollowDiamond",qy],["hollowHexagon",Qy],["hollowPoint",$y],["hollowSquare",Hy],["hollowTriangle",Uy],["hollowTriangleDown",Zy],["hv",lm],["hvh",fm],["hyphen",om],["line",em],["plus",im],["point",zy],["rect",Gy],["smooth",cm],["square",Wy],["tick",rm],["triangleDown",Xy],["triangle",Vy],["vh",um],["vhv",hm]]);function pm(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function gm(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||nl(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 vm=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=Le(t,["colorAttribute","symbol","mode"]),a=dm.get(pm(r))||dm.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,[v,y]=wy(e),m=gm(i,e,r,s)||o.r||l.r;return uy(c.createElement("path",{})).call(py,l).style("fill","transparent").style("d",a(v,y,m)).style("lineWidth",h).style("transform",p).style("transformOrigin",`${v-m} ${y-m}`).style("stroke",d).style(by(t),g).style(n,d).call(py,o).node()}};vm.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ym=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);ym.props=Object.assign({defaultMarker:"hollowBowtie"},vm.props);const mm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);mm.props=Object.assign({defaultMarker:"hollowDiamond"},vm.props);const bm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);bm.props=Object.assign({defaultMarker:"hollowHexagon"},vm.props);const xm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);xm.props=Object.assign({defaultMarker:"hollowPoint"},vm.props);const wm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);wm.props=Object.assign({defaultMarker:"hollowSquare"},vm.props);const km=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);km.props=Object.assign({defaultMarker:"hollowTriangle"},vm.props);const Mm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);Mm.props=Object.assign({defaultMarker:"hollowTriangleDown"},vm.props);const Em=(t,e)=>{const{colorAttribute:n,mode:r="auto"}=t,i=Le(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,v]=wy(e),y=gm(r,e,s,o)||i.r||c.r;return uy(a.createElement("circle",{})).call(py,c).style("fill","transparent").style("cx",g).style("cy",v).style("r",y).style("lineWidth",f).style("transform",d).style("transformOrigin",`${g} ${v}`).style("stroke",h).style(by(t),p).style(n,h).call(py,i).node()}},Om=(t,e)=>Em(Object.assign({colorAttribute:"fill"},t),e);Om.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const _m=(t,e)=>Em(Object.assign({colorAttribute:"stroke"},t),e);_m.props=Object.assign({defaultMarker:"hollowPoint"},Om.props);const Sm=(t,e)=>vm(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);Sm.props=Object.assign({defaultMarker:"bowtie"},vm.props);const Am=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);Am.props=Object.assign({defaultMarker:"cross"},vm.props);const Tm=(t,e)=>vm(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);Tm.props=Object.assign({defaultMarker:"diamond"},vm.props);const Pm=(t,e)=>vm(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Pm.props=Object.assign({defaultMarker:"hexagon"},vm.props);const Nm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);Nm.props=Object.assign({defaultMarker:"hyphen"},vm.props);const Cm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);Cm.props=Object.assign({defaultMarker:"line"},vm.props);const Lm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);Lm.props=Object.assign({defaultMarker:"plus"},vm.props);const jm=(t,e)=>vm(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);jm.props=Object.assign({defaultMarker:"point"},vm.props);const Rm=(t,e)=>vm(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);Rm.props=Object.assign({defaultMarker:"square"},vm.props);const Im=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);Im.props=Object.assign({defaultMarker:"tick"},vm.props);const Dm=(t,e)=>vm(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);Dm.props=Object.assign({defaultMarker:"triangle"},vm.props);const Bm=(t,e)=>vm(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);Bm.props=Object.assign({defaultMarker:"triangleDown"},vm.props);const Fm=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=Le(t,["arrow","arrowSize"]),{document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Le(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=cc();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*As(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(...t),d.lineTo(...h),d.lineTo(...e)}return uy(o.createElement("path",{})).call(py,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(py,i).node()}};function zm(t,e){e(t),t.children&&t.children.forEach((function(t){t&&zm(t,e)}))}function $m(t){Gm(t,!0)}function Wm(t){Gm(t,!1)}function Gm(t,e){var n=e?"visible":"hidden";zm(t,(function(t){t.attr("visibility",n)}))}Fm.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Hm=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,Be([],De(e),!1))||this;return r.isMutationObserved=!0,r.addEventListener($p.INSERTED,(function(){Wm(r)})),r}return Ne(e,t),e}(Ig);function Ym(t){var e=t.appendChild(new Hm({class:"offscreen"}));return Wm(e),e}var qm=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Le(e,["style"]);return t.call(this,Ce({style:Ce({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return Ne(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Ym(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(Zg);function Vm(t){return t*Math.PI/180}function Um(t){return Number((180*t/Math.PI).toPrecision(5))}var Xm=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t}();function Zm(t,e){return m(t)?t.apply(void 0,Be([],De(e),!1)):t}var Km,Qm,Jm,tb,eb=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=De(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},nb=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var o=De(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?nb(t[a],s,n+1,r):c[a]=e[a]):x(s)?(c[a]=[],c[a]=c[a].concat(s)):c[a]=s:c[a]=s)}))},rb=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)nb(t,e[r]);return t},ib=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},ob=(Qm=function(t,e){var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Km||(Km=mg.offscreenCanvasCreator.getOrCreateContext(void 0)),Km.font=[o,a,i,"".concat(n,"px"),r].join(" "),Km.measureText(t).width},Jm=function(t,e){return[t,Object.values(e||ab(t)).join()].join("")},void 0===(tb=4096)&&(tb=128),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Jm?Jm.apply(this,t):t[0];X.has(Qm)||X.set(Qm,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)}}}(tb));var r=X.get(Qm);if(r.has(n))return r.get(n);var i=Qm.apply(this,t);return r.set(n,i),i}),ab=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 sb(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function cb(t,e){var n=sb(t);n&&n.attr(e)}function lb(t,e,n){void 0===n&&(n="..."),cb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function ub(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var o=n[0];return[o.clientX,o.clientY]}return r&&i?[r,i]:[0,0]}function fb(t){return"function"==typeof t?t():L(t)||I(t)?new qm({style:{text:String(t)}}):t}function hb(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=function(t){t.node().removeChildren()}),t?n(e):(r&&i(e),null)}function db(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}function pb(t,e){return"number"==typeof t&&"number"==typeof e?function(t,e){return function(n){return t*(1-n)+e*n}}(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=De(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=De(e,2),i=n[0],o=n[1];return r[i]=o(t)})),r}}(t,e):function(e){return t}}function gb(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=De([s+a.width,c+a.height],2),u=l[0],f=l[1];s<e&&(e=s),c<n&&(n=c),u>r&&(r=u),f>i&&(i=f)}return new Xm(e,n,r-e,i-n)}var vb=function(t,e,n){var r=t.width,i=t.height,o=n.flexDirection,a=void 0===o?"row":o,s=n.justifyContent,c=void 0===s?"flex-start":s,l=n.alignItems,u=void 0===l?"flex-start":l,f="row"===a,h="row"===a||"column"===a,d=f?h?[1,0]:[-1,0]:h?[0,1]:[0,-1],p=De([0,0],2),g=p[0],v=p[1],y=e.map((function(t){var e,n=t.width,r=t.height,i=De([g,v],2),o=i[0],a=i[1];return e=De([g+n*d[0],v+r*d[1]],2),g=e[0],v=e[1],new Xm(o,a,n,r)})),m=gb(y),b={"flex-start":0,"flex-end":f?r-m.width:i-m.height,center:f?(r-m.width)/2:(i-m.height)/2},x=y.map((function(t){var e=t.x,n=t.y,r=Xm.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r}));gb(x);var w=function(t){var e=De(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}},k=x.map((function(t){var e=t.x,n=t.y,r=Xm.fromRect(t);return r.x=f?e:e+w(r),r.y=f?n+w(r):n,r})),M=k.map((function(e){var n,r,i=Xm.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 M},yb=function(t,e,n){return[]};function mb(t,e){return[t[0]*e,t[1]*e]}function bb(t,e){return[t[0]+e[0],t[1]+e[1]]}function xb(t,e){return[t[0]-e[0],t[1]-e[1]]}function wb(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function kb(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Mb(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Eb(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 Ob(t,e){return+t.toPrecision(e)}function _b(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 Sb(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=De(r,2))[0],d=i[1];for(var p=0,g=t.length;p<g;p+=1)h=wb(h,y=t[p]),d=kb(d,y)}p=0;for(var v=t.length;p<v;p+=1){var y=t[p];if(0!==p||n)if(p!==v-1||n){o=t[[p?p-1:v-1,p-1][n?0:1]];var m=[0,0];m=mb(m=xb(a=t[n?(p+1)%v:p+1],o),e);var b=Mb(y,o),x=Mb(y,a),w=b+x;0!==w&&(b/=w,x/=w);var k=mb(m,-b),M=mb(m,x);c=bb(y,k),s=wb(s=bb(y,M),kb(a,y)),s=kb(s,wb(a,y)),c=wb(c=bb(y,k=mb(k=xb(s,y),-b/x)),kb(o,y)),s=bb(y,M=mb(M=xb(y,c=kb(c,wb(o,y))),x/b)),f&&(c=wb(c=kb(c,h),d),s=wb(s=kb(s,h),d)),u.push(l),u.push(c),l=s}else c=y,u.push(l),u.push(c);else l=y}return n&&u.push(u.shift()),u}(i,.4,r,n),f=i.length,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=De(i,1)[0],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),h}var Ab=["$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 Tb(t){return Ab.includes(t)}function Pb(t){var e={};for(var n in t)Tb(n)&&(e[n]=t[n]);return e}function Nb(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,o=r.height,a=e/Math.max(i,o);return n&&(t.style.transform="scale(".concat(a,")")),a}var Cb=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=De(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=Fe(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=Fe(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=Fe(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 r=e(t);n.has(r)||n.set(r,[]),n.get(r).push(t)})),n}(this._elements,(function(t){return r(t.__data__)})),p=0;p<t.length;p++){var g=t[p],v=e(g,p),y=r(g,p);if(f.has(v))(w=f.get(v)).__data__=g,w.__facet__=!1,s.push(w),c.delete(w),f.delete(v);else if(h.has(v)){(w=h.get(v)).__data__=g,w.__facet__=!0,s.push(w),h.delete(v)}else if(d.has(v)){var m=d.get(v);l.push([g,m]);try{for(var b=(i=void 0,Ie(m)),x=b.next();!x.done;x=b.next()){var w=x.value;c.delete(w)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}d.delete(v)}else if(f.has(y)){(w=f.get(y)).__toData__?w.__toData__.push(g):w.__toData__=[g],u.add(w),c.delete(w)}else a.push(g)}var k=[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,k)},t.prototype.merge=function(t){var e=Be(Be([],De(this._elements),!1),De(t._elements),!1),r=Be(Be([],De(this._transitions),!1),De(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=De(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=new Array(this._elements.length);return this.each((function(n,r){e[r]=t.call(this,n,r)})),this._transitions=T(e),this},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,Be([this._parent,this],De(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:Ig,rect:Ug,circle:Cg,path:Gg,text:qm,ellipse:Rg,image:Fg,line:$g,polygon:Yg,polyline:Vg,html:Bg},t}();function Lb(t){return new Cb([t],null,t,t.ownerDocument)}function jb(t){if(I(t))return[t,t,t,t];if(x(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}function Rb(t){var e=t.getLocalBounds(),n=De([e.min,e.max],2),r=De(n[0],2),i=r[0],o=r[1],a=De(n[1],2),s=a[0],c=a[1];return{x:i,y:o,width:s-i,height:c-o,left:i,bottom:c,top:o,right:s}}function Ib(t,e){var n=De(t,2),r=n[0],i=n[1],o=De(e,2),a=o[0],s=o[1];return r!==a&&i===s}function Db(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Bb(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 Fb=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function zb(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i=De(t,2),o=i[0],a=i[1];if("className"===o||"class"===o);else if(Fb(o,"show")&&Fb(Bb(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(Db(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(Db(e)),"")]=a;else if(!Fb(o,"show")&&Fb(o,e)!==n){var s=Bb(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}})),r}function $b(t,e){return Object.entries(t).reduce((function(t,n){var r=De(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(Db(i))]=o,t}),{})}function Wb(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=De(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)})),[r,i]}function Gb(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=De([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 Hb=function(t,e){null!=e?t.replaceChildren?Array.isArray(e)?t.replaceChildren.apply(t,Be([],De(e),!1)):t.replaceChildren(e):(t.innerHTML="",Array.isArray(e)?e.forEach((function(e){return t.appendChild(e)})):t.appendChild(e)):t.innerHTML=""};function Yb(){Gm(this,"hidden"!==this.attributes.visibility)}var qb=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,rb({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return Ne(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Ym(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&&Yb.call(this)},e.prototype.update=function(t,e){var n;return this.attr(rb({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e.prototype.getSubShapeStyle=function(t){return Le(t,["x","y","transform","transformOrigin","class","className","zIndex"])},e}(jg),Vb=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"]]},Ub=Vb,Xb=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},Zb=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},Kb=Zb;var Qb=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function Jb(t){var e=function(t){var e="default";if(w(t)&&t instanceof Image)e="image";else if(m(t))e="symbol";else if(L(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var tx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ne(e,t),e.prototype.render=function(t,n){var r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o,s=this.getSubShapeStyle(t),c=s.symbol,l=s.size,u=void 0===l?16:l,f=Le(s,["symbol","size"]),h=Jb(c);hb(!!h,Lb(n),(function(t){t.maybeAppendByClassName("marker",h).attr("className","marker ".concat(h,"-marker")).call((function(t){if("image"===h){var n=2*u;t.styles({img:c,width:n,height:n,x:i-u,y:a-u})}else{n=u/2;var r=m(c)?c:e.getSymbol(c);t.styles(Ce({d:null==r?void 0:r(i,a,n)},f))}}))}))},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(qb);tx.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]]})),tx.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),tx.registerSymbol("line",Xb),tx.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),tx.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]]})),tx.registerSymbol("circle",Vb),tx.registerSymbol("point",Ub),tx.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"]]})),tx.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"]]})),tx.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"]]})),tx.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),tx.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"]]})),tx.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"]]})),tx.registerSymbol("line",Xb),tx.registerSymbol("dot",Zb),tx.registerSymbol("dash",Kb),tx.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]]})),tx.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]]})),tx.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]]})),tx.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]]})),tx.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 ex=function(t){function e(e){var n=this,r=e.style,i=Le(e,["style"]);return(n=t.call(this,Q({},{type:"column"},Ce({style:r},i)))||this).columnsGroup=new Ig({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return Ne(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,")"),Lb(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(rb({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Ng),nx=function(t){function e(e){var n=this,r=e.style,i=Le(e,["style"]);return(n=t.call(this,Q({},{type:"lines"},Ce({style:r},i)))||this).linesGroup=n.appendChild(new Ig),n.areasGroup=n.appendChild(new Ig),n.render(),n}return Ne(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(rb({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){Lb(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){Lb(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}(Ng);function rx(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return Be([e===n?"M":"L"],De(t),!1)}));return e?r.reverse():r}function ix(t,e){if(void 0===e&&(e=!1),t.length<=2)return rx(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];et(o,n.slice(-2))||n.push.apply(n,Be([],De(o),!1))}var a=Sb(n,!1);return e?a.unshift(Be(["M"],De(t[r-1]),!1)):a.unshift(Be(["M"],De(t[0]),!1)),a}function ox(t,e,n){var r=V(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function ax(t){return 0===t.length?[0,0]:[N(F(t,(function(t){return N(t)||0}))),P(B(t,(function(t){return P(t)||0})))]}function sx(t){for(var e=V(t),n=e[0].length,r=De([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 cx=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 Ne(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=V(t);return I(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?sx(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=De(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=zb(this.attributes,"area"),a=zb(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=De(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=De([a,s],2),s=n[0],a=n[1]),t.map((function(t){return t.map((function(t,e){return[r.map(e),R(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=ix(o),s=void 0;if(0===i)s=ox(a,e,n);else{var c=ix(t[i-1],!0),l=o[0];c[0][0]="L",s=Be(Be(Be([],De(a),!1),De(c),!1),[Be(["M"],De(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=rx(t[i]),a=void 0;if(0===i)a=ox(o,e,n);else{var s=rx(t[i-1],!0);s[0][0]="L",a=Be(Be(Be([],De(o),!1),De(s),!1),[["Z"]],!1)}r.push(a)}return r}(u,s,h):function(t,e,n,r){return t.map((function(t){return ox(e?ix(t):rx(t),n,r)}))}(u,i,s,h)}return{lines:u.map((function(e,n){return Ce({stroke:t.getColor(n),d:i?ix(e):rx(e)},a)})),areas:f.map((function(e,n){return Ce({d:e,fill:t.getColor(n)},o)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=zb(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=sx(s));var c=this.createScales(s),l=c.x,u=c.y,f=De(ax(s),2),h=f[0],d=f[1],p=new po({domain:[0,d-(h>0?0:h)],range:[0,a*o]}),g=l.getBandWidth(),v=this.rawData;return{columns:s.map((function(n,i){return n.map((function(n,o){var a=g/s.length;return Ce(Ce({fill:t.getColor(i)},e),r?{x:l.map(o),y:u.map(n),width:g,height:p.map(v[i][o])}:{x:l.map(o)+a*i,y:n>=0?u.map(n):u.map(0),width:a,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?Lb(n).select(r):Lb(n).append(i)).attr("className","container").node();var o=t.type,a=t.x,s=t.y,c="spark".concat(o),l=Ce({x:a,y:s},"line"===o?this.linesStyle:this.columnsStyle);Lb(e).selectAll(".spark").data([o]).join((function(t){return t.append((function(t){return"line"===t?new nx({className:c,style:l}):new ex({className:c,style:l})})).attr("className","spark ".concat(c))}),(function(t){return t.update(l)}),(function(t){return t.remove()}))},e.prototype.getColor=function(t){var e=this.attributes.color;return x(e)?e[t%e.length]:m(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=De(ax(t),2),d=h[0],p=h[1],g=new po({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 po({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new Xi({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}(qb);function lx(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=De(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,Ce(Ce({},t[e]),n)]:[e,n]})))}function ux(t,e){t?t.finished.then(e):e()}function fx(t,e){"update"in t?t.update(e):t.attr(e)}function hx(t,e,n){return 0===e.length?null:n?t.animate(e,n):(fx(t,{style:e.slice(-1)[0]}),null)}function dx(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=De(e,2),o=n[0],a=n[1];if(!b(a)){var s=t.style[o]||t.parsedStyle[o]||0;s!==a&&(r[o]=s,i[o]=a)}})),n?hx(t,[r,i],Ce({fill:"both"},n)):(fx(t,i),null)}function px(t,e){return t.style.opacity||(t.style.opacity=1),dx(t,{opacity:0},e)}var gx={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},vx={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},yx={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},mx=eb({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),bx=eb({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),xx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ne(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=Le(t,["x","y","size","radius","orientation"]),u=o,f=2.4*u,h=Lb(e).maybeAppendByClassName(bx.iconRect,"rect").styles(Ce(Ce({},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,v=r+3/4*f-f/2;h.maybeAppendByClassName("".concat(bx.iconLine,"-1"),"line").styles(Ce({x1:d,x2:d,y1:g,y2:v},l)),h.maybeAppendByClassName("".concat(bx.iconLine,"-2"),"line").styles(Ce({x1:p,x2:p,y1:g,y2:v},l)),"vertical"===c&&(h.node().style.transform="rotate(90)")},e}(qb),wx=function(t){function e(e){return t.call(this,e,yx)||this}return Ne(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,o=n.showLabel,a=zb(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=De(Wb(Le(a,["x","y","transform","transformOrigin"]),[]),2),p=d[0],g=d[1],v=Lb(t).maybeAppendByClassName(bx.labelGroup,"g").styles(g),y=Ce(Ce({},vx),p),m=y.text,b=Le(y,["text"]);hb(!!o,v,(function(t){e.label=t.maybeAppendByClassName(bx.label,"text").styles(Ce(Ce({},b),{x:r+c,y:i+u,transform:f,transformOrigin:h,text:"".concat(m)})),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=Ce(Ce({x:n,y:r,orientation:i},gx),zb(this.attributes,"icon")),s=this.attributes.iconShape,c=void 0===s?function(){return new xx({style:a})}:s;Lb(t).maybeAppendByClassName(bx.iconGroup,"g").selectAll(bx.icon.class).data([c]).join((function(t){return t.append("string"==typeof c?c:function(){return c(o)}).attr("className",bx.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}(qb),kx=function(t){function e(e){var n=t.call(this,e,Ce(Ce(Ce({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},$b(yx,"handle")),$b(gx,"handleIcon")),$b(vx,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(ub(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(ub(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 Np("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 Ne(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=zb(this.attributes,"sparkline");return Ce(Ce({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=De(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=De(jb(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],i=t[3],o=this.shape;return{x:i,y:e,width:o.width-(i+n),height:o.height-(e+r)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll(mx.selection.class).each((function(n,r){dx(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&dx(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&dx(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=zb(this.attributes,"track");this.trackShape=Lb(t).maybeAppendByClassName(mx.track,"rect").styles(Ce(Ce({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=Lb(t).maybeAppendByClassName(mx.brushArea,"rect").styles(Ce({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;hb("horizontal"===n.orientation,Lb(t).maybeAppendByClassName(mx.sparklineGroup,"g"),(function(t){var n=Ce(Ce({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName(mx.sparkline,(function(){return new cx({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(mx.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 wx({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(mx.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=Lb(t).maybeAppendByClassName(mx.foreground,"g");var a=zb(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(Ce(Ce({},a),{transform:"translate(".concat(n,", ").concat(r,")")}))},c=this;this.foregroundGroup.selectAll(mx.selection.class).data("value"===i?[]:this.calcSelectionArea().map((function(t,e){return{style:Ce({},t),index:e,show:"select"===o?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",mx.selection.name).call(s).each((function(t,e){var n=this;1===e?(c.selectionShape=Lb(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=De(this.range,2),i=r[0],o=r[1],a=De(this.getValues().map((function(t){return Ob(t,e)})),2),s=a[0],c=a[1],l=De(((Array.isArray(t)?t:[s,null!=t?t:c])||[s,c]).map((function(t){return Ob(t,e)})),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,R(f,i,o)];u>f&&(u=(n=De([f,u],2))[0],f=n[1]);var h=f-u;return h>o-i?[i,o]:u<i?s===i&&c===f?[i,f]:[i,h+i]:f>o?c===o&&s===u?[u,o]:[o-h,o]:[u,f]},e.prototype.calcSelectionArea=function(t){var e=De(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=De(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=zb(this.attributes,"handle"),c=zb(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),h=o("start"===t?f[0]:f[1]),d=new qm({style:Ce(Ce(Ce({},c),this.inferTextStyle(t)),{text:h})}),p=d.getBBox(),g=p.width,v=p.height;if(d.destroy(),!a){if("value"===r)return{text:h,x:0,y:-v-l};var y=l+u+("horizontal"===i?g/2:0);return(e={text:h})["horizontal"===i?"x":"y"]="start"===t?-y:y,e}var m=0,b=0,x=this.availableSpace,w=x.width,k=x.height,M=this.calcSelectionArea()[1],E=M.x,O=M.y,_=M.width,S=M.height,A=l+u;if("horizontal"===i){var T=A+g/2;if("start"===t)m=E-A-g>0?-T:T;else m=w-E-_-A>g?T:-T}else{var P=v+A;b="start"===t?O-u>v?-P:A:k-(O+S)-u>v?P:-A}return{x:m,y:b,text:h}},e.prototype.getHandleLabelStyle=function(t){var e=zb(this.attributes,"handleLabel");return Ce(Ce(Ce({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=zb(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return Ce({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),Ce(Ce(Ce({},$b(this.getHandleIconStyle(),"icon")),$b(Ce(Ce({},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=De(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=De(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 Np(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}(qb),Mx=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 Np("scroll",r)),n.dispatchEvent(new Np("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=De(n.getLocalPosition(),2),r=e[0],i=e[1],o=De(n.padding,4),a=o[0],s=o[3],c=n.getOrientVal([r+s,i+a]),l=(n.getOrientVal(ub(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Np("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Np("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Np("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Np("trackMouseleave",{detail:t.detail}))},n}return Ne(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return jb(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=De(this.range,2),n=e[0],r=e[1];return R(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=De(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=De(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=De(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=zb(this.attributes,"track"),l=zb(this.attributes,"thumb"),u=Ce(Ce({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()},$b(c,"track")),$b(l,"selection"));this.slider=Lb(t).maybeAppendByClassName("scrollbar",(function(){return new kx({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=De(this.range,2),i=r[0],o=r[1];this.slider.setValues(this.getValues(R(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}(qb),Ex={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 Gg({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:[]};Q({},Ex,{style:{type:"arc"}}),Q({},Ex,{style:{}});var Ox=eb({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"),_x=eb({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Sx(t){return t.reduce((function(t,e,n){return t.push(Be([0===n?"M":"L"],De(e),!1)),t}),[])}function Ax(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 Sx(t);if(!o)return[];var a=Mb(t[0],o),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push(Be(["M"],De(e),!1)):t.push(Be(["A",a,a,0,0,s],De(e),!1)),t}),[])}(t,e,n):Sx(t)}function Tx(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=De([Ax(t,n),Ax(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=De([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([Be(["L"],De(h),!1)],[Be(["L"],De(f),!1)]);if(!o)throw new Error("Arc grid need to specified center");var p=De([Mb(h,o),Mb(f,o)],2),g=p[0],v=p[1];return d([Be(["A",g,g,0,0,1],De(h),!1),Be(["L"],De(h),!1)],[Be(["A",v,v,0,0,0],De(f),!1),Be(["L"],De(f),!1)])}var Px=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ne(e,t),e.prototype.render=function(t,e){var n=Le(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=De(e,1)[0];return Ce(Ce({},t),{points:Be(Be([],De(e),!1),[n],!1)})})):n}(t),i=Lb(e).maybeAppendByClassName(_x.lineGroup,"g"),o=Lb(e).maybeAppendByClassName(_x.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:Ax(t.points,n)}}));return t.selectAll(_x.line.class).data(a,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=Zm(Pb(Ce({d:t.d},r)),[t,e,a]);this.attr(Ce({class:_x.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))}))}),(function(t){return t.transition((function(t,e){return dx(this,Zm(Pb(Ce({d:t.d},r)),[t,e,a]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=px(this,i.exit);return ux(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=De([e[l].points,e[l+1].points],2),f=Tx(u[0],u[1],n);c.push({d:f,fill:s(l)})}return t.selectAll(_x.region.class).data(c,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=Zm(t,[t,e,c]);this.attr(n)})).attr("className",_x.region.name)}),(function(t){return t.transition((function(t,e){return dx(this,Zm(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=px(this,r.exit);return ux(e,(function(){return t.remove()})),e}))})).transitions()}(o,r,t);return Be(Be([],De(a),!1),De(s),!1)},e}(qb);function Nx(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=De(t,2);return[n[0],Zm(n[1],e)]})))}function Cx(t,e){return e&&m(e)?t.filter(e):t}function Lx(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function jx(t,e){if("linear"===e.type){var n=De(e.startPos,2),r=n[0],i=n[1],o=De(e.endPos,2),a=De([o[0]-r,o[1]-i],2);return Eb([a[0],a[1]])}var s=Vm(Lx(t,e));return[-Math.sin(s),Math.cos(s)]}function Rx(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(jx(t,n),"positive"!==e)}function Ix(t,e){return Rx(t,e.labelDirection,e)}function Dx(t,e){return"linear"===e.type?function(t,e){var n=De(e.startPos,2),r=n[0],i=n[1],o=De(e.endPos,2),a=De([o[0]-r,o[1]-i],2);return[r+a[0]*t,i+a[1]*t]}(t,e):function(t,e){var n=e.radius,r=De(e.center,2),i=r[0],o=r[1],a=Vm(Lx(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function Bx(t){return 0===jx(0,t)[1]}function Fx(t){return 0===jx(0,t)[0]}function zx(t,e){return e-t===360}function $x(t,e,n,r,i){var o=e-t,a=De([i,i],2),s=a[0],c=a[1],l=De([Vm(t),Vm(e)],2),u=l[0],f=l[1],h=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},d=De(h(u),2),p=d[0],g=d[1],v=De(h(f),2),y=v[0],m=v[1];if(zx(t,e)){var b=De(h((f+u)/2),2);return[["M",p,g],["A",s,c,0,1,0,b[0],b[1]],["A",s,c,0,1,0,y,m]]}var x=o>180?1:0,w=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(c,",0,").concat(x,",").concat(w,",").concat(y,",").concat(m)}function Wx(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(Ox.line.class).data([{d:$x.apply(void 0,Be(Be([i,o],De(a),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",Ox.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,Ce({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return Be(Be([n,r],De(i),!1),[o],!1)}(this),Be(Be([i,o],De(a),!1),[s],!1),r.update);if(e){var n=function(){var e=rt(t.attributes,"__keyframe_data__");t.style.d=$x.apply(void 0,Be([],De(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function Gx(t){var e=De(t,2),n=De(e[0],2),r=n[0],i=n[1],o=De(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function Hx(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,c=e.lineExtension,l=De([o,a],2),u=De(l[0],2),f=u[0],h=u[1],d=De(l[1],2),p=d[0],g=d[1],v=De(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=De([t,e,n],3),i=De(r[0],2),o=i[0],a=i[1],s=De(r[1],2),c=s[0],l=s[1],u=De(r[2],2),f=u[0],h=u[1],d=De([c-o,l-a],2),p=d[0],g=d[1],v=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),y=De([-f/v,h/v],2),m=y[0],b=y[1];return[m*p,m*g,b*p,b*g]}(o,a,c):new Array(4).fill(0),4),y=v[0],m=v[1],b=v[2],x=v[3],w=function(e){return t.selectAll(Ox.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(Ox.line.name," ").concat(t.className)})).styles(n).transition((function(t){return dx(this,Gx(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return dx(this,Gx(t.line),r.update)}))}),(function(t){return t.remove()})).transitions()};if(!i||!s)return w([{line:[[f+y,h+m],[p+b,g+x]],className:Ox.line.name}]);var k=De(s,2),M=k[0],E=k[1],O=p-f,_=g-h,S=De([f+O*M,h+_*M],2),A=S[0],T=S[1],P=De([f+O*E,h+_*E],2),N=P[0],C=P[1];return w([{line:[[f+y,h+m],[A,T]],className:Ox.lineFirst.name},{line:[[N,C],[p+b,g+x]],className:Ox.lineSecond.name}])}function Yx(t,e,n){var r,i=e.type,o=zb(e,"line");return r="linear"===i?Hx(t,e,_b(o,"arrow"),n):Wx(t,e,_b(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(Ox.line.class):a?t.select(Ox.lineSecond.class):t.select(Ox.line.class),!o||!s||"arc"===n.type&&zx(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=fb(s);f.attr(r),Nb(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function qx(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Vx(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=De(Dx(i,e),2),a=o[0],s=o[1],c=De(mb(function(t,e){return Rx(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}}))}function Ux(t,e,n,r){var i=zb(n,"grid"),o=i.type,a=i.areaFill,s=qx(n),c=Cx(e,n.gridFilter),l="segment"===o?Vx(c,n):function(t,e){var n=e.gridControlAngles,r=qx(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=De(r,2),o=i[0],a=i[1];return t.map((function(t,r){var i=De(Dx(t.value,e),2),s=i[0],c=i[1],l=De([s-o,c-a],2),u=l[0],f=l[1],h=[];return n.forEach((function(t){var e=Vm(t),n=De([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=u*r-f*i+o,c=u*i+f*r+a;h.push([s,c])})),{points:h,id:r}}))}(c,n),u=Ce(Ce({},i),{center:s,areaFill:m(a)?c.map((function(t,e){return Zm(a,[t,e,c])})):a,animate:r,data:l});return t.selectAll(Ox.grid.class).data([1]).join((function(t){return t.append((function(){return new Px({style:u})})).attr("className",Ox.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}var Xx=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 Zx(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getBounds(),i=De(r.min,2),o=i[0],a=i[1],s=De(r.max,2),c=s[0],l=s[1],u=t.getBBox(),f=u.width,h=u.height,d=0,p=0,g=o,v=a,y=sb(t);if(y){h-=1.5;var m=y.style.textAlign,b=y.style.textBaseline;"center"===m?g=(o+c)/2:"right"!==m&&"end"!==m||(g=c),"middle"===b?v=(a+l)/2:"bottom"===b&&(v=l)}var x=De(jb(e),4),w=x[0],k=void 0===w?0:w,M=x[1],E=void 0===M?0:M,O=x[2],_=void 0===O?k:O,S=x[3],A=new Xx((d+=o)-(void 0===S?E:S),(p+=a)-k,d+f+E,p+h+_);return t.setEulerAngles(n),A.rotatedPoints(Vm(n),g,v)}function Kx(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 Qx(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 Jx(t,e){return e.every((function(e){return function(t,e){var n=t.length;if(n<3)return!1;var r,i,o,a,s,c,l=[e,[9999,e[1]]],u=0,f=0;do{var h=[t[f],t[(f+1)%n]];if(i=l,o=void 0,a=void 0,s=void 0,c=void 0,o=Qx((r=h)[0],r[1],i[0]),a=Qx(r[0],r[1],i[1]),s=Qx(i[0],i[1],r[0]),c=Qx(i[0],i[1],r[1]),o!==a&&s!==c||0===o&&Kx(r,i[0])||0===a&&Kx(r,i[1])||0===s&&Kx(i,r[0])||0===c&&Kx(i,r[1])){if(0===Qx(h[0],e,h[1]))return Kx(h,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(t,e)}))}function tw(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=De(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=De(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,v=r-c,y=i-l,m=u*y-f*v;if(m<0===g)return!1;var b=h*y-d*v;return b<0!==g&&m>p!==g&&b>p!==g}(e,t)}))}function ew(t,e,n){var r,i,o=e.crossPadding,a=new Set,s=null,c=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var o=t.center,a=t.radius,s=De(o,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-a-u,h=a+u,d=De(jb(e),4),p=d[0],g=d[1],v=d[2],y=d[3];return new Xx(c+f-y,l+f-p,c+h+g,l+h+v)}var m=De(t.startPos,2),b=m[0],x=m[1],w=De(t.endPos,2),k=w[0],M=w[1],E=De(Fx(t)?[-e,0,e,0]:[0,e,0,-e],4),O=E[0],_=E[1],S=E[2],A=E[3],T=mb(Ix(0,t),i),P=new Xx(b,x,k,M);return P.x1+=A,P.y1+=O,P.x2+=_+T[0],P.y2+=S+T[1],P}(e,o),l=function(t){return!c||function(t,e,n){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;return Jx([[r,o],[i,o],[i,a],[r,a]],Zx(e,n))}(c,t)},u=function(t,e){return!t||!t.firstChild||!function(t,e,n){var r,i,o=Zx(t,n).flat(1),a=Zx(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=Ie(s),l=c.next();!l.done;l=c.next())if(tw(a,l.value))return!0}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return!1}(t.firstChild,e.firstChild,jb(n))};try{for(var f=Ie(t),h=f.next();!h.done;h=f.next()){var d=h.value;l(d)?!s||u(s,d)?s=d:(a.add(s),a.add(d)):a.add(d)}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(a)}function nw(t,e){return void 0===e&&(e={}),b(t)?0:"number"==typeof t?t:Math.floor(ob(t,e))}var rw=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(Wm(t),!1)}))};var iw=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=rw,f=function(t){return t.forEach(r.show),t},h=2,d=t.slice(),p=t.slice(),g=Math.min.apply(Math,Be([1],De(t.map((function(t){return t.getBBox().width}))),!1));if("linear"===n.type&&(Bx(n)||Fx(n))){var v=Rb(t[0]).left,y=Rb(t[i-1]).right,m=Math.abs(y-v)||1;h=Math.max(Math.floor(i*g/m),h)}for(o&&(s=d.splice(0,1)[0]),a&&(c=d.splice(-1,1)[0],d.reverse()),f(d);h<t.length&&ew((l=c?Be(Be([c],De(p),!1),[s],!1):Be([s],De(p),!1),l.filter(ib)),n,null==e?void 0:e.margin).length;){if(c&&!s&&h%2==0)d.splice(0,1).forEach(r.hide);else if(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=Ie(s),p=d.next();!p.done;p=d.next()){if(h(p.value),ew(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=ab(r.getTextShape(t[0])),p=nw(u,d),g=a?nw(a,d):p,v=nw(c,d);(b(v)||v===1/0)&&(v=Math.max.apply(null,t.map((function(t){return t.getBBox().width}))));var y=t.slice();De(h,4);for(var m=function(e){if(y.forEach((function(t){r.ellipsis(r.getTextShape(t),e,o)})),(y=ew(t,n,h)).length<1)return{value:void 0}},x=v;x>g+p;x-=p){var w=m(x);if("object"==typeof w)return w.value}}}],["wrap",function(t,e,n,r){var i=e.wordWrapWidth,o=void 0===i?50:i,a=e.maxLines,s=void 0===a?3:a,c=e.recoverWhenFailed,l=void 0===c||c,u=e.margin,f=void 0===u?[0,0,0,0]:u,h=t.map((function(t){return t.attr("maxLines")||1})),d=Math.min.apply(Math,Be([],De(h),!1)),p=function(){return ew(t,n,f).length<1},g=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&Bx(t)?"negative"===n?"bottom":"top":"middle"}(n),v=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,o,i,g)}))};if(!(d>s)){if("linear"===n.type&&Bx(n)){if(v(s),p())return}else for(var y=d;y<=s;y++)if(v(y),p())return;l&&v(h)}}]]);function ow(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return t*function(t){return"positive"===t?-1:1}(e)}),1)}function aw(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function sw(t,e){var n=De(t,2),r=n[0],i=n[1],o=De(e,2),a=o[0],s=o[1],c=De([r*a+i*s,r*s-i*a],2),l=c[0],u=c[1];return Math.atan2(u,l)}function cw(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=Ix(t.value,n),a=jx(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return db(e,-90,90)||(e+=180),e}(Um("perpendicular"===i?sw([1,0],o):sw([a[0]<0?-1:1,0],a)))}function lw(t,e,n){var r=n.type,i=n.labelAlign,o=Ix(t,n),a=aw(e),s=aw(Um(sw([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?(db(a,0,90,!1,!0)||db(a,0,90)||db(a,270,360))&&(c="start"):90===s?db(a,0,90,!1,!0)?c="start":(db(a,90,180)||db(a,270,360))&&(c="end"):270===s?db(a,0,90,!1,!0)?c="end":(db(a,90,180)||db(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(db(a,0,90)||db(a,270,360))&&(c="end")):c="center":"parallel"===i?l=db(s,0,180,!0)?"top":"bottom":"horizontal"===i?db(s,90,270,!1)?c="end":(db(s,270,360,!1)||db(s,0,90))&&(c="start"):"perpendicular"===i&&(c=db(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function uw(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=Zm(s,[t,c,e]),u=De([Ix(t.value,n),ow(a,o)],2),f=De(bb(mb(u[0],l+(1===u[1]?Zm(r?i:0,[t,c,e]):0)),Dx(t.value,n)),2);return{x:f[0],y:f[1]}}function fw(t,e){"text"===t.nodeName&&t.attr(e)}function hw(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=iw.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:Wm,show:$m,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=lw(e.__data__.value,t,n),i=e.querySelector(Ox.labelItem.class);i&&fw(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&lb(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"),cb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function dw(t,e,n,r,i){var o=n.indexOf(e),a=Lb(t).append(function(t,e,n,r){var i=r.labelFormatter;return m(i)?function(){return fb(Zm(i,[t,e,n,Ix(t.value,r)]))}:function(){return fb(t.label||"")}}(e,o,n,i)).attr("className",Ox.labelItem.name).node(),s=De(Wb(Nx(r,[e,o,n])),2),c=s[0],l=s[1],u=l.transform,f=Le(l,["transform"]);Gb(a,u);var h=cw(e,a,i);return a.getLocalEulerAngles()||a.setLocalEulerAngles(h),fw(a,Ce(Ce({},lw(e.value,h,i)),c)),t.attr(f),a}function pw(t,e,n,r){var i,o,a,s=Cx(e,n.labelFilter),c=zb(n,"label"),l=t.selectAll(Ox.label.class).data(s,(function(t,e){return e})).join((function(t){return t.append("g").attr("className",Ox.label.name).transition((function(t){dw(this,t,e,c,n);var r=uw(t,e,n),i=r.x,o=r.y;return this.style.transform="translate(".concat(i,", ").concat(o,")"),null}))}),(function(t){return t.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&&Wm(t),e.isVisible()&&$m(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=De(t.getGeometryBounds().center,2),h=f[0],d=f[1],p=De(e.getGeometryBounds().center,2),g=De([(h+p[0])/2-h,(d+p[1])/2-d],2),v=g[0],y=g[1],m=t.style.opacity,b=void 0===m?1:m,x=e.style.opacity,w=void 0===x?1:x,k=t.style.transform||"",M=e.style.transform||"",E=t.animate([{opacity:b,transform:"translate(0, 0) ".concat(k)},{opacity:0,transform:"translate(".concat(v,", ").concat(y,") ").concat(k)}],Ce(Ce({fill:"both"},n),{duration:c+l+u})),O=e.animate([{opacity:0,transform:"translate(".concat(-v,", ").concat(-y,") ").concat(M),offset:.01},{opacity:w,transform:"translate(0, 0) ".concat(M)}],Ce(Ce({fill:"both"},n),{duration:l+u,delay:c+l-u}));return ux(O,i),[E,O]}(this.querySelector(Ox.labelItem.class),dw(this,t,e,c,n),r.update),o=uw(t,e,n),a=o.x,s=o.y,l=dx(this,{transform:"translate(".concat(a,", ").concat(s,")")},r.update);return Be(Be([],De(i),!1),[l],!1)}))}),(function(t){return i=t,t.transition((function(){var t=this,e=px(this.childNodes[0],r.exit);return ux(e,(function(){return Lb(t).remove()})),e})),i})).transitions();return a=function(){hw.call(t,n)},0===(o=l).length?a():Promise.all(o.map((function(t){return null==t?void 0:t.finished}))).then(a),l}function gw(t,e){return Rx(t,e.tickDirection,e)}function vw(t,e,n,r,i){var o=De(function(t,e){var n=De(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,Zm(i.tickLength,[t,e,n])),2),a=De(o[0],2),s=a[0],c=a[1],l=De(o[1],2);return{x1:s,x2:l[0],y1:c,y2:l[1]}}function yw(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=gw(e.value,i),s="line";return m(o)&&(s=function(){return Zm(o,[e,n,r,a])}),t.append(s).attr("className",Ox.tickItem.name)}(Lb(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=gw(t.value,o),c=vw(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,h=c.y2,d=De(Wb(Nx(a,[t,e,n,s])),2),p=d[0],g=d[1];"line"===r.node().nodeName&&r.styles(Ce({x1:l,x2:u,y1:f,y2:h},p)),i.attr(g),r.styles(p)}(t,e,n,a,this,r,i);var s=De(Dx(t.value,r),2),c=s[0],l=s[1];return dx(this,{transform:"translate(".concat(c,", ").concat(l,")")},o)}var mw=eb({text:"text"},"title");function bw(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function xw(t,e){var n=Object.entries(e).reduce((function(e,n){var r=De(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e}),{});t.styles(n)}var ww=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 Ne(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(mw.text.class);if(!a)return new Xm(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=De(jb(i),4),f=u[0],h=u[1],d=u[2],p=u[3],g=De([0,0,+e,+n],4),v=g[0],y=g[1],m=g[2],b=g[3],x=bw(r);if(x.includes("i"))return new Xm(v,y,m,b);x.forEach((function(t,r){var i,o,a,s;"t"===t&&(i=De(0===r?[l+d,+n-l-d]:[0,+n],2),y=i[0],b=i[1]),"r"===t&&(o=De([+e-c-p],1),m=o[0]),"b"===t&&(a=De([+n-l-f],1),b=a[0]),"l"===t&&(s=De(0===r?[c+h,+e-c-h]:[0,+e],2),v=s[0],m=s[1])}));var w=De(jb(o),4),k=w[0],M=w[1],E=w[2],O=w[3],_=De([O+M,k+E],2),S=_[0],A=_[1];return new Xm(v+O,y+k,m-S,b-A)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new Xm(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=Le(t,["width","height","position","spacing"]),i=De(Wb(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,c=o.position,l=De([+a/2,+s/2],2),u=De([+l[0],+l[1],"center","middle"],4),f=u[0],h=u[1],d=u[2],p=u[3],g=bw(c);return g.includes("l")&&(f=(e=De([0,"start"],2))[0],d=e[1]),g.includes("r")&&(f=(n=De([+a,"end"],2))[0],d=n[1]),g.includes("t")&&(h=(r=De([0,"top"],2))[0],p=r[1]),g.includes("b")&&(h=(i=De([+s,"bottom"],2))[0],p=i[1]),{x:f,y:h,textAlign:d,textBaseline:p}}(t),a=o.x,s=o.y,c=o.textAlign,l=o.textBaseline;hb(!!r.text,Lb(e),(function(t){n.title=t.maybeAppendByClassName(mw.text,"text").styles(i).call(xw,{x:a,y:s,textAlign:c,textBaseline:l}).node()}))},e}(qb);function kw(t,e,n,r,i){var o=De(Wb(zb(r,"title")),2),a=o[0],s=o[1],c=s.transform,l=s.transformOrigin,u=Le(s,["transform","transformOrigin"]);e.styles(u);var f=c||function(t,e,n){var r=2*t.getGeometryBounds().halfExtents[1];if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(r/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(r/2,")")}return""}(t.node(),a.direction,a.position);t.styles(Ce(Ce({},a),{transformOrigin:l})),Gb(t.node(),f);var h=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=bw(i),s=t.node().getLocalBounds(),c=De(s.min,2),l=c[0],u=c[1],f=De(s.halfExtents,2),h=f[0],d=f[1],p=De(e.node().getLocalBounds().halfExtents,2),g=p[0],v=p[1],y=De([l+h,u+d],2),m=y[0],b=y[1],x=De(jb(o),4),w=x[0],k=x[1],M=x[2],E=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var O=n.startPos,_=n.endPos,S=De("start"===i?[O,_]:[_,O],2),A=S[0],T=S[1],P=De(mb(Eb([-T[0]+A[0],-T[1]+A[1]]),w),2),N=P[0],C=P[1];return{x:A[0]+N,y:A[1]+C}}return a.includes("t")&&(b-=d+v+w),a.includes("r")&&(m+=h+g+k),a.includes("l")&&(m-=h+g+E),a.includes("b")&&(b+=d+v+M),{x:m,y:b}}(Lb(n._offscreen||n.querySelector(Ox.mainGroup.class)),e,r),d=h.x,p=h.y;return dx(e.node(),{transform:"translate(".concat(d,", ").concat(p,")")},i)}function Mw(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=hb(i,e.maybeAppendByClassName(Ox.lineGroup,"g"),(function(e){return Yx(e,t,r)}))||[],c=hb(o,e.maybeAppendByClassName(Ox.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=Cx(e,n.tickFilter),o=zb(n,"tick");return t.selectAll(Ox.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",Ox.tick.name).transition((function(t,e){return yw.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),yw.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=px(this.childNodes[0],r.exit);return ux(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=hb(a,e.maybeAppendByClassName(Ox.labelGroup,"g"),(function(e){return pw(e,n,t,r)}))||[];return Be(Be(Be([],De(s),!1),De(c),!1),De(l),!1).filter((function(t){return!!t}))}var Ew=function(t){function e(e){return t.call(this,e,Ex)||this}return Ne(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=lx(void 0===n?a:n),d=hb(c,Lb(e).maybeAppendByClassName(Ox.gridGroup,"g"),(function(e){return Ux(e,f,t,h)}))||[],p=Lb(e).maybeAppendByClassName(Ox.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&Mw(t,Lb(this.offscreenGroup),f,lx(!1));var g=Mw(t,Lb(p.node()),f,h),v=hb(s,Lb(e).maybeAppendByClassName(Ox.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(Ox.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 fb(i)})).attr("className",Ox.title.name).transition((function(){return kw(Lb(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return kw(Lb(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,h)}))||[];return Be(Be(Be([],De(d),!1),De(g),!1),De(v),!1).flat().filter((function(t){return!!t}))},e}(qb),Ow=eb({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"),_w=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:Qb(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new Ig({class:Ow.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new Ig({class:Ow.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return Ne(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return R(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=De(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map((function(e,n){return t.map((function(t){return t[n]}))})))||[]}(this.pageViews.map((function(t){var e=t.getBBox();return[e.width,e.height]}))).map((function(t){return Math.max.apply(Math,Be([],De(t),!1))})),2),e=t[0],n=t[1],r=this.attributes,i=r.pageWidth,o=void 0===i?e:i,a=r.pageHeight;return{pageWidth:o,pageHeight:void 0===a?n:a}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,o=this.pageShape,a=o.pageWidth,s=o.pageHeight;return new Xm(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=De(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=hx(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return ux(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:R(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:R(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(Ow.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)?$m(e):Wm(e)}))},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,o=i.orientation,a=i.controllerPadding,s=r.getBBox().width,c=De("horizontal"===o?[-180,0]:[-90,90],2),l=c[0],u=c[1];e.setLocalEulerAngles(l),n.setLocalEulerAngles(u);var f=e.getBBox(),h=f.width,d=f.height,p=n.getBBox(),g=p.width,v=p.height,y=Math.max(h,s,g),m="horizontal"===o?{offset:[[0,0],[h/2+a,0],[h+s+2*a,0]],textAlign:"start"}:{offset:[[y/2,-d-a],[y/2,0],[y/2,v+a]],textAlign:"center"},b=De(m.offset,3),x=De(b[0],2),w=x[0],k=x[1],M=De(b[1],2),E=M[0],O=M[1],_=De(b[2],2),S=_[0],A=_[1],T=m.textAlign,P=r.querySelector("text");P&&(P.style.textAlign=T),e.setLocalPosition(w,k),r.setLocalPosition(E,O),n.setLocalPosition(S,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(Ow.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=De(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(Ow.controller,"g");if(Gm(s.node(),a),a){var c=zb(this.attributes,"button"),l=zb(this.attributes,"pageNum"),u=De(Wb(c),2),f=u[0],h=u[1],d=f.size,p=Le(f,["size"]),g=!s.select(Ow.prevBtnGroup.class).node(),v=s.maybeAppendByClassName(Ow.prevBtnGroup,"g").styles(h);this.prevBtnGroup=v.node();var y=v.maybeAppendByClassName(Ow.prevBtn,"path"),m=s.maybeAppendByClassName(Ow.nextBtnGroup,"g").styles(h);this.nextBtnGroup=m.node(),[y,m.maybeAppendByClassName(Ow.nextBtn,"path")].forEach((function(t){t.styles(Ce(Ce({},p),{transformOrigin:"center"})),Nb(t.node(),d,!0)}));var b=s.maybeAppendByClassName(Ow.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(Ow.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=Lb(e);this.renderClipPath(a),this.renderController(a),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=U((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener($p.INSERTED,e),this.playWindow.addEventListener($p.REMOVED,e)},e}(qb);function Sw(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}tx.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"]]})),tx.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]]})),tx.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 Aw=eb({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");var Tw=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new Cg({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return Ne(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=De(jb(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=De(this.spacing,2),f=u[0],h=u[1];if(r){var d=r-n-f-h,p=De(this.span,2);c=(t=De([p[0]*d,p[1]*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=De(jb(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=De(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(Aw.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=zb(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(Aw.markerGroup,"g").style("zIndex",0),hb(!!n,this.markerGroup,(function(){var t,i=e.markerGroup.node(),o=null===(t=i.childNodes)||void 0===t?void 0:t[0],a="string"==typeof n?new tx({style:{symbol:n},className:Aw.marker.name}):n();o?a.nodeName===o.nodeName?o instanceof tx?o.update(Ce(Ce({},r),{symbol:n})):(!function(t,e){var n,r,i=e.attributes;try{for(var o=Ie(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=De(a.value,2),c=s[0],l=s[1];"id"!==c&&"className"!==c&&t.attr(c,l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(o,a),Lb(o).styles(r)):(o.remove(),Lb(a).attr("className",Aw.marker.name).styles(r),i.appendChild(a)):(a instanceof tx||Lb(a).attr("className",Aw.marker.name).styles(r),i.appendChild(a)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var s=Nb(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(s,")")}))},e.prototype.renderLabel=function(t){var e=zb(this.attributes,"label"),n=e.text,r=Le(e,["text"]);this.labelGroup=t.maybeAppendByClassName(Aw.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Aw.label,(function(){return fb(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=zb(this.attributes,"value"),r=n.text,i=Le(n,["text"]);this.valueGroup=t.maybeAppendByClassName(Aw.valueGroup,"g").style("zIndex",0),hb(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(Aw.value,(function(){return fb(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=zb(this.attributes,"background");this.background=t.maybeAppendByClassName(Aw.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Aw.background,"rect").styles(Ce({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=De(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,")")}),lb(this.labelGroup.select(Aw.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(c,")")}),lb(this.valueGroup.select(Aw.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=Lb(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}(qb),Pw=eb({page:"item-page",navigator:"navigator",item:"item"},"items"),Nw=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Cw=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:st,mouseenter:st,mouseleave:st})||this;return n.navigatorShape=[0,0],n}return Ne(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=zb(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:Ce({layout:n,labelText:s,valueText:c},Object.fromEntries(Object.entries(r).map((function(n){var r=De(n,2);return[r[0],Zm(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=De(this.navigatorShape,1)[0],s=De(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,v=t.ifHorizontal(l,c),y=[Math.floor(g/v),g%v];"vertical"===n&&y.reverse();var m=De(y,2),b=m[0],x=m[1],w=(r-a-(l-1)*o)/l,k=e.getBBox().height,M=De([0,0],2),E=M[0],O=M[1];return"horizontal"===n?(E=(h=De([f,b*(k+i)],2))[0],O=h[1],f=x===l-1?0:f+w+o):(E=(d=De([x*(w+o),f],2))[0],O=d[1],f=b===c-1?0:f+k+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:w,height:k,x:E,y:O}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,o=De(this.navigatorShape,1)[0],a=De(this.grid,2),s=a[0],c=a[1],l=De([e-o,n],2),u=l[0],f=l[1],h=De([0,0,0,0,0,0,0,0],8),d=h[0],p=h[1],g=h[2],v=h[3],y=h[4],m=h[5],b=h[6],x=h[7];return this.pageViews.children.map((function(t,e){var n,o,a,l,h=t.getBBox(),w=h.width,k=h.height,M=0===b?0:i,E=b+M+w;return E<=u&&Nw(y,(function(t){return t<c}))?(n=De([b+M,x,E],3),d=n[0],p=n[1],b=n[2],{width:w,height:k,x:d,y:p,page:g,index:e,pageIndex:v++,row:m,col:y++}):(o=De([m+1,0,0,x+k+r],4),m=o[0],y=o[1],b=o[2],(x=o[3])+k<=f&&Nw(m,(function(t){return t<s}))?(a=De([b,x,w],3),d=a[0],p=a[1],b=a[2],{width:w,height:k,x:d,y:p,page:g,index:e,pageIndex:v++,row:m,col:y++}):(l=De([0,0,w,0,g+1,0,0,0],8),d=l[0],p=l[1],b=l[2],x=l[3],g=l[4],v=l[5],m=l[6],y=l[7],{width:w,height:k,x:d,y:p,page:g,index:e,pageIndex:v++,row:m,col:y++}))}))},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Sw(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(Pw.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(Pw.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);Lb(t).selectAll(Pw.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new Tw({style:e})})).attr("className",Pw.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=De(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=De(t,2);return{page:e[0],layouts:e[1]}})),i=Be([],De(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new Ig({className:Pw.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=L(e)?e.split("."):e;i.forEach((function(t,e){e<i.length-1?(w(r[t])||(r[t]=I(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=zb(this.attributes,"nav"),r=rb({orientation:e},n),i=this;return t.selectAll(Pw.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new _w({style:r})})).attr("className",Pw.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(Lb(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Np(t,{detail:e});this.dispatchEvent(n)},e}(qb),Lw=eb({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),jw={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},Rw=function(t){function e(e){return t.call(this,e,jw)||this}return Ne(e,t),e.prototype.render=function(t,e){var n=Lb(e).maybeAppendByClassName(Lw.markerGroup,"g");this.renderMarker(n);var r=Lb(e).maybeAppendByClassName(Lw.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?Sw(r,"horizontalHandle","verticalHandle"):i;hb(!!o,t,(function(t){var n=zb(e.attributes,"marker"),r=Ce({symbol:o},n);e.marker=t.maybeAppendByClassName(Lw.marker,(function(){return new tx({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;hb(r,t,(function(t){var n,r=zb(e.attributes,"label"),o=r.text,c=Le(r,["text"]),l=(null===(n=t.select(Lw.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,h=l.height,d=De(Sw(i,[0,(void 0===h?0:h)+a,"center","top"],[f+a,0,"start","middle"]),4),p=d[0],g=d[1],v=d[2],y=d[3];t.maybeAppendByClassName(Lw.label,"text").styles(Ce(Ce({},c),{x:p,y:g,text:s(o).toString(),textAlign:v,textBaseline:y}))}))},e}(qb),Iw={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},Dw=rb({},Iw,{}),Bw=rb({},Iw,$b(jw,"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"}),Fw=eb({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"),zw=function(t){function e(e){return t.call(this,e,Dw)||this}return Ne(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=De(Wb(zb(this.attributes,"title")),2),s=a[0],c=a[1];this.titleGroup=t.maybeAppendByClassName(Fw.titleGroup,"g").styles(c);var l=Ce(Ce({width:e,height:n},s),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(Fw.title,(function(){return new ww({style:l})})).update(l)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,o=e.height,a=De(Wb(zb(this.attributes,"title",!0)),2),s=a[0],c=a[1],l=Ce(Ce({},s),{width:i,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Fw.itemsGroup,"g").styles(Ce(Ce({},c),{transform:"translate(".concat(n,", ").concat(r,")")}));var u=this;this.itemsGroup.selectAll(Fw.items.class).data(["items"]).join((function(t){return t.append((function(){return new Cw({style:l})})).attr("className",Fw.items.name).each((function(){u.items=Lb(this)}))}),(function(t){return t.update(l)}),(function(t){return t.remove()}))},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().style.transform="translate(".concat(e,", ").concat(n,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,r=t.height;return e?this.title.node().getAvailableSpace():new Xm(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=bw(r),u=De(jb(a?i:0),4),f=u[0],h=u[1],d=u[2],p=u[3],g=De(jb(o),4),v=g[0],y=g[1],m=g[2],b=g[3],x=De([p+h,f+d],2),w=x[0],k=x[1],M=De([b+y,v+m],2),E=M[0],O=M[1];if("l"===l[0])return new Xm(s.x,s.y,c.width+s.width+w+E,Math.max(c.height+O,s.height));if("t"===l[0])return new Xm(s.x,s.y,Math.max(c.width+E,s.width),c.height+s.height+k+O);var _=De([e.attributes.width||c.width,e.attributes.height||c.height],2),S=_[0],A=_[1];return new Xm(c.x,c.y,S+s.width+w+E,A+s.height+k+O)}(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=Lb(e);e.style.transform="translate(".concat(a,", ").concat(c,")"),this.renderTitle(l,r,i),this.renderItems(l,this.availableSpace),this.adjustLayout()},e}(qb),$w={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},Ww=eb({background:"background",labelGroup:"label-group",label:"label"},"indicator"),Gw=function(t){function e(e){var n=t.call(this,e,$w)||this;return n.point=[0,0],n.group=n.appendChild(new Ig({})),n.isMutationObserved=!0,n}return Ne(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=De(jb(t.padding),4),r=n[0],i=n[1],o=n[2],a=n[3],s=this.label.node().getLocalBounds(),c=s.min,l=s.max,u=new Xm(c[0]-a,c[1]-r,l[0]+i-c[0]+a,l[1]+o-c[1]+r),f=this.getPath(e,u),h=zb(this.attributes,"background");this.background=Lb(this.group).maybeAppendByClassName(Ww.background,"path").styles(Ce(Ce({},h),{d:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=De(Wb(zb(this.attributes,"label")),2),i=r[0],o=r[1],a=Le(i,["text"]);(this.label=Lb(this.group).maybeAppendByClassName(Ww.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(Ww.label,(function(){return fb(e(n))})).style("text",e(n).toString()).selectAll("text").styles(a)},e.prototype.adjustLayout=function(){var t=De(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,Be([c+1,1],De(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=Ib.apply(void 0,Be([],De(t),!1)),r=De(t,2),i=De(r[0],2),o=i[0],a=i[1],s=De(r[1],2),c=s[0],l=s[1],u=De(n?[c-o,[o,c]]:[l-a,[a,l]],2),f=u[0],h=De(u[1],2),d=h[0],p=h[1],g=f/2,v=e*(f/Math.abs(f)),y=v/2,m=v*Math.sqrt(3)/2*.8,b=De([d,d+g-y,d+g,d+g+y,p],5),x=b[0],w=b[1],k=b[2],M=b[3],E=b[4];return n?(this.point=[k,a-m],[["L",x,a],["L",w,a],["L",k,a-m],["L",M,a],["L",E,a]]):(this.point=[o+m,k],[["L",o,x],["L",o,w],["L",o+m,k],["L",o,M],["L",o,E]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?Wm(this):$m(this)},e.prototype.bindEvents=function(){this.label.on($p.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(qb);function Hw(t,e){var n=De(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 Yw=eb({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function qw(t){var e=t.orientation,n=t.size,r=t.length;return Sw(e,[r,n],[n,r])}function Vw(t){var e=t.type,n=De(qw(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 Uw(t){return Vw(t)}function Xw(t){var e,n=t.orientation,r=t.color,i=t.block,o=t.partition;if(m(r)){e=new Array(20).fill(0).map((function(t,e,n){return r(e/(n.length-1))}))}else e=r;var a=e.length,s=e.map((function(t){return lh(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(Sw(n,"0","270"),")")):""}function Zw(t){var e=t.orientation,n=t.range;if(!n)return[];var r=De(qw(t),2),i=r[0],o=r[1],a=De(n,2),s=a[0],c=a[1],l=Sw(e,s*i,0),u=Sw(e,0,s*o),f=Sw(e,c*i,i),h=Sw(e,o,c*o);return[["M",l,u],["L",l,h],["L",f,h],["L",f,u],["Z"]]}var Kw=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 Ne(e,t),e.prototype.render=function(t,e){!function(t,e){var n=zb(e,"track");t.maybeAppendByClassName(Yw.track,"path").styles(Ce({d:Vw(e)},n))}(Lb(e).maybeAppendByClassName(Yw.trackGroup,"g"),t),function(t,e){var n=zb(e,"selection"),r=Xw(e),i=t.maybeAppendByClassName(Yw.selection,"path").styles(Ce({d:Uw(e),fill:r},n)),o=i.maybeAppendByClassName(Yw.clipPath,"path").styles({d:Zw(e)}).node();i.style("clipPath",o)}(Lb(e).maybeAppendByClassName(Yw.selectionGroup,"g"),t)},e}(qb);var Qw=function(t){function e(e){var n=t.call(this,e,Bw)||this;return n.eventToOffsetScale=new po({}),n.innerRibbonScale=new po({}),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=Hw(r.map((function(t){return t.value})),o).range,s=n.getRealSelection(a);n.showIndicator((a[0]+a[1])/2,"".concat(s[0],"-").concat(s[1])),n.dispatchIndicated(o,a)}else{var c=n.getTickValue(o);n.showIndicator(c,"".concat(n.getRealValue(c))),n.dispatchIndicated(c)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=De(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 Ne(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 Xm(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(Lb(e));var i=this.availableSpace,o=i.x,a=i.y,s=Lb(e).maybeAppendByClassName(Fw.contentGroup,"g").styles({transform:"translate(".concat(o,", ").concat(a,")")});hb(!!r,s.maybeAppendByClassName(Fw.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(Fw.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(Fw.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,Be([],De(t.map((function(t){return t.value}))),!1)),max:Math.max.apply(Math,Be([],De(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=De(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=De(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Sw(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=zb(this.attributes,"title"),s=Ce(Ce({},a),{width:i,height:o,text:r}),c=this;t.selectAll(Fw.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new ww({style:s})})).attr("className",Fw.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 Xm(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 Xm(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(Ox.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new Xm(0,0,n,r),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var t=this.attributes,e=t.showLabel,n=t.labelSpacing,r=void 0===n?0:n;if(!e)return{width:0,height:0,size:0,length:0};var i=this.labelBBox,o=i.width,a=i.height;return{width:o,height:a,size:this.ifHorizontal(a,o)+r+this.labelFixedSpacing,length:this.ifHorizontal(o,a)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,n=t.ribbonSize,r=this.availableSpace,i=r.width,o=r.height,a=this.labelShape,s=a.size,c=a.length,l=De(this.ifHorizontal([o,i],[i,o]),2),u=l[0],f=l[1],h=e?this.handleShape:{size:0,length:0},d=h.size,p=h.length,g=this.handleOffsetRatio,v=0,y=this.labelPosition;v=n||(["bottom","right"].includes(y)?Math.min(u-s,(u-d)/g):u*(1-g)>d?Math.max(u-s,0):Math.max((u-s-d)/g,0));var m=Math.max(p,c),b=f-m,x=De(this.ifHorizontal([b,v],[v,b]),2),w=x[0],k=x[1],M=["top","left"].includes(y)?s:0,E=De(this.ifHorizontal([m/2,M],[M,m/2]),2),O=E[0],_=E[1];return new Xm(O,_,w,k)},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=zb(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,v=p.size,y=rb({transform:"translate(".concat(h,", ").concat(d,")"),length:g,size:v,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(Fw.ribbon,(function(){return new Kw({style:y})})).update(y)},e.prototype.getHandleClassName=function(t){return"".concat(Fw.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=zb(this.attributes,"handle"),i=De(this.selection,2),o=i[0],a=i[1],s=Ce(Ce({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?Rw:wx,u=this;this.handlesGroup.selectAll(Fw.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(Fw.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=De(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 Xm(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=De([Math.max(e,i),Math.max(n,o)],2),s=a[0],c=a[1];return this.cacheHandleBBox=new Xm(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=De(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=De(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=zb(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Fw.indicator,(function(){return new Gw({})})).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(Ce(Ce({},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=De([n.value,c.value],2),u=l[0],f=l[1],h=(u+f)/2;e.push(Ce(Ce({},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=De(["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=zb(this.attributes,"tick"),s=zb(this.attributes,"label"),c=s.align,l=rb(Ce({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),$b(a,"tick"),$b(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=Ce(Ce(Ce({},l),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(Fw.label,(function(){return new Ew({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=De([0,0,0],3),l=c[0],u=c[1],f=c[2],h=null!=i?i:o;return e?(f=h,u=s,"positive"===n?"right"===a?(l=h,f=h):"bottom"===a&&(l=f):"negative"===n&&("top"===a||"left"===a)&&(l=o)):"positive"===n?"right"===a?u=h:"bottom"===a&&(l=o+s,u=r):"negative"===n&&("left"===a||"top"===a)&&(u=r),{offset:l,spacing:u,tickLength:f}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,o=this.labelAxisStyle,a=o.offset,s=o.spacing,c=o.tickLength,l=De(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=R(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}),$m(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){Wm(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=De(this.selection,2),o=i[0],a=i[1],s=De([t,e],2),c=s[0],l=s[1];n&&(c+=o,l+=a);var u=this.range;r=De(function(t,e,n){var r,i=De(t,2),o=i[0],a=i[1],s=De(e,2),c=s[0],l=s[1],u=De(n,2),f=u[0],h=u[1],d=De([c,l],2),p=d[0],g=d[1],v=g-p;return p>g&&(p=(r=De([g,p],2))[0],g=r[1]),v>a-o?[o,a]:p<o?f===o&&h===g?[o,g]:[o,v+o]:g>a?h===a&&f===p?[p,a]:[a-v,a]:[p,g]}([u.min,u.max],[c,l],this.selection),2),c=r[0],l=r[1],this.update({defaultValue:[c,l]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return Y(e)?Ob(.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?Hw(n.map((function(t){return t.value})),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t){var e=this.range,n=e.min,r=e.max,i=De(this.ribbon.node().getPosition(),2),o=i[0],a=i[1],s=this.ifHorizontal(o,a),c=this.ifHorizontal.apply(this,Be([],De(ub(t)),!1))-s;return R(this.getOffset(c,!0),n,r)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,o=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,i],range:[0,o]}),e?a.invert(t):a.map(t)},e.prototype.getRealSelection=function(t){var e=this.range.max,n=De(t,2),r=n[0],i=n[1];return this.ifHorizontal([r,i],[e-i,e-r])},e.prototype.getRealValue=function(t){var e=this.range.max;return this.ifHorizontal(t,e-t)},e.prototype.dispatchSelection=function(){var t=this.getRealSelection(this.selection),e=new Np("valuechange",{detail:{value:t}});this.dispatchEvent(e)},e.prototype.dispatchIndicated=function(t,e){var n=this,r=this.range.max,i=this.ifHorizontal((function(){return{value:t,range:e}}),(function(){return{value:r-t,range:e?n.getRealSelection(e):void 0}})),o=new Np("indicate",{detail:i});this.dispatchEvent(o)},e}(qb);function Jw(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 tk={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function ek(t){var e;void 0===t&&(t="");var n=Jw(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)]=Ce({flex:1},tk),e[".".concat(n.VALUE)]=Ce({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},tk),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 nk=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=Jw(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:ek(o)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return Ne(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map((function(t,e){var r=t.name,i=void 0===r?"":r,o=t.color,a=void 0===o?"black":o,s=t.index,c=Le(t,["name","color","index"]),l=Ce({name:i,color:a,index:null!=s?s:e},c);return On(function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t}(n.item,l))}))},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=function(){n.attributes.x=null!=t?t:n.attributes.x,n.attributes.y=null!=e?e:n.attributes.y,n.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(r):r()}this.element.style.visibility="visible"},e.prototype.hide=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.attributes.enterable&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=On(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:Hb(this.element,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=Jw(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,Hb(f,u);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=De(e,2),r=n[0],i=n[1];Be([t],De(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=De(l,2),n=e[0],i=e[1],a=De(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=De(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=De(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=De([+o+n,+a+r],2),d=h[0],p=h[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},v=s.x,y=s.y,m={left:d<v,right:d+u>v+s.width,top:p<y,bottom:p+f>y+s.height},b=[];c.split("-").forEach((function(t){m[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 Xm(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}(qb),rk=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[$p.BOUNDS_CHANGED,$p.INSERTED,$p.REMOVED],n.$margin=jb(0),n.$padding=jb(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 Ne(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=jb(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=jb(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=De(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new Xm(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=De(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],c=De(this.$margin,4),l=c[0],u=c[3];return new Xm(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:vb,grid:yb},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&&(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}(Ig);function ik(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]}const ok=Py((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:v,coordCenter:y,innerHTML:m}=e,b=Le(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=>!I(t))))return void t.children.forEach((t=>t.remove()));const x=Qo(b,"background"),{padding:w}=x,k=Le(x,["padding"]),M=Qo(b,"connector"),{points:E=[]}=M,O=Le(M,["points"]);let _;_=m?uy(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",m).call(py,Object.assign({transform:a,transformOrigin:s},b)).node():uy(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(py,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const S=uy(t).maybeAppend("background","rect").style("zIndex",-1).call(py,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}}(_,w)).call(py,d?k:{}).node(),A=function(t,e,n,r,i=!0,o=!0){const a=t=>kc()(t);if(!e[0]&&!e[1])return a([ik(t),e]);if(!n.length)return a([[0,0],e]);const[s,c]=n,l=[...c],u=[...s];if(c[0]!==s[0]){const t=i?-4:4;l[1]=c[1],o&&!i&&(l[0]=Math.max(s[0],c[0]-t),c[1]<s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.max(u[0],l[0]-t))),o||i||(l[0]=Math.max(s[0],c[0]-t),c[1]>s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.max(u[0],l[0]-t))),!o&&i&&(l[0]=Math.min(s[0],c[0]-t),c[1]>s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.min(u[0],l[0]-t))),o&&i&&(l[0]=Math.min(s[0],c[0]-t),c[1]<s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.min(u[0],l[0]-t)))}return a([c,l,u,s,e])}(S,[+u-+c,+f-+l],E,0,+u<y[0],+f<y[1]),T=g&&new tx({id:"startMarker",style:Object.assign({x:0,y:0},Qo(b,"startMarker"))}),P=v&&new tx({id:"endMarker",style:Object.assign({x:0,y:0},Qo(b,"endMarker"))});uy(t).maybeAppend("connector","path").style("zIndex",0).style("d",A).style("markerStart",T).style("markerEnd",P).call(py,p?O:{})})),ak=(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 uy(new ok).style("x",f).style("y",h).call(py,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(py,u).call(py,t).node()}};ak.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const sk=Py((t=>{const e=Le(t.attributes,["class","x","y","transform"]),n=Qo(e,"marker"),{size:r=24}=n,i=()=>function(t){const e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[o,a]=[0,0],[s,c]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,s,c],["L",o,a],["Z"]]}(r/2),o=uy(t).maybeAppend("marker",(()=>new tx({}))).call((t=>t.node().update(Object.assign({symbol:i},n)))).node(),[a,s]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(o);uy(t).maybeAppend("text","text").style("x",a).style("y",s).call(py,e)})),ck=(t,e)=>{const n=Le(t,[]);return(t,e,r)=>{const{color:i}=r,o=Le(r,["color"]),{color:a=i,text:s=""}=e,c={text:String(s),stroke:a,fill:a},[[l,u]]=t;return uy(new sk).call(py,o).style("transform",`translate(${l},${u})`).call(py,c).call(py,n).node()}};ck.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const lk=(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 uy(new Zg).style("x",f).style("y",h).call(py,i).style("transformOrigin","center center").style("transform",`${l}rotate(${c}deg)`).style("coordCenter",n.getCenter()).call(py,u).call(py,t).node()}};lk.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const uk=Py((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;uy(t).maybeAppend("connect-path",(()=>o.createElement("path",{}))).style("d",n).call(py,i),uy(t).maybeAppend("area-path",(()=>o.createElement("path",{}))).style("d",e).call(py,r)})),fk=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=t=>!Number.isNaN(t)&&null!=t,connect:o=!1}=t,a=Le(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=Kc(s),v=xy(s,e),y=r&&h?vy(h,d,p,r,void 0,g):f,m=Object.assign(Object.assign(Object.assign(Object.assign({},l),{stroke:y,fill:y}),v&&{transform:v}),a),[b,x]=function(t,e){const n=[],r=[],i=[];let o=!1,a=null;const s=t.length/2;for(let c=0;c<s;c++){const l=t[c],u=t[c+s];if([...l,...u].some((t=>!e(t))))o=!0;else{if(n.push(l),r.push(u),o&&a){o=!1;const[t,e]=a;i.push([t,l,e,u])}a=[l,u]}}return[n.concat(r),i]}(t,i),w=Qo(m,"connect"),k=!!x.length,M=t=>uy(c.createElement("path",{})).style("d",t||"").call(py,m).node();if(Qc(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=Mc().curve(Ec),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 Sc(n())},delete t.lineX0,t.lineEndAngle=function(){return Sc(r())},delete t.lineX1,t.lineInnerRadius=function(){return Sc(i())},delete t.lineY0,t.lineOuterRadius=function(){return Sc(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(_c(t)):e()._curve},t}().angle(((t,n)=>Ps(_s(r[n],e)))).outerRadius(((t,n)=>As(r[n],e))).innerRadius(((t,n)=>As(o[n],e))).defined(((t,e)=>[...r[e],...o[e]].every(i))).curve(n)(o)};return!k||o&&!Object.keys(w).length?M(e(b)):k&&!o?M(e(t)):uy(new uk).style("areaStyle",m).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return g?Mc().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):Mc().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!k||o&&!Object.keys(w).length?M(e(b)):k&&!o?M(e(t)):uy(new uk).style("areaStyle",m).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};fk.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hk=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Qc(n)?Dc:bc;return fk(Object.assign({curve:i},t),e)(...r)}};hk.props=Object.assign(Object.assign({},fk.props),{defaultMarker:"square"});const dk=(t,e)=>{const n=Le(t,[]),{coordinate:r}=e;return(...t)=>{const i=Qc(r)?Rc:Kc(r)?qc:Yc;return fk(Object.assign({curve:i},n),e)(...t)}};dk.props=Object.assign(Object.assign({},fk.props),{defaultMarker:"smooth"});const pk=(t,e)=>(...n)=>fk(Object.assign({curve:Uc},t),e)(...n);pk.props=Object.assign(Object.assign({},fk.props),{defaultMarker:"hvh"});const gk=(t,e)=>(...n)=>fk(Object.assign({curve:Xc},t),e)(...n);gk.props=Object.assign(Object.assign({},fk.props),{defaultMarker:"vh"});const vk=(t,e)=>(...n)=>fk(Object.assign({curve:Zc},t),e)(...n);vk.props=Object.assign(Object.assign({},fk.props),{defaultMarker:"hv"});const yk=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>Fm(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};yk.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const mk=(t,e)=>{const n=Le(t,[]),{document:r}=e;return(t,e,i)=>{const{color:o}=i,a=Le(i,["color"]),{color:s=o,transform:c}=e,[l,u]=t,f=cc();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]),uy(r.createElement("path",{})).call(py,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(py,n).node()}};function bk(t,e,n,r){const i=cc();if(Qc(n)){const o=n.getCenter(),a=As(t,o),s=(As(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),gy(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return Kc(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)}mk.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xk=(t,e)=>{const{cornerRatio:n=1/3}=t,r=Le(t,["cornerRatio"]),{coordinate:i,document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Le(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=bk(f,h,i,n);return uy(o.createElement("path",{})).call(py,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(py,r).node()}};xk.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const wk=(t,e)=>{const n=Le(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Le(o,["color"]),{color:c=a,transform:l}=e,[u,f]=t,h=cc();if(h.moveTo(u[0],u[1]),Qc(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{gy(h,u,f,Ls(u,f),As(u,f)/2)}return uy(i.createElement("path",{})).call(py,s).style("d",h.toString()).style("stroke",c).style("transform",l).call(py,n).node()}};function kk(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 Mk(t={}){return[...kk(t),{name:"title",scale:"identity"}]}function Ek(){return[{type:Oa,channel:"color"},{type:Ba,channel:["x","y"]}]}function Ok(){return[{type:Oa,channel:"x"},{type:Ba,channel:["y"]}]}function _k(t={}){return kk(t)}function Sk(){return[{type:Pa}]}function Ak(t,e){return t.getBandWidth(t.invert(e))}function Tk(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?Ak(a,r[e]):0,l=d?Ak(s,i[e]):0,g=p&&o?(Ak(c,o[e])/2+ +o[e])*n:0,[v,y]=t;return[v+u*n+g,y+f*l]}:t=>t}function Pk(t){return parseFloat(t)/100}function Nk(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?Pk(e)*a:+e,"string"==typeof n?Pk(n)*s:+n]]}));return[t,c]}function Ck(t){return"function"==typeof t?t:e=>e[t]}function Lk(t,e){return Array.from(t,Ck(e))}function jk(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=Lk(o,n),c=Lk(o,r),l=Lk(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})))}}wk.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Rk=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Le(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,[v,y]=n.getSize();h="string"==typeof h?Pk(h)*v:h,d="string"==typeof d?Pk(d)*y:d;const m=p-Number(h)/2,b=g-Number(d)/2;return uy(r.createElement("image",{})).call(py,s).style("x",m).style("y",b).style("src",l).style("stroke",c).style("transform",f).call(py,t).style("width",h).style("height",d).node()}};function Ik(t,e){const n=cc();if(Qc(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>As(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?gy(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)}Rk.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Dk=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Le(o,["color"]),{color:c=a,transform:l}=i,u=Ik(e,n);return uy(r.createElement("path",{})).call(py,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(py,t).node()}};function Bk(t,e){const[n,r,i,o]=t,a=cc();if(Qc(e)){const t=e.getCenter(),s=As(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),gy(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),gy(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}Dk.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Fk=(t,e)=>{const n=Le(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Le(o,["color"]),{color:c=a,transform:l}=e,u=Bk(t,r);return uy(i.createElement("path",{})).call(py,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(py,n).node()}};function zk(t,e){const n=cc();if(Qc(e)){const r=e.getCenter(),[i,o]=r,a=Ts(_s(t[0],r)),s=Ts(_s(t[1],r)),c=As(r,t[2]),l=As(r,t[3]),u=As(r,t[8]),f=As(r,t[10]),h=As(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}Fk.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const $k=(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=Le(o,["color","fill","stroke"]),h=zk(e,n);return uy(r.createElement("path",{})).call(py,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(py,t).node()}};function Wk(t,e,n=4){const r=cc();if(!Qc(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=As(i,t[3]),c=As(i,t[8]),l=As(i,t[10]),u=Ts(_s(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}$k.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Gk=(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=Le(o,["color","fill","stroke"]),h=Wk(e,n,4);return uy(r.createElement("path",{})).call(py,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(py,t).node()}};Gk.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Hk=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=Le(t,["arrow","arrowSize"]),{coordinate:o,document:a}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=Le(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},Qo(i,"arrow"))):null,p=function(t,e){if(!Qc(e))return kc().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return vc()({startAngle:0,endAngle:2*Math.PI,outerRadius:As(t[0],n),innerRadius:As(t[1],n)})}(t,o),g=function(t,e){if(!Qc(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,e.transform);return uy(a.createElement("path",{})).call(py,u).style("d",p).style("stroke",f).style("lineWidth",h).style("transform",g).style("markerEnd",d).call(py,i).node()}};function Yk(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}Hk.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const qk=(t,e)=>{const{offsetX:n=0,sourceOffsetX:r=n,targetOffsetX:i=n,offsetY:o=0,sourceOffsetY:a=o,targetOffsetY:s=o,connectLength1:c,endMarker:l=!0}=t,u=Le(t,["offsetX","sourceOffsetX","targetOffsetX","offsetY","sourceOffsetY","targetOffsetY","connectLength1","endMarker"]),{coordinate:f}=e;return(t,e,n)=>{const{color:o,connectLength1:h}=n,d=Le(n,["color","connectLength1"]),{color:p,transform:g}=e,v=function(t,e,n,r,i,o,a=0){const[[s,c],[l,u]]=e;if(Kc(t)){const t=s+n,e=t+a,f=c+i,h=u+o;return[[t,f],[e,f],[e,h],[l+r,h]]}const f=c-n,h=f-a,d=s-i,p=l-o;return[[d,f],[d,h],[p,h],[p,u-r]]}(f,t,a,s,r,i,null!=c?c:h),y=Qo(Object.assign(Object.assign({},u),n),"endMarker");return uy(new Gg).call(py,d).style("d",function(t){return kc().x((t=>t[0])).y((t=>t[1]))(t)}(v)).style("stroke",p||o).style("transform",g).style("markerEnd",l?new tx({className:"marker",style:Object.assign(Object.assign({},y),{symbol:Yk})}):null).call(py,u).node()}};function Vk(t,e,n,r){const{bounds:i}=n,[[o,a],[s,c]]=i,l=s-o,u=c-a,f=t=>{const{x:e,y:r}=t,i=ea(n.x,l),s=ea(n.y,u);return Object.assign(Object.assign({},t),{x:(i||e)+o,y:(s||r)+a})};return f("left"===t?{x:0,y:u/2,textAlign:"start",textBaseline:"middle"}:"right"===t?{x:l,y:u/2,textAlign:"end",textBaseline:"middle"}:"top"===t?{x:l/2,y:0,textAlign:"center",textBaseline:"top"}:"bottom"===t?{x:l/2,y:u,textAlign:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAlign:"start",textBaseline:"top"}:"top-right"===t?{x:l,y:0,textAlign:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAlign:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:l,y:u,textAlign:"end",textBaseline:"bottom"}:{x:l/2,y:u/2,textAlign:"center",textBaseline:"middle"})}function Uk(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=my(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:h,endAngle:d}=l,p="inside"===t?(h+d)/2:d,g=Zk(p,a,s),v=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?Xk(c,p,i):Ls(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},v),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function Xk(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function Zk(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function Kk(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=my(r,e,[i,o]),{startAngle:f,endAngle:h}=u,d=r.getCenter(),p=(f+h)/2,g={textAlign:"center",textBaseline:"middle",rotate:Zk(p,a,s)},{innerRadius:v,outerRadius:y}=u,m=v+(y-v)*c+l,[b,x]=Xk(d,p,m);return Object.assign({x:b,y:x},g)}function Qk(t){return void 0===t?null:t}function Jk(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:Qk(o[0]),y:Qk(o[1])}}function tM(t,e,n,r){const{bounds:i}=n;if(1===i.length)return Jk(0,0,n);return(Jc(r)?Uk:rl(r)?Kk:Vk)(t,e,n,r)}function eM(t,e,n){const r=my(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function nM(t,e,n){const r=my(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function rM(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=nM(e,n,r),d=Math.sin(h)>0?1:-1,p=Zk(h,i,o),g={textAlign:d>0||Jc(r)?"start":"end",textBaseline:"middle",rotate:p},v=eM(e,n,r),y=v+(s?c:a),[[m,b],[x,w],[k,M]]=function(t,e,n,r,i){const[o,a]=Xk(t,e,n),[s,c]=Xk(t,e,r);return[[o,a],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,h,v,y,s?l:0),E=s?+u*d:0,O=k+E,_={connector:s,connectorPoints:[[x-O,w-M],[k-O,M-M]]};return Object.assign(Object.assign({x0:m,y0:b,x:k+E,y:M},g),_)}function iM(t,e={}){const{labelHeight:n=14,height:r}=e,i=ir(t,(t=>t.y)),o=i.length,a=new Array(o);for(let t=0;t<o;t++){const e=i[t],{y:r}=e;a[t]={y:r,y1:r+n,labels:[r]}}let s=!0;for(;s;){s=!1;for(let t=a.length-1;t>0;t--){const e=a[t],n=a[t-1];if(n.y1>e.y){s=!0,n.labels.push(...e.labels),a.splice(t,1),n.y1+=e.y1-e.y;const i=n.y1-n.y;n.y1=Math.max(Math.min(n.y1,r),i),n.y=n.y1-i}}}let c=0;for(const t of a){const{y:e,labels:r}=t;let o=e-n;for(const t of r){const e=i[c++],r=o+n-t;e.connectorPoints[0][1]-=r,e.y=o+n,o+=n}}}function oM(t,e){const n=ir(t,(t=>t.y)),{height:r,labelHeight:i=14}=e,o=Math.ceil(r/i);if(n.length<=o)return iM(n,e);const a=[];for(let t=0;t<n.length;t++)t<n.length-o?(n[t].opacity=0,n[t].connector=!1):a.push(n[t]);iM(a,e)}qk.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const aM=new WeakMap;var sM=Object.freeze({__proto__:null,area:function(t,e,n,r){const i=e.length/2,o=e.slice(0,i),a=e.slice(i);let s=yr(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=Ts(_s(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:tM,bottomLeft:tM,bottomRight:tM,inside:tM,left:tM,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?Jk(0,0,n):(Jc(r)?Uk:rl(r)?rM:Vk)(t,e,n,r)},right:tM,spider:function(t,e,n,r,i,o){if(!rl(r))return{};if(aM.has(e))return aM.get(e);const a=o.map((t=>function(t,e,n){const{connectorLength:r,connectorLength2:i,connectorDistance:o}=e,a=Le(rM(0,t,e,n),[]),s=n.getCenter(),c=eM(t,e,n),l=nM(t,e,n),u=c+r+i,f=Math.sin(l)>0?1:-1,h=s[0]+(u+ +o)*f,{x:d}=a,p=h-d;return a.x+=p,a.connectorPoints[0][0]-=p,a}(t,n,r))),{width:s,height:c}=r.getOptions(),l=a.filter((t=>t.x<s/2)),u=a.filter((t=>t.x>=s/2)),f=Object.assign(Object.assign({},i),{height:c});return oM(l,f),oM(u,f),a.forEach(((t,e)=>aM.set(o[e],t))),aM.get(e)},surround:function(t,e,n,r){if(!rl(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=Le(rM(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if(rl(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=Ps([c-u[0],l-u[1]]),p=Math.sin(d)>0?1:-1,[g,v]=Xk(u,d,h);return s.x=g+(o+a)*p,s.y=v,s},top:tM,topLeft:tM,topRight:tM});function cM(t,e,n,r,i,o){const{position:a}=e,{render:s}=i,c=function(t,e){return void 0!==t?t:rl(e)?"inside":Kc(e)?"right":"top"}(a,n),l=r[s?"htmlLabel":"inside"===c?"innerLabel":"label"],u=Object.assign({},l,e),f=sM[pm(c)];if(!f)throw new Error(`Unknown position: ${c}`);return Object.assign(Object.assign({},l),f(c,t,u,n,i,o))}const lM=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,o,a,s)=>{const{text:c,x:l,y:u,transform:f="",transformOrigin:h,className:d=""}=o,p=Le(o,["text","x","y","transform","transformOrigin","className"]),g=cM(e,o,n,r,t,s),{rotate:v=0,transform:y=""}=g,m=Le(g,["rotate","transform"]);return uy(new ok).call(py,m).style("text",`${c}`).style("className",`${d} g2-label`).style("innerHTML",i?i(c,o.datum,o.index):void 0).style("labelTransform",`${y} rotate(${+v}) ${f}`.trim()).style("labelTransformOrigin",h).style("coordCenter",n.getCenter()).call(py,p).node()}};lM.props={defaultMarker:"point"};const uM=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=Le(t,["arrow","colorAttribute"]),{coordinate:o,document:a}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=Le(n,["color","stroke"]),{d:u,color:f=s}=e,[h,d]=o.getSize();return uy(a.createElement("path",{})).call(py,l).style("d","function"==typeof u?u({width:h,height:d}):u).style(r,f).call(py,i).node()}};uM.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const fM=(t,e)=>uM(Object.assign({colorAttribute:"fill"},t),e);fM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hM=(t,e)=>uM(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);hM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dM=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:o}=r,{color:a}=i,s=Le(i,["color"]),{color:c=a}=r,[l,...u]=e,f=cc();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),uy(n.createElement("path",{})).call(py,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(py,t).node()}};function pM(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 gM(t,e=(...t)=>`${t[0]}`,n=16){const r=pM(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)}}function vM(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}dM.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},pM(3);const yM=gM(((t,e,n)=>{const r=vM(n,2*t,2*t),i=r.getContext("2d"),o=t,a=t;if(1===e)i.beginPath(),i.arc(o,a,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const n=i.createRadialGradient(o,a,t*e,o,a,t);n.addColorStop(0,"rgba(0,0,0,1)"),n.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=n,i.fillRect(0,0,2*t,2*t)}return r}),(t=>`${t}`));function mM(t,e,n,r,i,o,a){const s=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},o);s.minOpacity*=255,s.opacity*=255,s.maxOpacity*=255;const c=vM(a,t,e).getContext("2d"),l=function(t,e){const n=vM(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=yM(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=vM(a,t,e).getContext("2d");return f.putImageData(u,0,0),f}const bM=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:o,blur:a,useGradientOpacity:s}=t,c=Le(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(),v=t.map((t=>({x:t[0],y:t[1],value:t[2],radius:t[3]}))),y=mr(t,(t=>t[2])),m=vr(t,(t=>t[2])),b=p&&g?mM(p,g,y,m,v,function(t,e){return Object.keys(t).reduce(((n,r)=>{const i=t[r];return e(i,r)||(n[r]=i),n}),{})}({gradient:n,opacity:r,minOpacity:o,maxOpacity:i,blur:a,useGradientOpacity:s},(t=>void 0===t)),u):{canvas:null};return uy(f.createElement("image",{})).call(py,h).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas.toDataURL()).style("transform",d).call(py,c).node()}};bM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xM=(t,e)=>{const{render:n}=t,r=Le(t,["render"]);return t=>{const[[i,o]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:o}),e)}};xM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};function wM(t,e,n){return t+(e-t)*n}function kM(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 MM(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=kM(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}const EM={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 `}},OM=(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=Le(i,["background","outline","wave"]),{border:f=2,distance:h=0}=c,d=Le(c,["border","distance"]),{length:p=192,count:g=3}=l;return(t,r,i)=>{const{document:c}=e.canvas,{color:l,fillOpacity:v}=i,y=Object.assign(Object.assign({fill:l},i),u),b=c.createElement("g",{}),[x,w]=n.getCenter(),k=n.getSize(),M=Math.min(...k)/2,E=m(o)?o:((t="circle")=>EM[t]||EM.circle)(o),O=E(x,w,M,...k);if(Object.keys(s).length){const t=c.createElement("path",{style:Object.assign({d:O,fill:"#fff"},s)});b.appendChild(t)}if(a>0){const t=c.createElement("path",{style:{d:O}});b.appendChild(t),b.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 p=r<=1?1:i/(r-1),g=MM(s,a+s*n,c,0,s/40,t,e),v=u.createElement("path",{style:{d:g,fill:f,opacity:wM(.2,.9,p)*Number(d||h)}});o.appendChild(v);try{if(!1===l)return;const t=[{transform:"translate(0, 0)"},{transform:`translate(${2*c}, 0)`}];v.animate(t,{duration:2*wM(2500,5e3,p),iterations:1/0})}catch(t){console.warn("off-screen group animate error!")}}}(x,w,1-a,g,y,b,t.getBBox().y,2*M,p,!0,c)}const _=c.createElement("path",{style:{d:O,fill:"transparent",lineWidth:f+2*h,stroke:"#fff"}}),S=c.createElement("path",{style:Object.assign(Object.assign(Object.assign({d:O,stroke:l,strokeOpacity:v,lineWidth:f},y),d),{fill:"transparent"})});return b.appendChild(_),b.appendChild(S),b}};OM.props={};const _M=(t,e)=>Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))/2,SM=(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=_M(n[0],n[1]),f=2*_M(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),ot(t,["shape","last","first"])),{fill:s||o.color})});return l.appendChild(h),l}};function AM(t,e){return t.getBandWidth(t.invert(e))}const TM={rect:Ey,hollow:Oy,funnel:Sy,pyramid:Ty},PM=()=>(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=AM(l,i[t]),n=e*(u?AM(u,null==s?void 0:s[t]):1),c=(+(null==s?void 0:s[t])||0)*e,f=+i[t]+c,[h,p]=d(f,n,t),g=+o[t],v=+a[t];return[[h,g],[p,g],[p,v],[h,v]].map((t=>r.map(t)))}));return[t,p]};PM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:TM,channels:[...Mk({shapes:Object.keys(TM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Sk(),{type:jn},{type:_a}],postInference:[...Ok()],interaction:{shareTooltip:!0}};const NM={rect:Ey,hollow:Oy},CM=()=>(t,e,n,r)=>{const{x:i,x1:o,y:a,y1:s}=n,c=Array.from(t,(t=>[[+i[t],+a[t]],[+o[t],+a[t]],[+o[t],+s[t]],[+i[t],+s[t]]].map((t=>r.map(t)))));return[t,c]};CM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:NM,channels:[...Mk({shapes:Object.keys(NM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Sk(),{type:jn}],postInference:[...Ok()],interaction:{shareTooltip:!0}};const LM={line:Ly,smooth:jy,hv:Ry,vh:Iy,hvh:Dy,trail:Fy},jM=(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(Jn(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]},RM=(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.");Qc(r)&&i.push(i[0]);const o=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}));return[t,o]},IM=()=>(t,e,n,r)=>(el(r)?RM:jM)(t,e,n,r);IM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:LM,channels:[...Mk({shapes:Object.keys(LM)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Sk(),{type:Ga},{type:Na}],postInference:[...Ok(),{type:Oa,channel:"color"},{type:Ba,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const DM={hollow:xm,hollowDiamond:mm,hollowHexagon:bm,hollowSquare:wm,hollowTriangleDown:Mm,hollowTriangle:km,hollowBowtie:ym,hollowCircle:_m,point:jm,plus:Lm,diamond:Tm,square:Rm,triangle:Dm,hexagon:Pm,cross:Am,bowtie:Sm,hyphen:Nm,line:Cm,tick:Im,triangleDown:Bm,circle:Om},BM=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=Tk(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]},v=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,v]};BM.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:DM,channels:[...Mk({shapes:Object.keys(DM)}),{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:[...Sk(),{type:_a},{type:Sa}],postInference:[{type:Ta},...Ek()]};const FM={text:ak,badge:ck,tag:lk},zM=t=>{const{cartesian:e=!1}=t;return e?Nk:(e,n,r,i)=>{const{x:o,y:a}=r,s=Tk(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};zM.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:FM,channels:[...Mk({shapes:Object.keys(FM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize",scale:"identity"},{name:"rotate",scale:"identity"}],preInference:[...Sk(),{type:Wa},{type:za}],postInference:[...Ek()]};const $M={cell:Ey,hollow:Oy},WM=()=>(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]};WM.props={defaultShape:"cell",defaultLabelShape:"label",shape:$M,composite:!1,channels:[...Mk({shapes:Object.keys($M)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Sk(),{type:_a},{type:Sa},{type:Fa}],postInference:[...Ek()]};const GM={area:hk,smooth:dk,hvh:pk,vh:gk,hv:vk},HM=()=>(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(Jn(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,v=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}));return[d,v,h]};HM.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:GM,channels:[...Mk({shapes:Object.keys(GM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Sk(),{type:Na},{type:jn},{type:Fa}],postInference:[...Ok()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const YM={link:yk,arc:wk,smooth:mk,vhv:xk},qM=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=Tk(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]};qM.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:YM,channels:[...Mk({shapes:Object.keys(YM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Sk(),{type:ja},{type:Ra}],postInference:[...Ek()]};const VM={image:Rk},UM=t=>{const{cartesian:e}=t;return e?Nk:(e,n,r,i)=>{const{x:o,y:a}=r,s=Tk(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};UM.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:VM,channels:[...Mk({shapes:Object.keys(VM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Sk(),{type:Wa},{type:za}],postInference:[...Ek()]};const XM={polygon:Dk,ribbon:Fk},ZM=()=>(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]};ZM.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:XM,channels:[...Mk({shapes:Object.keys(XM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Sk()],postInference:[...Ek()]};const KM={box:$k,violin:Gk},QM=()=>(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,v,y,m,b]=[+o[t],+a[t],+s[t],+c[t],+l[t]];return[[p-n/2,b],[p+n/2,b],[p,b],[p,m],[p-n/2,m],[p+n/2,m],[p+n/2,v],[p-n/2,v],[p-n/2,y],[p+n/2,y],[p,v],[p,g],[p-n/2,g],[p+n/2,g]].map((t=>r.map(t)))}));return[t,d]};QM.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:KM,channels:[...Mk({shapes:Object.keys(KM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Sk(),{type:_a}],postInference:[...Ok()],interaction:{shareTooltip:!0}};const JM={vector:Fm},tE=()=>(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]};tE.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:JM,channels:[...Mk({shapes:Object.keys(JM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Sk()],postInference:[...Ek()]};const eE={line:Hk},nE=t=>(e,n,r,i)=>{const{y:o}=r,a=Tk(n,r,Q({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]};nE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:eE,channels:[..._k({shapes:Object.keys(eE)}),{name:"y",required:!0}],preInference:[...Sk(),{type:Ca}],postInference:[]};const rE={line:Hk},iE=t=>(e,n,r,i)=>{const{x:o}=r,a=Tk(n,r,Q({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]};iE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:rE,channels:[..._k({shapes:Object.keys(rE)}),{name:"x",required:!0}],preInference:[...Sk(),{type:La}],postInference:[]};const oE={connector:qk},aE=(...t)=>qM(...t);function sE(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 cE(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=sE("x",e,i,r.x),s=sE("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]}}aE.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:oE,channels:[..._k({shapes:Object.keys(oE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Sk()],postInference:[]};const lE={range:Ey},uE=()=>cE();uE.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:lE,channels:[..._k({shapes:Object.keys(lE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Sk()],postInference:[]};const fE={range:Ey},hE=()=>cE({extendY:!0});hE.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:fE,channels:[..._k({shapes:Object.keys(fE)}),{name:"x",required:!0}],preInference:[...Sk(),{type:Ia}],postInference:[]};const dE={range:Ey},pE=()=>cE({extendX:!0});function gE(t){return t.target.depth}function vE(t,e){return t.sourceLinks.length?t.depth:e-1}function yE(t){return function(){return t}}function mE(t,e){return xE(t.source,e.source)||t.index-e.index}function bE(t,e){return xE(t.target,e.target)||t.index-e.index}function xE(t,e){return t.y0-e.y0}function wE(t){return t.value}function kE(t){return t.index}function ME(t){return t.nodes}function EE(t){return t.links}function OE(t,e){const n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function _E({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}}function SE(){let t,e,n,r,i=0,o=0,a=1,s=1,c=24,l=8,u=kE,f=vE,h=ME,d=EE,p=6;function g(g){const m={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=OE(n,r)),"object"!=typeof i&&(i=t.target=OE(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)}(m),function({nodes:t}){for(const e of t)e.value=void 0===e.fixedValue?Math.max(Tr(e.sourceLinks,wE),Tr(e.targetLinks,wE)):e.fixedValue}(m),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(vr(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)}}(m),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}}(m),function(e){const r=function({nodes:t}){const e=Math.max(vr(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)/(vr(r,(t=>t.length))-1)),function(e){const n=mr(e,(e=>(s-o-(e.length-1)*t)/Tr(e,wE)));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)}k(r)}}(r);for(let t=0;t<p;++t){const e=Math.pow(.99,t),n=Math.max(1-e,(t+1)/p);y(r,e,n),v(r,e,n)}}(m),_E(m),m}function v(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,w(t)}void 0===n&&o.sort(xE),o.length&&m(o,r)}}function y(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,w(t)}void 0===n&&o.sort(xE),o.length&&m(o,r)}}function m(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 w({sourceLinks:t,targetLinks:e}){if(void 0===r){for(const{source:{sourceLinks:t}}of e)t.sort(bE);for(const{target:{targetLinks:e}}of t)e.sort(mE)}}function k(t){if(void 0===r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(bE),n.sort(mE)}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 _E(t),t},g.nodeId=function(t){return arguments.length?(u="function"==typeof t?t:yE(t),g):u},g.nodeAlign=function(t){return arguments.length?(f="function"==typeof t?t:yE(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:yE(t),g):h},g.links=function(t){return arguments.length?(d="function"==typeof t?t:yE(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}pE.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:dE,channels:[..._k({shapes:Object.keys(dE)}),{name:"y",required:!0}],preInference:[...Sk(),{type:Da}],postInference:[]};const AE={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},TE={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?mr(t.sourceLinks,gE)-1:0},justify:vE};const PE=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({},AE,t),h=SE().nodeSort(r).linkSort(u).links(l).nodes(c).nodeWidth(o).nodePadding(a).nodeDepth(s).nodeAlign(function(t){const e=typeof t;return"string"===e?TE[t]||vE:"function"===e?t:vE}(i)).iterations(f).extent([[0,0],[1,1]]);"function"==typeof n&&h.nodeId(n);const d=h(e),{nodes:p,links:g}=d,v=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]})})),y=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:v,links:y}};function NE(t,e,n={},r=!1){if(ra(t))return t;if(Array.isArray(t)&&r)return t;const i=Qo(t,e);return Q(n,i)}function CE(t,e={}){return ra(t)||Array.isArray(t)?t:LE(t)?Q(e,t):t}function LE(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}function jE(t,e){return"object"==typeof t?Qo(t,e):t}PE.props={};const RE={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},IE={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},DE={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},BE={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},FE=t=>{const{data:e,encode:n={},scale:r,style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={},interaction:u}=t,{links:f,nodes:h}=jk(e,n),d=Qo(n,"node"),p=Qo(n,"link"),{key:g=t=>t.key,color:v=g}=d,{links:y,nodes:m}=PE(Object.assign(Object.assign(Object.assign({},RE),{nodeId:Ck(g)}),o))({links:f,nodes:h}),b=Qo(i,"label"),{text:x=g,spacing:w=5}=b,k=Le(b,["text","spacing"]),M=Ck(g),E=NE(l,"node",{title:M,items:[{field:"value"}]},!0),O=NE(l,"link",{title:"",items:[t=>({name:"source",value:M(t.source)}),t=>({name:"target",value:M(t.target)})]});return[Q({},IE,{data:m,encode:Object.assign(Object.assign({},d),{color:v}),scale:r,style:Qo(i,"node"),labels:[Object.assign(Object.assign(Object.assign({},BE),{text:x,dx:t=>t.x[0]<.5?w:-w}),k),...a],tooltip:E,animate:jE(c,"node"),axis:!1,interaction:u}),Q({},DE,{data:y,encode:p,labels:s,style:Object.assign({fill:p.color?void 0:"#aaa",lineWidth:0},Qo(i,"link")),tooltip:O,animate:jE(c,"link"),interaction:u})]};FE.props={};var zE=Object.freeze({__proto__:null,weight:function(t,e){return e.value-t.value},frequency:function(t,e){return e.frequency-t.frequency},id:function(t,e){return`${t.id}`.localeCompare(`${e.id}`)},name:function(t,e){return`${t.name}`.localeCompare(`${e.name}`)}});const $E={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};function WE(t){const{y:e,thickness:n,weight:r,marginRatio:i,id:o,source:a,target:s,sourceWeight:c,targetWeight:l,sortBy:u}=Object.assign(Object.assign({},$E),t);return function(t){const f=t.nodes.map((t=>Object.assign({},t))),h=t.edges.map((t=>Object.assign({},t)));return function(t,e){e.forEach((t=>{t.source=a(t),t.target=s(t),t.sourceWeight=c(t),t.targetWeight=l(t)}));const n=Jn(e,(t=>t.source)),r=Jn(e,(t=>t.target));t.forEach((t=>{t.id=o(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=Tr(e,(t=>t.sourceWeight))+Tr(i,(t=>t.targetWeight))}))}(f,h),function(t){const e="function"==typeof u?u:zE[u];e&&t.sort(e)}(f),function(t,o){const a=t.length;if(!a)throw Uo("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)}(f,h),function(t,n){const i=new Map(t.map((t=>[t.id,t])));if(!r)return n.forEach((t=>{const e=a(t),n=s(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=Jn(n,(t=>t.source)),c=Jn(n,(t=>t.target));t.forEach((t=>{const{edges:e,width:n,x:r,y:i,value:a,id:s}=t,l=o.get(s)||[],u=c.get(s)||[];let f=0;l.map((t=>{const e=t.sourceWeight/a*n;t.x[0]=r[0]+f,t.x[1]=r[0]+f+e,f+=e})),u.forEach((t=>{const e=t.targetWeight/a*n;t.x[3]=r[0]+f,t.x[2]=r[0]+f+e,f+=e}))}))}(f,h),{nodes:f,edges:h}}}const GE=t=>e=>WE(t)(e);GE.props={};const HE={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},YE={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}},qE={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{opacity:.5,lineWidth:1}},VE={position:"outside",fontSize:10},UE=(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}=jk(n,r),d=Qo(r,"node"),p=Qo(r,"link"),{key:g=t=>t.key,color:v=g}=d,{linkEncodeColor:y=t=>t.source}=p,{nodeWidthRatio:m=HE.thickness,nodePaddingRatio:b=HE.marginRatio}=a,x=Le(a,["nodeWidthRatio","nodePaddingRatio"]),{nodes:w,edges:k}=GE(Object.assign(Object.assign(Object.assign(Object.assign({},HE),{id:Ck(g),thickness:m,marginRatio:b}),x),{weight:!0}))({nodes:f,edges:h}),M=Qo(o,"label"),{text:E=g}=M,O=Le(M,["text"]),_=NE(u,"node",{title:"",items:[t=>({name:t.key,value:t.value})]},!0),S=NE(u,"link",{title:"",items:[t=>({name:`${t.source} -> ${t.target}`,value:t.value})]}),{height:A,width:T}=e,P=Math.min(A,T);return[Q({},qE,{data:k,encode:Object.assign(Object.assign({},p),{color:y}),labels:c,style:Object.assign({fill:y?void 0:"#aaa"},Qo(o,"link")),tooltip:S,animate:jE(l,"link")}),Q({},YE,{data:w,encode:Object.assign(Object.assign({},d),{color:v}),scale:i,style:Qo(o,"node"),coordinate:{type:"polar",outerRadius:(P-20)/P,startAngle:2*-Math.PI,endAngle:0},labels:[Object.assign(Object.assign(Object.assign({},VE),{text:E}),O),...s],tooltip:_,animate:jE(l,"node"),axis:!1})]};UE.props={};const XE={path:fM,hollow:hM},ZE=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];function KE(t,e){return t.parent===e.parent?1:2}function QE(t,e){return t+e.x}function JE(t,e){return Math.max(t,e.y)}function tO(){var t=KE,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(QE,0)/t.length}(n),e.y=function(t){return 1+t.reduce(JE,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}function eO(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 nO(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=iO)):void 0===e&&(e=rO);for(var n,r,i,o,a,s=new sO(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 sO(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(aO)}function rO(t){return t.children}function iO(t){return Array.isArray(t)?t[1]:null}function oO(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function aO(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function sO(t){this.data=t,this.depth=this.height=0,this.parent=null}function cO(t){return null==t?null:lO(t)}function lO(t){if("function"!=typeof t)throw new Error;return t}function uO(){return 0}function fO(t){return function(){return t}}ZE.props={defaultShape:"path",defaultLabelShape:"label",shape:XE,composite:!1,channels:[...Mk({shapes:Object.keys(XE)}),{name:"d",scale:"identity"}],preInference:[...Sk()],postInference:[]},sO.prototype=nO.prototype={constructor:sO,count:function(){return this.eachAfter(eO)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],c=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)t.call(e,o,++c,this);return this},eachBefore:function(t,e){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(t.call(e,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return nO(this).eachBefore(oO)},[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)}};const hO=4294967296;function dO(t,e){var n,r;if(vO(e,t))return[e];for(n=0;n<t.length;++n)if(pO(e,t[n])&&vO(mO(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(pO(mO(t[n],t[r]),e)&&pO(mO(t[n],e),t[r])&&pO(mO(t[r],e),t[n])&&vO(bO(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function pO(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 gO(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 vO(t,e){for(var n=0;n<e.length;++n)if(!gO(t,e[n]))return!1;return!0}function yO(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return mO(t[0],t[1]);case 3:return bO(t[0],t[1],t[2])}}function mO(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 bO(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,v=c-o,y=f-o,m=r*r+i*i-o*o,b=m-a*a-s*s+c*c,x=m-l*l-u*u+f*f,w=d*p-h*g,k=(p*x-g*b)/(2*w)-r,M=(g*v-p*y)/w,E=(d*b-h*x)/(2*w)-i,O=(h*y-d*v)/w,_=M*M+O*O-1,S=2*(o+k*M+E*O),A=k*k+E*E-o*o,T=-(Math.abs(_)>1e-6?(S+Math.sqrt(S*S-4*_*A))/(2*_):A/S);return{x:r+k+M*T,y:i+E+O*T,r:T}}function xO(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 wO(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 kO(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 MO(t){this._=t,this.next=null,this.previous=null}function EO(t,e){if(!(o=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,r,i,o,a,s,c,l,u,f,h;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;xO(r,n,i=t[2]),n=new MO(n),r=new MO(r),i=new MO(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(c=3;c<o;++c){xO(n._,r._,i=t[c]),i=new MO(i),l=r.next,u=n.previous,f=r._.r,h=n._.r;do{if(f<=h){if(wO(l._,i._)){r=l,n.next=r,r.previous=n,--c;continue t}f+=l._.r,l=l.next}else{if(wO(u._,i._)){(n=u).next=r,r.previous=n,--c;continue t}h+=u._.r,u=u.previous}}while(l!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=kO(n);(i=i.next)!==r;)(s=kO(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=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&&gO(r,n)?++i:(r=yO(a=dO(a,n)),i=0);return r}(n,e),c=0;c<o;++c)(n=t[c]).x-=i.x,n.y-=i.y;return i.r}function OO(t){return Math.sqrt(t.value)}function _O(){var t=null,e=1,n=1,r=uO;function i(i){const o=function(){let t=1;return()=>(t=(1664525*t+1013904223)%hO)/hO}();return i.x=e/2,i.y=n/2,t?i.eachBefore(SO(t)).eachAfter(AO(r,.5,o)).eachBefore(TO(1)):i.eachBefore(SO(OO)).eachAfter(AO(uO,1,o)).eachAfter(AO(r,i.r/Math.min(e,n),o)).eachBefore(TO(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=cO(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:fO(+t),i):r},i}function SO(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function AO(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=EO(i,n),c)for(o=0;o<s;++o)i[o].r-=c;r.r=a+c}}}function TO(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)}}function PO(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 NO(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}var CO={depth:-1},LO={},jO={};function RO(t){return t.id}function IO(t){return t.parentId}function DO(){var t,e=RO,n=IO;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){t=`${t}`;let e=t.length;FO(t,e-1)&&!FO(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(BO),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(BO(t)),h.push(jO));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 sO(o),null!=(u=d(o,a,r))&&(u+="")&&(f=l.id=u,g.set(f,g.has(f)?LO: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===LO)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===jO&&1===s.children.length;)s=s.children[0],--i;for(let t=h.length-1;t>=0&&(l=h[t]).data===jO;--t)l.data=null}if(s.parent=CO,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(aO),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=cO(t),r):e},r.parentId=function(t){return arguments.length?(n=cO(t),r):n},r.path=function(e){return arguments.length?(t=cO(e),r):t},r}function BO(t){let e=t.length;if(e<2)return"";for(;--e>1&&!FO(t,e););return t.slice(0,e)}function FO(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function zO(t,e){return t.parent===e.parent?1:2}function $O(t){var e=t.children;return e?e[0]:t.t}function WO(t){var e=t.children;return e?e[e.length-1]:t.t}function GO(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 HO(t,e,n){return t.a.parent===e.parent?t.a:n}function YO(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 qO(){var t=zO,e=1,n=1,r=null;function i(i){var c=function(t){for(var e,n,r,i,o,a=new YO(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 YO(r[i],i)),n.parent=e;return(a.parent=new YO(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=WO(s),o=$O(o),s&&o;)c=$O(c),(a=WO(a)).a=e,(i=s.z+f-o.z-l+t(s._,o._))>0&&(GO(HO(s,e,r),e,i),l+=i,u+=i),f+=s.m,l+=o.m,h+=c.m,u+=a.m;s&&!WO(a)&&(a.t=s,a.m+=f-u),o&&!$O(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 VO(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}YO.prototype=Object.create(sO.prototype);var UO=(1+Math.sqrt(5))/2;function XO(t,e,n,r,i,o){for(var a,s,c,l,u,f,h,d,p,g,v,y=[],m=e.children,b=0,x=0,w=m.length,k=e.value;b<w;){c=i-n,l=o-r;do{u=m[x++].value}while(!u&&x<w);for(f=h=u,v=u*u*(g=Math.max(l/c,c/l)/(k*t)),p=Math.max(h/v,v/f);x<w;++x){if(u+=s=m[x].value,s<f&&(f=s),s>h&&(h=s),v=u*u*g,(d=Math.max(h/v,v/f))>p){u-=s;break}p=d}y.push(a={value:u,dice:c<l,children:m.slice(b,x)}),a.dice?NO(a,n,r,i,k?r+=l*u/k:o):VO(a,n,r,k?n+=c*u/k:i,o),k-=u,b=x}return y}var ZO=function t(e){function n(t,n,r,i,o){XO(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(UO);function KO(t,e,n,r,i){var o,a,s=t.children,c=s.length,l=new Array(c+1);for(l[0]=a=o=0;o<c;++o)l[o+1]=a+=s[o].value;!function t(e,n,r,i,o,a,c){if(e>=n-1){var u=s[e];return u.x0=i,u.y0=o,u.x1=a,void(u.y1=c)}var f=l[e],h=r/2+f,d=e+1,p=n-1;for(;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 v=l[d]-f,y=r-v;if(a-i>c-o){var m=r?(i*y+a*v)/r:a;t(e,d,v,i,o,m,c),t(d,n,y,m,o,a,c)}else{var b=r?(o*y+c*v)/r:c;t(e,d,v,i,o,a,b),t(d,n,y,i,b,a,c)}}(0,c,t.value,e,n,r,i)}function QO(t,e,n,r,i){(1&t.depth?VO:NO)(t,e,n,r,i)}var JO=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?NO(s,n,r,i,d?r+=(o-r)*s.value/d:o):VO(s,n,r,d?n+=(i-n)*s.value/d:i,o),d-=s.value}else t._squarify=a=XO(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(UO);function t_(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],t_(n,n.path)}))}function e_(t){const e=rt(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach((t=>{e_(t)}))}function n_(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:KO,treemapDice:NO,treemapSlice:VO,treemapSliceDice:QO,treemapSquarify:ZO,treemapResquarify:JO},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?DO().path(e)(t):DO()(t):nO(t)}(t,e.path);x(t)?e_(o):t_(o),r?o.sum((t=>e.ignoreParentValue&&t.children?0:Ck(r)(t))).sort(e.sort):o.count(),function(){var t=ZO,e=!1,n=1,r=1,i=[0],o=uO,a=uO,s=uO,c=uO,l=uO;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(PO),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=lO(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:fO(+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:fO(+t),u):a},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:fO(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"==typeof t?t:fO(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:fO(+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 r_={fontSize:10,text:t=>j(t.path),position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0,isTreemapLabel:!0},i_={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"}]},o_={title:t=>j(t.path),items:[{field:"value"}]},a_=(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=Le(t,["data","encode","scale","style","layout","labels","tooltip"]),d=rt(i,["interaction","treemapDrillDown"]),p=Q({},((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,v]=n_(o,p,a),y=Qo(c,"label");return Q({},((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(Object.assign({},r_),y),d&&{cursor:"pointer"}),...u]},h),{encode:a,tooltip:CE(f,i_),axis:!1}),d?{interaction:Object.assign(Object.assign({},h.interaction),{treemapDrillDown:d?Object.assign(Object.assign({},d),{originData:v,layout:p}):void 0}),encode:Object.assign({color:t=>j(t.path)},a),tooltip:CE(f,o_)}:{})};a_.props={};const s_={text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r},c_={title:t=>t.data.name,items:[{field:"value"}]},l_=(t,e)=>{const{width:n,height:r}=e,{data:i,encode:o={},scale:a={},style:s={},layout:c={},labels:l=[],tooltip:u={}}=t,f=Le(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=x(t)?DO().path(e.path)(t):nO(t);return r?i.sum((t=>Ck(r)(t))).sort(e.sort):i.count(),_O().size(e.size).padding(e.padding)(i),i.descendants()})(i,Q({},((t,e)=>({size:[t,e],padding:0,sort:(t,e)=>e.value-t.value}))(n,r),c),Q({},h.encode,o)),p=Qo(s,"label");return Q({},h,Object.assign(Object.assign({data:d,encode:o,scale:a,style:s,labels:[Object.assign(Object.assign({},s_),p),...l]},f),{tooltip:CE(u,c_),axis:!1}))};function u_(t,e){return mr(t,(t=>e[t]))}function f_(t,e){return vr(t,(t=>e[t]))}function h_(t,e){const n=2.5*d_(t,e)-1.5*g_(t,e);return mr(t,(t=>e[t]>=n?e[t]:NaN))}function d_(t,e){return kr(t,.25,(t=>e[t]))}function p_(t,e){return kr(t,.5,(t=>e[t]))}function g_(t,e){return kr(t,.75,(t=>e[t]))}function v_(t,e){const n=2.5*g_(t,e)-1.5*d_(t,e);return vr(t,(t=>e[t]<=n?e[t]:NaN))}function y_(){return(t,e)=>{const{encode:n}=e,{y:r,x:i}=n,{value:o}=r,{value:a}=i,s=Array.from(Jn(t,(t=>a[+t])).values()),c=s.flatMap((t=>{const e=h_(t,o),n=v_(t,o);return t.filter((t=>o[t]<e||o[t]>n))}));return[c,e]}}l_.props={};const m_=t=>{const{data:e,encode:n,style:r={},tooltip:i={},transform:o,animate:a}=t,s=Le(t,["data","encode","style","tooltip","transform","animate"]),{point:c=!0}=r,l=Le(r,["point"]),{y:u}=n,f={y:u,y1:u,y2:u,y3:u,y4:u},h={y1:d_,y2:p_,y3:g_},d=NE(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=NE(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:u_},h),{y4:f_})],encode:Object.assign(Object.assign({},n),f),style:l,tooltip:d},s);const g=Qo(l,"box"),v=Qo(l,"point");return[Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:h_},h),{y4:v_})],encode:Object.assign(Object.assign({},n),f),style:g,tooltip:d,animate:jE(a,"box")},s),{type:"point",data:e,transform:[{type:y_}],encode:n,style:Object.assign({},v),tooltip:p,animate:jE(a,"point")}]};m_.props={};const b_=t=>{const{cartesian:e}=t;return e?Nk:(e,n,r,i)=>{const{x:o,y:a}=r,s=Tk(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};function x_(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,v=t._y0,y=t._x1,m=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=e>=(o=(g+y)/2))?g=o:y=o,(u=n>=(a=(v+m)/2))?v=a:m=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+y)/2))?g=o:y=o,(u=n>=(a=(v+m)/2))?v=a:m=a}while((f=u<<1|l)==(h=(c>=a)<<1|s>=o));return i[h]=d,i[f]=p,t}function w_(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function k_(t){return t[0]}function M_(t){return t[1]}function E_(t,e,n){var r=new O_(null==e?k_:e,null==n?M_:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function O_(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 __(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}b_.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:xM},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Sk(),{type:Wa},{type:za},{type:$a}]};var S_=E_.prototype=O_.prototype;function A_(t){return function(){return t}}function T_(t){return 1e-6*(t()-.5)}function P_(t){return t.index}function N_(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}S_.copy=function(){var t,e,n=new O_(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=__(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]=__(e));return n},S_.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return x_(this.cover(e,n),e,n,t)},S_.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)x_(this,a[n],s[n],t[n]);return this},S_.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},S_.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},S_.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]]},S_.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 w_(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 v=(i+a)/2,y=(o+s)/2;p.push(new w_(g[3],v,y,a,s),new w_(g[2],i,y,v,s),new w_(g[1],v,o,a,y),new w_(g[0],i,o,v,y)),(l=(e>=y)<<1|t>=v)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=c)}else{var m=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),x=m*m+b*b;if(x<n){var w=Math.sqrt(n=x);u=t-w,f=e-w,h=t+w,d=e+w,r=g.data}}return r},S_.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,v=this._x1,y=this._y1;if(!d)return this;if(d.length)for(;;){if((l=o>=(s=(p+v)/2))?p=s:v=s,(u=a>=(c=(g+y)/2))?g=c:y=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)},S_.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},S_.root=function(){return this._root},S_.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},S_.visit=function(t){var e,n,r,i,o,a,s=[],c=this._root;for(c&&s.push(new w_(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 w_(n,l,u,o,a)),(n=c[2])&&s.push(new w_(n,r,u,l,a)),(n=c[1])&&s.push(new w_(n,l,i,o,u)),(n=c[0])&&s.push(new w_(n,r,i,l,u))}return this},S_.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new w_(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 w_(o,a,s,u,f)),(o=i[1])&&n.push(new w_(o,u,s,c,f)),(o=i[2])&&n.push(new w_(o,a,f,u,l)),(o=i[3])&&n.push(new w_(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},S_.x=function(t){return arguments.length?(this._x=t,this):this._x},S_.y=function(t){return arguments.length?(this._y=t,this):this._y};var C_={value:()=>{}};function L_(){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 j_(r)}function j_(t){this._=t}function R_(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function I_(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=C_,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}j_.prototype=L_.prototype={constructor:j_,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]=I_(i[n],t.name,e);else if(null==e)for(n in i)i[n]=I_(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=R_(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new j_(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)}};var D_,B_,F_=0,z_=0,$_=0,W_=0,G_=0,H_=0,Y_="object"==typeof performance&&performance.now?performance:Date,q_="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function V_(){return G_||(q_(U_),G_=Y_.now()+H_)}function U_(){G_=0}function X_(){this._call=this._time=this._next=null}function Z_(t,e,n){var r=new X_;return r.restart(t,e,n),r}function K_(){G_=(W_=Y_.now())+H_,F_=z_=0;try{!function(){V_(),++F_;for(var t,e=D_;e;)(t=G_-e._time)>=0&&e._call.call(void 0,t),e=e._next;--F_}()}finally{F_=0,function(){var t,e,n=D_,r=1/0;for(;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:D_=e);B_=t,J_(r)}(),G_=0}}function Q_(){var t=Y_.now(),e=t-W_;e>1e3&&(H_-=e,W_=t)}function J_(t){F_||(z_&&(z_=clearTimeout(z_)),t-G_>24?(t<1/0&&(z_=setTimeout(K_,t-Y_.now()-H_)),$_&&($_=clearInterval($_))):($_||(W_=Y_.now(),$_=setInterval(Q_,1e3)),F_=1,q_(K_)))}X_.prototype=Z_.prototype={constructor:X_,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?V_():+n)+(null==e?0:+e),this._next||B_===this||(B_?B_._next=this:D_=this,B_=this),this._call=t,this._time=n,J_()},stop:function(){this._call&&(this._call=null,this._time=1/0,J_())}};const tS=4294967296;function eS(t){return t.x}function nS(t){return t.y}var rS=Math.PI*(3-Math.sqrt(5));function iS(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,c=Z_(f),l=L_("tick","end"),u=function(){let t=1;return()=>(t=(1664525*t+1013904223)%tS)/tS}();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=10*Math.sqrt(.5+n),o=n*rS;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)}}}const oS={joint:!0},aS={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}},sS={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},style:{stroke:"#fff"}},cS={text:""};function lS(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=A_(-30),a=1,s=1/0,c=.81;function l(n){var i,o=t.length,a=E_(t,eS,nS).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=T_(n))*f),0===h&&(p+=(h=T_(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=T_(n))*f),0===h&&(p+=(h=T_(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:A_(+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=P_,c=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=A_(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,v=0;v<s;++v)l=(c=t[v]).source,h=(f=c.target).x+f.vx-l.x-l.vx||T_(a),d=f.y+f.vy-l.y-l.vy||T_(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[v])/p*r*e[v],d*=p,f.vx-=h*(g=o[v]),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=N_(f,c.source)),"object"!=typeof c.target&&(c.target=N_(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:A_(+t),d(),f):c},f.distance=function(t){return arguments.length?(l="function"==typeof t?t:A_(+t),p(),f):l},f}(i).id(Ck(l));"function"==typeof a&&u.strength(a),"function"==typeof s&&f.strength(s);const h=iS(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=A_(.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=A_(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:A_(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:A_(+e),a(),o):t},o}()).force("y",function(t){var e,n,r,i=A_(.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=A_(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:A_(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:A_(+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 uS=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=Le(n,["nodeKey","linkKey"]),d=Object.assign({nodeKey:u,linkKey:f},h),p=Qo(d,"node"),g=Qo(d,"link"),{links:v,nodes:y}=jk(e,d),{nodesData:m,linksData:b}=lS({links:v,nodes:y},Q({},oS,o),d),x=NE(l,"link",{items:[t=>({name:"source",value:Ck(f)(t.source)}),t=>({name:"target",value:Ck(f)(t.target)})]}),w=NE(l,"node",{items:[t=>({name:"key",value:Ck(u)(t)})]},!0);return[Q({},aS,{data:b,encode:g,labels:s,style:Qo(i,"link"),tooltip:x,animate:jE(c,"link")}),Q({},sS,{data:m,encode:Object.assign({},p),scale:r,style:Qo(i,"node"),tooltip:w,labels:[Object.assign(Object.assign({},cS),Qo(i,"label")),...a],animate:jE(c,"link")})]};uS.props={};const fS=t=>e=>n=>{const{field:r="value",nodeSize:i,separation:o,sortBy:a,as:s=["x","y"]}=e,[c,l]=s,u=nO(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}},hS=t=>fS(tO)(t);hS.props={};const dS=t=>fS(qO)(t);dS.props={};const pS={sortBy:(t,e)=>e.value-t.value},gS={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},vS={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},yS={text:"",fontSize:10},mS=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}=dS(Object.assign(Object.assign(Object.assign({},pS),o),{field:u}))(e),d=NE(l,"node",{title:"name",items:["value"]},!0),p=NE(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[Q({},vS,{data:h,encode:Qo(n,"link"),scale:Qo(r,"link"),labels:s,style:Object.assign({stroke:"#999"},Qo(i,"link")),tooltip:p,animate:jE(c,"link")}),Q({},gS,{data:f,scale:Qo(r,"node"),encode:Qo(n,"node"),labels:[Object.assign(Object.assign({},yS),Qo(i,"label")),...a],style:Object.assign({},Qo(i,"node")),tooltip:d,animate:jE(c,"node")})]};mS.props={};const bS=(t,e)=>Re(void 0,void 0,void 0,(function*(){const{width:n,height:r}=e,{data:i,encode:o={},scale:a,style:s={},layout:c={}}=t,l=Le(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 Q({},{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},tooltip:{items:[t=>({name:t.text,value:t.value})]}},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}))}));bS.props={};const xS={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"]}}},wS={style:{shape:(t,e)=>{const{shape:n,radius:r}=t,i=Le(t,["shape","radius"]),o=Qo(i,"pointer"),a=Qo(i,"pin"),{shape:s}=o,l=Le(o,["shape"]),{shape:u}=a,f=Le(a,["shape"]),{coordinate:h,theme:d}=e;return(t,e)=>{const n=t.map((t=>h.invert(t))),[o,a,p]=function(t,e){const{transformations:n}=t.getOptions(),[,...r]=n.find((t=>t[0]===e));return r}(h,"polar"),g=h.clone(),{color:v}=e,y=c({startAngle:o,endAngle:a,innerRadius:p,outerRadius:r});y.push(["cartesian"]),g.update({transformations:y});const m=n.map((t=>g.map(t))),[b,x]=wy(m),[w,k]=h.getCenter(),M=Object.assign(Object.assign({x1:b,y1:x,x2:w,y2:k,stroke:v},l),i),E=Object.assign(Object.assign({cx:w,cy:k,stroke:v},f),i),O=uy(new Ig);return ra(s)||("function"==typeof s?O.append((()=>s(m,e,g,d))):O.append("line").call(py,M).node()),ra(u)||("function"==typeof u?O.append((()=>u(m,e,g,d))):O.append("circle").call(py,E).node()),O.node()}},lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},kS={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"},tooltip:!1};function MS(t,e){const{name:n="score",target:r,total:i,percent:o,thresholds:a=[]}=function(t){if(I(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}}function ES(t,{target:e,total:n}){const{content:r}=t;return r?r(e,n):e.toString()}const OS=t=>{const{data:e={},scale:n={},style:r={},animate:i={},transform:o=[]}=t,a=Le(t,["data","scale","style","animate","transform"]),{targetData:s,totalData:c,target:l,total:u,scale:f}=MS(e,n),h=Qo(r,"text"),{tooltip:d}=h,p=Le(h,["tooltip"]),g=(v=r,y=["pointer","pin"],Object.fromEntries(Object.entries(v).filter((([t])=>y.find((e=>t.startsWith(e)))))));var v,y;const m=Qo(r,"arc"),b=m.shape;return[Q({},xS,Object.assign({type:"interval",transform:[{type:"stackY"}],data:c,scale:f,style:"round"===b?Object.assign(Object.assign({},m),{shape:SM}):m,animate:"object"==typeof i?Qo(i,"arc"):i},a)),Q({},xS,wS,Object.assign({type:"point",data:s,scale:f,style:g,animate:"object"==typeof i?Qo(i,"indicator"):i},a)),Q({},kS,{style:Object.assign({text:ES(p,{target:l,total:u})},p),tooltip:d,animate:"object"==typeof i?Qo(i,"text"):i})]};OS.props={};const _S={density:dM},SS=()=>(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]};SS.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:_S,channels:[...Mk({shapes:Object.keys(_S)}),{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:[...Sk(),{type:jn},{type:_a}],postInference:[...Ok()],interaction:{shareTooltip:!0}};const AS={heatmap:bM},TS=t=>(t,e,n,r)=>{const{x:i,y:o,size:a,color:s}=n,c=Array.from(t,(t=>{const e=a?+a[t]:40;return[...r.map([+i[t],+o[t]]),s[t],e]}));return[[0],[c]]};TS.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:AS,channels:[...Mk({shapes:Object.keys(AS)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Sk(),{type:_a},{type:Sa}],postInference:[...Ek()]};const PS={axis:{x:!1,y:!1},legend:!1,tooltip:!1,encode:{x:"type",y:"percent"},scale:{y:{domain:[0,1]}},style:{shape:OM},animate:{enter:{type:"fadeIn"}}},NS={type:"text",style:{x:"50%",y:"50%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"},animate:{enter:{type:"fadeIn"}}},CS=t=>{const{data:e={},style:n={},animate:r}=t,i=Le(t,["data","style","animate"]),o=Math.max(0,I(e)?e:null==e?void 0:e.percent),a=[{percent:o,type:"liquid"}],s=Object.assign(Object.assign({},Qo(n,"text")),Qo(n,"content")),c=Qo(n,"outline"),l=Qo(n,"wave"),u=Qo(n,"background");return[Q({},PS,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)),Q({},NS,{style:Object.assign({text:`${dy(100*o)} %`},s),animate:r})]};CS.props={};const LS=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];LS.props={};const jS=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];jS.props={};const RS=t=>new Xi(t);RS.props={};const IS=t=>new po(t);IS.props={};const DS=t=>new qi(t);DS.props={};const BS=t=>new co(t);BS.props={};const FS=t=>new go(t);FS.props={};const zS=t=>new Bo(t);zS.props={};const $S=t=>new wo(t);$S.props={};const WS=t=>new yo(t);WS.props={};const GS=t=>new bo(t);GS.props={};const HS=t=>new Eo(t);HS.props={};const YS=t=>new ko(t);YS.props={};const qS=t=>new mo(t);qS.props={};const VS=t=>new $o(t);VS.props={};const US=t=>new Ki(t);function XS({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:v="auto",margin:y=16}){return{padding:v,margin:y,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",tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[o,o],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:o,colPadding:a,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:c,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:c,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:l,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"},tooltip:{css:{".g2-tooltip":{"font-family":"sans-serif"}}}}}US.props={};const ZS=XS({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}),KS=t=>Q({},ZS,t);KS.props={};const QS=t=>Q({},KS(),{category10:"category10",category20:"category20"},t);QS.props={};const JS=XS({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),tA=t=>Q({},JS,{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),eA=t=>Object.assign({},tA(),{category10:"category10",category20:"category20"},t);eA.props={};const nA=XS({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}),rA=t=>Q({},nA,{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 iA(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)]}rA.props={};var oA,aA=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sA(t){if(!(e=aA.exec(t)))throw new Error("invalid format: "+t);var e;return new cA({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 cA(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 lA(t,e){var n=iA(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")}sA.prototype=cA.prototype,cA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var uA={"%":(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)=>lA(100*t,e),r:lA,s:function(t,e){var n=iA(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(oA=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")+iA(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function fA(t){return t}var hA,dA,pA=Array.prototype.map,gA=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function vA(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?fA:(e=pA.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?fA:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(pA.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=sA(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,v=t.precision,y=t.trim,m=t.type;"n"===m?(g=!0,m="g"):uA[m]||(void 0===v&&(v=12),y=!0,m="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",x="$"===h?o:/[%p]/.test(m)?c:"",w=uA[m],k=/[defgprs%]/.test(m);function M(t){var i,o,c,h=b,M=x;if("c"===m)M=w(t)+M,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),v),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0===+t&&"+"!==f&&(E=!1),h=(E?"("===f?f:l:"-"===f||"("===f?"":f)+h,M=("s"===m?gA[8+oA/3]:"")+M+(E&&"("===f?")":""),k)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 O=h.length+t.length+M.length,_=O<p?new Array(p-O+1).join(e):"";switch(g&&d&&(t=r(_+t,_.length?p-M.length:1/0),_=""),n){case"<":t=h+t+M+_;break;case"=":t=h+_+t+M;break;case"^":t=_.slice(0,O=_.length>>1)+h+t+M+_.slice(O);break;default:t=_+h+t+M}return s(t)}return v=void 0===v?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,e){var n=f(((t=sA(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=iA(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=gA[8+r/3];return function(t){return n(i*t)+o}}}}function yA(t,e,n){return t.querySelector(e)?uy(t).select(e):uy(t).append(n)}function mA(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function bA(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)}hA=vA({thousands:",",grouping:[3],currency:["$",""]}),dA=hA.format;class xA extends rk{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 wA extends xA{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function kA(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function MA(t){return"vertical"===t||t===-Math.PI/2}function EA(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,v]=s?[d,h]:[h,d];return{orientation:p,width:g,height:v,size:h,length:d}}function OA(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=Le(t,["style"]),i={};return Object.entries(r).forEach((([t,n])=>{e.includes(t)?i[`show${G(t)}`]=n:i[t]=n})),Object.assign(Object.assign({},i),n)}function _A(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function SA(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function AA(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]=Vn(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(Qc(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 po({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(!nl(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new po({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new po({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return Qc(s)||Kc(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:Jc(s)&&"center"===a||Kc(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||Kc(s)&&g(a)?1-l:l,label:f(h(dy(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(dy(e),n,r)),id:String(n)}}))}function TA(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 PA(t,e,n){return!function(t){return Qc(t)&&Kc(t)}(e)&&!el(e)&&(void 0===t?!!n.getTicks:t)}function NA(t,e,n,r,i,o){const a=function(t,e,n,r,i){const o=n.axis,a=["top","right","bottom","left"].includes(i)?n[`axis${Vo(i)}`]:n.axisLinear,s=t.getOptions().name,c=n[`axis${G(s)}`]||{};return Object.assign({},o,a,c)}(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:MA(o)?10:0,tick:"center"!==r&&void 0}):a}const CA=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?dA(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)}},LA=CA((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,v=Le(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:i,value:y,coordinate:m,theme:b})=>{const{bbox:x}=y,[w]=i,{domain:k,xScale:M}=w.getOptions(),E=NA(w,0,b,e,s,o),O=Object.assign(Object.assign(Object.assign({},E),l),v),_=function(t,e,n="xy"){const[r,i,o]=SA(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,m,t.plane),S=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]=il(r),[f,h]=ol(r),d=Math.min(s,c)/2,{insetLeft:p,insetTop:g}=r.getOptions(),v=l*d,y=u*d,[m,b]=[t+o-p,n+a-g],[x,w]=[Math.cos(e),Math.sin(e)],k=[m+y*x,b+y*w],M=[m+v*x,b+v*w],E=()=>{const{domain:t}=i.getOptions();return t.length},O=Qc(r)&&i?E():3;return{startPos:k,endPos:M,gridClosed:Math.abs(h-f-360)<1e-6,gridCenter:[m,b],gridControlAngles:new Array(O).fill(0).map(((t,e,n)=>(h-f)/O*e))}}}return{}}(s,o,x,m,M),A=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(m),T=AA(w,k,f,r,h,d,s,m),P=g?T.map(((t,e)=>{const n=g.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):T,N=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},O),{type:"linear",data:P,crossSize:c,titleText:mA(u),labelOverlap:TA(p,O),grid:PA(O.grid,m,w),gridLength:_,line:!0,indexBBox:g}),O.line?null:{lineOpacity:0}),S),A),n),C=N.labelOverlap.find((t=>"hide"===t.type));return C&&(N.crossSize=!1),new Ew({className:"axis",style:OA(N)})}})),jA=CA((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=Le(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(),v=AA(t,g,s,o,a,c,r,n),y=f?v.map(((t,e)=>{const n=f.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):v,[m,b]=il(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]=ol(i),[d,p]=SA(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,m,b,n),{axis:w,axisArc:k={}}=i,M=OA(Q({},w,k,x,Object.assign(Object.assign({type:"arc",data:y,titleText:mA(h),grid:d},p),l)));return new Ew({style:ot(M,["transform"])})}}));LA.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},jA.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const RA=t=>(...e)=>{const n=LA(Object.assign({},{crossPadding:50},t))(...e);return _A(n,t),n};RA.props=Object.assign(Object.assign({},LA.props),{defaultPosition:"bottom"});const IA=t=>(...e)=>{const n=LA(Object.assign({},{crossPadding:10},t))(...e);return _A(n,t),n};function DA(t,e,n,r){const{radar:i}=t,[o]=r,a=o.getOptions().name,[s,c]=ol(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))})}IA.props=Object.assign(Object.assign({},LA.props),{defaultPosition:"left"});const BA=t=>{const{important:e={}}=t,n=Le(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return LA(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({},DA(t,i,o,a)),e)}))(r)}};function FA(t,e){const{scales:n,library:r,markState:i}=e,[o,a]=function(t,e){const n=kA(t,"shape"),r=kA(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)||j(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=Le(e,["d","fill","lineWidth","path","stroke","color"]);const l=dm.get(t)||dm.get("point");return(...t)=>new Gg({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 kA(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 zA(t){const e=kA(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function $A(t,e){const{labelFormatter:n=t=>`${t}`}=t,{scales:r,theme:i}=e,o=function(t,e){const n=kA(t,"size");return n instanceof co?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:FA(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:zA(r)},s="string"==typeof n?dA(n):n,c=kA(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)})))})}BA.props=Object.assign(Object.assign({},LA.props),{defaultPosition:"center"});const WA=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,cols:c,itemMarker:l}=t,u=Le(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}=EA(t,e,n);return{width:i,height:o}}(r,t,WA),d=bA(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:mA(s)}),$A(t,e)),{legendCategory:g={}}=i,v=OA(Object.assign({},g,function(t){return Object.assign(Object.assign({},t),{data:(null==t?void 0:t.data.filter((t=>""!==t.id)))||[]})}(p),u)),y=new wA({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},d),{subOptions:v})});return y.appendChild(new zw({className:"legend-category",style:v})),y}};function GA(t,e,n,r,i){const o=e.thresholds,a=function(t){return e=>({value:e/t,label:String(e)})}(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...o,r].map(a)})}function HA(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],ca(e)];return[n,r]}function YA(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:[lh(e).toString()]})),r}(s,c),[u,f]=HA(l),[h,d]=HA([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof Ki))));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})`))}))})}function qA(t,e,n,r,i,o){const a=kA(t,"color"),s=function(t,e,n){const{size:r}=e,i=EA(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 bo){const{range:t}=a.getOptions(),[e,n]=HA(a);return a instanceof ko||a instanceof Eo?GA(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 YA(s,a,kA(t,"size"),kA(t,"opacity"),e,o)}WA.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const VA=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,style:c,crossPadding:l,padding:u}=t,f=Le(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,v=bA(o,n),{legendContinuous:y={}}=a,m=OA(Object.assign({},y,Object.assign(Object.assign({titleText:mA(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>dA(e)(t.label):e},qA(r,l,i,t,VA,a)),c),f)),b=new xA({style:Object.assign(Object.assign({x:h,y:d,width:p,height:g},v),{subOptions:m})});return b.appendChild(new Qw({className:"legend-continuous",style:m})),b}};VA.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const UA=t=>(...e)=>VA(Object.assign({},{block:!0},t))(...e);UA.props=Object.assign(Object.assign({},VA.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const XA=t=>e=>{const{scales:n}=e,r=kA(n,"size");return VA(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};XA.props=Object.assign(Object.assign({},VA.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const ZA=t=>XA(Object.assign({},{block:!0},t));function KA(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"}}}ZA.props=Object.assign(Object.assign({},VA.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const QA=(JA={render(t,e){const{width:n,title:r,subtitle:i,spacing:o=2,align:a="left",x:s,y:c}=t,l=Le(t,["width","title","subtitle","spacing","align","x","y"]);e.style.transform=`translate(${s}, ${c})`;const u=Qo(l,"title"),f=Qo(l,"subtitle"),h=yA(e,".title","text").attr("className","title").call(py,Object.assign(Object.assign(Object.assign({},KA(0,0,n,a)),{fontSize:14,textBaseline:"top",text:r}),u)).node().getLocalBounds();yA(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({},KA(0,h.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),f))}))}},class extends jg{constructor(t){super(t),this.descriptor=JA}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(Q({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var JA;const tT=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new QA({style:Q({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};function eT(t){return!!t.getBandWidth}function nT(t,e,n){if(!eT(t))return t.invert(e);const{adjustedRange:r}=t,{domain:i}=t.getOptions(),o=n?-1:0,a=t.getStep(),s=n?r:r.map((t=>t+a)),c=function(t,e,n){return Math.min(n,Math.max(e,t))}(Wn(s,e)+o,0,i.length-1);return i[c]}function rT(t,e,n){if(!e)return t.getOptions().domain;if(!eT(t)){const r=ir(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 iT(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[nT(a,n,e),nT(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[rT(a,[l[0],u[0]]),rT(s,[l[1],u[1]])]}function oT(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}tT.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const aT=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:o}=t,a=Le(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,v=(null===(s=c.getFormatter)||void 0===s?void 0:s.call(c))||(t=>t+""),y="string"==typeof n?dA(n):n,m="horizontal"===e,b=Kc(f)&&m,{trackSize:x=g.trackSize}=i,[w,k]=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 kx({className:"slider",style:Object.assign({},g,Object.assign(Object.assign({x:w,y:k,trackLength:m?d:p,orientation:e,formatter:t=>(y||v)(nT(c,b?1-t:t,!0)),sparklineData:sT(t,r)},i),a))})}};function sT(t,e){const{markState:n}=e;return x(t.sparklineData)?t.sparklineData:function(t,e){const[n]=Array.from(t.entries()).filter((([t])=>"line"===t.type||"area"===t.type)).filter((([t])=>t.slider)).map((([t])=>{const{encode:n,slider:r}=t;if(null==r?void 0:r.x){const t=t=>{const e=n[t];return[t,e?e.value:void 0]};return Object.fromEntries(e.map(t))}}));if(!(null==n?void 0:n.series))return null==n?void 0:n.y;const r=n.series.reduce(((t,e,r)=>(t[e]=t[e]||[],t[e].push(n.y[r]),t)),{});return Object.values(r)}(n,["y","series"])}aT.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const cT=t=>aT(Object.assign(Object.assign({},t),{orientation:"horizontal"}));cT.props=Object.assign(Object.assign({},aT.props),{defaultPosition:"bottom"});const lT=t=>aT(Object.assign(Object.assign({},t),{orientation:"vertical"}));lT.props=Object.assign(Object.assign({},aT.props),{defaultPosition:"left"});const uT=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=Le(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,[v,y]=d,m=y>v?0:1;return new Mx({className:"g2-scrollbar",style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:c,trackLength:p,value:m}),i),{orientation:e,contentLength:g,viewportLength:p}))})}};uT.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const fT=t=>uT(Object.assign(Object.assign({},t),{orientation:"horizontal"}));fT.props=Object.assign(Object.assign({},uT.props),{defaultPosition:"bottom"});const hT=t=>uT(Object.assign(Object.assign({},t),{orientation:"vertical"}));hT.props=Object.assign(Object.assign({},uT.props),{defaultPosition:"left"});const dT=t=>()=>new Ig;dT.props={};const pT=(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]=Kc(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))}},gT=(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]=Kc(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))}},vT=(t,e)=>{const n=1e-4,{coordinate:r}=e;return Qg({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:Hu.NUMBER}),(e,i,o)=>{const[a]=e;return Qc(r)?(e=>{const{__data__:i,style:a}=e,{fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=a,{points:u,y:f,y1:h}=i,d=my(r,u,[f,h]),{innerRadius:p,outerRadius:g}=d,v=[{scaleInYRadius:p+n,fillOpacity:0,strokeOpacity:0,opacity:0},{scaleInYRadius:p+n,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{scaleInYRadius:g,fillOpacity:s,strokeOpacity:c,opacity:l}];return e.animate(v,Object.assign(Object.assign({},o),t))})(a):(e=>{const{style:n}=e,{transform:i="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=n,[l,u]=Kc(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)}},yT=(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]=Kc(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))}},mT=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))};mT.props={};const bT=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))};bT.props={};const xT={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},wT={[tu.CIRCLE]:["cx","cy","r"],[tu.ELLIPSE]:["cx","cy","rx","ry"],[tu.RECT]:["x","y","width","height"],[tu.IMAGE]:["x","y","width","height"],[tu.LINE]:["x1","y1","x2","y2"],[tu.POLYLINE]:["points"],[tu.POLYGON]:["points"]};function kT(t,e,n=!1){const r={};for(const i of e){const e=t.style[i];e?r[i]=e:n&&(r[i]=xT[i])}return r}const MT=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function ET(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function OT(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 _T(t,e){const[n,r,i,o]=ET(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(OT([t,o,e,l]))}f-=t,u+=1}return c}function ST(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function AT(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function TT(t){const e=$h(t);if(e&&!function(t){return!AT(t,"m")||!AT(t,"M")}(e))return e}function PT(t){const{nodeName:e}=t;if("path"===e){const e=rt(t,"attributes");return e.markerEnd||e.markerStart}return!1}function NT(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=TT(e),s=TT(n),c=i===o&&"path"!==i,l=void 0===a||void 0===s,u=PT(e)||PT(n);if(c||l||u)return function(t,e,n){let{transform:r}=t.style;const{transform:i}=e.style;ST(e,t);let o=MT;if(t.nodeName===tu.GROUP){const[n,i,o,a]=ET(t),[s,c,l,u]=ET(e);r=`translate(${n-s}, ${i-c}) scale(${o/l}, ${a/u})`}else o=o.concat(wT[t.nodeName]||[]);const a=[Object.assign({transform:null!=r?r:"none"},kT(t,o,!0)),Object.assign({transform:null!=i?i:"none"},kT(e,o,!0))];return e.animate(a,n)}(e,n,r);const f=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new Gg({style:Object.assign(Object.assign({},kT(t,MT)),{d:e})});return ST(r,t),r}(t,a),h=[Object.assign({},kT(e,MT)),Object.assign({},kT(n,MT))];if(a!==s){h[0].d=a,h[1].d=s;const t=f.animate(h,r);return t.onfinish=()=>{Xo(f,n),f.style.d=s,f.style.transform="none"},f.style.transform="none",t}return null}const CT=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:_T}(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 NT(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)=>NT(e,new Gg({style:Object.assign({d:i[r]},kT(t,MT))}),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)=>NT(t,t,new Gg({style:{d:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,o,i)}return null};CT.props={};const LT=(t,e)=>{const n=1e-4;Qg({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:Hu.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!Qc(r))return pT(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:v,y1:y}=c,m=vc().cornerRadius(u).padAngle(f*Math.PI/180),b=my(r,g,[v,y]),{startAngle:x,endAngle:w}=b,k=[{waveInArcAngle:x+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:x+n,fillOpacity:h,strokeOpacity:d,opacity:p,offset:.01},{waveInArcAngle:w,fillOpacity:h,strokeOpacity:d,opacity:p}],M=s.animate(k,Object.assign(Object.assign({},a),t));return M.onframe=function(){s.style.d=m(Object.assign(Object.assign({},b),{endAngle:Number(s.style.waveInArcAngle)}))},M.onfinish=function(){s.style.d=m(Object.assign(Object.assign({},b),{endAngle:w}))},M}};LT.props={};const jT=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))},RT=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))},IT=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))};IT.props={};const DT=(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 Gg({style:{d:`M${a},${s}L${a+l},${s}L${a+l},${s+u}L${a},${s+u}Z`}});o.appendChild(f),o.style.clipPath=f;return pT(t,e)([f],r,i)};DT.props={};const BT=(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 Gg({style:{d:`M${a},${s}L${a+l},${s}L${a+l},${s+u}L${a},${s+u}Z`}});o.appendChild(f),o.style.clipPath=f;return vT(t,e)([f],r,i)};BT.props={};const FT="main-layer",zT="label-layer",$T="element",WT="view",GT="plot",HT="component",YT="label",qT="area";
|
|
18
|
+
var dv=function(t){function e(t,n,r,i){var o;return hl(this,e),(o=wl(this,e,[t])).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 Ml(e,t),pl(e)}(Sp),pv=0,gv=function(){return pl((function t(e,n){var r;hl(this,t),this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=e,e.animation=this,this.timeline=n,this.id="".concat(pv++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(r=this.effect)||void 0===r?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}),[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"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}},{key:"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}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(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))}}},{key:"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()}}},{key:"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()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var t;if(null!==(t=this.effect.target)&&void 0!==t&&t.destroyed)return this.readyPromise=void 0,this.finishedPromise=void 0,!1;var e=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==e&&("idle"===n?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===e?this.resolveReadyPromise():"pending"===n&&(this.readyPromise=void 0)),this.finishedPromise&&n!==e&&("idle"===n?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===n?this.resolveFinishedPromise():"finished"===e&&(this.finishedPromise=void 0)),this.oldPlayState=n,this.readyPromise||this.finishedPromise}},{key:"play",value: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()}},{key:"pause",value: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()}},{key:"finish",value: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())}},{key:"cancel",value: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 dv(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value: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))}},{key:"rewind",value: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}}},{key:"persist",value:function(){throw new Error(vu)}},{key:"addEventListener",value:function(t,e,n){throw new Error(vu)}},{key:"removeEventListener",value:function(t,e,n){throw new Error(vu)}},{key:"dispatchEvent",value:function(t){throw new Error(vu)}},{key:"commitStyles",value:function(){throw new Error(vu)}},{key:"ensureAlive",value:function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new dv(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 dv(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}}}])}(),vv=.1,yv="function"==typeof Float32Array,mv=function(t,e){return 1-3*e+3*t},bv=function(t,e){return 3*e-6*t},xv=function(t){return 3*t},wv=function(t,e,n){return((mv(e,n)*t+bv(e,n))*t+xv(e))*t},kv=function(t,e,n){return 3*mv(e,n)*t*t+2*bv(e,n)*t+xv(e)},Mv=function(t,e,n,r){if(!(t>=0&&t<=1&&n>=0&&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=yv?new Float32Array(11):new Array(11),o=0;o<11;++o)i[o]=wv(o*vv,t,n);var a=function(e){for(var r=0,o=1;10!==o&&i[o]<=e;++o)r+=vv;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*vv,s=kv(a,t,n);return s>=.001?function(t,e,n,r){for(var i=0;i<4;++i){var o=kv(e,n,r);if(0===o)return e;e-=(wv(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=wv(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+vv,t,n)};return function(t){return 0===t||1===t?t:wv(a(t),e,r)}},Ev=function(t){return Math.pow(t,2)},Ov=function(t){return Math.pow(t,3)},_v=function(t){return Math.pow(t,4)},Sv=function(t){return Math.pow(t,5)},Av=function(t){return Math.pow(t,6)},Tv=function(t){return 1-Math.cos(t*Math.PI/2)},Pv=function(t){return 1-Math.sqrt(1-t*t)},Nv=function(t){return t*t*(3*t-2)},Cv=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)},Lv=function(t){var e=El(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?1:n,i=e[1],o=void 0===i?.5:i,a=R(Number(r),1,10),s=R(Number(o),.1,2);return 0===t||1===t?t:-a*Math.pow(2,10*(t-1))*Math.sin((t-1-s/(2*Math.PI)*Math.asin(1/a))*(2*Math.PI)/s)},jv=function(t){var e=arguments.length>2?arguments[2]:void 0,n=El(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),r=n[0],i=void 0===r?1:r,o=n[1],a=void 0===o?100:o,s=n[2],c=void 0===s?10:s,l=n[3],u=void 0===l?0:l;i=R(i,.1,1e3),a=R(a,.1,1e3),c=R(c,.1,1e3),u=R(u,.1,1e3);var f=Math.sqrt(a/i),h=c/(2*Math.sqrt(a*i)),d=h<1?f*Math.sqrt(1-h*h):0,p=h<1?(h*f-u)/d:-u+f,g=e?e*t/1e3:t;return g=h<1?Math.exp(-g*h*f)*(1*Math.cos(d*g)+p*Math.sin(d*g)):(1+p*g)*Math.exp(-g*f),0===t||1===t?t:1-g},Rv=function(t){var e=El(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?10:n;return("start"===e[1]?Math.ceil:Math.floor)(R(t,0,1)*r)/r},Iv=function(t){var e=El(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),n=e[0],r=e[1],i=e[2],o=e[3];return Mv(n,r,i,o)(t)},Dv=Mv(.42,0,1,1),Bv=function(t){return function(e){return 1-t(1-e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],arguments.length>2?arguments[2]:void 0)}},Fv=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},zv=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},$v={steps:Rv,"step-start":function(t){return Rv(t,[1,"start"])},"step-end":function(t){return Rv(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Iv,ease:function(t){return Iv(t,[.25,.1,.25,1])},in:Dv,out:Bv(Dv),"in-out":Fv(Dv),"out-in":zv(Dv),"in-quad":Ev,"out-quad":Bv(Ev),"in-out-quad":Fv(Ev),"out-in-quad":zv(Ev),"in-cubic":Ov,"out-cubic":Bv(Ov),"in-out-cubic":Fv(Ov),"out-in-cubic":zv(Ov),"in-quart":_v,"out-quart":Bv(_v),"in-out-quart":Fv(_v),"out-in-quart":zv(_v),"in-quint":Sv,"out-quint":Bv(Sv),"in-out-quint":Fv(Sv),"out-in-quint":zv(Sv),"in-expo":Av,"out-expo":Bv(Av),"in-out-expo":Fv(Av),"out-in-expo":zv(Av),"in-sine":Tv,"out-sine":Bv(Tv),"in-out-sine":Fv(Tv),"out-in-sine":zv(Tv),"in-circ":Pv,"out-circ":Bv(Pv),"in-out-circ":Fv(Pv),"out-in-circ":zv(Pv),"in-back":Nv,"out-back":Bv(Nv),"in-out-back":Fv(Nv),"out-in-back":zv(Nv),"in-bounce":Cv,"out-bounce":Bv(Cv),"in-out-bounce":Fv(Cv),"out-in-bounce":zv(Cv),"in-elastic":Lv,"out-elastic":Bv(Lv),"in-out-elastic":Fv(Lv),"out-in-elastic":zv(Lv),spring:jv,"spring-in":jv,"spring-out":Bv(jv),"spring-in-out":Fv(jv),"spring-out-in":zv(jv)},Wv=function(t){return t};function Gv(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Hv="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Yv=new RegExp("cubic-bezier\\(".concat(Hv,",").concat(Hv,",").concat(Hv,",").concat(Hv,"\\)")),qv=/steps\(\s*(\d+)\s*\)/,Vv=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Uv(t){var e=Yv.exec(t);if(e)return Mv.apply(void 0,yl(e.slice(1).map(Number)));var n=qv.exec(t);if(n)return Gv(Number(n[1]),0);var r=Vv.exec(t);return r?Gv(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):$v[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||$v.linear}function Xv(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function Zv(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)}function Kv(t,e,n){var r=function(t,e){for(var n={},r=0;r<t.length;r++)for(var i in t[r])if(Qv(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Uv(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:ty(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)Qv(n)&&t.setAttribute(n,null)}}function Qv(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Jv=function(t,e,n){return function(r){var i=ey(t,e,r);return I(i)?i:n(i)}};function ty(t,e,n,r){var i=pd[t];if(i&&i.syntax&&i.int){var o=mg.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=o.parser,s=a?a(e,r):e,c=a?a(n,r):n,l=o.mixer(s,c,r);if(l){var u=Jv.apply(void 0,yl(l));return function(t){return 0===t?e:1===t?n:u(t)}}}}return Jv(!1,!0,(function(t){return t?n:e}))}function ey(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(ey(t[s<r?s:r-1],e[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments ".concat(t,":").concat(e))}var ny=function(){return pl((function t(){hl(this,t),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Wv,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}),[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Uv(t),this._easing=t}}])}();function ry(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&&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(b(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(!b(s)&&!b(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 iy="backwards|forwards|both|none".split("|"),oy="reverse|alternate|alternate-reverse".split("|");function ay(t,e){return function(t,e){var n=new ny;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===iy.indexOf(t[e]))return;if("direction"===e&&-1===oy.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}(t=function(t){"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t});return t}(null!=t?t:{duration:"auto"}),e)}var sy=function(){return pl((function t(e,n,r){var i=this;hl(this,t),this.composite="replace",this.iterationComposite="replace",this.target=e,this.timing=ay(r,!1),this.timing.effect=this,this.timing.activeDuration=Xv(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=ry(n,this.timing),this.interpolations=Kv(this.normalizedKeyframes,this.timing,this.target);var o=mg.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}),[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return null!==t&&(this.timeFraction=Zv(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=ry(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))}}])}();function cy(t,e){return Number(t.id)-Number(e.id)}var ly=function(){return pl((function t(e){var n=this;hl(this,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){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(t){var e=n.rafCallbacks;n.rafCallbacks=[],t<Number(n.currentTime)&&(t=Number(n.currentTime)),n.animations.sort(cy),n.animations=n.tick(t,!0,n.animations)[0],e.forEach((function(e){e[1](t)})),n.applyPendingEffects()},this.document=e}),[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,e,n){var r=new sy(t,e,n),i=new gv(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i}},{key:"applyDirtiedAnimation",value:function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(cy),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()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value: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}},{key:"requestAnimationFrame",value:function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))}},{key:"tick",value: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,a),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[c,l]}}])}();function uy(t){return new fy([t],null,t,t.ownerDocument)}mg.EasingFunction=Uv,mg.AnimationTimeline=ly;class fy{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 fy(e,null,this._elements[0],this._document)}selectFacetAll(t){const e="string"==typeof t?this._parent.querySelectorAll(t):t;return new fy(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 fy([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 fy(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 fy(n,null,n[0],this._document)}maybeAppend(t,e,n){const r=this._elements[0],i=r.getElementById(t);if(i)return new fy([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 fy([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=Jn(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 fy([],r,this._parent,this._document),new fy(i,null,this._parent,this._document),new fy(o,null,this._parent,this._document),new fy([],a,this._parent,this._document),new fy(s,null,this._parent,this._document)];return new fy(this._elements,null,this._parent,this._document,f)}merge(t){const e=[...this._elements,...t._elements],n=[...this._transitions,...t._transitions];return new fy(e,null,this._parent,this._document,void 0,n)}createElement(t){if(this._document)return this._document.createElement(t,{});const e=fy.registry[t];return e?new e:Uo(`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 fy([],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 hy(t,e,n){return Math.max(e,Math.min(t,n))}function dy(t,e=10){return"number"!=typeof t||Math.abs(t)<1e-15?t:parseFloat(t.toFixed(e))}function py(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}function gy(t,e,n,r,i){const o=Ts(_s(r,e))+Math.PI,a=Ts(_s(r,n))+Math.PI;return t.arc(r[0],r[1],i,o,a,a-o<0),t}function vy(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=aa(a),[l,u]=Vn(c,(t=>a[t])),f=new po({domain:[l,u],range:[0,100]}),h=t=>I(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 yy(t){const[e,n,r,i]=t;return[i,e,n,r]}function my(t,e,n){const[r,i,,o]=Kc(t)?yy(e):e,[a,s]=n,c=t.getCenter(),l=Ps(_s(r,c)),u=Ps(_s(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:As(o,c),outerRadius:As(r,c)}}function by(t){const{colorAttribute:e,opacityAttribute:n=e}=t;return`${n}Opacity`}function xy(t,e){if(!Qc(t))return"";const n=t.getCenter(),{transform:r}=e;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function wy(t){if(1===t.length)return t[0];const[[e,n,r=0],[i,o,a=0]]=t;return[(e+i)/2,(n+o)/2,(r+a)/2]}function ky(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:v=1/0,minHeight:y=-1/0}=i,m=Le(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!Qc(r)&&!tl(r)){const n=!!Kc(r),[i,,o]=n?yy(e):e,[a,b]=i,[x,w]=_s(o,i),k=(x>0?a:a+x)+s,M=(w>0?b:b+w)+c,E=Math.abs(x)-(s+l),O=Math.abs(w)-(c+u),_=n?hy(E,y,1/0):hy(E,g,v),S=n?hy(O,g,v):hy(O,y,1/0),A=n?k:k-(_-E)/2,T=n?M-(S-O)/2:M-(S-O);return uy(t.createElement("rect",{})).style("x",A).style("y",T).style("width",_).style("height",S).style("radius",[d,p,h,f]).call(py,m).node()}const{y:b,y1:x}=n,w=r.getCenter(),k=my(r,e,[b,x]),M=vc().cornerRadius(a).padAngle(o*Math.PI/180);return uy(t.createElement("path",{})).style("d",M(k)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",a).style("inset",o).call(py,m).node()}fy.registry={g:Ig,rect:Ug,circle:Cg,path:Gg,text:Zg,ellipse:Rg,image:Fg,line:$g,polygon:Yg,polyline:Vg,html:Bg};const My=(t,e)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=t,a=Le(t,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:c}=e;return(e,r,l)=>{const{color:u,radius:f=0}=l,h=Le(l,["color","radius"]),d=h.lineWidth||1,{stroke:p,radius:g=f,radiusTopLeft:v=g,radiusTopRight:y=g,radiusBottomRight:m=g,radiusBottomLeft:b=g,innerRadius:x=0,innerRadiusTopLeft:w=x,innerRadiusTopRight:k=x,innerRadiusBottomRight:M=x,innerRadiusBottomLeft:E=x,lineWidth:O=("stroke"===n||p?d:0),inset:_=0,insetLeft:S=_,insetRight:A=_,insetBottom:T=_,insetTop:P=_,minWidth:N,maxWidth:C,minHeight:L}=a,j=Le(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,D=[i?v:w,i?y:k,o?m:M,o?b:E],B=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];Kc(s)&&B.push(B.shift());const F=Object.assign(Object.assign({radius:g},Object.fromEntries(B.map(((t,e)=>[t,D[e]])))),{inset:_,insetLeft:S,insetRight:A,insetBottom:T,insetTop:P,minWidth:N,maxWidth:C,minHeight:L});return uy(ky(c,e,r,s,F)).call(py,h).style("fill","transparent").style(n,R).style(by(t),I).style("lineWidth",O).style("stroke",void 0===p?R:p).call(py,j).node()}};My.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ey=(t,e)=>My(Object.assign({colorAttribute:"fill"},t),e);Ey.props=Object.assign(Object.assign({},My.props),{defaultMarker:"square"});const Oy=(t,e)=>My(Object.assign({colorAttribute:"stroke"},t),e);function _y(t,e,n){const[r,i,o,a]=t;if(Kc(n)){return[r,[e?e[0][0]:i[0],i[1]],[e?e[3][0]:o[0],o[1]],a]}return[r,[i[0],e?e[0][1]:i[1]],[o[0],e?e[3][1]:o[1]],a]}Oy.props=Object.assign(Object.assign({},My.props),{defaultMarker:"hollowSquare"});const Sy=(t,e)=>{const{adjustPoints:n=_y}=t,r=Le(t,["adjustPoints"]),{coordinate:i,document:o}=e;return(t,e,a,s)=>{const{index:c}=e,{color:l}=a,u=Le(a,["color"]),f=s[c+1],h=n(t,f,i),d=!!Kc(i),[p,g,v,y]=d?yy(h):h,{color:m=l,opacity:b}=e,x=kc().curve(Dc)([p,g,v,y]);return uy(o.createElement("path",{})).call(py,u).style("d",x).style("fill",m).style("fillOpacity",b).call(py,r).node()}};function Ay(t,e,n){const[r,i,o,a]=t;if(Kc(n)){return[r,[e?e[0][0]:(i[0]+o[0])/2,i[1]],[e?e[3][0]:(i[0]+o[0])/2,o[1]],a]}return[r,[i[0],e?e[0][1]:(i[1]+o[1])/2],[o[0],e?e[3][1]:(i[1]+o[1])/2],a]}Sy.props={defaultMarker:"square"};const Ty=(t,e)=>Sy(Object.assign({adjustPoints:Ay},t),e);function Py(t){const e="function"==typeof t?t:t.render;return class extends jg{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){e(this)}}}Ty.props={defaultMarker:"square"};const Ny=Py((t=>{const{d1:e,d2:n,style1:r,style2:i}=t.attributes,o=t.ownerDocument;uy(t).maybeAppend("line",(()=>o.createElement("path",{}))).style("d",e).call(py,r),uy(t).maybeAppend("line1",(()=>o.createElement("path",{}))).style("d",n).call(py,i)}));const Cy=(t,e)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=t=>!Number.isNaN(t)&&null!=t,connect:a=!1}=t,s=Le(t,["curve","gradient","gradientColor","defined","connect"]),{coordinate:c,document:l}=e;return(t,e,u)=>{const{color:f,lineWidth:h}=u,d=Le(u,["color","lineWidth"]),{color:p=f,size:g=h,seriesColor:v,seriesX:y,seriesY:m}=e,b=xy(c,e),x=Kc(c),w=r&&v?vy(v,y,m,r,i,x):p,k=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},d),w&&{stroke:w}),g&&{lineWidth:g}),b&&{transform:b}),s);let M;if(Qc(c)){const t=c.getCenter();M=e=>Sc(kc().curve(Ec)).angle(((n,r)=>Ps(_s(e[r],t)))).radius(((n,r)=>As(e[r],t))).defined((([t,e])=>o(t)&&o(e))).curve(n)(e)}else M=kc().x((t=>t[0])).y((t=>t[1])).defined((([t,e])=>o(t)&&o(e))).curve(n);const[E,O]=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),_=Qo(k,"connect"),S=!!O.length;if(!S||a&&!Object.keys(_).length)return uy(l.createElement("path",{})).style("d",M(E)||[]).call(py,k).node();if(S&&!a)return uy(l.createElement("path",{})).style("d",M(t)).call(py,k).node();return uy(new Ny).style("style1",Object.assign(Object.assign({},k),_)).style("style2",k).style("d1",(A=O,A.map(M).join(","))).style("d2",M(t)).node();var A}};Cy.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Ly=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Qc(n)?Dc:bc;return Cy(Object.assign({curve:i},t),e)(...r)}};Ly.props=Object.assign(Object.assign({},Cy.props),{defaultMarker:"line"});const jy=(t,e)=>{const n=Le(t,[]),{coordinate:r}=e;return(...t)=>{const i=Qc(r)?Rc:Kc(r)?qc:Yc;return Cy(Object.assign({curve:i},n),e)(...t)}};jy.props=Object.assign(Object.assign({},Cy.props),{defaultMarker:"smooth"});const Ry=(t,e)=>Cy(Object.assign({curve:Zc},t),e);Ry.props=Object.assign(Object.assign({},Cy.props),{defaultMarker:"hv"});const Iy=(t,e)=>Cy(Object.assign({curve:Xc},t),e);Iy.props=Object.assign(Object.assign({},Cy.props),{defaultMarker:"vh"});const Dy=(t,e)=>Cy(Object.assign({curve:Uc},t),e);function By(t,e,n,r,i){const o=Ts(_s(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=Ss(e,s),h=Ss(n,c),d=Ss(h,l),p=Ss(n,l),g=_s(p,c),v=_s(n,c),y=_s(e,s),m=_s(y,u),b=_s(e,u),x=_s(f,u);t.moveTo(...f),t.lineTo(...h),t.arcTo(...d,...p,i/2),t.arcTo(...g,...v,i/2),t.lineTo(...y),t.arcTo(...m,...b,r/2),t.arcTo(...x,...f,r/2),t.closePath()}Dy.props=Object.assign(Object.assign({},Cy.props),{defaultMarker:"hvh"});const Fy=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{seriesSize:o,color:a}=r,{color:s}=i,c=Le(i,["color"]),l=cc();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(Zo)&&By(l,n,r,i,a)}return uy(n.createElement("path",{})).call(py,c).style("fill",a||s).style("d",l.toString()).call(py,t).node()}};Fy.props=Object.assign(Object.assign({},Cy.props),{defaultMarker:"line"});const zy=(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"]];zy.style=["fill"];const $y=zy.bind(void 0);$y.style=["stroke","lineWidth"];const Wy=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]];Wy.style=["fill"];const Gy=Wy.bind(void 0);Gy.style=["fill"];const Hy=Wy.bind(void 0);Hy.style=["stroke","lineWidth"];const Yy=(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"]]};Yy.style=["fill"];const qy=Yy.bind(void 0);qy.style=["stroke","lineWidth"];const Vy=(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"]]};Vy.style=["fill"];const Uy=Vy.bind(void 0);Uy.style=["stroke","lineWidth"];const Xy=(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"]]};Xy.style=["fill"];const Zy=Xy.bind(void 0);Zy.style=["stroke","lineWidth"];const Ky=(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"]]};Ky.style=["fill"];const Qy=Ky.bind(void 0);Qy.style=["stroke","lineWidth"];const Jy=(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"]]};Jy.style=["fill"];const tm=Jy.bind(void 0);tm.style=["stroke","lineWidth"];const em=(t,e,n)=>[["M",t,e+n],["L",t,e-n]];em.style=["stroke","lineWidth"];const nm=(t,e,n)=>[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]];nm.style=["stroke","lineWidth"];const rm=(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]];rm.style=["stroke","lineWidth"];const im=(t,e,n)=>[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]];im.style=["stroke","lineWidth"];const om=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];om.style=["stroke","lineWidth"];const am=(t,e,n)=>[["M",t-n,e],["L",t+n,e]];am.style=["stroke","lineWidth"];const sm=am.bind(void 0);sm.style=["stroke","lineWidth"];const cm=(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]];cm.style=["stroke","lineWidth"];const lm=(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]];lm.style=["stroke","lineWidth"];const um=(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]];um.style=["stroke","lineWidth"];const fm=(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]];fm.style=["stroke","lineWidth"];const hm=(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]];hm.style=["stroke","lineWidth"];const dm=new Map([["bowtie",Jy],["cross",nm],["dash",sm],["diamond",Yy],["dot",am],["hexagon",Ky],["hollowBowtie",tm],["hollowDiamond",qy],["hollowHexagon",Qy],["hollowPoint",$y],["hollowSquare",Hy],["hollowTriangle",Uy],["hollowTriangleDown",Zy],["hv",lm],["hvh",fm],["hyphen",om],["line",em],["plus",im],["point",zy],["rect",Gy],["smooth",cm],["square",Wy],["tick",rm],["triangleDown",Xy],["triangle",Vy],["vh",um],["vhv",hm]]);function pm(t){return t.replace(/-(\w)/g,(function(t,e){return e.toUpperCase()}))}function gm(t,e,n,r){if(1===e.length)return;const{size:i}=n;if("fixed"===t)return i;if("normal"===t||nl(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 vm=(t,e)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=t,o=Le(t,["colorAttribute","symbol","mode"]),a=dm.get(pm(r))||dm.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,[v,y]=wy(e),m=gm(i,e,r,s)||o.r||l.r;return uy(c.createElement("path",{})).call(py,l).style("fill","transparent").style("d",a(v,y,m)).style("lineWidth",h).style("transform",p).style("transformOrigin",`${v-m} ${y-m}`).style("stroke",d).style(by(t),g).style(n,d).call(py,o).node()}};vm.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const ym=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},t),e);ym.props=Object.assign({defaultMarker:"hollowBowtie"},vm.props);const mm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"diamond"},t),e);mm.props=Object.assign({defaultMarker:"hollowDiamond"},vm.props);const bm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},t),e);bm.props=Object.assign({defaultMarker:"hollowHexagon"},vm.props);const xm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"point"},t),e);xm.props=Object.assign({defaultMarker:"hollowPoint"},vm.props);const wm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"square"},t),e);wm.props=Object.assign({defaultMarker:"hollowSquare"},vm.props);const km=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"triangle"},t),e);km.props=Object.assign({defaultMarker:"hollowTriangle"},vm.props);const Mm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},t),e);Mm.props=Object.assign({defaultMarker:"hollowTriangleDown"},vm.props);const Em=(t,e)=>{const{colorAttribute:n,mode:r="auto"}=t,i=Le(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,v]=wy(e),y=gm(r,e,s,o)||i.r||c.r;return uy(a.createElement("circle",{})).call(py,c).style("fill","transparent").style("cx",g).style("cy",v).style("r",y).style("lineWidth",f).style("transform",d).style("transformOrigin",`${g} ${v}`).style("stroke",h).style(by(t),p).style(n,h).call(py,i).node()}},Om=(t,e)=>Em(Object.assign({colorAttribute:"fill"},t),e);Om.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const _m=(t,e)=>Em(Object.assign({colorAttribute:"stroke"},t),e);_m.props=Object.assign({defaultMarker:"hollowPoint"},Om.props);const Sm=(t,e)=>vm(Object.assign({colorAttribute:"fill",symbol:"bowtie"},t),e);Sm.props=Object.assign({defaultMarker:"bowtie"},vm.props);const Am=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"cross"},t),e);Am.props=Object.assign({defaultMarker:"cross"},vm.props);const Tm=(t,e)=>vm(Object.assign({colorAttribute:"fill",symbol:"diamond"},t),e);Tm.props=Object.assign({defaultMarker:"diamond"},vm.props);const Pm=(t,e)=>vm(Object.assign({colorAttribute:"fill",symbol:"hexagon"},t),e);Pm.props=Object.assign({defaultMarker:"hexagon"},vm.props);const Nm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},t),e);Nm.props=Object.assign({defaultMarker:"hyphen"},vm.props);const Cm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"line"},t),e);Cm.props=Object.assign({defaultMarker:"line"},vm.props);const Lm=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"plus"},t),e);Lm.props=Object.assign({defaultMarker:"plus"},vm.props);const jm=(t,e)=>vm(Object.assign({colorAttribute:"fill",symbol:"point"},t),e);jm.props=Object.assign({defaultMarker:"point"},vm.props);const Rm=(t,e)=>vm(Object.assign({colorAttribute:"fill",symbol:"square"},t),e);Rm.props=Object.assign({defaultMarker:"square"},vm.props);const Im=(t,e)=>vm(Object.assign({colorAttribute:"stroke",symbol:"tick"},t),e);Im.props=Object.assign({defaultMarker:"tick"},vm.props);const Dm=(t,e)=>vm(Object.assign({colorAttribute:"fill",symbol:"triangle"},t),e);Dm.props=Object.assign({defaultMarker:"triangle"},vm.props);const Bm=(t,e)=>vm(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},t),e);Bm.props=Object.assign({defaultMarker:"triangleDown"},vm.props);const Fm=(t,e)=>{const{arrow:n=!0,arrowSize:r="40%"}=t,i=Le(t,["arrow","arrowSize"]),{document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Le(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=cc();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*As(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(...t),d.lineTo(...h),d.lineTo(...e)}return uy(o.createElement("path",{})).call(py,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(py,i).node()}};function zm(t,e){e(t),t.children&&t.children.forEach((function(t){t&&zm(t,e)}))}function $m(t){Gm(t,!0)}function Wm(t){Gm(t,!1)}function Gm(t,e){var n=e?"visible":"hidden";zm(t,(function(t){t.attr("visibility",n)}))}Fm.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};var Hm=function(t){function e(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.apply(this,Be([],De(e),!1))||this;return r.isMutationObserved=!0,r.addEventListener($p.INSERTED,(function(){Wm(r)})),r}return Ne(e,t),e}(Ig);function Ym(t){var e=t.appendChild(new Hm({class:"offscreen"}));return Wm(e),e}var qm=function(t){function e(e){void 0===e&&(e={});var n=e.style,r=Le(e,["style"]);return t.call(this,Ce({style:Ce({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},n)},r))||this}return Ne(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Ym(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(Zg);function Vm(t){return t*Math.PI/180}function Um(t){return Number((180*t/Math.PI).toPrecision(5))}var Xm=function(){function t(t,e,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===n&&(n=0),void 0===r&&(r=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=e,this.width=n,this.height=r}return Object.defineProperty(t.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},t.prototype.isPointIn=function(t,e){return t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t}();function Zm(t,e){return m(t)?t.apply(void 0,Be([],De(e),!1)):t}var Km,Qm,Jm,tb,eb=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},r=Object.fromEntries(Object.entries(t).map((function(t){var e=De(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},nb=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=5),Object.entries(e).forEach((function(i){var o=De(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?nb(t[a],s,n+1,r):c[a]=e[a]):x(s)?(c[a]=[],c[a]=c[a].concat(s)):c[a]=s:c[a]=s)}))},rb=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)nb(t,e[r]);return t},ib=function(t){return void 0!==t&&null!=t&&!Number.isNaN(t)},ob=(Qm=function(t,e){var n=e.fontSize,r=e.fontFamily,i=e.fontWeight,o=e.fontStyle,a=e.fontVariant;return Km||(Km=mg.offscreenCanvasCreator.getOrCreateContext(void 0)),Km.font=[o,a,i,"".concat(n,"px"),r].join(" "),Km.measureText(t).width},Jm=function(t,e){return[t,Object.values(e||ab(t)).join()].join("")},void 0===(tb=4096)&&(tb=128),function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Jm?Jm.apply(this,t):t[0];X.has(Qm)||X.set(Qm,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)}}}(tb));var r=X.get(Qm);if(r.has(n))return r.get(n);var i=Qm.apply(this,t);return r.set(n,i),i}),ab=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 sb(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function cb(t,e){var n=sb(t);n&&n.attr(e)}function lb(t,e,n){void 0===n&&(n="..."),cb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}function ub(t){var e=t.canvas,n=t.touches,r=t.offsetX,i=t.offsetY;if(e)return[e.x,e.y];if(n){var o=n[0];return[o.clientX,o.clientY]}return r&&i?[r,i]:[0,0]}function fb(t){return"function"==typeof t?t():L(t)||I(t)?new qm({style:{text:String(t)}}):t}function hb(t,e,n,r,i){return void 0===r&&(r=!0),void 0===i&&(i=function(t){t.node().removeChildren()}),t?n(e):(r&&i(e),null)}function db(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}function pb(t,e){return"number"==typeof t&&"number"==typeof e?function(t,e){return function(n){return t*(1-n)+e*n}}(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=De(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=De(e,2),i=n[0],o=n[1];return r[i]=o(t)})),r}}(t,e):function(e){return t}}function gb(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=De([s+a.width,c+a.height],2),u=l[0],f=l[1];s<e&&(e=s),c<n&&(n=c),u>r&&(r=u),f>i&&(i=f)}return new Xm(e,n,r-e,i-n)}var vb=function(t,e,n){var r=t.width,i=t.height,o=n.flexDirection,a=void 0===o?"row":o,s=n.justifyContent,c=void 0===s?"flex-start":s,l=n.alignItems,u=void 0===l?"flex-start":l,f="row"===a,h="row"===a||"column"===a,d=f?h?[1,0]:[-1,0]:h?[0,1]:[0,-1],p=De([0,0],2),g=p[0],v=p[1],y=e.map((function(t){var e,n=t.width,r=t.height,i=De([g,v],2),o=i[0],a=i[1];return e=De([g+n*d[0],v+r*d[1]],2),g=e[0],v=e[1],new Xm(o,a,n,r)})),m=gb(y),b={"flex-start":0,"flex-end":f?r-m.width:i-m.height,center:f?(r-m.width)/2:(i-m.height)/2},x=y.map((function(t){var e=t.x,n=t.y,r=Xm.fromRect(t);return r.x=f?e+b[c]:e,r.y=f?n:n+b[c],r}));gb(x);var w=function(t){var e=De(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}},k=x.map((function(t){var e=t.x,n=t.y,r=Xm.fromRect(t);return r.x=f?e:e+w(r),r.y=f?n+w(r):n,r})),M=k.map((function(e){var n,r,i=Xm.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 M},yb=function(t,e,n){return[]};function mb(t,e){return[t[0]*e,t[1]*e]}function bb(t,e){return[t[0]+e[0],t[1]+e[1]]}function xb(t,e){return[t[0]-e[0],t[1]-e[1]]}function wb(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function kb(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function Mb(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function Eb(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 Ob(t,e){return+t.toPrecision(e)}function _b(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 Sb(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=De(r,2))[0],d=i[1];for(var p=0,g=t.length;p<g;p+=1)h=wb(h,y=t[p]),d=kb(d,y)}p=0;for(var v=t.length;p<v;p+=1){var y=t[p];if(0!==p||n)if(p!==v-1||n){o=t[[p?p-1:v-1,p-1][n?0:1]];var m=[0,0];m=mb(m=xb(a=t[n?(p+1)%v:p+1],o),e);var b=Mb(y,o),x=Mb(y,a),w=b+x;0!==w&&(b/=w,x/=w);var k=mb(m,-b),M=mb(m,x);c=bb(y,k),s=wb(s=bb(y,M),kb(a,y)),s=kb(s,wb(a,y)),c=wb(c=bb(y,k=mb(k=xb(s,y),-b/x)),kb(o,y)),s=bb(y,M=mb(M=xb(y,c=kb(c,wb(o,y))),x/b)),f&&(c=wb(c=kb(c,h),d),s=wb(s=kb(s,h),d)),u.push(l),u.push(c),l=s}else c=y,u.push(l),u.push(c);else l=y}return n&&u.push(u.shift()),u}(i,.4,r,n),f=i.length,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=De(i,1)[0],h.push(["C",s[0],s[1],c[0],c[1],l[0],l[1]])),h}var Ab=["$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 Tb(t){return Ab.includes(t)}function Pb(t){var e={};for(var n in t)Tb(n)&&(e[n]=t[n]);return e}function Nb(t,e,n){void 0===n&&(n=!1);var r=t.getBBox(),i=r.width,o=r.height,a=e/Math.max(i,o);return n&&(t.style.transform="scale(".concat(a,")")),a}var Cb=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=De(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=Fe(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=Fe(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=Fe(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 r=e(t);n.has(r)||n.set(r,[]),n.get(r).push(t)})),n}(this._elements,(function(t){return r(t.__data__)})),p=0;p<t.length;p++){var g=t[p],v=e(g,p),y=r(g,p);if(f.has(v))(w=f.get(v)).__data__=g,w.__facet__=!1,s.push(w),c.delete(w),f.delete(v);else if(h.has(v)){(w=h.get(v)).__data__=g,w.__facet__=!0,s.push(w),h.delete(v)}else if(d.has(v)){var m=d.get(v);l.push([g,m]);try{for(var b=(i=void 0,Ie(m)),x=b.next();!x.done;x=b.next()){var w=x.value;c.delete(w)}}catch(t){i={error:t}}finally{try{x&&!x.done&&(o=b.return)&&o.call(b)}finally{if(i)throw i.error}}d.delete(v)}else if(f.has(y)){(w=f.get(y)).__toData__?w.__toData__.push(g):w.__toData__=[g],u.add(w),c.delete(w)}else a.push(g)}var k=[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,k)},t.prototype.merge=function(t){var e=Be(Be([],De(this._elements),!1),De(t._elements),!1),r=Be(Be([],De(this._transitions),!1),De(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=De(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=new Array(this._elements.length);return this.each((function(n,r){e[r]=t.call(this,n,r)})),this._transitions=T(e),this},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,Be([this._parent,this],De(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:Ig,rect:Ug,circle:Cg,path:Gg,text:qm,ellipse:Rg,image:Fg,line:$g,polygon:Yg,polyline:Vg,html:Bg},t}();function Lb(t){return new Cb([t],null,t,t.ownerDocument)}function jb(t){if(I(t))return[t,t,t,t];if(x(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}function Rb(t){var e=t.getLocalBounds(),n=De([e.min,e.max],2),r=De(n[0],2),i=r[0],o=r[1],a=De(n[1],2),s=a[0],c=a[1];return{x:i,y:o,width:s-i,height:c-o,left:i,bottom:c,top:o,right:s}}function Ib(t,e){var n=De(t,2),r=n[0],i=n[1],o=De(e,2),a=o[0],s=o[1];return r!==a&&i===s}function Db(t){return t.toString().charAt(0).toUpperCase()+t.toString().slice(1)}function Bb(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 Fb=function(t,e){if(!(null==t?void 0:t.startsWith(e)))return!1;var n=t[e.length];return n>="A"&&n<="Z"};function zb(t,e,n){void 0===n&&(n=!1);var r={};return Object.entries(t).forEach((function(t){var i=De(t,2),o=i[0],a=i[1];if("className"===o||"class"===o);else if(Fb(o,"show")&&Fb(Bb(o,"show"),e)!==n)o===function(t,e){return"".concat(e).concat(Db(t))}(e,"show")?r[o]=a:r[o.replace(new RegExp(Db(e)),"")]=a;else if(!Fb(o,"show")&&Fb(o,e)!==n){var s=Bb(o,e);"filter"===s&&"function"==typeof a||(r[s]=a)}})),r}function $b(t,e){return Object.entries(t).reduce((function(t,n){var r=De(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(Db(i))]=o,t}),{})}function Wb(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=De(t,2),a=o[0],s=o[1];e.includes(a)||(-1!==n.indexOf(a)?i[a]=s:r[a]=s)})),[r,i]}function Gb(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=De([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 Hb=function(t,e){null!=e?t.replaceChildren?Array.isArray(e)?t.replaceChildren.apply(t,Be([],De(e),!1)):t.replaceChildren(e):(t.innerHTML="",Array.isArray(e)?e.forEach((function(e){return t.appendChild(e)})):t.appendChild(e)):t.innerHTML=""};function Yb(){Gm(this,"hidden"!==this.attributes.visibility)}var qb=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this,rb({},{style:n},e))||this;return r.initialized=!1,r._defaultOptions=n,r}return Ne(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Ym(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&&Yb.call(this)},e.prototype.update=function(t,e){var n;return this.attr(rb({},this.attributes,t||{})),null===(n=this.render)||void 0===n?void 0:n.call(this,this.attributes,this,e)},e.prototype.clear=function(){this.removeChildren()},e.prototype.bindEvents=function(t,e){},e.prototype.getSubShapeStyle=function(t){return Le(t,["x","y","transform","transformOrigin","class","className","zIndex"])},e}(jg),Vb=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"]]},Ub=Vb,Xb=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},Zb=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},Kb=Zb;var Qb=function(t,e,n){return[["M",t-n,e-n],["L",t+n,e],["L",t-n,e+n],["Z"]]};function Jb(t){var e=function(t){var e="default";if(w(t)&&t instanceof Image)e="image";else if(m(t))e="symbol";else if(L(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var tx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ne(e,t),e.prototype.render=function(t,n){var r=t.x,i=void 0===r?0:r,o=t.y,a=void 0===o?0:o,s=this.getSubShapeStyle(t),c=s.symbol,l=s.size,u=void 0===l?16:l,f=Le(s,["symbol","size"]),h=Jb(c);hb(!!h,Lb(n),(function(t){t.maybeAppendByClassName("marker",h).attr("className","marker ".concat(h,"-marker")).call((function(t){if("image"===h){var n=2*u;t.styles({img:c,width:n,height:n,x:i-u,y:a-u})}else{n=u/2;var r=m(c)?c:e.getSymbol(c);t.styles(Ce({d:null==r?void 0:r(i,a,n)},f))}}))}))},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(qb);tx.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]]})),tx.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),tx.registerSymbol("line",Xb),tx.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),tx.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]]})),tx.registerSymbol("circle",Vb),tx.registerSymbol("point",Ub),tx.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"]]})),tx.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"]]})),tx.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"]]})),tx.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),tx.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"]]})),tx.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"]]})),tx.registerSymbol("line",Xb),tx.registerSymbol("dot",Zb),tx.registerSymbol("dash",Kb),tx.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]]})),tx.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]]})),tx.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]]})),tx.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]]})),tx.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 ex=function(t){function e(e){var n=this,r=e.style,i=Le(e,["style"]);return(n=t.call(this,Q({},{type:"column"},Ce({style:r},i)))||this).columnsGroup=new Ig({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return Ne(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,")"),Lb(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(rb({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(Ng),nx=function(t){function e(e){var n=this,r=e.style,i=Le(e,["style"]);return(n=t.call(this,Q({},{type:"lines"},Ce({style:r},i)))||this).linesGroup=n.appendChild(new Ig),n.areasGroup=n.appendChild(new Ig),n.render(),n}return Ne(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(rb({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){Lb(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){Lb(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}(Ng);function rx(t,e){void 0===e&&(e=!1);var n=e?t.length-1:0,r=t.map((function(t,e){return Be([e===n?"M":"L"],De(t),!1)}));return e?r.reverse():r}function ix(t,e){if(void 0===e&&(e=!1),t.length<=2)return rx(t);for(var n=[],r=t.length,i=0;i<r;i+=1){var o=e?t[r-i-1]:t[i];et(o,n.slice(-2))||n.push.apply(n,Be([],De(o),!1))}var a=Sb(n,!1);return e?a.unshift(Be(["M"],De(t[r-1]),!1)):a.unshift(Be(["M"],De(t[0]),!1)),a}function ox(t,e,n){var r=V(t);return r.push(["L",e,n],["L",0,n],["Z"]),r}function ax(t){return 0===t.length?[0,0]:[N(F(t,(function(t){return N(t)||0}))),P(B(t,(function(t){return P(t)||0})))]}function sx(t){for(var e=V(t),n=e[0].length,r=De([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 cx=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 Ne(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=V(t);return I(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?sx(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=De(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=zb(this.attributes,"area"),a=zb(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=De(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=De([a,s],2),s=n[0],a=n[1]),t.map((function(t){return t.map((function(t,e){return[r.map(e),R(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=ix(o),s=void 0;if(0===i)s=ox(a,e,n);else{var c=ix(t[i-1],!0),l=o[0];c[0][0]="L",s=Be(Be(Be([],De(a),!1),De(c),!1),[Be(["M"],De(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=rx(t[i]),a=void 0;if(0===i)a=ox(o,e,n);else{var s=rx(t[i-1],!0);s[0][0]="L",a=Be(Be(Be([],De(o),!1),De(s),!1),[["Z"]],!1)}r.push(a)}return r}(u,s,h):function(t,e,n,r){return t.map((function(t){return ox(e?ix(t):rx(t),n,r)}))}(u,i,s,h)}return{lines:u.map((function(e,n){return Ce({stroke:t.getColor(n),d:i?ix(e):rx(e)},a)})),areas:f.map((function(e,n){return Ce({d:e,fill:t.getColor(n)},o)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=zb(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=sx(s));var c=this.createScales(s),l=c.x,u=c.y,f=De(ax(s),2),h=f[0],d=f[1],p=new po({domain:[0,d-(h>0?0:h)],range:[0,a*o]}),g=l.getBandWidth(),v=this.rawData;return{columns:s.map((function(n,i){return n.map((function(n,o){var a=g/s.length;return Ce(Ce({fill:t.getColor(i)},e),r?{x:l.map(o),y:u.map(n),width:g,height:p.map(v[i][o])}:{x:l.map(o)+a*i,y:n>=0?u.map(n):u.map(0),width:a,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,r,i;(n=e,r=".container",i="rect",n.querySelector(r)?Lb(n).select(r):Lb(n).append(i)).attr("className","container").node();var o=t.type,a=t.x,s=t.y,c="spark".concat(o),l=Ce({x:a,y:s},"line"===o?this.linesStyle:this.columnsStyle);Lb(e).selectAll(".spark").data([o]).join((function(t){return t.append((function(t){return"line"===t?new nx({className:c,style:l}):new ex({className:c,style:l})})).attr("className","spark ".concat(c))}),(function(t){return t.update(l)}),(function(t){return t.remove()}))},e.prototype.getColor=function(t){var e=this.attributes.color;return x(e)?e[t%e.length]:m(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=De(ax(t),2),d=h[0],p=h[1],g=new po({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 po({domain:[0,t[0].length-1],range:[0,u]}),y:g}:{type:i,x:new Xi({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}(qb);function lx(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=De(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,Ce(Ce({},t[e]),n)]:[e,n]})))}function ux(t,e){t?t.finished.then(e):e()}function fx(t,e){"update"in t?t.update(e):t.attr(e)}function hx(t,e,n){return 0===e.length?null:n?t.animate(e,n):(fx(t,{style:e.slice(-1)[0]}),null)}function dx(t,e,n){var r={},i={};return Object.entries(e).forEach((function(e){var n=De(e,2),o=n[0],a=n[1];if(!b(a)){var s=t.style[o]||t.parsedStyle[o]||0;s!==a&&(r[o]=s,i[o]=a)}})),n?hx(t,[r,i],Ce({fill:"both"},n)):(fx(t,i),null)}function px(t,e){return t.style.opacity||(t.style.opacity=1),dx(t,{opacity:0},e)}var gx={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},vx={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},yx={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},mx=eb({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),bx=eb({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),xx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ne(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=Le(t,["x","y","size","radius","orientation"]),u=o,f=2.4*u,h=Lb(e).maybeAppendByClassName(bx.iconRect,"rect").styles(Ce(Ce({},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,v=r+3/4*f-f/2;h.maybeAppendByClassName("".concat(bx.iconLine,"-1"),"line").styles(Ce({x1:d,x2:d,y1:g,y2:v},l)),h.maybeAppendByClassName("".concat(bx.iconLine,"-2"),"line").styles(Ce({x1:p,x2:p,y1:g,y2:v},l)),"vertical"===c&&(h.node().style.transform="rotate(90)")},e}(qb),wx=function(t){function e(e){return t.call(this,e,yx)||this}return Ne(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,r=n.x,i=n.y,o=n.showLabel,a=zb(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=De(Wb(Le(a,["x","y","transform","transformOrigin"]),[]),2),p=d[0],g=d[1],v=Lb(t).maybeAppendByClassName(bx.labelGroup,"g").styles(g),y=Ce(Ce({},vx),p),m=y.text,b=Le(y,["text"]);hb(!!o,v,(function(t){e.label=t.maybeAppendByClassName(bx.label,"text").styles(Ce(Ce({},b),{x:r+c,y:i+u,transform:f,transformOrigin:h,text:"".concat(m)})),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=Ce(Ce({x:n,y:r,orientation:i},gx),zb(this.attributes,"icon")),s=this.attributes.iconShape,c=void 0===s?function(){return new xx({style:a})}:s;Lb(t).maybeAppendByClassName(bx.iconGroup,"g").selectAll(bx.icon.class).data([c]).join((function(t){return t.append("string"==typeof c?c:function(){return c(o)}).attr("className",bx.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}(qb),kx=function(t){function e(e){var n=t.call(this,e,Ce(Ce(Ce({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},$b(yx,"handle")),$b(gx,"handleIcon")),$b(vx,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(ub(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(ub(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 Np("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 Ne(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=zb(this.attributes,"sparkline");return Ce(Ce({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=De(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=De(jb(this.attributes.padding),4),e=t[0],n=t[1],r=t[2],i=t[3],o=this.shape;return{x:i,y:e,width:o.width-(i+n),height:o.height-(e+r)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll(mx.selection.class).each((function(n,r){dx(this,e[r],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&dx(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&dx(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=zb(this.attributes,"track");this.trackShape=Lb(t).maybeAppendByClassName(mx.track,"rect").styles(Ce(Ce({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=Lb(t).maybeAppendByClassName(mx.brushArea,"rect").styles(Ce({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;hb("horizontal"===n.orientation,Lb(t).maybeAppendByClassName(mx.sparklineGroup,"g"),(function(t){var n=Ce(Ce({},e.sparklineStyle),{x:r,y:i});t.maybeAppendByClassName(mx.sparkline,(function(){return new cx({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(mx.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 wx({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(mx.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=Lb(t).maybeAppendByClassName(mx.foreground,"g");var a=zb(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(Ce(Ce({},a),{transform:"translate(".concat(n,", ").concat(r,")")}))},c=this;this.foregroundGroup.selectAll(mx.selection.class).data("value"===i?[]:this.calcSelectionArea().map((function(t,e){return{style:Ce({},t),index:e,show:"select"===o?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",mx.selection.name).call(s).each((function(t,e){var n=this;1===e?(c.selectionShape=Lb(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=De(this.range,2),i=r[0],o=r[1],a=De(this.getValues().map((function(t){return Ob(t,e)})),2),s=a[0],c=a[1],l=De(((Array.isArray(t)?t:[s,null!=t?t:c])||[s,c]).map((function(t){return Ob(t,e)})),2),u=l[0],f=l[1];if("value"===this.attributes.type)return[0,R(f,i,o)];u>f&&(u=(n=De([f,u],2))[0],f=n[1]);var h=f-u;return h>o-i?[i,o]:u<i?s===i&&c===f?[i,f]:[i,h+i]:f>o?c===o&&s===u?[u,o]:[o-h,o]:[u,f]},e.prototype.calcSelectionArea=function(t){var e=De(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=De(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=zb(this.attributes,"handle"),c=zb(s,"label"),l=s.spacing,u=this.getHandleSize(),f=this.clampValues(),h=o("start"===t?f[0]:f[1]),d=new qm({style:Ce(Ce(Ce({},c),this.inferTextStyle(t)),{text:h})}),p=d.getBBox(),g=p.width,v=p.height;if(d.destroy(),!a){if("value"===r)return{text:h,x:0,y:-v-l};var y=l+u+("horizontal"===i?g/2:0);return(e={text:h})["horizontal"===i?"x":"y"]="start"===t?-y:y,e}var m=0,b=0,x=this.availableSpace,w=x.width,k=x.height,M=this.calcSelectionArea()[1],E=M.x,O=M.y,_=M.width,S=M.height,A=l+u;if("horizontal"===i){var T=A+g/2;if("start"===t)m=E-A-g>0?-T:T;else m=w-E-_-A>g?T:-T}else{var P=v+A;b="start"===t?O-u>v?-P:A:k-(O+S)-u>v?P:-A}return{x:m,y:b,text:h}},e.prototype.getHandleLabelStyle=function(t){var e=zb(this.attributes,"handleLabel");return Ce(Ce(Ce({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=zb(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),r=this.getHandleSize();return Ce({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),Ce(Ce(Ce({},$b(this.getHandleIconStyle(),"icon")),$b(Ce(Ce({},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=De(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=De(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 Np(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}(qb),Mx=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 Np("scroll",r)),n.dispatchEvent(new Np("valuechange",r))}},n.onTrackClick=function(t){if(n.attributes.slidable){var e=De(n.getLocalPosition(),2),r=e[0],i=e[1],o=De(n.padding,4),a=o[0],s=o[3],c=n.getOrientVal([r+s,i+a]),l=(n.getOrientVal(ub(t))-c)/n.trackLength;n.setValue(l,!0)}},n.onThumbMouseenter=function(t){n.dispatchEvent(new Np("thumbMouseenter",{detail:t.detail}))},n.onTrackMouseenter=function(t){n.dispatchEvent(new Np("trackMouseenter",{detail:t.detail}))},n.onThumbMouseleave=function(t){n.dispatchEvent(new Np("thumbMouseleave",{detail:t.detail}))},n.onTrackMouseleave=function(t){n.dispatchEvent(new Np("trackMouseleave",{detail:t.detail}))},n}return Ne(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return jb(this.attributes.padding)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){var t=this.attributes.value,e=De(this.range,2),n=e[0],r=e[1];return R(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=De(this.padding,4),r=n[0],i=n[1],o=n[2],a=n[3],s=De(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=De(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=zb(this.attributes,"track"),l=zb(this.attributes,"thumb"),u=Ce(Ce({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()},$b(c,"track")),$b(l,"selection"));this.slider=Lb(t).maybeAppendByClassName("scrollbar",(function(){return new kx({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=De(this.range,2),i=r[0],o=r[1];this.slider.setValues(this.getValues(R(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}(qb),Ex={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 Gg({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:[]};Q({},Ex,{style:{type:"arc"}}),Q({},Ex,{style:{}});var Ox=eb({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"),_x=eb({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Sx(t){return t.reduce((function(t,e,n){return t.push(Be([0===n?"M":"L"],De(e),!1)),t}),[])}function Ax(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 Sx(t);if(!o)return[];var a=Mb(t[0],o),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push(Be(["M"],De(e),!1)):t.push(Be(["A",a,a,0,0,s],De(e),!1)),t}),[])}(t,e,n):Sx(t)}function Tx(t,e,n){var r=n.type,i=n.connect,o=n.center,a=n.closed?[["Z"]]:[],s=De([Ax(t,n),Ax(e.slice().reverse(),n,!0)],2),c=s[0],l=s[1],u=De([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([Be(["L"],De(h),!1)],[Be(["L"],De(f),!1)]);if(!o)throw new Error("Arc grid need to specified center");var p=De([Mb(h,o),Mb(f,o)],2),g=p[0],v=p[1];return d([Be(["A",g,g,0,0,1],De(h),!1),Be(["L"],De(h),!1)],[Be(["A",v,v,0,0,0],De(f),!1),Be(["L"],De(f),!1)])}var Px=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ne(e,t),e.prototype.render=function(t,e){var n=Le(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=De(e,1)[0];return Ce(Ce({},t),{points:Be(Be([],De(e),!1),[n],!1)})})):n}(t),i=Lb(e).maybeAppendByClassName(_x.lineGroup,"g"),o=Lb(e).maybeAppendByClassName(_x.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:Ax(t.points,n)}}));return t.selectAll(_x.line.class).data(a,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=Zm(Pb(Ce({d:t.d},r)),[t,e,a]);this.attr(Ce({class:_x.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},n))}))}),(function(t){return t.transition((function(t,e){return dx(this,Zm(Pb(Ce({d:t.d},r)),[t,e,a]),i.update)}))}),(function(t){return t.transition((function(){var t=this,e=px(this,i.exit);return ux(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=De([e[l].points,e[l+1].points],2),f=Tx(u[0],u[1],n);c.push({d:f,fill:s(l)})}return t.selectAll(_x.region.class).data(c,(function(t,e){return e})).join((function(t){return t.append("path").each((function(t,e){var n=Zm(t,[t,e,c]);this.attr(n)})).attr("className",_x.region.name)}),(function(t){return t.transition((function(t,e){return dx(this,Zm(t,[t,e,c]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=px(this,r.exit);return ux(e,(function(){return t.remove()})),e}))})).transitions()}(o,r,t);return Be(Be([],De(a),!1),De(s),!1)},e}(qb);function Nx(t,e){return Object.fromEntries(Object.entries(t).map((function(t){var n=De(t,2);return[n[0],Zm(n[1],e)]})))}function Cx(t,e){return e&&m(e)?t.filter(e):t}function Lx(t,e){var n=e.startAngle;return(e.endAngle-n)*t+n}function jx(t,e){if("linear"===e.type){var n=De(e.startPos,2),r=n[0],i=n[1],o=De(e.endPos,2),a=De([o[0]-r,o[1]-i],2);return Eb([a[0],a[1]])}var s=Vm(Lx(t,e));return[-Math.sin(s),Math.cos(s)]}function Rx(t,e,n){return function(t,e){return e?[t[1],-t[0]]:[-t[1],t[0]]}(jx(t,n),"positive"!==e)}function Ix(t,e){return Rx(t,e.labelDirection,e)}function Dx(t,e){return"linear"===e.type?function(t,e){var n=De(e.startPos,2),r=n[0],i=n[1],o=De(e.endPos,2),a=De([o[0]-r,o[1]-i],2);return[r+a[0]*t,i+a[1]*t]}(t,e):function(t,e){var n=e.radius,r=De(e.center,2),i=r[0],o=r[1],a=Vm(Lx(t,e));return[i+n*Math.cos(a),o+n*Math.sin(a)]}(t,e)}function Bx(t){return 0===jx(0,t)[1]}function Fx(t){return 0===jx(0,t)[0]}function zx(t,e){return e-t===360}function $x(t,e,n,r,i){var o=e-t,a=De([i,i],2),s=a[0],c=a[1],l=De([Vm(t),Vm(e)],2),u=l[0],f=l[1],h=function(t){return[n+i*Math.cos(t),r+i*Math.sin(t)]},d=De(h(u),2),p=d[0],g=d[1],v=De(h(f),2),y=v[0],m=v[1];if(zx(t,e)){var b=De(h((f+u)/2),2);return[["M",p,g],["A",s,c,0,1,0,b[0],b[1]],["A",s,c,0,1,0,y,m]]}var x=o>180?1:0,w=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(c,",0,").concat(x,",").concat(w,",").concat(y,",").concat(m)}function Wx(t,e,n,r){var i=e.startAngle,o=e.endAngle,a=e.center,s=e.radius;return t.selectAll(Ox.line.class).data([{d:$x.apply(void 0,Be(Be([i,o],De(a),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",Ox.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,Ce({fill:"both"},r))}(this,function(t){var e=t.attributes,n=e.startAngle,r=e.endAngle,i=e.center,o=e.radius;return Be(Be([n,r],De(i),!1),[o],!1)}(this),Be(Be([i,o],De(a),!1),[s],!1),r.update);if(e){var n=function(){var e=rt(t.attributes,"__keyframe_data__");t.style.d=$x.apply(void 0,Be([],De(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function Gx(t){var e=De(t,2),n=De(e[0],2),r=n[0],i=n[1],o=De(e[1],2);return{x1:r,y1:i,x2:o[0],y2:o[1]}}function Hx(t,e,n,r){var i=e.showTrunc,o=e.startPos,a=e.endPos,s=e.truncRange,c=e.lineExtension,l=De([o,a],2),u=De(l[0],2),f=u[0],h=u[1],d=De(l[1],2),p=d[0],g=d[1],v=De(c?function(t,e,n){void 0===n&&(n=[0,0]);var r=De([t,e,n],3),i=De(r[0],2),o=i[0],a=i[1],s=De(r[1],2),c=s[0],l=s[1],u=De(r[2],2),f=u[0],h=u[1],d=De([c-o,l-a],2),p=d[0],g=d[1],v=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),y=De([-f/v,h/v],2),m=y[0],b=y[1];return[m*p,m*g,b*p,b*g]}(o,a,c):new Array(4).fill(0),4),y=v[0],m=v[1],b=v[2],x=v[3],w=function(e){return t.selectAll(Ox.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(Ox.line.name," ").concat(t.className)})).styles(n).transition((function(t){return dx(this,Gx(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return dx(this,Gx(t.line),r.update)}))}),(function(t){return t.remove()})).transitions()};if(!i||!s)return w([{line:[[f+y,h+m],[p+b,g+x]],className:Ox.line.name}]);var k=De(s,2),M=k[0],E=k[1],O=p-f,_=g-h,S=De([f+O*M,h+_*M],2),A=S[0],T=S[1],P=De([f+O*E,h+_*E],2),N=P[0],C=P[1];return w([{line:[[f+y,h+m],[A,T]],className:Ox.lineFirst.name},{line:[[N,C],[p+b,g+x]],className:Ox.lineSecond.name}])}function Yx(t,e,n){var r,i=e.type,o=zb(e,"line");return r="linear"===i?Hx(t,e,_b(o,"arrow"),n):Wx(t,e,_b(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(Ox.line.class):a?t.select(Ox.lineSecond.class):t.select(Ox.line.class),!o||!s||"arc"===n.type&&zx(n.startAngle,n.endAngle)){var u=i.node();u&&(u.style.markerEnd=void 0)}else{var f=fb(s);f.attr(r),Nb(f,l,!0),i.style("markerEnd",f).style("markerEndOffset",-c)}}(t,i,e,o),r}function qx(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function Vx(t,e){var n=e.gridLength;return t.map((function(t,r){var i=t.value,o=De(Dx(i,e),2),a=o[0],s=o[1],c=De(mb(function(t,e){return Rx(t,e.gridDirection,e)}(i,e),n),2);return{id:r,points:[[a,s],[a+c[0],s+c[1]]]}}))}function Ux(t,e,n,r){var i=zb(n,"grid"),o=i.type,a=i.areaFill,s=qx(n),c=Cx(e,n.gridFilter),l="segment"===o?Vx(c,n):function(t,e){var n=e.gridControlAngles,r=qx(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=De(r,2),o=i[0],a=i[1];return t.map((function(t,r){var i=De(Dx(t.value,e),2),s=i[0],c=i[1],l=De([s-o,c-a],2),u=l[0],f=l[1],h=[];return n.forEach((function(t){var e=Vm(t),n=De([Math.cos(e),Math.sin(e)],2),r=n[0],i=n[1],s=u*r-f*i+o,c=u*i+f*r+a;h.push([s,c])})),{points:h,id:r}}))}(c,n),u=Ce(Ce({},i),{center:s,areaFill:m(a)?c.map((function(t,e){return Zm(a,[t,e,c])})):a,animate:r,data:l});return t.selectAll(Ox.grid.class).data([1]).join((function(t){return t.append((function(){return new Px({style:u})})).attr("className",Ox.grid.name)}),(function(t){return t.transition((function(){return this.update(u)}))}),(function(t){return t.remove()})).transitions()}var Xx=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 Zx(t,e){var n=t.getEulerAngles()||0;t.setEulerAngles(0);var r=t.getBounds(),i=De(r.min,2),o=i[0],a=i[1],s=De(r.max,2),c=s[0],l=s[1],u=t.getBBox(),f=u.width,h=u.height,d=0,p=0,g=o,v=a,y=sb(t);if(y){h-=1.5;var m=y.style.textAlign,b=y.style.textBaseline;"center"===m?g=(o+c)/2:"right"!==m&&"end"!==m||(g=c),"middle"===b?v=(a+l)/2:"bottom"===b&&(v=l)}var x=De(jb(e),4),w=x[0],k=void 0===w?0:w,M=x[1],E=void 0===M?0:M,O=x[2],_=void 0===O?k:O,S=x[3],A=new Xx((d+=o)-(void 0===S?E:S),(p+=a)-k,d+f+E,p+h+_);return t.setEulerAngles(n),A.rotatedPoints(Vm(n),g,v)}function Kx(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 Qx(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 Jx(t,e){return e.every((function(e){return function(t,e){var n=t.length;if(n<3)return!1;var r,i,o,a,s,c,l=[e,[9999,e[1]]],u=0,f=0;do{var h=[t[f],t[(f+1)%n]];if(i=l,o=void 0,a=void 0,s=void 0,c=void 0,o=Qx((r=h)[0],r[1],i[0]),a=Qx(r[0],r[1],i[1]),s=Qx(i[0],i[1],r[0]),c=Qx(i[0],i[1],r[1]),o!==a&&s!==c||0===o&&Kx(r,i[0])||0===a&&Kx(r,i[1])||0===s&&Kx(i,r[0])||0===c&&Kx(i,r[1])){if(0===Qx(h[0],e,h[1]))return Kx(h,e);u++}f=(f+1)%n}while(0!==f);return!!(1&u)}(t,e)}))}function tw(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=De(t,4),r=n[0],i=n[1],o=n[2],a=n[3],s=De(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,v=r-c,y=i-l,m=u*y-f*v;if(m<0===g)return!1;var b=h*y-d*v;return b<0!==g&&m>p!==g&&b>p!==g}(e,t)}))}function ew(t,e,n){var r,i,o=e.crossPadding,a=new Set,s=null,c=function(t,e){var n=t.type,r=t.labelDirection,i=t.crossSize;if(!i)return!1;if("arc"===n){var o=t.center,a=t.radius,s=De(o,2),c=s[0],l=s[1],u="negative"===r?0:i,f=-a-u,h=a+u,d=De(jb(e),4),p=d[0],g=d[1],v=d[2],y=d[3];return new Xx(c+f-y,l+f-p,c+h+g,l+h+v)}var m=De(t.startPos,2),b=m[0],x=m[1],w=De(t.endPos,2),k=w[0],M=w[1],E=De(Fx(t)?[-e,0,e,0]:[0,e,0,-e],4),O=E[0],_=E[1],S=E[2],A=E[3],T=mb(Ix(0,t),i),P=new Xx(b,x,k,M);return P.x1+=A,P.y1+=O,P.x2+=_+T[0],P.y2+=S+T[1],P}(e,o),l=function(t){return!c||function(t,e,n){var r=t.x1,i=t.x2,o=t.y1,a=t.y2;return Jx([[r,o],[i,o],[i,a],[r,a]],Zx(e,n))}(c,t)},u=function(t,e){return!t||!t.firstChild||!function(t,e,n){var r,i,o=Zx(t,n).flat(1),a=Zx(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=Ie(s),l=c.next();!l.done;l=c.next())if(tw(a,l.value))return!0}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return!1}(t.firstChild,e.firstChild,jb(n))};try{for(var f=Ie(t),h=f.next();!h.done;h=f.next()){var d=h.value;l(d)?!s||u(s,d)?s=d:(a.add(s),a.add(d)):a.add(d)}}catch(t){r={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(a)}function nw(t,e){return void 0===e&&(e={}),b(t)?0:"number"==typeof t?t:Math.floor(ob(t,e))}var rw=function(t,e){var n=e.seq,r=void 0===n?2:n;return t.filter((function(t,e){return!(e%r)||(Wm(t),!1)}))};var iw=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=rw,f=function(t){return t.forEach(r.show),t},h=2,d=t.slice(),p=t.slice(),g=Math.min.apply(Math,Be([1],De(t.map((function(t){return t.getBBox().width}))),!1));if("linear"===n.type&&(Bx(n)||Fx(n))){var v=Rb(t[0]).left,y=Rb(t[i-1]).right,m=Math.abs(y-v)||1;h=Math.max(Math.floor(i*g/m),h)}for(o&&(s=d.splice(0,1)[0]),a&&(c=d.splice(-1,1)[0],d.reverse()),f(d);h<t.length&&ew((l=c?Be(Be([c],De(p),!1),[s],!1):Be([s],De(p),!1),l.filter(ib)),n,null==e?void 0:e.margin).length;){if(c&&!s&&h%2==0)d.splice(0,1).forEach(r.hide);else if(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=Ie(s),p=d.next();!p.done;p=d.next()){if(h(p.value),ew(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=ab(r.getTextShape(t[0])),p=nw(u,d),g=a?nw(a,d):p,v=nw(c,d);(b(v)||v===1/0)&&(v=Math.max.apply(null,t.map((function(t){return t.getBBox().width}))));var y=t.slice();De(h,4);for(var m=function(e){if(y.forEach((function(t){r.ellipsis(r.getTextShape(t),e,o)})),(y=ew(t,n,h)).length<1)return{value:void 0}},x=v;x>g+p;x-=p){var w=m(x);if("object"==typeof w)return w.value}}}],["wrap",function(t,e,n,r){var i=e.wordWrapWidth,o=void 0===i?50:i,a=e.maxLines,s=void 0===a?3:a,c=e.recoverWhenFailed,l=void 0===c||c,u=e.margin,f=void 0===u?[0,0,0,0]:u,h=t.map((function(t){return t.attr("maxLines")||1})),d=Math.min.apply(Math,Be([],De(h),!1)),p=function(){return ew(t,n,f).length<1},g=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&Bx(t)?"negative"===n?"bottom":"top":"middle"}(n),v=function(e){return t.forEach((function(t,n){var i=Array.isArray(e)?e[n]:e;r.wrap(t,o,i,g)}))};if(!(d>s)){if("linear"===n.type&&Bx(n)){if(v(s),p())return}else for(var y=d;y<=s;y++)if(v(y),p())return;l&&v(h)}}]]);function ow(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce((function(t,e){return t*function(t){return"positive"===t?-1:1}(e)}),1)}function aw(t){for(var e=t;e<0;)e+=360;return Math.round(e%360)}function sw(t,e){var n=De(t,2),r=n[0],i=n[1],o=De(e,2),a=o[0],s=o[1],c=De([r*a+i*s,r*s-i*a],2),l=c[0],u=c[1];return Math.atan2(u,l)}function cw(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=Ix(t.value,n),a=jx(t.value,n);return"horizontal"===i?0:function(t){var e=(t+360)%180;return db(e,-90,90)||(e+=180),e}(Um("perpendicular"===i?sw([1,0],o):sw([a[0]<0?-1:1,0],a)))}function lw(t,e,n){var r=n.type,i=n.labelAlign,o=Ix(t,n),a=aw(e),s=aw(Um(sw([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?(db(a,0,90,!1,!0)||db(a,0,90)||db(a,270,360))&&(c="start"):90===s?db(a,0,90,!1,!0)?c="start":(db(a,90,180)||db(a,270,360))&&(c="end"):270===s?db(a,0,90,!1,!0)?c="end":(db(a,90,180)||db(a,270,360))&&(c="start"):180===s&&(90===a?c="start":(db(a,0,90)||db(a,270,360))&&(c="end")):c="center":"parallel"===i?l=db(s,0,180,!0)?"top":"bottom":"horizontal"===i?db(s,90,270,!1)?c="end":(db(s,270,360,!1)||db(s,0,90))&&(c="start"):"perpendicular"===i&&(c=db(s,90,270)?"end":"start"),{textAlign:c,textBaseline:l}}function uw(t,e,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,c=e.indexOf(t),l=Zm(s,[t,c,e]),u=De([Ix(t.value,n),ow(a,o)],2),f=De(bb(mb(u[0],l+(1===u[1]?Zm(r?i:0,[t,c,e]):0)),Dx(t.value,n)),2);return{x:f[0],y:f[1]}}function fw(t,e){"text"===t.nodeName&&t.attr(e)}function hw(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=iw.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:Wm,show:$m,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var r=lw(e.__data__.value,t,n),i=e.querySelector(Ox.labelItem.class);i&&fw(i,r)}(+n,e,t)},ellipsis:function(t,e,n){t&&lb(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"),cb(t,{wordWrap:!0,wordWrapWidth:e,maxLines:r,textBaseline:i}))},getTextShape:function(t){return t.querySelector("text")}})}function dw(t,e,n,r,i){var o=n.indexOf(e),a=Lb(t).append(function(t,e,n,r){var i=r.labelFormatter;return m(i)?function(){return fb(Zm(i,[t,e,n,Ix(t.value,r)]))}:function(){return fb(t.label||"")}}(e,o,n,i)).attr("className",Ox.labelItem.name).node(),s=De(Wb(Nx(r,[e,o,n])),2),c=s[0],l=s[1],u=l.transform,f=Le(l,["transform"]);Gb(a,u);var h=cw(e,a,i);return a.getLocalEulerAngles()||a.setLocalEulerAngles(h),fw(a,Ce(Ce({},lw(e.value,h,i)),c)),t.attr(f),a}function pw(t,e,n,r){var i,o,a,s=Cx(e,n.labelFilter),c=zb(n,"label"),l=t.selectAll(Ox.label.class).data(s,(function(t,e){return e})).join((function(t){return t.append("g").attr("className",Ox.label.name).transition((function(t){dw(this,t,e,c,n);var r=uw(t,e,n),i=r.x,o=r.y;return this.style.transform="translate(".concat(i,", ").concat(o,")"),null}))}),(function(t){return t.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&&Wm(t),e.isVisible()&&$m(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=De(t.getGeometryBounds().center,2),h=f[0],d=f[1],p=De(e.getGeometryBounds().center,2),g=De([(h+p[0])/2-h,(d+p[1])/2-d],2),v=g[0],y=g[1],m=t.style.opacity,b=void 0===m?1:m,x=e.style.opacity,w=void 0===x?1:x,k=t.style.transform||"",M=e.style.transform||"",E=t.animate([{opacity:b,transform:"translate(0, 0) ".concat(k)},{opacity:0,transform:"translate(".concat(v,", ").concat(y,") ").concat(k)}],Ce(Ce({fill:"both"},n),{duration:c+l+u})),O=e.animate([{opacity:0,transform:"translate(".concat(-v,", ").concat(-y,") ").concat(M),offset:.01},{opacity:w,transform:"translate(0, 0) ".concat(M)}],Ce(Ce({fill:"both"},n),{duration:l+u,delay:c+l-u}));return ux(O,i),[E,O]}(this.querySelector(Ox.labelItem.class),dw(this,t,e,c,n),r.update),o=uw(t,e,n),a=o.x,s=o.y,l=dx(this,{transform:"translate(".concat(a,", ").concat(s,")")},r.update);return Be(Be([],De(i),!1),[l],!1)}))}),(function(t){return i=t,t.transition((function(){var t=this,e=px(this.childNodes[0],r.exit);return ux(e,(function(){return Lb(t).remove()})),e})),i})).transitions();return a=function(){hw.call(t,n)},0===(o=l).length?a():Promise.all(o.map((function(t){return null==t?void 0:t.finished}))).then(a),l}function gw(t,e){return Rx(t,e.tickDirection,e)}function vw(t,e,n,r,i){var o=De(function(t,e){var n=De(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(r,Zm(i.tickLength,[t,e,n])),2),a=De(o[0],2),s=a[0],c=a[1],l=De(o[1],2);return{x1:s,x2:l[0],y1:c,y2:l[1]}}function yw(t,e,n,r,i,o){var a=function(t,e,n,r,i){var o=i.tickFormatter,a=gw(e.value,i),s="line";return m(o)&&(s=function(){return Zm(o,[e,n,r,a])}),t.append(s).attr("className",Ox.tickItem.name)}(Lb(this),t,e,n,r);!function(t,e,n,r,i,o,a){var s=gw(t.value,o),c=vw(t,e,n,s,o),l=c.x1,u=c.x2,f=c.y1,h=c.y2,d=De(Wb(Nx(a,[t,e,n,s])),2),p=d[0],g=d[1];"line"===r.node().nodeName&&r.styles(Ce({x1:l,x2:u,y1:f,y2:h},p)),i.attr(g),r.styles(p)}(t,e,n,a,this,r,i);var s=De(Dx(t.value,r),2),c=s[0],l=s[1];return dx(this,{transform:"translate(".concat(c,", ").concat(l,")")},o)}var mw=eb({text:"text"},"title");function bw(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function xw(t,e){var n=Object.entries(e).reduce((function(e,n){var r=De(n,2),i=r[0],o=r[1];return t.node().attr(i)||(e[i]=o),e}),{});t.styles(n)}var ww=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 Ne(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(mw.text.class);if(!a)return new Xm(0,0,+e,+n);var s=a.getBBox(),c=s.width,l=s.height,u=De(jb(i),4),f=u[0],h=u[1],d=u[2],p=u[3],g=De([0,0,+e,+n],4),v=g[0],y=g[1],m=g[2],b=g[3],x=bw(r);if(x.includes("i"))return new Xm(v,y,m,b);x.forEach((function(t,r){var i,o,a,s;"t"===t&&(i=De(0===r?[l+d,+n-l-d]:[0,+n],2),y=i[0],b=i[1]),"r"===t&&(o=De([+e-c-p],1),m=o[0]),"b"===t&&(a=De([+n-l-f],1),b=a[0]),"l"===t&&(s=De(0===r?[c+h,+e-c-h]:[0,+e],2),v=s[0],m=s[1])}));var w=De(jb(o),4),k=w[0],M=w[1],E=w[2],O=w[3],_=De([O+M,k+E],2),S=_[0],A=_[1];return new Xm(v+O,y+k,m-S,b-A)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new Xm(0,0,0,0)},e.prototype.render=function(t,e){var n=this,r=Le(t,["width","height","position","spacing"]),i=De(Wb(r),1)[0],o=function(t){var e,n,r,i,o=t,a=o.width,s=o.height,c=o.position,l=De([+a/2,+s/2],2),u=De([+l[0],+l[1],"center","middle"],4),f=u[0],h=u[1],d=u[2],p=u[3],g=bw(c);return g.includes("l")&&(f=(e=De([0,"start"],2))[0],d=e[1]),g.includes("r")&&(f=(n=De([+a,"end"],2))[0],d=n[1]),g.includes("t")&&(h=(r=De([0,"top"],2))[0],p=r[1]),g.includes("b")&&(h=(i=De([+s,"bottom"],2))[0],p=i[1]),{x:f,y:h,textAlign:d,textBaseline:p}}(t),a=o.x,s=o.y,c=o.textAlign,l=o.textBaseline;hb(!!r.text,Lb(e),(function(t){n.title=t.maybeAppendByClassName(mw.text,"text").styles(i).call(xw,{x:a,y:s,textAlign:c,textBaseline:l}).node()}))},e}(qb);function kw(t,e,n,r,i){var o=De(Wb(zb(r,"title")),2),a=o[0],s=o[1],c=s.transform,l=s.transformOrigin,u=Le(s,["transform","transformOrigin"]);e.styles(u);var f=c||function(t,e,n){var r=2*t.getGeometryBounds().halfExtents[1];if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(r/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(r/2,")")}return""}(t.node(),a.direction,a.position);t.styles(Ce(Ce({},a),{transformOrigin:l})),Gb(t.node(),f);var h=function(t,e,n){var r=n.titlePosition,i=void 0===r?"lb":r,o=n.titleSpacing,a=bw(i),s=t.node().getLocalBounds(),c=De(s.min,2),l=c[0],u=c[1],f=De(s.halfExtents,2),h=f[0],d=f[1],p=De(e.node().getLocalBounds().halfExtents,2),g=p[0],v=p[1],y=De([l+h,u+d],2),m=y[0],b=y[1],x=De(jb(o),4),w=x[0],k=x[1],M=x[2],E=x[3];if(["start","end"].includes(i)&&"linear"===n.type){var O=n.startPos,_=n.endPos,S=De("start"===i?[O,_]:[_,O],2),A=S[0],T=S[1],P=De(mb(Eb([-T[0]+A[0],-T[1]+A[1]]),w),2),N=P[0],C=P[1];return{x:A[0]+N,y:A[1]+C}}return a.includes("t")&&(b-=d+v+w),a.includes("r")&&(m+=h+g+k),a.includes("l")&&(m-=h+g+E),a.includes("b")&&(b+=d+v+M),{x:m,y:b}}(Lb(n._offscreen||n.querySelector(Ox.mainGroup.class)),e,r),d=h.x,p=h.y;return dx(e.node(),{transform:"translate(".concat(d,", ").concat(p,")")},i)}function Mw(t,e,n,r){var i=t.showLine,o=t.showTick,a=t.showLabel,s=hb(i,e.maybeAppendByClassName(Ox.lineGroup,"g"),(function(e){return Yx(e,t,r)}))||[],c=hb(o,e.maybeAppendByClassName(Ox.tickGroup,"g"),(function(e){return function(t,e,n,r){var i=Cx(e,n.tickFilter),o=zb(n,"tick");return t.selectAll(Ox.tick.class).data(i,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",Ox.tick.name).transition((function(t,e){return yw.call(this,t,e,i,n,o,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),yw.call(this,t,e,i,n,o,r.update)}))}),(function(t){return t.transition((function(){var t=this,e=px(this.childNodes[0],r.exit);return ux(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,r)}))||[],l=hb(a,e.maybeAppendByClassName(Ox.labelGroup,"g"),(function(e){return pw(e,n,t,r)}))||[];return Be(Be(Be([],De(s),!1),De(c),!1),De(l),!1).filter((function(t){return!!t}))}var Ew=function(t){function e(e){return t.call(this,e,Ex)||this}return Ne(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=lx(void 0===n?a:n),d=hb(c,Lb(e).maybeAppendByClassName(Ox.gridGroup,"g"),(function(e){return Ux(e,f,t,h)}))||[],p=Lb(e).maybeAppendByClassName(Ox.mainGroup,"g");i&&(!this.initialized&&h.enter||this.initialized&&h.update)&&Mw(t,Lb(this.offscreenGroup),f,lx(!1));var g=Mw(t,Lb(p.node()),f,h),v=hb(s,Lb(e).maybeAppendByClassName(Ox.titleGroup,"g"),(function(e){return function(t,e,n,r){var i=n.titleText;return t.selectAll(Ox.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 fb(i)})).attr("className",Ox.title.name).transition((function(){return kw(Lb(this),t,e,n,r.enter)}))}),(function(i){return i.transition((function(){return kw(Lb(this),t,e,n,r.update)}))}),(function(t){return t.remove()})).transitions()}(e,r,t,h)}))||[];return Be(Be(Be([],De(d),!1),De(g),!1),De(v),!1).flat().filter((function(t){return!!t}))},e}(qb),Ow=eb({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"),_w=function(t){function e(e){var n=t.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:Qb(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return n.playState="idle",n.contentGroup=n.appendChild(new Ig({class:Ow.contentGroup.name})),n.playWindow=n.contentGroup.appendChild(new Ig({class:Ow.playWindow.name})),n.innerCurrPage=n.defaultPage,n}return Ne(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return R(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=De(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map((function(e,n){return t.map((function(t){return t[n]}))})))||[]}(this.pageViews.map((function(t){var e=t.getBBox();return[e.width,e.height]}))).map((function(t){return Math.max.apply(Math,Be([],De(t),!1))})),2),e=t[0],n=t[1],r=this.attributes,i=r.pageWidth,o=void 0===i?e:i,a=r.pageHeight;return{pageWidth:o,pageHeight:void 0===a?n:a}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,r=e.y,i=this.controllerShape,o=this.pageShape,a=o.pageWidth,s=o.pageHeight;return new Xm(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=De(this.getFollowingPageDiff(t),2),l=c[0],u=c[1];this.playState="running";var f=hx(a,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-l,", ").concat(-u,")")}],n);return ux(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:R(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:R(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(Ow.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)?$m(e):Wm(e)}))},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,r=t.pageInfoGroup,i=this.attributes,o=i.orientation,a=i.controllerPadding,s=r.getBBox().width,c=De("horizontal"===o?[-180,0]:[-90,90],2),l=c[0],u=c[1];e.setLocalEulerAngles(l),n.setLocalEulerAngles(u);var f=e.getBBox(),h=f.width,d=f.height,p=n.getBBox(),g=p.width,v=p.height,y=Math.max(h,s,g),m="horizontal"===o?{offset:[[0,0],[h/2+a,0],[h+s+2*a,0]],textAlign:"start"}:{offset:[[y/2,-d-a],[y/2,0],[y/2,v+a]],textAlign:"center"},b=De(m.offset,3),x=De(b[0],2),w=x[0],k=x[1],M=De(b[1],2),E=M[0],O=M[1],_=De(b[2],2),S=_[0],A=_[1],T=m.textAlign,P=r.querySelector("text");P&&(P.style.textAlign=T),e.setLocalPosition(w,k),r.setLocalPosition(E,O),n.setLocalPosition(S,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(Ow.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=De(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(Ow.controller,"g");if(Gm(s.node(),a),a){var c=zb(this.attributes,"button"),l=zb(this.attributes,"pageNum"),u=De(Wb(c),2),f=u[0],h=u[1],d=f.size,p=Le(f,["size"]),g=!s.select(Ow.prevBtnGroup.class).node(),v=s.maybeAppendByClassName(Ow.prevBtnGroup,"g").styles(h);this.prevBtnGroup=v.node();var y=v.maybeAppendByClassName(Ow.prevBtn,"path"),m=s.maybeAppendByClassName(Ow.nextBtnGroup,"g").styles(h);this.nextBtnGroup=m.node(),[y,m.maybeAppendByClassName(Ow.nextBtn,"path")].forEach((function(t){t.styles(Ce(Ce({},p),{transformOrigin:"center"})),Nb(t.node(),d,!0)}));var b=s.maybeAppendByClassName(Ow.pageInfoGroup,"g");this.pageInfoGroup=b.node(),b.maybeAppendByClassName(Ow.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=Lb(e);this.renderClipPath(a),this.renderController(a),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=U((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener($p.INSERTED,e),this.playWindow.addEventListener($p.REMOVED,e)},e}(qb);function Sw(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}tx.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"]]})),tx.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]]})),tx.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 Aw=eb({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");var Tw=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new Cg({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return Ne(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=De(jb(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=De(this.spacing,2),f=u[0],h=u[1];if(r){var d=r-n-f-h,p=De(this.span,2);c=(t=De([p[0]*d,p[1]*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=De(jb(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=De(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(Aw.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=zb(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(Aw.markerGroup,"g").style("zIndex",0),hb(!!n,this.markerGroup,(function(){var t,i=e.markerGroup.node(),o=null===(t=i.childNodes)||void 0===t?void 0:t[0],a="string"==typeof n?new tx({style:{symbol:n},className:Aw.marker.name}):n();o?a.nodeName===o.nodeName?o instanceof tx?o.update(Ce(Ce({},r),{symbol:n})):(!function(t,e){var n,r,i=e.attributes;try{for(var o=Ie(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=De(a.value,2),c=s[0],l=s[1];"id"!==c&&"className"!==c&&t.attr(c,l)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}(o,a),Lb(o).styles(r)):(o.remove(),Lb(a).attr("className",Aw.marker.name).styles(r),i.appendChild(a)):(a instanceof tx||Lb(a).attr("className",Aw.marker.name).styles(r),i.appendChild(a)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var s=Nb(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(s,")")}))},e.prototype.renderLabel=function(t){var e=zb(this.attributes,"label"),n=e.text,r=Le(e,["text"]);this.labelGroup=t.maybeAppendByClassName(Aw.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Aw.label,(function(){return fb(n)})).styles(r)},e.prototype.renderValue=function(t){var e=this,n=zb(this.attributes,"value"),r=n.text,i=Le(n,["text"]);this.valueGroup=t.maybeAppendByClassName(Aw.valueGroup,"g").style("zIndex",0),hb(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(Aw.value,(function(){return fb(r)})).styles(i)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,r=e.height,i=zb(this.attributes,"background");this.background=t.maybeAppendByClassName(Aw.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Aw.background,"rect").styles(Ce({width:n,height:r},i))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,r=t.height,i=De(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,")")}),lb(this.labelGroup.select(Aw.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(c,")")}),lb(this.valueGroup.select(Aw.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=Lb(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}(qb),Pw=eb({page:"item-page",navigator:"navigator",item:"item"},"items"),Nw=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Cw=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:st,mouseenter:st,mouseleave:st})||this;return n.navigatorShape=[0,0],n}return Ne(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=zb(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:Ce({layout:n,labelText:s,valueText:c},Object.fromEntries(Object.entries(r).map((function(n){var r=De(n,2);return[r[0],Zm(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=De(this.navigatorShape,1)[0],s=De(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,v=t.ifHorizontal(l,c),y=[Math.floor(g/v),g%v];"vertical"===n&&y.reverse();var m=De(y,2),b=m[0],x=m[1],w=(r-a-(l-1)*o)/l,k=e.getBBox().height,M=De([0,0],2),E=M[0],O=M[1];return"horizontal"===n?(E=(h=De([f,b*(k+i)],2))[0],O=h[1],f=x===l-1?0:f+w+o):(E=(d=De([x*(w+o),f],2))[0],O=d[1],f=b===c-1?0:f+k+i),{page:p,index:s,row:b,col:x,pageIndex:g,width:w,height:k,x:E,y:O}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,r=t.rowPadding,i=t.colPadding,o=De(this.navigatorShape,1)[0],a=De(this.grid,2),s=a[0],c=a[1],l=De([e-o,n],2),u=l[0],f=l[1],h=De([0,0,0,0,0,0,0,0],8),d=h[0],p=h[1],g=h[2],v=h[3],y=h[4],m=h[5],b=h[6],x=h[7];return this.pageViews.children.map((function(t,e){var n,o,a,l,h=t.getBBox(),w=h.width,k=h.height,M=0===b?0:i,E=b+M+w;return E<=u&&Nw(y,(function(t){return t<c}))?(n=De([b+M,x,E],3),d=n[0],p=n[1],b=n[2],{width:w,height:k,x:d,y:p,page:g,index:e,pageIndex:v++,row:m,col:y++}):(o=De([m+1,0,0,x+k+r],4),m=o[0],y=o[1],b=o[2],(x=o[3])+k<=f&&Nw(m,(function(t){return t<s}))?(a=De([b,x,w],3),d=a[0],p=a[1],b=a[2],{width:w,height:k,x:d,y:p,page:g,index:e,pageIndex:v++,row:m,col:y++}):(l=De([0,0,w,0,g+1,0,0,0],8),d=l[0],p=l[1],b=l[2],x=l[3],g=l[4],v=l[5],m=l[6],y=l[7],{width:w,height:k,x:d,y:p,page:g,index:e,pageIndex:v++,row:m,col:y++}))}))},Object.defineProperty(e.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var t="grid"===this.attributes.layout?this.getGridLayout:this.getFlexLayout,e=t.call(this);return e.slice(-1)[0].page>0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Sw(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(Pw.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(Pw.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);Lb(t).selectAll(Pw.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new Tw({style:e})})).attr("className",Pw.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=De(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=De(t,2);return{page:e[0],layouts:e[1]}})),i=Be([],De(this.navigator.getContainer().children),!1);r.forEach((function(t){var e=t.layouts,r=n.pageViews.appendChild(new Ig({className:Pw.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=L(e)?e.split("."):e;i.forEach((function(t,e){e<i.length-1?(w(r[t])||(r[t]=I(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=zb(this.attributes,"nav"),r=rb({orientation:e},n),i=this;return t.selectAll(Pw.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new _w({style:r})})).attr("className",Pw.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(Lb(e));this.renderItems(r.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new Np(t,{detail:e});this.dispatchEvent(n)},e}(qb),Lw=eb({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),jw={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},Rw=function(t){function e(e){return t.call(this,e,jw)||this}return Ne(e,t),e.prototype.render=function(t,e){var n=Lb(e).maybeAppendByClassName(Lw.markerGroup,"g");this.renderMarker(n);var r=Lb(e).maybeAppendByClassName(Lw.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?Sw(r,"horizontalHandle","verticalHandle"):i;hb(!!o,t,(function(t){var n=zb(e.attributes,"marker"),r=Ce({symbol:o},n);e.marker=t.maybeAppendByClassName(Lw.marker,(function(){return new tx({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;hb(r,t,(function(t){var n,r=zb(e.attributes,"label"),o=r.text,c=Le(r,["text"]),l=(null===(n=t.select(Lw.marker.class))||void 0===n?void 0:n.node().getBBox())||{},u=l.width,f=void 0===u?0:u,h=l.height,d=De(Sw(i,[0,(void 0===h?0:h)+a,"center","top"],[f+a,0,"start","middle"]),4),p=d[0],g=d[1],v=d[2],y=d[3];t.maybeAppendByClassName(Lw.label,"text").styles(Ce(Ce({},c),{x:p,y:g,text:s(o).toString(),textAlign:v,textBaseline:y}))}))},e}(qb),Iw={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},Dw=rb({},Iw,{}),Bw=rb({},Iw,$b(jw,"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"}),Fw=eb({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"),zw=function(t){function e(e){return t.call(this,e,Dw)||this}return Ne(e,t),e.prototype.renderTitle=function(t,e,n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=De(Wb(zb(this.attributes,"title")),2),s=a[0],c=a[1];this.titleGroup=t.maybeAppendByClassName(Fw.titleGroup,"g").styles(c);var l=Ce(Ce({width:e,height:n},s),{text:i?o:""});this.title=this.titleGroup.maybeAppendByClassName(Fw.title,(function(){return new ww({style:l})})).update(l)},e.prototype.renderItems=function(t,e){var n=e.x,r=e.y,i=e.width,o=e.height,a=De(Wb(zb(this.attributes,"title",!0)),2),s=a[0],c=a[1],l=Ce(Ce({},s),{width:i,height:o,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Fw.itemsGroup,"g").styles(Ce(Ce({},c),{transform:"translate(".concat(n,", ").concat(r,")")}));var u=this;this.itemsGroup.selectAll(Fw.items.class).data(["items"]).join((function(t){return t.append((function(){return new Cw({style:l})})).attr("className",Fw.items.name).each((function(){u.items=Lb(this)}))}),(function(t){return t.update(l)}),(function(t){return t.remove()}))},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().style.transform="translate(".concat(e,", ").concat(n,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,r=t.height;return e?this.title.node().getAvailableSpace():new Xm(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=bw(r),u=De(jb(a?i:0),4),f=u[0],h=u[1],d=u[2],p=u[3],g=De(jb(o),4),v=g[0],y=g[1],m=g[2],b=g[3],x=De([p+h,f+d],2),w=x[0],k=x[1],M=De([b+y,v+m],2),E=M[0],O=M[1];if("l"===l[0])return new Xm(s.x,s.y,c.width+s.width+w+E,Math.max(c.height+O,s.height));if("t"===l[0])return new Xm(s.x,s.y,Math.max(c.width+E,s.width),c.height+s.height+k+O);var _=De([e.attributes.width||c.width,e.attributes.height||c.height],2),S=_[0],A=_[1];return new Xm(c.x,c.y,S+s.width+w+E,A+s.height+k+O)}(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=Lb(e);e.style.transform="translate(".concat(a,", ").concat(c,")"),this.renderTitle(l,r,i),this.renderItems(l,this.availableSpace),this.adjustLayout()},e}(qb),$w={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},Ww=eb({background:"background",labelGroup:"label-group",label:"label"},"indicator"),Gw=function(t){function e(e){var n=t.call(this,e,$w)||this;return n.point=[0,0],n.group=n.appendChild(new Ig({})),n.isMutationObserved=!0,n}return Ne(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=De(jb(t.padding),4),r=n[0],i=n[1],o=n[2],a=n[3],s=this.label.node().getLocalBounds(),c=s.min,l=s.max,u=new Xm(c[0]-a,c[1]-r,l[0]+i-c[0]+a,l[1]+o-c[1]+r),f=this.getPath(e,u),h=zb(this.attributes,"background");this.background=Lb(this.group).maybeAppendByClassName(Ww.background,"path").styles(Ce(Ce({},h),{d:f})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,r=De(Wb(zb(this.attributes,"label")),2),i=r[0],o=r[1],a=Le(i,["text"]);(this.label=Lb(this.group).maybeAppendByClassName(Ww.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(Ww.label,(function(){return fb(e(n))})).style("text",e(n).toString()).selectAll("text").styles(a)},e.prototype.adjustLayout=function(){var t=De(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,Be([c+1,1],De(l),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=Ib.apply(void 0,Be([],De(t),!1)),r=De(t,2),i=De(r[0],2),o=i[0],a=i[1],s=De(r[1],2),c=s[0],l=s[1],u=De(n?[c-o,[o,c]]:[l-a,[a,l]],2),f=u[0],h=De(u[1],2),d=h[0],p=h[1],g=f/2,v=e*(f/Math.abs(f)),y=v/2,m=v*Math.sqrt(3)/2*.8,b=De([d,d+g-y,d+g,d+g+y,p],5),x=b[0],w=b[1],k=b[2],M=b[3],E=b[4];return n?(this.point=[k,a-m],[["L",x,a],["L",w,a],["L",k,a-m],["L",M,a],["L",E,a]]):(this.point=[o+m,k],[["L",o,x],["L",o,w],["L",o+m,k],["L",o,M],["L",o,E]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?Wm(this):$m(this)},e.prototype.bindEvents=function(){this.label.on($p.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(qb);function Hw(t,e){var n=De(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 Yw=eb({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function qw(t){var e=t.orientation,n=t.size,r=t.length;return Sw(e,[r,n],[n,r])}function Vw(t){var e=t.type,n=De(qw(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 Uw(t){return Vw(t)}function Xw(t){var e,n=t.orientation,r=t.color,i=t.block,o=t.partition;if(m(r)){e=new Array(20).fill(0).map((function(t,e,n){return r(e/(n.length-1))}))}else e=r;var a=e.length,s=e.map((function(t){return lh(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(Sw(n,"0","270"),")")):""}function Zw(t){var e=t.orientation,n=t.range;if(!n)return[];var r=De(qw(t),2),i=r[0],o=r[1],a=De(n,2),s=a[0],c=a[1],l=Sw(e,s*i,0),u=Sw(e,0,s*o),f=Sw(e,c*i,i),h=Sw(e,o,c*o);return[["M",l,u],["L",l,h],["L",f,h],["L",f,u],["Z"]]}var Kw=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 Ne(e,t),e.prototype.render=function(t,e){!function(t,e){var n=zb(e,"track");t.maybeAppendByClassName(Yw.track,"path").styles(Ce({d:Vw(e)},n))}(Lb(e).maybeAppendByClassName(Yw.trackGroup,"g"),t),function(t,e){var n=zb(e,"selection"),r=Xw(e),i=t.maybeAppendByClassName(Yw.selection,"path").styles(Ce({d:Uw(e),fill:r},n)),o=i.maybeAppendByClassName(Yw.clipPath,"path").styles({d:Zw(e)}).node();i.style("clipPath",o)}(Lb(e).maybeAppendByClassName(Yw.selectionGroup,"g"),t)},e}(qb);var Qw=function(t){function e(e){var n=t.call(this,e,Bw)||this;return n.eventToOffsetScale=new po({}),n.innerRibbonScale=new po({}),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=Hw(r.map((function(t){return t.value})),o).range,s=n.getRealSelection(a);n.showIndicator((a[0]+a[1])/2,"".concat(s[0],"-").concat(s[1])),n.dispatchIndicated(o,a)}else{var c=n.getTickValue(o);n.showIndicator(c,"".concat(n.getRealValue(c))),n.dispatchIndicated(c)}},n.onDragStart=function(t){return function(e){e.stopPropagation(),n.attributes.slidable&&(n.target=t,n.prevValue=n.getTickValue(n.getValueByCanvasPoint(e)),document.addEventListener("mousemove",n.onDragging),document.addEventListener("touchmove",n.onDragging),document.addEventListener("mouseleave",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("mouseup",n.onDragEnd),document.addEventListener("touchend",n.onDragEnd))}},n.onDragging=function(t){var e=n.target;n.updateMouse();var r=De(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 Ne(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 Xm(0,0,e,n)},e.prototype.render=function(t,e){var n=this,r=t.showLabel;this.renderTitle(Lb(e));var i=this.availableSpace,o=i.x,a=i.y,s=Lb(e).maybeAppendByClassName(Fw.contentGroup,"g").styles({transform:"translate(".concat(o,", ").concat(a,")")});hb(!!r,s.maybeAppendByClassName(Fw.labelGroup,"g").styles({zIndex:1}),(function(t){n.renderLabel(t)}));var c=s.maybeAppendByClassName(Fw.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=s.maybeAppendByClassName(Fw.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,Be([],De(t.map((function(t){return t.value}))),!1)),max:Math.max.apply(Math,Be([],De(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=De(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=De(void 0===r?[e,n]:r,2);return[i[0],i[1]]},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Sw(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=zb(this.attributes,"title"),s=Ce(Ce({},a),{width:i,height:o,text:r}),c=this;t.selectAll(Fw.title.class).data(n?[r]:[]).join((function(t){return t.append((function(){return new ww({style:s})})).attr("className",Fw.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 Xm(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 Xm(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var e=(null===(t=this.label.querySelector(Ox.labelGroup.class))||void 0===t?void 0:t.children.slice(-1)[0]).getBBox(),n=e.width,r=e.height;return this.cacheLabelBBox=new Xm(0,0,n,r),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"labelShape",{get:function(){var t=this.attributes,e=t.showLabel,n=t.labelSpacing,r=void 0===n?0:n;if(!e)return{width:0,height:0,size:0,length:0};var i=this.labelBBox,o=i.width,a=i.height;return{width:o,height:a,size:this.ifHorizontal(a,o)+r+this.labelFixedSpacing,length:this.ifHorizontal(o,a)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ribbonBBox",{get:function(){var t=this.attributes,e=t.showHandle,n=t.ribbonSize,r=this.availableSpace,i=r.width,o=r.height,a=this.labelShape,s=a.size,c=a.length,l=De(this.ifHorizontal([o,i],[i,o]),2),u=l[0],f=l[1],h=e?this.handleShape:{size:0,length:0},d=h.size,p=h.length,g=this.handleOffsetRatio,v=0,y=this.labelPosition;v=n||(["bottom","right"].includes(y)?Math.min(u-s,(u-d)/g):u*(1-g)>d?Math.max(u-s,0):Math.max((u-s-d)/g,0));var m=Math.max(p,c),b=f-m,x=De(this.ifHorizontal([b,v],[v,b]),2),w=x[0],k=x[1],M=["top","left"].includes(y)?s:0,E=De(this.ifHorizontal([m/2,M],[M,m/2]),2),O=E[0],_=E[1];return new Xm(O,_,w,k)},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=zb(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,v=p.size,y=rb({transform:"translate(".concat(h,", ").concat(d,")"),length:g,size:v,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(Fw.ribbon,(function(){return new Kw({style:y})})).update(y)},e.prototype.getHandleClassName=function(t){return"".concat(Fw.prefix("".concat(t,"-handle")))},e.prototype.renderHandles=function(){var t=this.attributes,e=t.showHandle,n=t.orientation,r=zb(this.attributes,"handle"),i=De(this.selection,2),o=i[0],a=i[1],s=Ce(Ce({},r),{orientation:n}),c=r.shape,l="basic"===(void 0===c?"slider":c)?Rw:wx,u=this;this.handlesGroup.selectAll(Fw.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(Fw.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=De(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 Xm(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=De([Math.max(e,i),Math.max(n,o)],2),s=a[0],c=a[1];return this.cacheHandleBBox=new Xm(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=De(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=De(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=zb(this.attributes,"indicator");this.indicator=t.maybeAppendByClassName(Fw.indicator,(function(){return new Gw({})})).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(Ce(Ce({},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=De([n.value,c.value],2),u=l[0],f=l[1],h=(u+f)/2;e.push(Ce(Ce({},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=De(["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=zb(this.attributes,"tick"),s=zb(this.attributes,"label"),c=s.align,l=rb(Ce({showLine:!1,showGrid:!1,showTick:r,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),$b(a,"tick"),$b(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=Ce(Ce(Ce({},l),u),{labelOverlap:[{type:"hide"}]});this.label=t.maybeAppendByClassName(Fw.label,(function(){return new Ew({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=De([0,0,0],3),l=c[0],u=c[1],f=c[2],h=null!=i?i:o;return e?(f=h,u=s,"positive"===n?"right"===a?(l=h,f=h):"bottom"===a&&(l=f):"negative"===n&&("top"===a||"left"===a)&&(l=o)):"positive"===n?"right"===a?u=h:"bottom"===a&&(l=o+s,u=r):"negative"===n&&("left"===a||"top"===a)&&(u=r),{offset:l,spacing:u,tickLength:f}},enumerable:!1,configurable:!0}),e.prototype.adjustLabel=function(){if(this.attributes.showLabel){var t=this.ribbonBBox,e=t.x,n=t.y,r=t.width,i=t.height,o=this.labelAxisStyle,a=o.offset,s=o.spacing,c=o.tickLength,l=De(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=R(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}),$m(this.indicator.node())}else this.hideIndicator()},e.prototype.hideIndicator=function(){Wm(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=De(this.selection,2),o=i[0],a=i[1],s=De([t,e],2),c=s[0],l=s[1];n&&(c+=o,l+=a);var u=this.range;r=De(function(t,e,n){var r,i=De(t,2),o=i[0],a=i[1],s=De(e,2),c=s[0],l=s[1],u=De(n,2),f=u[0],h=u[1],d=De([c,l],2),p=d[0],g=d[1],v=g-p;return p>g&&(p=(r=De([g,p],2))[0],g=r[1]),v>a-o?[o,a]:p<o?f===o&&h===g?[o,g]:[o,v+o]:g>a?h===a&&f===p?[p,a]:[a-v,a]:[p,g]}([u.min,u.max],[c,l],this.selection),2),c=r[0],l=r[1],this.update({defaultValue:[c,l]}),this.dispatchSelection()},Object.defineProperty(e.prototype,"step",{get:function(){var t=this.attributes.step,e=void 0===t?1:t,n=this.range,r=n.min,i=n.max;return Y(e)?Ob(.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?Hw(n.map((function(t){return t.value})),t).tick:function(t,e,n){return n+Math.round((t-n)/e)*e}(t,this.step,i)},e.prototype.getValueByCanvasPoint=function(t){var e=this.range,n=e.min,r=e.max,i=De(this.ribbon.node().getPosition(),2),o=i[0],a=i[1],s=this.ifHorizontal(o,a),c=this.ifHorizontal.apply(this,Be([],De(ub(t)),!1))-s;return R(this.getOffset(c,!0),n,r)},e.prototype.getOffset=function(t,e){void 0===e&&(e=!1);var n=this.range,r=n.min,i=n.max,o=this.ribbonShape.length,a=this.eventToOffsetScale;return a.update({domain:[r,i],range:[0,o]}),e?a.invert(t):a.map(t)},e.prototype.getRealSelection=function(t){var e=this.range.max,n=De(t,2),r=n[0],i=n[1];return this.ifHorizontal([r,i],[e-i,e-r])},e.prototype.getRealValue=function(t){var e=this.range.max;return this.ifHorizontal(t,e-t)},e.prototype.dispatchSelection=function(){var t=this.getRealSelection(this.selection),e=new Np("valuechange",{detail:{value:t}});this.dispatchEvent(e)},e.prototype.dispatchIndicated=function(t,e){var n=this,r=this.range.max,i=this.ifHorizontal((function(){return{value:t,range:e}}),(function(){return{value:r-t,range:e?n.getRealSelection(e):void 0}})),o=new Np("indicate",{detail:i});this.dispatchEvent(o)},e}(qb);function Jw(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 tk={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function ek(t){var e;void 0===t&&(t="");var n=Jw(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)]=Ce({flex:1},tk),e[".".concat(n.VALUE)]=Ce({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},tk),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 nk=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=Jw(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:ek(o)})||this).timestamp=-1,i.prevCustomContentKey=i.attributes.contentKey,i.initShape(),i.render(i.attributes,i),i}return Ne(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map((function(t,e){var r=t.name,i=void 0===r?"":r,o=t.color,a=void 0===o?"black":o,s=t.index,c=Le(t,["name","color","index"]),l=Ce({name:i,color:a,index:null!=s?s:e},c);return On(function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t}(n.item,l))}))},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var r=function(){n.attributes.x=null!=t?t:n.attributes.x,n.attributes.y=null!=e?e:n.attributes.y,n.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(r):r()}this.element.style.visibility="visible"},e.prototype.hide=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.attributes.enterable&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=On(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:Hb(this.element,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=Jw(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,Hb(f,u);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=De(e,2),r=n[0],i=n[1];Be([t],De(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=De(l,2),n=e[0],i=e[1],a=De(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=De(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=De(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=De([+o+n,+a+r],2),d=h[0],p=h[1],g={left:"right",right:"left",top:"bottom",bottom:"top"},v=s.x,y=s.y,m={left:d<v,right:d+u>v+s.width,top:p<y,bottom:p+f>y+s.height},b=[];c.split("-").forEach((function(t){m[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 Xm(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}(qb),rk=function(t){function e(e){var n=t.call(this,e)||this;n.layoutEvents=[$p.BOUNDS_CHANGED,$p.INSERTED,$p.REMOVED],n.$margin=jb(0),n.$padding=jb(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 Ne(e,t),Object.defineProperty(e.prototype,"margin",{get:function(){return this.$margin},set:function(t){this.$margin=jb(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"padding",{get:function(){return this.$padding},set:function(t){this.$padding=jb(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=De(this.$margin,4),c=s[0],l=s[1],u=s[2],f=s[3];return new Xm(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=De(this.$padding,4),i=r[0],o=r[1],a=r[2],s=r[3],c=De(this.$margin,4),l=c[0],u=c[3];return new Xm(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:vb,grid:yb},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&&(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}(Ig);function ik(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]}const ok=Py((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:v,coordCenter:y,innerHTML:m}=e,b=Le(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=>!I(t))))return void t.children.forEach((t=>t.remove()));const x=Qo(b,"background"),{padding:w}=x,k=Le(x,["padding"]),M=Qo(b,"connector"),{points:E=[]}=M,O=Le(M,["points"]);let _;_=m?uy(t).maybeAppend("html","html",n).style("zIndex",0).style("innerHTML",m).call(py,Object.assign({transform:a,transformOrigin:s},b)).node():uy(t).maybeAppend("text","text").style("zIndex",0).style("text",h).call(py,Object.assign({textBaseline:"middle",transform:a,transformOrigin:s},b)).node();const S=uy(t).maybeAppend("background","rect").style("zIndex",-1).call(py,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}}(_,w)).call(py,d?k:{}).node(),A=function(t,e,n,r,i=!0,o=!0){const a=t=>kc()(t);if(!e[0]&&!e[1])return a([ik(t),e]);if(!n.length)return a([[0,0],e]);const[s,c]=n,l=[...c],u=[...s];if(c[0]!==s[0]){const t=i?-4:4;l[1]=c[1],o&&!i&&(l[0]=Math.max(s[0],c[0]-t),c[1]<s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.max(u[0],l[0]-t))),o||i||(l[0]=Math.max(s[0],c[0]-t),c[1]>s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.max(u[0],l[0]-t))),!o&&i&&(l[0]=Math.min(s[0],c[0]-t),c[1]>s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.min(u[0],l[0]-t))),o&&i&&(l[0]=Math.min(s[0],c[0]-t),c[1]<s[1]?u[1]=l[1]:(u[1]=s[1],u[0]=Math.min(u[0],l[0]-t)))}return a([c,l,u,s,e])}(S,[+u-+c,+f-+l],E,0,+u<y[0],+f<y[1]),T=g&&new tx({id:"startMarker",style:Object.assign({x:0,y:0},Qo(b,"startMarker"))}),P=v&&new tx({id:"endMarker",style:Object.assign({x:0,y:0},Qo(b,"endMarker"))});uy(t).maybeAppend("connector","path").style("zIndex",0).style("d",A).style("markerStart",T).style("markerEnd",P).call(py,p?O:{})})),ak=(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 uy(new ok).style("x",f).style("y",h).call(py,i).style("transform",`${l}rotate(${+c})`).style("coordCenter",n.getCenter()).call(py,u).call(py,t).node()}};ak.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const sk=Py((t=>{const e=Le(t.attributes,["class","x","y","transform"]),n=Qo(e,"marker"),{size:r=24}=n,i=()=>function(t){const e=t/Math.sqrt(2),n=t*Math.sqrt(2),[r,i]=[-e,e-n],[o,a]=[0,0],[s,c]=[e,e-n];return[["M",r,i],["A",t,t,0,1,1,s,c],["L",o,a],["Z"]]}(r/2),o=uy(t).maybeAppend("marker",(()=>new tx({}))).call((t=>t.node().update(Object.assign({symbol:i},n)))).node(),[a,s]=function(t){const{min:e,max:n}=t.getLocalBounds();return[.5*(e[0]+n[0]),.5*(e[1]+n[1])]}(o);uy(t).maybeAppend("text","text").style("x",a).style("y",s).call(py,e)})),ck=(t,e)=>{const n=Le(t,[]);return(t,e,r)=>{const{color:i}=r,o=Le(r,["color"]),{color:a=i,text:s=""}=e,c={text:String(s),stroke:a,fill:a},[[l,u]]=t;return uy(new sk).call(py,o).style("transform",`translate(${l},${u})`).call(py,c).call(py,n).node()}};ck.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const lk=(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 uy(new Zg).style("x",f).style("y",h).call(py,i).style("transformOrigin","center center").style("transform",`${l}rotate(${c}deg)`).style("coordCenter",n.getCenter()).call(py,u).call(py,t).node()}};lk.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const uk=Py((t=>{const{areaPath:e,connectPath:n,areaStyle:r,connectStyle:i}=t.attributes,o=t.ownerDocument;uy(t).maybeAppend("connect-path",(()=>o.createElement("path",{}))).style("d",n).call(py,i),uy(t).maybeAppend("area-path",(()=>o.createElement("path",{}))).style("d",e).call(py,r)})),fk=(t,e)=>{const{curve:n,gradient:r=!1,defined:i=t=>!Number.isNaN(t)&&null!=t,connect:o=!1}=t,a=Le(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=Kc(s),v=xy(s,e),y=r&&h?vy(h,d,p,r,void 0,g):f,m=Object.assign(Object.assign(Object.assign(Object.assign({},l),{stroke:y,fill:y}),v&&{transform:v}),a),[b,x]=function(t,e){const n=[],r=[],i=[];let o=!1,a=null;const s=t.length/2;for(let c=0;c<s;c++){const l=t[c],u=t[c+s];if([...l,...u].some((t=>!e(t))))o=!0;else{if(n.push(l),r.push(u),o&&a){o=!1;const[t,e]=a;i.push([t,l,e,u])}a=[l,u]}}return[n.concat(r),i]}(t,i),w=Qo(m,"connect"),k=!!x.length,M=t=>uy(c.createElement("path",{})).style("d",t||"").call(py,m).node();if(Qc(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=Mc().curve(Ec),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 Sc(n())},delete t.lineX0,t.lineEndAngle=function(){return Sc(r())},delete t.lineX1,t.lineInnerRadius=function(){return Sc(i())},delete t.lineY0,t.lineOuterRadius=function(){return Sc(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(_c(t)):e()._curve},t}().angle(((t,n)=>Ps(_s(r[n],e)))).outerRadius(((t,n)=>As(r[n],e))).innerRadius(((t,n)=>As(o[n],e))).defined(((t,e)=>[...r[e],...o[e]].every(i))).curve(n)(o)};return!k||o&&!Object.keys(w).length?M(e(b)):k&&!o?M(e(t)):uy(new uk).style("areaStyle",m).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}{const e=t=>{const e=t.slice(0,t.length/2),r=t.slice(t.length/2);return g?Mc().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):Mc().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!k||o&&!Object.keys(w).length?M(e(b)):k&&!o?M(e(t)):uy(new uk).style("areaStyle",m).style("connectStyle",Object.assign(Object.assign({},w),a)).style("areaPath",e(t)).style("connectPath",x.map(e).join("")).node()}}};fk.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hk=(t,e)=>{const{coordinate:n}=e;return(...r)=>{const i=Qc(n)?Dc:bc;return fk(Object.assign({curve:i},t),e)(...r)}};hk.props=Object.assign(Object.assign({},fk.props),{defaultMarker:"square"});const dk=(t,e)=>{const n=Le(t,[]),{coordinate:r}=e;return(...t)=>{const i=Qc(r)?Rc:Kc(r)?qc:Yc;return fk(Object.assign({curve:i},n),e)(...t)}};dk.props=Object.assign(Object.assign({},fk.props),{defaultMarker:"smooth"});const pk=(t,e)=>(...n)=>fk(Object.assign({curve:Uc},t),e)(...n);pk.props=Object.assign(Object.assign({},fk.props),{defaultMarker:"hvh"});const gk=(t,e)=>(...n)=>fk(Object.assign({curve:Xc},t),e)(...n);gk.props=Object.assign(Object.assign({},fk.props),{defaultMarker:"vh"});const vk=(t,e)=>(...n)=>fk(Object.assign({curve:Zc},t),e)(...n);vk.props=Object.assign(Object.assign({},fk.props),{defaultMarker:"hv"});const yk=(t,e)=>{const{arrow:n=!1}=t;return(...r)=>Fm(Object.assign(Object.assign({},t),{arrow:n}),e)(...r)};yk.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const mk=(t,e)=>{const n=Le(t,[]),{document:r}=e;return(t,e,i)=>{const{color:o}=i,a=Le(i,["color"]),{color:s=o,transform:c}=e,[l,u]=t,f=cc();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]),uy(r.createElement("path",{})).call(py,a).style("d",f.toString()).style("stroke",s).style("transform",c).call(py,n).node()}};function bk(t,e,n,r){const i=cc();if(Qc(n)){const o=n.getCenter(),a=As(t,o),s=(As(e,o)-a)*r+a;return i.moveTo(t[0],t[1]),gy(i,t,e,o,s),i.lineTo(e[0],e[1]),i}return Kc(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)}mk.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xk=(t,e)=>{const{cornerRatio:n=1/3}=t,r=Le(t,["cornerRatio"]),{coordinate:i,document:o}=e;return(t,e,a)=>{const{defaultColor:s}=a,c=Le(a,["defaultColor"]),{color:l=s,transform:u}=e,[f,h]=t,d=bk(f,h,i,n);return uy(o.createElement("path",{})).call(py,c).style("d",d.toString()).style("stroke",l).style("transform",u).call(py,r).node()}};xk.props={defaultMarker:"vhv",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const wk=(t,e)=>{const n=Le(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Le(o,["color"]),{color:c=a,transform:l}=e,[u,f]=t,h=cc();if(h.moveTo(u[0],u[1]),Qc(r)){const t=r.getCenter();h.quadraticCurveTo(t[0],t[1],f[0],f[1])}else{gy(h,u,f,Ls(u,f),As(u,f)/2)}return uy(i.createElement("path",{})).call(py,s).style("d",h.toString()).style("stroke",c).style("transform",l).call(py,n).node()}};function kk(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 Mk(t={}){return[...kk(t),{name:"title",scale:"identity"}]}function Ek(){return[{type:Oa,channel:"color"},{type:Ba,channel:["x","y"]}]}function Ok(){return[{type:Oa,channel:"x"},{type:Ba,channel:["y"]}]}function _k(t={}){return kk(t)}function Sk(){return[{type:Pa}]}function Ak(t,e){return t.getBandWidth(t.invert(e))}function Tk(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?Ak(a,r[e]):0,l=d?Ak(s,i[e]):0,g=p&&o?(Ak(c,o[e])/2+ +o[e])*n:0,[v,y]=t;return[v+u*n+g,y+f*l]}:t=>t}function Pk(t){return parseFloat(t)/100}function Nk(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?Pk(e)*a:+e,"string"==typeof n?Pk(n)*s:+n]]}));return[t,c]}function Ck(t){return"function"==typeof t?t:e=>e[t]}function Lk(t,e){return Array.from(t,Ck(e))}function jk(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=Lk(o,n),c=Lk(o,r),l=Lk(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})))}}wk.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Rk=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Le(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,[v,y]=n.getSize();h="string"==typeof h?Pk(h)*v:h,d="string"==typeof d?Pk(d)*y:d;const m=p-Number(h)/2,b=g-Number(d)/2;return uy(r.createElement("image",{})).call(py,s).style("x",m).style("y",b).style("src",l).style("stroke",c).style("transform",f).call(py,t).style("width",h).style("height",d).node()}};function Ik(t,e){const n=cc();if(Qc(e)){const r=e.getCenter(),i=[...t,t[0]],o=i.map((t=>As(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?gy(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)}Rk.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Dk=(t,e)=>{const{coordinate:n,document:r}=e;return(e,i,o)=>{const{color:a}=o,s=Le(o,["color"]),{color:c=a,transform:l}=i,u=Ik(e,n);return uy(r.createElement("path",{})).call(py,s).style("d",u.toString()).style("stroke",c).style("fill",c).style("transform",l).call(py,t).node()}};function Bk(t,e){const[n,r,i,o]=t,a=cc();if(Qc(e)){const t=e.getCenter(),s=As(t,n);return a.moveTo(n[0],n[1]),a.quadraticCurveTo(t[0],t[1],i[0],i[1]),gy(a,i,o,t,s),a.quadraticCurveTo(t[0],t[1],r[0],r[1]),gy(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}Dk.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Fk=(t,e)=>{const n=Le(t,[]),{coordinate:r,document:i}=e;return(t,e,o)=>{const{color:a}=o,s=Le(o,["color"]),{color:c=a,transform:l}=e,u=Bk(t,r);return uy(i.createElement("path",{})).call(py,s).style("d",u.toString()).style("fill",c||a).style("stroke",c||a).style("transform",l).call(py,n).node()}};function zk(t,e){const n=cc();if(Qc(e)){const r=e.getCenter(),[i,o]=r,a=Ts(_s(t[0],r)),s=Ts(_s(t[1],r)),c=As(r,t[2]),l=As(r,t[3]),u=As(r,t[8]),f=As(r,t[10]),h=As(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}Fk.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const $k=(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=Le(o,["color","fill","stroke"]),h=zk(e,n);return uy(r.createElement("path",{})).call(py,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(py,t).node()}};function Wk(t,e,n=4){const r=cc();if(!Qc(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=As(i,t[3]),c=As(i,t[8]),l=As(i,t[10]),u=Ts(_s(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}$k.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Gk=(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=Le(o,["color","fill","stroke"]),h=Wk(e,n,4);return uy(r.createElement("path",{})).call(py,f).style("d",h.toString()).style("stroke",u).style("fill",a||l).style("transform",s).call(py,t).node()}};Gk.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Hk=(t,e)=>{const{arrow:n,arrowSize:r=4}=t,i=Le(t,["arrow","arrowSize"]),{coordinate:o,document:a}=e;return(t,e,s)=>{const{color:c,lineWidth:l}=s,u=Le(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},Qo(i,"arrow"))):null,p=function(t,e){if(!Qc(e))return kc().x((t=>t[0])).y((t=>t[1]))(t);const n=e.getCenter();return vc()({startAngle:0,endAngle:2*Math.PI,outerRadius:As(t[0],n),innerRadius:As(t[1],n)})}(t,o),g=function(t,e){if(!Qc(t))return e;const[n,r]=t.getCenter();return`translate(${n}, ${r}) ${e||""}`}(o,e.transform);return uy(a.createElement("path",{})).call(py,u).style("d",p).style("stroke",f).style("lineWidth",h).style("transform",g).style("markerEnd",d).call(py,i).node()}};function Yk(t,e,n){return[["M",t,e],["L",t+2*n,e-n],["L",t+2*n,e+n],["Z"]]}Hk.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const qk=(t,e)=>{const{offsetX:n=0,sourceOffsetX:r=n,targetOffsetX:i=n,offsetY:o=0,sourceOffsetY:a=o,targetOffsetY:s=o,connectLength1:c,endMarker:l=!0}=t,u=Le(t,["offsetX","sourceOffsetX","targetOffsetX","offsetY","sourceOffsetY","targetOffsetY","connectLength1","endMarker"]),{coordinate:f}=e;return(t,e,n)=>{const{color:o,connectLength1:h}=n,d=Le(n,["color","connectLength1"]),{color:p,transform:g}=e,v=function(t,e,n,r,i,o,a=0){const[[s,c],[l,u]]=e;if(Kc(t)){const t=s+n,e=t+a,f=c+i,h=u+o;return[[t,f],[e,f],[e,h],[l+r,h]]}const f=c-n,h=f-a,d=s-i,p=l-o;return[[d,f],[d,h],[p,h],[p,u-r]]}(f,t,a,s,r,i,null!=c?c:h),y=Qo(Object.assign(Object.assign({},u),n),"endMarker");return uy(new Gg).call(py,d).style("d",function(t){return kc().x((t=>t[0])).y((t=>t[1]))(t)}(v)).style("stroke",p||o).style("transform",g).style("markerEnd",l?new tx({className:"marker",style:Object.assign(Object.assign({},y),{symbol:Yk})}):null).call(py,u).node()}};function Vk(t,e,n,r){const{bounds:i}=n,[[o,a],[s,c]]=i,l=s-o,u=c-a,f=t=>{const{x:e,y:r}=t,i=ea(n.x,l),s=ea(n.y,u);return Object.assign(Object.assign({},t),{x:(i||e)+o,y:(s||r)+a})};return f("left"===t?{x:0,y:u/2,textAlign:"start",textBaseline:"middle"}:"right"===t?{x:l,y:u/2,textAlign:"end",textBaseline:"middle"}:"top"===t?{x:l/2,y:0,textAlign:"center",textBaseline:"top"}:"bottom"===t?{x:l/2,y:u,textAlign:"center",textBaseline:"bottom"}:"top-left"===t?{x:0,y:0,textAlign:"start",textBaseline:"top"}:"top-right"===t?{x:l,y:0,textAlign:"end",textBaseline:"top"}:"bottom-left"===t?{x:0,y:u,textAlign:"start",textBaseline:"bottom"}:"bottom-right"===t?{x:l,y:u,textAlign:"end",textBaseline:"bottom"}:{x:l/2,y:u/2,textAlign:"center",textBaseline:"middle"})}function Uk(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s}=n,c=r.getCenter(),l=my(r,e,[i,o]),{innerRadius:u,outerRadius:f,startAngle:h,endAngle:d}=l,p="inside"===t?(h+d)/2:d,g=Zk(p,a,s),v=(()=>{const[n,r]=e,i=u+.5*(f-u),[o,a]="inside"===t?Xk(c,p,i):Ls(n,r);return{x:o,y:a}})();return Object.assign(Object.assign({},v),{textAlign:"inside"===t?"center":"start",textBaseline:"middle",rotate:g})}function Xk(t,e,n){return[t[0]+Math.sin(e)*n,t[1]-Math.cos(e)*n]}function Zk(t,e,n){if(!e)return 0;const r=n?0:Math.sin(t)<0?90:-90;return t/Math.PI*180+r}function Kk(t,e,n,r){const{y:i,y1:o,autoRotate:a,rotateToAlignArc:s,radius:c=.5,offset:l=0}=n,u=my(r,e,[i,o]),{startAngle:f,endAngle:h}=u,d=r.getCenter(),p=(f+h)/2,g={textAlign:"center",textBaseline:"middle",rotate:Zk(p,a,s)},{innerRadius:v,outerRadius:y}=u,m=v+(y-v)*c+l,[b,x]=Xk(d,p,m);return Object.assign({x:b,y:x},g)}function Qk(t){return void 0===t?null:t}function Jk(t,e,n,r){const{bounds:i}=n,[o]=i;return{x:Qk(o[0]),y:Qk(o[1])}}function tM(t,e,n,r){const{bounds:i}=n;if(1===i.length)return Jk(0,0,n);return(Jc(r)?Uk:rl(r)?Kk:Vk)(t,e,n,r)}function eM(t,e,n){const r=my(n,t,[e.y,e.y1]),{innerRadius:i,outerRadius:o}=r;return i+(o-i)}function nM(t,e,n){const r=my(n,t,[e.y,e.y1]),{startAngle:i,endAngle:o}=r;return(i+o)/2}function rM(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=nM(e,n,r),d=Math.sin(h)>0?1:-1,p=Zk(h,i,o),g={textAlign:d>0||Jc(r)?"start":"end",textBaseline:"middle",rotate:p},v=eM(e,n,r),y=v+(s?c:a),[[m,b],[x,w],[k,M]]=function(t,e,n,r,i){const[o,a]=Xk(t,e,n),[s,c]=Xk(t,e,r);return[[o,a],[s,c],[s+(Math.sin(e)>0?1:-1)*i,c]]}(f,h,v,y,s?l:0),E=s?+u*d:0,O=k+E,_={connector:s,connectorPoints:[[x-O,w-M],[k-O,M-M]]};return Object.assign(Object.assign({x0:m,y0:b,x:k+E,y:M},g),_)}function iM(t,e={}){const{labelHeight:n=14,height:r}=e,i=ir(t,(t=>t.y)),o=i.length,a=new Array(o);for(let t=0;t<o;t++){const e=i[t],{y:r}=e;a[t]={y:r,y1:r+n,labels:[r]}}let s=!0;for(;s;){s=!1;for(let t=a.length-1;t>0;t--){const e=a[t],n=a[t-1];if(n.y1>e.y){s=!0,n.labels.push(...e.labels),a.splice(t,1),n.y1+=e.y1-e.y;const i=n.y1-n.y;n.y1=Math.max(Math.min(n.y1,r),i),n.y=n.y1-i}}}let c=0;for(const t of a){const{y:e,labels:r}=t;let o=e-n;for(const t of r){const e=i[c++],r=o+n-t;e.connectorPoints[0][1]-=r,e.y=o+n,o+=n}}}function oM(t,e){const n=ir(t,(t=>t.y)),{height:r,labelHeight:i=14}=e,o=Math.ceil(r/i);if(n.length<=o)return iM(n,e);const a=[];for(let t=0;t<n.length;t++)t<n.length-o?(n[t].opacity=0,n[t].connector=!1):a.push(n[t]);iM(a,e)}qk.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const aM=new WeakMap;var sM=Object.freeze({__proto__:null,area:function(t,e,n,r){const i=e.length/2,o=e.slice(0,i),a=e.slice(i);let s=yr(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=Ts(_s(c(s+1),u))/Math.PI*180;return{x:l[0],y:l[1],transform:`rotate(${f})`,textAlign:"center",textBaseline:"middle"}},bottom:tM,bottomLeft:tM,bottomRight:tM,inside:tM,left:tM,outside:function(t,e,n,r){const{bounds:i}=n;return 1===i.length?Jk(0,0,n):(Jc(r)?Uk:rl(r)?rM:Vk)(t,e,n,r)},right:tM,spider:function(t,e,n,r,i,o){if(!rl(r))return{};if(aM.has(e))return aM.get(e);const a=o.map((t=>function(t,e,n){const{connectorLength:r,connectorLength2:i,connectorDistance:o}=e,a=Le(rM(0,t,e,n),[]),s=n.getCenter(),c=eM(t,e,n),l=nM(t,e,n),u=c+r+i,f=Math.sin(l)>0?1:-1,h=s[0]+(u+ +o)*f,{x:d}=a,p=h-d;return a.x+=p,a.connectorPoints[0][0]-=p,a}(t,n,r))),{width:s,height:c}=r.getOptions(),l=a.filter((t=>t.x<s/2)),u=a.filter((t=>t.x>=s/2)),f=Object.assign(Object.assign({},i),{height:c});return oM(l,f),oM(u,f),a.forEach(((t,e)=>aM.set(o[e],t))),aM.get(e)},surround:function(t,e,n,r){if(!rl(r))return{};const{connectorLength:i,connectorLength2:o,connectorDistance:a}=n,s=Le(rM(0,e,n,r),[]),{x0:c,y0:l}=s,u=r.getCenter(),f=function(t){if(rl(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=Ps([c-u[0],l-u[1]]),p=Math.sin(d)>0?1:-1,[g,v]=Xk(u,d,h);return s.x=g+(o+a)*p,s.y=v,s},top:tM,topLeft:tM,topRight:tM});function cM(t,e,n,r,i,o){const{position:a}=e,{render:s}=i,c=function(t,e){return void 0!==t?t:rl(e)?"inside":Kc(e)?"right":"top"}(a,n),l=r[s?"htmlLabel":"inside"===c?"innerLabel":"label"],u=Object.assign({},l,e),f=sM[pm(c)];if(!f)throw new Error(`Unknown position: ${c}`);return Object.assign(Object.assign({},l),f(c,t,u,n,i,o))}const lM=(t,e)=>{const{coordinate:n,theme:r}=e,{render:i}=t;return(e,o,a,s)=>{const{text:c,x:l,y:u,transform:f="",transformOrigin:h,className:d=""}=o,p=Le(o,["text","x","y","transform","transformOrigin","className"]),g=cM(e,o,n,r,t,s),{rotate:v=0,transform:y=""}=g,m=Le(g,["rotate","transform"]);return uy(new ok).call(py,m).style("text",`${c}`).style("className",`${d} g2-label`).style("innerHTML",i?i(c,o.datum,o.index):void 0).style("labelTransform",`${y} rotate(${+v}) ${f}`.trim()).style("labelTransformOrigin",h).style("coordCenter",n.getCenter()).call(py,p).node()}};lM.props={defaultMarker:"point"};const uM=(t,e)=>{const{arrow:n,colorAttribute:r}=t,i=Le(t,["arrow","colorAttribute"]),{coordinate:o,document:a}=e;return(t,e,n)=>{const{color:s,stroke:c}=n,l=Le(n,["color","stroke"]),{d:u,color:f=s}=e,[h,d]=o.getSize();return uy(a.createElement("path",{})).call(py,l).style("d","function"==typeof u?u({width:h,height:d}):u).style(r,f).call(py,i).node()}};uM.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const fM=(t,e)=>uM(Object.assign({colorAttribute:"fill"},t),e);fM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const hM=(t,e)=>uM(Object.assign({fill:"none",colorAttribute:"stroke"},t),e);hM.props={defaultMarker:"hvh",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const dM=(t,e)=>{const{document:n}=e;return(e,r,i)=>{const{transform:o}=r,{color:a}=i,s=Le(i,["color"]),{color:c=a}=r,[l,...u]=e,f=cc();return f.moveTo(...l),u.forEach((([t,e])=>{f.lineTo(t,e)})),f.closePath(),uy(n.createElement("path",{})).call(py,s).style("d",f.toString()).style("stroke",c||a).style("fill",c||a).style("fillOpacity",.4).style("transform",o).call(py,t).node()}};function pM(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 gM(t,e=(...t)=>`${t[0]}`,n=16){const r=pM(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)}}function vM(t,e,n){const r=t?t():document.createElement("canvas");return r.width=e,r.height=n,r}dM.props={defaultMarker:"square",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"},pM(3);const yM=gM(((t,e,n)=>{const r=vM(n,2*t,2*t),i=r.getContext("2d"),o=t,a=t;if(1===e)i.beginPath(),i.arc(o,a,t,0,2*Math.PI,!1),i.fillStyle="rgba(0,0,0,1)",i.fill();else{const n=i.createRadialGradient(o,a,t*e,o,a,t);n.addColorStop(0,"rgba(0,0,0,1)"),n.addColorStop(1,"rgba(0,0,0,0)"),i.fillStyle=n,i.fillRect(0,0,2*t,2*t)}return r}),(t=>`${t}`));function mM(t,e,n,r,i,o,a){const s=Object.assign({blur:.85,minOpacity:0,opacity:.6,maxOpacity:1,gradient:[[.25,"rgb(0,0,255)"],[.55,"rgb(0,255,0)"],[.85,"yellow"],[1,"rgb(255,0,0)"]]},o);s.minOpacity*=255,s.opacity*=255,s.maxOpacity*=255;const c=vM(a,t,e).getContext("2d"),l=function(t,e){const n=vM(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=yM(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=vM(a,t,e).getContext("2d");return f.putImageData(u,0,0),f}const bM=(t,e)=>{const{gradient:n,opacity:r,maxOpacity:i,minOpacity:o,blur:a,useGradientOpacity:s}=t,c=Le(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(),v=t.map((t=>({x:t[0],y:t[1],value:t[2],radius:t[3]}))),y=mr(t,(t=>t[2])),m=vr(t,(t=>t[2])),b=p&&g?mM(p,g,y,m,v,function(t,e){return Object.keys(t).reduce(((n,r)=>{const i=t[r];return e(i,r)||(n[r]=i),n}),{})}({gradient:n,opacity:r,minOpacity:o,maxOpacity:i,blur:a,useGradientOpacity:s},(t=>void 0===t)),u):{canvas:null};return uy(f.createElement("image",{})).call(py,h).style("x",0).style("y",0).style("width",p).style("height",g).style("src",b.canvas.toDataURL()).style("transform",d).call(py,c).node()}};bM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const xM=(t,e)=>{const{render:n}=t,r=Le(t,["render"]);return t=>{const[[i,o]]=t;return n(Object.assign(Object.assign({},r),{x:i,y:o}),e)}};xM.props={defaultMarker:"point",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};function wM(t,e,n){return t+(e-t)*n}function kM(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 MM(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=kM(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}const EM={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 `}},OM=(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=Le(i,["background","outline","wave"]),{border:f=2,distance:h=0}=c,d=Le(c,["border","distance"]),{length:p=192,count:g=3}=l;return(t,r,i)=>{const{document:c}=e.canvas,{color:l,fillOpacity:v}=i,y=Object.assign(Object.assign({fill:l},i),u),b=c.createElement("g",{}),[x,w]=n.getCenter(),k=n.getSize(),M=Math.min(...k)/2,E=m(o)?o:((t="circle")=>EM[t]||EM.circle)(o),O=E(x,w,M,...k);if(Object.keys(s).length){const t=c.createElement("path",{style:Object.assign({d:O,fill:"#fff"},s)});b.appendChild(t)}if(a>0){const t=c.createElement("path",{style:{d:O}});b.appendChild(t),b.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 p=r<=1?1:i/(r-1),g=MM(s,a+s*n,c,0,s/40,t,e),v=u.createElement("path",{style:{d:g,fill:f,opacity:wM(.2,.9,p)*Number(d||h)}});o.appendChild(v);try{if(!1===l)return;const t=[{transform:"translate(0, 0)"},{transform:`translate(${2*c}, 0)`}];v.animate(t,{duration:2*wM(2500,5e3,p),iterations:1/0})}catch(t){console.warn("off-screen group animate error!")}}}(x,w,1-a,g,y,b,t.getBBox().y,2*M,p,!0,c)}const _=c.createElement("path",{style:{d:O,fill:"transparent",lineWidth:f+2*h,stroke:"#fff"}}),S=c.createElement("path",{style:Object.assign(Object.assign(Object.assign({d:O,stroke:l,strokeOpacity:v,lineWidth:f},y),d),{fill:"transparent"})});return b.appendChild(_),b.appendChild(S),b}};OM.props={};const _M=(t,e)=>Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))/2,SM=(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=_M(n[0],n[1]),f=2*_M(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),ot(t,["shape","last","first"])),{fill:s||o.color})});return l.appendChild(h),l}};function AM(t,e){return t.getBandWidth(t.invert(e))}const TM={rect:Ey,hollow:Oy,funnel:Sy,pyramid:Ty},PM=()=>(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=AM(l,i[t]),n=e*(u?AM(u,null==s?void 0:s[t]):1),c=(+(null==s?void 0:s[t])||0)*e,f=+i[t]+c,[h,p]=d(f,n,t),g=+o[t],v=+a[t];return[[h,g],[p,g],[p,v],[h,v]].map((t=>r.map(t)))}));return[t,p]};PM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:TM,channels:[...Mk({shapes:Object.keys(TM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"},{name:"size"}],preInference:[...Sk(),{type:jn},{type:_a}],postInference:[...Ok()],interaction:{shareTooltip:!0}};const NM={rect:Ey,hollow:Oy},CM=()=>(t,e,n,r)=>{const{x:i,x1:o,y:a,y1:s}=n,c=Array.from(t,(t=>[[+i[t],+a[t]],[+o[t],+a[t]],[+o[t],+s[t]],[+i[t],+s[t]]].map((t=>r.map(t)))));return[t,c]};CM.props={defaultShape:"rect",defaultLabelShape:"label",composite:!1,shape:NM,channels:[...Mk({shapes:Object.keys(NM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Sk(),{type:jn}],postInference:[...Ok()],interaction:{shareTooltip:!0}};const LM={line:Ly,smooth:jy,hv:Ry,vh:Iy,hvh:Dy,trail:Fy},jM=(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(Jn(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]},RM=(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.");Qc(r)&&i.push(i[0]);const o=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}));return[t,o]},IM=()=>(t,e,n,r)=>(el(r)?RM:jM)(t,e,n,r);IM.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:LM,channels:[...Mk({shapes:Object.keys(LM)}),{name:"x"},{name:"y"},{name:"position",independent:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Sk(),{type:Ga},{type:Na}],postInference:[...Ok(),{type:Oa,channel:"color"},{type:Ba,channel:["position"]}],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const DM={hollow:xm,hollowDiamond:mm,hollowHexagon:bm,hollowSquare:wm,hollowTriangleDown:Mm,hollowTriangle:km,hollowBowtie:ym,hollowCircle:_m,point:jm,plus:Lm,diamond:Tm,square:Rm,triangle:Dm,hexagon:Pm,cross:Am,bowtie:Sm,hyphen:Nm,line:Cm,tick:Im,triangleDown:Bm,circle:Om},BM=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=Tk(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]},v=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,v]};BM.props={defaultShape:"hollow",defaultLabelShape:"label",composite:!1,shape:DM,channels:[...Mk({shapes:Object.keys(DM)}),{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:[...Sk(),{type:_a},{type:Sa}],postInference:[{type:Ta},...Ek()]};const FM={text:ak,badge:ck,tag:lk},zM=t=>{const{cartesian:e=!1}=t;return e?Nk:(e,n,r,i)=>{const{x:o,y:a}=r,s=Tk(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};zM.props={defaultShape:"text",defaultLabelShape:"label",composite:!1,shape:FM,channels:[...Mk({shapes:Object.keys(FM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"text",scale:"identity"},{name:"fontSize",scale:"identity"},{name:"rotate",scale:"identity"}],preInference:[...Sk(),{type:Wa},{type:za}],postInference:[...Ek()]};const $M={cell:Ey,hollow:Oy},WM=()=>(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]};WM.props={defaultShape:"cell",defaultLabelShape:"label",shape:$M,composite:!1,channels:[...Mk({shapes:Object.keys($M)}),{name:"x",required:!0,scale:"band"},{name:"y",required:!0,scale:"band"}],preInference:[...Sk(),{type:_a},{type:Sa},{type:Fa}],postInference:[...Ek()]};const GM={area:hk,smooth:dk,hvh:pk,vh:gk,hv:vk},HM=()=>(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(Jn(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,v=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}));return[d,v,h]};HM.props={defaultShape:"area",defaultLabelShape:"label",composite:!1,shape:GM,channels:[...Mk({shapes:Object.keys(GM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"size"},{name:"series",scale:"band"}],preInference:[...Sk(),{type:Na},{type:jn},{type:Fa}],postInference:[...Ok()],interaction:{shareTooltip:!0,seriesTooltip:!0,crosshairs:!0}};const YM={link:yk,arc:wk,smooth:mk,vhv:xk},qM=t=>(e,n,r,i)=>{const{x:o,y:a,x1:s=o,y1:c=a}=r,l=Tk(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]};qM.props={defaultShape:"link",defaultLabelShape:"label",composite:!1,shape:YM,channels:[...Mk({shapes:Object.keys(YM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Sk(),{type:ja},{type:Ra}],postInference:[...Ek()]};const VM={image:Rk},UM=t=>{const{cartesian:e}=t;return e?Nk:(e,n,r,i)=>{const{x:o,y:a}=r,s=Tk(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};UM.props={defaultShape:"image",defaultLabelShape:"label",composite:!1,shape:VM,channels:[...Mk({shapes:Object.keys(VM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"src",scale:"identity"},{name:"size"}],preInference:[...Sk(),{type:Wa},{type:za}],postInference:[...Ek()]};const XM={polygon:Dk,ribbon:Fk},ZM=()=>(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]};ZM.props={defaultShape:"polygon",defaultLabelShape:"label",composite:!1,shape:XM,channels:[...Mk({shapes:Object.keys(XM)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Sk()],postInference:[...Ek()]};const KM={box:$k,violin:Gk},QM=()=>(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,v,y,m,b]=[+o[t],+a[t],+s[t],+c[t],+l[t]];return[[p-n/2,b],[p+n/2,b],[p,b],[p,m],[p-n/2,m],[p+n/2,m],[p+n/2,v],[p-n/2,v],[p-n/2,y],[p+n/2,y],[p,v],[p,g],[p-n/2,g],[p+n/2,g]].map((t=>r.map(t)))}));return[t,d]};QM.props={defaultShape:"box",defaultLabelShape:"label",composite:!1,shape:KM,channels:[...Mk({shapes:Object.keys(KM)}),{name:"x",scale:"band",required:!0},{name:"y",required:!0},{name:"series",scale:"band"}],preInference:[...Sk(),{type:_a}],postInference:[...Ok()],interaction:{shareTooltip:!0}};const JM={vector:Fm},tE=()=>(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]};tE.props={defaultShape:"vector",defaultLabelShape:"label",composite:!1,shape:JM,channels:[...Mk({shapes:Object.keys(JM)}),{name:"x",required:!0},{name:"y",required:!0},{name:"rotate",required:!0,scale:"identity"},{name:"size",required:!0}],preInference:[...Sk()],postInference:[...Ek()]};const eE={line:Hk},nE=t=>(e,n,r,i)=>{const{y:o}=r,a=Tk(n,r,Q({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]};nE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:eE,channels:[..._k({shapes:Object.keys(eE)}),{name:"y",required:!0}],preInference:[...Sk(),{type:Ca}],postInference:[]};const rE={line:Hk},iE=t=>(e,n,r,i)=>{const{x:o}=r,a=Tk(n,r,Q({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]};iE.props={defaultShape:"line",defaultLabelShape:"label",composite:!1,shape:rE,channels:[..._k({shapes:Object.keys(rE)}),{name:"x",required:!0}],preInference:[...Sk(),{type:La}],postInference:[]};const oE={connector:qk},aE=(...t)=>qM(...t);function sE(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 cE(t={}){const{extendX:e=!1,extendY:n=!1}=t;return(t,r,i,o)=>{const a=sE("x",e,i,r.x),s=sE("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]}}aE.props={defaultShape:"connector",defaultLabelShape:"label",composite:!1,shape:oE,channels:[..._k({shapes:Object.keys(oE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Sk()],postInference:[]};const lE={range:Ey},uE=()=>cE();uE.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:lE,channels:[..._k({shapes:Object.keys(lE)}),{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Sk()],postInference:[]};const fE={range:Ey},hE=()=>cE({extendY:!0});hE.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:fE,channels:[..._k({shapes:Object.keys(fE)}),{name:"x",required:!0}],preInference:[...Sk(),{type:Ia}],postInference:[]};const dE={range:Ey},pE=()=>cE({extendX:!0});function gE(t){return t.target.depth}function vE(t,e){return t.sourceLinks.length?t.depth:e-1}function yE(t){return function(){return t}}function mE(t,e){return xE(t.source,e.source)||t.index-e.index}function bE(t,e){return xE(t.target,e.target)||t.index-e.index}function xE(t,e){return t.y0-e.y0}function wE(t){return t.value}function kE(t){return t.index}function ME(t){return t.nodes}function EE(t){return t.links}function OE(t,e){const n=t.get(e);if(!n)throw new Error("missing: "+e);return n}function _E({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}}function SE(){let t,e,n,r,i=0,o=0,a=1,s=1,c=24,l=8,u=kE,f=vE,h=ME,d=EE,p=6;function g(g){const m={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=OE(n,r)),"object"!=typeof i&&(i=t.target=OE(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)}(m),function({nodes:t}){for(const e of t)e.value=void 0===e.fixedValue?Math.max(Tr(e.sourceLinks,wE),Tr(e.targetLinks,wE)):e.fixedValue}(m),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(vr(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)}}(m),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}}(m),function(e){const r=function({nodes:t}){const e=Math.max(vr(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)/(vr(r,(t=>t.length))-1)),function(e){const n=mr(e,(e=>(s-o-(e.length-1)*t)/Tr(e,wE)));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)}k(r)}}(r);for(let t=0;t<p;++t){const e=Math.pow(.99,t),n=Math.max(1-e,(t+1)/p);y(r,e,n),v(r,e,n)}}(m),_E(m),m}function v(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,w(t)}void 0===n&&o.sort(xE),o.length&&m(o,r)}}function y(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,w(t)}void 0===n&&o.sort(xE),o.length&&m(o,r)}}function m(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 w({sourceLinks:t,targetLinks:e}){if(void 0===r){for(const{source:{sourceLinks:t}}of e)t.sort(bE);for(const{target:{targetLinks:e}}of t)e.sort(mE)}}function k(t){if(void 0===r)for(const{sourceLinks:e,targetLinks:n}of t)e.sort(bE),n.sort(mE)}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 _E(t),t},g.nodeId=function(t){return arguments.length?(u="function"==typeof t?t:yE(t),g):u},g.nodeAlign=function(t){return arguments.length?(f="function"==typeof t?t:yE(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:yE(t),g):h},g.links=function(t){return arguments.length?(d="function"==typeof t?t:yE(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}pE.props={defaultShape:"range",defaultLabelShape:"label",composite:!1,shape:dE,channels:[..._k({shapes:Object.keys(dE)}),{name:"y",required:!0}],preInference:[...Sk(),{type:Da}],postInference:[]};const AE={nodeAlign:"justify",nodeWidth:.008,nodePadding:.03,nodes:t=>t.nodes,links:t=>t.links,nodeSort:void 0,linkSort:void 0,iterations:6},TE={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?mr(t.sourceLinks,gE)-1:0},justify:vE};const PE=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({},AE,t),h=SE().nodeSort(r).linkSort(u).links(l).nodes(c).nodeWidth(o).nodePadding(a).nodeDepth(s).nodeAlign(function(t){const e=typeof t;return"string"===e?TE[t]||vE:"function"===e?t:vE}(i)).iterations(f).extent([[0,0],[1,1]]);"function"==typeof n&&h.nodeId(n);const d=h(e),{nodes:p,links:g}=d,v=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]})})),y=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:v,links:y}};function NE(t,e,n={},r=!1){if(ra(t))return t;if(Array.isArray(t)&&r)return t;const i=Qo(t,e);return Q(n,i)}function CE(t,e={}){return ra(t)||Array.isArray(t)?t:LE(t)?Q(e,t):t}function LE(t){if(0===Object.keys(t).length)return!0;const{title:e,items:n}=t;return void 0!==e||void 0!==n}function jE(t,e){return"object"==typeof t?Qo(t,e):t}PE.props={};const RE={nodeId:t=>t.key,nodeWidth:.02,nodePadding:.02},IE={type:"polygon",axis:!1,legend:!1,encode:{shape:"polygon",x:"x",y:"y"},scale:{x:{type:"identity"},y:{type:"identity"}},style:{stroke:"#000"}},DE={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{fillOpacity:.5,stroke:void 0}},BE={textAlign:t=>t.x[0]<.5?"start":"end",position:t=>t.x[0]<.5?"right":"left",fontSize:10},FE=t=>{const{data:e,encode:n={},scale:r,style:i={},layout:o={},nodeLabels:a=[],linkLabels:s=[],animate:c={},tooltip:l={},interaction:u}=t,{links:f,nodes:h}=jk(e,n),d=Qo(n,"node"),p=Qo(n,"link"),{key:g=t=>t.key,color:v=g}=d,{links:y,nodes:m}=PE(Object.assign(Object.assign(Object.assign({},RE),{nodeId:Ck(g)}),o))({links:f,nodes:h}),b=Qo(i,"label"),{text:x=g,spacing:w=5}=b,k=Le(b,["text","spacing"]),M=Ck(g),E=NE(l,"node",{title:M,items:[{field:"value"}]},!0),O=NE(l,"link",{title:"",items:[t=>({name:"source",value:M(t.source)}),t=>({name:"target",value:M(t.target)})]});return[Q({},IE,{data:m,encode:Object.assign(Object.assign({},d),{color:v}),scale:r,style:Qo(i,"node"),labels:[Object.assign(Object.assign(Object.assign({},BE),{text:x,dx:t=>t.x[0]<.5?w:-w}),k),...a],tooltip:E,animate:jE(c,"node"),axis:!1,interaction:u}),Q({},DE,{data:y,encode:p,labels:s,style:Object.assign({fill:p.color?void 0:"#aaa",lineWidth:0},Qo(i,"link")),tooltip:O,animate:jE(c,"link"),interaction:u})]};FE.props={};var zE=Object.freeze({__proto__:null,weight:function(t,e){return e.value-t.value},frequency:function(t,e){return e.frequency-t.frequency},id:function(t,e){return`${t.id}`.localeCompare(`${e.id}`)},name:function(t,e){return`${t.name}`.localeCompare(`${e.name}`)}});const $E={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};function WE(t){const{y:e,thickness:n,weight:r,marginRatio:i,id:o,source:a,target:s,sourceWeight:c,targetWeight:l,sortBy:u}=Object.assign(Object.assign({},$E),t);return function(t){const f=t.nodes.map((t=>Object.assign({},t))),h=t.edges.map((t=>Object.assign({},t)));return function(t,e){e.forEach((t=>{t.source=a(t),t.target=s(t),t.sourceWeight=c(t),t.targetWeight=l(t)}));const n=Jn(e,(t=>t.source)),r=Jn(e,(t=>t.target));t.forEach((t=>{t.id=o(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=Tr(e,(t=>t.sourceWeight))+Tr(i,(t=>t.targetWeight))}))}(f,h),function(t){const e="function"==typeof u?u:zE[u];e&&t.sort(e)}(f),function(t,o){const a=t.length;if(!a)throw Uo("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)}(f,h),function(t,n){const i=new Map(t.map((t=>[t.id,t])));if(!r)return n.forEach((t=>{const e=a(t),n=s(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=Jn(n,(t=>t.source)),c=Jn(n,(t=>t.target));t.forEach((t=>{const{edges:e,width:n,x:r,y:i,value:a,id:s}=t,l=o.get(s)||[],u=c.get(s)||[];let f=0;l.map((t=>{const e=t.sourceWeight/a*n;t.x[0]=r[0]+f,t.x[1]=r[0]+f+e,f+=e})),u.forEach((t=>{const e=t.targetWeight/a*n;t.x[3]=r[0]+f,t.x[2]=r[0]+f+e,f+=e}))}))}(f,h),{nodes:f,edges:h}}}const GE=t=>e=>WE(t)(e);GE.props={};const HE={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},YE={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}},qE={type:"polygon",axis:!1,legend:!1,encode:{shape:"ribbon",x:"x",y:"y"},style:{opacity:.5,lineWidth:1}},VE={position:"outside",fontSize:10},UE=(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}=jk(n,r),d=Qo(r,"node"),p=Qo(r,"link"),{key:g=t=>t.key,color:v=g}=d,{linkEncodeColor:y=t=>t.source}=p,{nodeWidthRatio:m=HE.thickness,nodePaddingRatio:b=HE.marginRatio}=a,x=Le(a,["nodeWidthRatio","nodePaddingRatio"]),{nodes:w,edges:k}=GE(Object.assign(Object.assign(Object.assign(Object.assign({},HE),{id:Ck(g),thickness:m,marginRatio:b}),x),{weight:!0}))({nodes:f,edges:h}),M=Qo(o,"label"),{text:E=g}=M,O=Le(M,["text"]),_=NE(u,"node",{title:"",items:[t=>({name:t.key,value:t.value})]},!0),S=NE(u,"link",{title:"",items:[t=>({name:`${t.source} -> ${t.target}`,value:t.value})]}),{height:A,width:T}=e,P=Math.min(A,T);return[Q({},qE,{data:k,encode:Object.assign(Object.assign({},p),{color:y}),labels:c,style:Object.assign({fill:y?void 0:"#aaa"},Qo(o,"link")),tooltip:S,animate:jE(l,"link")}),Q({},YE,{data:w,encode:Object.assign(Object.assign({},d),{color:v}),scale:i,style:Qo(o,"node"),coordinate:{type:"polar",outerRadius:(P-20)/P,startAngle:2*-Math.PI,endAngle:0},labels:[Object.assign(Object.assign(Object.assign({},VE),{text:E}),O),...s],tooltip:_,animate:jE(l,"node"),axis:!1})]};UE.props={};const XE={path:fM,hollow:hM},ZE=t=>(t,e,n,r)=>[t,t.map((()=>[[0,0]]))];function KE(t,e){return t.parent===e.parent?1:2}function QE(t,e){return t+e.x}function JE(t,e){return Math.max(t,e.y)}function tO(){var t=KE,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(QE,0)/t.length}(n),e.y=function(t){return 1+t.reduce(JE,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}function eO(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 nO(t,e){t instanceof Map?(t=[void 0,t],void 0===e&&(e=iO)):void 0===e&&(e=rO);for(var n,r,i,o,a,s=new sO(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 sO(i[o])),r.parent=n,r.depth=n.depth+1;return s.eachBefore(aO)}function rO(t){return t.children}function iO(t){return Array.isArray(t)?t[1]:null}function oO(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function aO(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function sO(t){this.data=t,this.depth=this.height=0,this.parent=null}function cO(t){return null==t?null:lO(t)}function lO(t){if("function"!=typeof t)throw new Error;return t}function uO(){return 0}function fO(t){return function(){return t}}ZE.props={defaultShape:"path",defaultLabelShape:"label",shape:XE,composite:!1,channels:[...Mk({shapes:Object.keys(XE)}),{name:"d",scale:"identity"}],preInference:[...Sk()],postInference:[]},sO.prototype=nO.prototype={constructor:sO,count:function(){return this.eachAfter(eO)},each:function(t,e){let n=-1;for(const r of this)t.call(e,r,++n,this);return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],s=[],c=-1;o=a.pop();)if(s.push(o),n=o.children)for(r=0,i=n.length;r<i;++r)a.push(n[r]);for(;o=s.pop();)t.call(e,o,++c,this);return this},eachBefore:function(t,e){for(var n,r,i=this,o=[i],a=-1;i=o.pop();)if(t.call(e,i,++a,this),n=i.children)for(r=n.length-1;r>=0;--r)o.push(n[r]);return this},find:function(t,e){let n=-1;for(const r of this)if(t.call(e,r,++n,this))return r},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return nO(this).eachBefore(oO)},[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)}};const hO=4294967296;function dO(t,e){var n,r;if(vO(e,t))return[e];for(n=0;n<t.length;++n)if(pO(e,t[n])&&vO(mO(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(pO(mO(t[n],t[r]),e)&&pO(mO(t[n],e),t[r])&&pO(mO(t[r],e),t[n])&&vO(bO(t[n],t[r],e),t))return[t[n],t[r],e];throw new Error}function pO(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 gO(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 vO(t,e){for(var n=0;n<e.length;++n)if(!gO(t,e[n]))return!1;return!0}function yO(t){switch(t.length){case 1:return function(t){return{x:t.x,y:t.y,r:t.r}}(t[0]);case 2:return mO(t[0],t[1]);case 3:return bO(t[0],t[1],t[2])}}function mO(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 bO(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,v=c-o,y=f-o,m=r*r+i*i-o*o,b=m-a*a-s*s+c*c,x=m-l*l-u*u+f*f,w=d*p-h*g,k=(p*x-g*b)/(2*w)-r,M=(g*v-p*y)/w,E=(d*b-h*x)/(2*w)-i,O=(h*y-d*v)/w,_=M*M+O*O-1,S=2*(o+k*M+E*O),A=k*k+E*E-o*o,T=-(Math.abs(_)>1e-6?(S+Math.sqrt(S*S-4*_*A))/(2*_):A/S);return{x:r+k+M*T,y:i+E+O*T,r:T}}function xO(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 wO(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 kO(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 MO(t){this._=t,this.next=null,this.previous=null}function EO(t,e){if(!(o=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var n,r,i,o,a,s,c,l,u,f,h;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;xO(r,n,i=t[2]),n=new MO(n),r=new MO(r),i=new MO(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(c=3;c<o;++c){xO(n._,r._,i=t[c]),i=new MO(i),l=r.next,u=n.previous,f=r._.r,h=n._.r;do{if(f<=h){if(wO(l._,i._)){r=l,n.next=r,r.previous=n,--c;continue t}f+=l._.r,l=l.next}else{if(wO(u._,i._)){(n=u).next=r,r.previous=n,--c;continue t}h+=u._.r,u=u.previous}}while(l!==u.next);for(i.previous=n,i.next=r,n.next=r.previous=r=i,a=kO(n);(i=i.next)!==r;)(s=kO(i))<a&&(n=i,a=s);r=n.next}for(n=[r._],i=r;(i=i.next)!==r;)n.push(i._);for(i=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&&gO(r,n)?++i:(r=yO(a=dO(a,n)),i=0);return r}(n,e),c=0;c<o;++c)(n=t[c]).x-=i.x,n.y-=i.y;return i.r}function OO(t){return Math.sqrt(t.value)}function _O(){var t=null,e=1,n=1,r=uO;function i(i){const o=function(){let t=1;return()=>(t=(1664525*t+1013904223)%hO)/hO}();return i.x=e/2,i.y=n/2,t?i.eachBefore(SO(t)).eachAfter(AO(r,.5,o)).eachBefore(TO(1)):i.eachBefore(SO(OO)).eachAfter(AO(uO,1,o)).eachAfter(AO(r,i.r/Math.min(e,n),o)).eachBefore(TO(Math.min(e,n)/(2*i.r))),i}return i.radius=function(e){return arguments.length?(t=cO(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:fO(+t),i):r},i}function SO(t){return function(e){e.children||(e.r=Math.max(0,+t(e)||0))}}function AO(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=EO(i,n),c)for(o=0;o<s;++o)i[o].r-=c;r.r=a+c}}}function TO(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)}}function PO(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 NO(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}var CO={depth:-1},LO={},jO={};function RO(t){return t.id}function IO(t){return t.parentId}function DO(){var t,e=RO,n=IO;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){t=`${t}`;let e=t.length;FO(t,e-1)&&!FO(t,e-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(e,n,r)))),n=e.map(BO),i=new Set(e).add("");for(const t of n)i.has(t)||(i.add(t),e.push(t),n.push(BO(t)),h.push(jO));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 sO(o),null!=(u=d(o,a,r))&&(u+="")&&(f=l.id=u,g.set(f,g.has(f)?LO: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===LO)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===jO&&1===s.children.length;)s=s.children[0],--i;for(let t=h.length-1;t>=0&&(l=h[t]).data===jO;--t)l.data=null}if(s.parent=CO,s.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(aO),s.parent=null,i>0)throw new Error("cycle");return s}return r.id=function(t){return arguments.length?(e=cO(t),r):e},r.parentId=function(t){return arguments.length?(n=cO(t),r):n},r.path=function(e){return arguments.length?(t=cO(e),r):t},r}function BO(t){let e=t.length;if(e<2)return"";for(;--e>1&&!FO(t,e););return t.slice(0,e)}function FO(t,e){if("/"===t[e]){let n=0;for(;e>0&&"\\"===t[--e];)++n;if(!(1&n))return!0}return!1}function zO(t,e){return t.parent===e.parent?1:2}function $O(t){var e=t.children;return e?e[0]:t.t}function WO(t){var e=t.children;return e?e[e.length-1]:t.t}function GO(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 HO(t,e,n){return t.a.parent===e.parent?t.a:n}function YO(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 qO(){var t=zO,e=1,n=1,r=null;function i(i){var c=function(t){for(var e,n,r,i,o,a=new YO(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 YO(r[i],i)),n.parent=e;return(a.parent=new YO(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=WO(s),o=$O(o),s&&o;)c=$O(c),(a=WO(a)).a=e,(i=s.z+f-o.z-l+t(s._,o._))>0&&(GO(HO(s,e,r),e,i),l+=i,u+=i),f+=s.m,l+=o.m,h+=c.m,u+=a.m;s&&!WO(a)&&(a.t=s,a.m+=f-u),o&&!$O(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 VO(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}YO.prototype=Object.create(sO.prototype);var UO=(1+Math.sqrt(5))/2;function XO(t,e,n,r,i,o){for(var a,s,c,l,u,f,h,d,p,g,v,y=[],m=e.children,b=0,x=0,w=m.length,k=e.value;b<w;){c=i-n,l=o-r;do{u=m[x++].value}while(!u&&x<w);for(f=h=u,v=u*u*(g=Math.max(l/c,c/l)/(k*t)),p=Math.max(h/v,v/f);x<w;++x){if(u+=s=m[x].value,s<f&&(f=s),s>h&&(h=s),v=u*u*g,(d=Math.max(h/v,v/f))>p){u-=s;break}p=d}y.push(a={value:u,dice:c<l,children:m.slice(b,x)}),a.dice?NO(a,n,r,i,k?r+=l*u/k:o):VO(a,n,r,k?n+=c*u/k:i,o),k-=u,b=x}return y}var ZO=function t(e){function n(t,n,r,i,o){XO(e,t,n,r,i,o)}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(UO);function KO(t,e,n,r,i){var o,a,s=t.children,c=s.length,l=new Array(c+1);for(l[0]=a=o=0;o<c;++o)l[o+1]=a+=s[o].value;!function t(e,n,r,i,o,a,c){if(e>=n-1){var u=s[e];return u.x0=i,u.y0=o,u.x1=a,void(u.y1=c)}var f=l[e],h=r/2+f,d=e+1,p=n-1;for(;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 v=l[d]-f,y=r-v;if(a-i>c-o){var m=r?(i*y+a*v)/r:a;t(e,d,v,i,o,m,c),t(d,n,y,m,o,a,c)}else{var b=r?(o*y+c*v)/r:c;t(e,d,v,i,o,a,b),t(d,n,y,i,b,a,c)}}(0,c,t.value,e,n,r,i)}function QO(t,e,n,r,i){(1&t.depth?VO:NO)(t,e,n,r,i)}var JO=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?NO(s,n,r,i,d?r+=(o-r)*s.value/d:o):VO(s,n,r,d?n+=(i-n)*s.value/d:i,o),d-=s.value}else t._squarify=a=XO(e,t,n,r,i,o),a.ratio=e}return n.ratio=function(e){return t((e=+e)>1?e:1)},n}(UO);function t_(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],t_(n,n.path)}))}function e_(t){const e=rt(t,["data","name"]);e.replaceAll&&(t.path=e.replaceAll(".","/").split("/")),t.children&&t.children.forEach((t=>{e_(t)}))}function n_(t,e,n){const{value:r}=n,i=function(t,e){const n={treemapBinary:KO,treemapDice:NO,treemapSlice:VO,treemapSliceDice:QO,treemapSquarify:ZO,treemapResquarify:JO},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?DO().path(e)(t):DO()(t):nO(t)}(t,e.path);x(t)?e_(o):t_(o),r?o.sum((t=>e.ignoreParentValue&&t.children?0:Ck(r)(t))).sort(e.sort):o.count(),function(){var t=ZO,e=!1,n=1,r=1,i=[0],o=uO,a=uO,s=uO,c=uO,l=uO;function u(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(f),i=[0],e&&t.eachBefore(PO),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=lO(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:fO(+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:fO(+t),u):a},u.paddingRight=function(t){return arguments.length?(s="function"==typeof t?t:fO(+t),u):s},u.paddingBottom=function(t){return arguments.length?(c="function"==typeof t?t:fO(+t),u):c},u.paddingLeft=function(t){return arguments.length?(l="function"==typeof t?t:fO(+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 r_={fontSize:10,text:t=>j(t.path),position:"inside",fill:"#000",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>t.x1-t.x0,isTreemapLabel:!0},i_={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"}]},o_={title:t=>j(t.path),items:[{field:"value"}]},a_=(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=Le(t,["data","encode","scale","style","layout","labels","tooltip"]),d=rt(i,["interaction","treemapDrillDown"]),p=Q({},((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,v]=n_(o,p,a),y=Qo(c,"label");return Q({},((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(Object.assign({},r_),y),d&&{cursor:"pointer"}),...u]},h),{encode:a,tooltip:CE(f,i_),axis:!1}),d?{interaction:Object.assign(Object.assign({},h.interaction),{treemapDrillDown:d?Object.assign(Object.assign({},d),{originData:v,layout:p}):void 0}),encode:Object.assign({color:t=>j(t.path)},a),tooltip:CE(f,o_)}:{})};a_.props={};const s_={text:"",position:"inside",textOverflow:"clip",wordWrap:!0,maxLines:1,wordWrapWidth:t=>2*t.r},c_={title:t=>t.data.name,items:[{field:"value"}]},l_=(t,e)=>{const{width:n,height:r}=e,{data:i,encode:o={},scale:a={},style:s={},layout:c={},labels:l=[],tooltip:u={}}=t,f=Le(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=x(t)?DO().path(e.path)(t):nO(t);return r?i.sum((t=>Ck(r)(t))).sort(e.sort):i.count(),_O().size(e.size).padding(e.padding)(i),i.descendants()})(i,Q({},((t,e)=>({size:[t,e],padding:0,sort:(t,e)=>e.value-t.value}))(n,r),c),Q({},h.encode,o)),p=Qo(s,"label");return Q({},h,Object.assign(Object.assign({data:d,encode:o,scale:a,style:s,labels:[Object.assign(Object.assign({},s_),p),...l]},f),{tooltip:CE(u,c_),axis:!1}))};function u_(t,e){return mr(t,(t=>e[t]))}function f_(t,e){return vr(t,(t=>e[t]))}function h_(t,e){const n=2.5*d_(t,e)-1.5*g_(t,e);return mr(t,(t=>e[t]>=n?e[t]:NaN))}function d_(t,e){return kr(t,.25,(t=>e[t]))}function p_(t,e){return kr(t,.5,(t=>e[t]))}function g_(t,e){return kr(t,.75,(t=>e[t]))}function v_(t,e){const n=2.5*g_(t,e)-1.5*d_(t,e);return vr(t,(t=>e[t]<=n?e[t]:NaN))}function y_(){return(t,e)=>{const{encode:n}=e,{y:r,x:i}=n,{value:o}=r,{value:a}=i,s=Array.from(Jn(t,(t=>a[+t])).values()),c=s.flatMap((t=>{const e=h_(t,o),n=v_(t,o);return t.filter((t=>o[t]<e||o[t]>n))}));return[c,e]}}l_.props={};const m_=t=>{const{data:e,encode:n,style:r={},tooltip:i={},transform:o,animate:a}=t,s=Le(t,["data","encode","style","tooltip","transform","animate"]),{point:c=!0}=r,l=Le(r,["point"]),{y:u}=n,f={y:u,y1:u,y2:u,y3:u,y4:u},h={y1:d_,y2:p_,y3:g_},d=NE(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=NE(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:u_},h),{y4:f_})],encode:Object.assign(Object.assign({},n),f),style:l,tooltip:d},s);const g=Qo(l,"box"),v=Qo(l,"point");return[Object.assign({type:"box",data:e,transform:[Object.assign(Object.assign({type:"groupX",y:h_},h),{y4:v_})],encode:Object.assign(Object.assign({},n),f),style:g,tooltip:d,animate:jE(a,"box")},s),{type:"point",data:e,transform:[{type:y_}],encode:n,style:Object.assign({},v),tooltip:p,animate:jE(a,"point")}]};m_.props={};const b_=t=>{const{cartesian:e}=t;return e?Nk:(e,n,r,i)=>{const{x:o,y:a}=r,s=Tk(n,r,t),c=Array.from(e,(t=>{const e=[+o[t],+a[t]];return[i.map(s(e,t))]}));return[e,c]}};function x_(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,v=t._y0,y=t._x1,m=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((l=e>=(o=(g+y)/2))?g=o:y=o,(u=n>=(a=(v+m)/2))?v=a:m=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+y)/2))?g=o:y=o,(u=n>=(a=(v+m)/2))?v=a:m=a}while((f=u<<1|l)==(h=(c>=a)<<1|s>=o));return i[h]=d,i[f]=p,t}function w_(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function k_(t){return t[0]}function M_(t){return t[1]}function E_(t,e,n){var r=new O_(null==e?k_:e,null==n?M_:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function O_(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 __(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}b_.props={defaultShape:"shape",defaultLabelShape:"label",composite:!1,shape:{shape:xM},channels:[{name:"x",required:!0},{name:"y",required:!0}],preInference:[...Sk(),{type:Wa},{type:za},{type:$a}]};var S_=E_.prototype=O_.prototype;function A_(t){return function(){return t}}function T_(t){return 1e-6*(t()-.5)}function P_(t){return t.index}function N_(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}S_.copy=function(){var t,e,n=new O_(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=__(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]=__(e));return n},S_.add=function(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return x_(this.cover(e,n),e,n,t)},S_.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)x_(this,a[n],s[n],t[n]);return this},S_.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},S_.data=function(){var t=[];return this.visit((function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)})),t},S_.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]]},S_.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 w_(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 v=(i+a)/2,y=(o+s)/2;p.push(new w_(g[3],v,y,a,s),new w_(g[2],i,y,v,s),new w_(g[1],v,o,a,y),new w_(g[0],i,o,v,y)),(l=(e>=y)<<1|t>=v)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-l],p[p.length-1-l]=c)}else{var m=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),x=m*m+b*b;if(x<n){var w=Math.sqrt(n=x);u=t-w,f=e-w,h=t+w,d=e+w,r=g.data}}return r},S_.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,v=this._x1,y=this._y1;if(!d)return this;if(d.length)for(;;){if((l=o>=(s=(p+v)/2))?p=s:v=s,(u=a>=(c=(g+y)/2))?g=c:y=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)},S_.removeAll=function(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this},S_.root=function(){return this._root},S_.size=function(){var t=0;return this.visit((function(e){if(!e.length)do{++t}while(e=e.next)})),t},S_.visit=function(t){var e,n,r,i,o,a,s=[],c=this._root;for(c&&s.push(new w_(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 w_(n,l,u,o,a)),(n=c[2])&&s.push(new w_(n,r,u,l,a)),(n=c[1])&&s.push(new w_(n,l,i,o,u)),(n=c[0])&&s.push(new w_(n,r,i,l,u))}return this},S_.visitAfter=function(t){var e,n=[],r=[];for(this._root&&n.push(new w_(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 w_(o,a,s,u,f)),(o=i[1])&&n.push(new w_(o,u,s,c,f)),(o=i[2])&&n.push(new w_(o,a,f,u,l)),(o=i[3])&&n.push(new w_(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},S_.x=function(t){return arguments.length?(this._x=t,this):this._x},S_.y=function(t){return arguments.length?(this._y=t,this):this._y};var C_={value:()=>{}};function L_(){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 j_(r)}function j_(t){this._=t}function R_(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function I_(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=C_,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}j_.prototype=L_.prototype={constructor:j_,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]=I_(i[n],t.name,e);else if(null==e)for(n in i)i[n]=I_(i[n],t.name,null);return this}for(;++a<s;)if((n=(t=o[a]).type)&&(n=R_(i[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new j_(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)}};var D_,B_,F_=0,z_=0,$_=0,W_=0,G_=0,H_=0,Y_="object"==typeof performance&&performance.now?performance:Date,q_="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function V_(){return G_||(q_(U_),G_=Y_.now()+H_)}function U_(){G_=0}function X_(){this._call=this._time=this._next=null}function Z_(t,e,n){var r=new X_;return r.restart(t,e,n),r}function K_(){G_=(W_=Y_.now())+H_,F_=z_=0;try{!function(){V_(),++F_;for(var t,e=D_;e;)(t=G_-e._time)>=0&&e._call.call(void 0,t),e=e._next;--F_}()}finally{F_=0,function(){var t,e,n=D_,r=1/0;for(;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:D_=e);B_=t,J_(r)}(),G_=0}}function Q_(){var t=Y_.now(),e=t-W_;e>1e3&&(H_-=e,W_=t)}function J_(t){F_||(z_&&(z_=clearTimeout(z_)),t-G_>24?(t<1/0&&(z_=setTimeout(K_,t-Y_.now()-H_)),$_&&($_=clearInterval($_))):($_||(W_=Y_.now(),$_=setInterval(Q_,1e3)),F_=1,q_(K_)))}X_.prototype=Z_.prototype={constructor:X_,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?V_():+n)+(null==e?0:+e),this._next||B_===this||(B_?B_._next=this:D_=this,B_=this),this._call=t,this._time=n,J_()},stop:function(){this._call&&(this._call=null,this._time=1/0,J_())}};const tS=4294967296;function eS(t){return t.x}function nS(t){return t.y}var rS=Math.PI*(3-Math.sqrt(5));function iS(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),o=0,a=.6,s=new Map,c=Z_(f),l=L_("tick","end"),u=function(){let t=1;return()=>(t=(1664525*t+1013904223)%tS)/tS}();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=10*Math.sqrt(.5+n),o=n*rS;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)}}}const oS={joint:!0},aS={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}},sS={type:"point",axis:!1,legend:!1,encode:{x:"x",y:"y",size:5,color:"group",shape:"point"},style:{stroke:"#fff"}},cS={text:""};function lS(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=A_(-30),a=1,s=1/0,c=.81;function l(n){var i,o=t.length,a=E_(t,eS,nS).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=T_(n))*f),0===h&&(p+=(h=T_(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=T_(n))*f),0===h&&(p+=(h=T_(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:A_(+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=P_,c=function(t){return 1/Math.min(i[t.source.index],i[t.target.index])},l=A_(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,v=0;v<s;++v)l=(c=t[v]).source,h=(f=c.target).x+f.vx-l.x-l.vx||T_(a),d=f.y+f.vy-l.y-l.vy||T_(a),h*=p=((p=Math.sqrt(h*h+d*d))-n[v])/p*r*e[v],d*=p,f.vx-=h*(g=o[v]),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=N_(f,c.source)),"object"!=typeof c.target&&(c.target=N_(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:A_(+t),d(),f):c},f.distance=function(t){return arguments.length?(l="function"==typeof t?t:A_(+t),p(),f):l},f}(i).id(Ck(l));"function"==typeof a&&u.strength(a),"function"==typeof s&&f.strength(s);const h=iS(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=A_(.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=A_(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:A_(+t),a(),o):i},o.x=function(e){return arguments.length?(t="function"==typeof e?e:A_(+e),a(),o):t},o}()).force("y",function(t){var e,n,r,i=A_(.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=A_(null==t?0:+t)),o.initialize=function(t){e=t,a()},o.strength=function(t){return arguments.length?(i="function"==typeof t?t:A_(+t),a(),o):i},o.y=function(e){return arguments.length?(t="function"==typeof e?e:A_(+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 uS=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=Le(n,["nodeKey","linkKey"]),d=Object.assign({nodeKey:u,linkKey:f},h),p=Qo(d,"node"),g=Qo(d,"link"),{links:v,nodes:y}=jk(e,d),{nodesData:m,linksData:b}=lS({links:v,nodes:y},Q({},oS,o),d),x=NE(l,"link",{items:[t=>({name:"source",value:Ck(f)(t.source)}),t=>({name:"target",value:Ck(f)(t.target)})]}),w=NE(l,"node",{items:[t=>({name:"key",value:Ck(u)(t)})]},!0);return[Q({},aS,{data:b,encode:g,labels:s,style:Qo(i,"link"),tooltip:x,animate:jE(c,"link")}),Q({},sS,{data:m,encode:Object.assign({},p),scale:r,style:Qo(i,"node"),tooltip:w,labels:[Object.assign(Object.assign({},cS),Qo(i,"label")),...a],animate:jE(c,"link")})]};uS.props={};const fS=t=>e=>n=>{const{field:r="value",nodeSize:i,separation:o,sortBy:a,as:s=["x","y"]}=e,[c,l]=s,u=nO(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}},hS=t=>fS(tO)(t);hS.props={};const dS=t=>fS(qO)(t);dS.props={};const pS={sortBy:(t,e)=>e.value-t.value},gS={axis:!1,legend:!1,type:"point",encode:{x:"x",y:"y",size:2,shape:"point"}},vS={type:"link",encode:{x:"x",y:"y",shape:"smooth"}},yS={text:"",fontSize:10},mS=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}=dS(Object.assign(Object.assign(Object.assign({},pS),o),{field:u}))(e),d=NE(l,"node",{title:"name",items:["value"]},!0),p=NE(l,"link",{title:"",items:[t=>({name:"source",value:t.source.name}),t=>({name:"target",value:t.target.name})]});return[Q({},vS,{data:h,encode:Qo(n,"link"),scale:Qo(r,"link"),labels:s,style:Object.assign({stroke:"#999"},Qo(i,"link")),tooltip:p,animate:jE(c,"link")}),Q({},gS,{data:f,scale:Qo(r,"node"),encode:Qo(n,"node"),labels:[Object.assign(Object.assign({},yS),Qo(i,"label")),...a],style:Object.assign({},Qo(i,"node")),tooltip:d,animate:jE(c,"node")})]};mS.props={};const bS=(t,e)=>Re(void 0,void 0,void 0,(function*(){const{width:n,height:r}=e,{data:i,encode:o={},scale:a,style:s={},layout:c={}}=t,l=Le(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 Q({},{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},tooltip:{items:[t=>({name:t.text,value:t.value})]}},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}))}));bS.props={};const xS={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"]}}},wS={style:{shape:(t,e)=>{const{shape:n,radius:r}=t,i=Le(t,["shape","radius"]),o=Qo(i,"pointer"),a=Qo(i,"pin"),{shape:s}=o,l=Le(o,["shape"]),{shape:u}=a,f=Le(a,["shape"]),{coordinate:h,theme:d}=e;return(t,e)=>{const n=t.map((t=>h.invert(t))),[o,a,p]=function(t,e){const{transformations:n}=t.getOptions(),[,...r]=n.find((t=>t[0]===e));return r}(h,"polar"),g=h.clone(),{color:v}=e,y=c({startAngle:o,endAngle:a,innerRadius:p,outerRadius:r});y.push(["cartesian"]),g.update({transformations:y});const m=n.map((t=>g.map(t))),[b,x]=wy(m),[w,k]=h.getCenter(),M=Object.assign(Object.assign({x1:b,y1:x,x2:w,y2:k,stroke:v},l),i),E=Object.assign(Object.assign({cx:w,cy:k,stroke:v},f),i),O=uy(new Ig);return ra(s)||("function"==typeof s?O.append((()=>s(m,e,g,d))):O.append("line").call(py,M).node()),ra(u)||("function"==typeof u?O.append((()=>u(m,e,g,d))):O.append("circle").call(py,E).node()),O.node()}},lineWidth:4,pointerLineCap:"round",pinR:10,pinFill:"#fff",radius:.6}},kS={type:"text",style:{x:"50%",y:"60%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"},tooltip:!1};function MS(t,e){const{name:n="score",target:r,total:i,percent:o,thresholds:a=[]}=function(t){if(I(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}}function ES(t,{target:e,total:n}){const{content:r}=t;return r?r(e,n):e.toString()}const OS=t=>{const{data:e={},scale:n={},style:r={},animate:i={},transform:o=[]}=t,a=Le(t,["data","scale","style","animate","transform"]),{targetData:s,totalData:c,target:l,total:u,scale:f}=MS(e,n),h=Qo(r,"text"),{tooltip:d}=h,p=Le(h,["tooltip"]),g=(v=r,y=["pointer","pin"],Object.fromEntries(Object.entries(v).filter((([t])=>y.find((e=>t.startsWith(e)))))));var v,y;const m=Qo(r,"arc"),b=m.shape;return[Q({},xS,Object.assign({type:"interval",transform:[{type:"stackY"}],data:c,scale:f,style:"round"===b?Object.assign(Object.assign({},m),{shape:SM}):m,animate:"object"==typeof i?Qo(i,"arc"):i},a)),Q({},xS,wS,Object.assign({type:"point",data:s,scale:f,style:g,animate:"object"==typeof i?Qo(i,"indicator"):i},a)),Q({},kS,{style:Object.assign({text:ES(p,{target:l,total:u})},p),tooltip:d,animate:"object"==typeof i?Qo(i,"text"):i})]};OS.props={};const _S={density:dM},SS=()=>(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]};SS.props={defaultShape:"density",defaultLabelShape:"label",composite:!1,shape:_S,channels:[...Mk({shapes:Object.keys(_S)}),{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:[...Sk(),{type:jn},{type:_a}],postInference:[...Ok()],interaction:{shareTooltip:!0}};const AS={heatmap:bM},TS=t=>(t,e,n,r)=>{const{x:i,y:o,size:a,color:s}=n,c=Array.from(t,(t=>{const e=a?+a[t]:40;return[...r.map([+i[t],+o[t]]),s[t],e]}));return[[0],[c]]};TS.props={defaultShape:"heatmap",defaultLabelShape:"label",composite:!1,shape:AS,channels:[...Mk({shapes:Object.keys(AS)}),{name:"x",required:!0},{name:"y",required:!0},{name:"color",scale:"identity",required:!0},{name:"size"}],preInference:[...Sk(),{type:_a},{type:Sa}],postInference:[...Ek()]};const PS={axis:{x:!1,y:!1},legend:!1,tooltip:!1,encode:{x:"type",y:"percent"},scale:{y:{domain:[0,1]}},style:{shape:OM},animate:{enter:{type:"fadeIn"}}},NS={type:"text",style:{x:"50%",y:"50%",textAlign:"center",textBaseline:"middle",fontSize:20,fontWeight:800,fill:"#888"},animate:{enter:{type:"fadeIn"}}},CS=t=>{const{data:e={},style:n={},animate:r}=t,i=Le(t,["data","style","animate"]),o=Math.max(0,I(e)?e:null==e?void 0:e.percent),a=[{percent:o,type:"liquid"}],s=Object.assign(Object.assign({},Qo(n,"text")),Qo(n,"content")),c=Qo(n,"outline"),l=Qo(n,"wave"),u=Qo(n,"background");return[Q({},PS,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)),Q({},NS,{style:Object.assign({text:`${dy(100*o)} %`},s),animate:r})]};CS.props={};const LS=()=>["#5B8FF9","#5AD8A6","#5D7092","#F6BD16","#6F5EF9","#6DC8EC","#945FB9","#FF9845","#1E9493","#FF99C3"];LS.props={};const jS=()=>["#5B8FF9","#CDDDFD","#5AD8A6","#CDF3E4","#5D7092","#CED4DE","#F6BD16","#FCEBB9","#6F5EF9","#D3CEFD","#6DC8EC","#D3EEF9","#945FB9","#DECFEA","#FF9845","#FFE0C7","#1E9493","#BBDEDE","#FF99C3","#FFE0ED"];jS.props={};const RS=t=>new Xi(t);RS.props={};const IS=t=>new po(t);IS.props={};const DS=t=>new qi(t);DS.props={};const BS=t=>new co(t);BS.props={};const FS=t=>new go(t);FS.props={};const zS=t=>new Bo(t);zS.props={};const $S=t=>new wo(t);$S.props={};const WS=t=>new yo(t);WS.props={};const GS=t=>new bo(t);GS.props={};const HS=t=>new Eo(t);HS.props={};const YS=t=>new ko(t);YS.props={};const qS=t=>new mo(t);qS.props={};const VS=t=>new $o(t);VS.props={};const US=t=>new Ki(t);function XS({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:v="auto",margin:y=16}){return{padding:v,margin:y,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",tick:!1,titlePosition:"start"},legendCategory:{backgroundFill:"transparent",itemBackgroundFill:"transparent",itemLabelFill:e,itemLabelFillOpacity:c,itemLabelFontSize:12,itemLabelFontWeight:"normal",itemMarkerFillOpacity:1,itemMarkerSize:8,itemSpacing:[o,o],itemValueFill:e,itemValueFillOpacity:.65,itemValueFontSize:12,itemValueFontWeight:"normal",navButtonFill:e,navButtonFillOpacity:.65,navPageNumFill:e,navPageNumFillOpacity:.45,navPageNumFontSize:12,padding:8,title:!1,titleFill:e,titleFillOpacity:.65,titleFontSize:12,titleFontWeight:"normal",titleSpacing:4,tickStroke:e,tickStrokeOpacity:.25,rowPadding:o,colPadding:a,maxRows:3,maxCols:3},legendContinuous:{handleHeight:12,handleLabelFill:e,handleLabelFillOpacity:u,handleLabelFontSize:12,handleLabelFontWeight:"normal",handleMarkerFill:e,handleMarkerFillOpacity:.6,handleMarkerLineWidth:1,handleMarkerStroke:e,handleMarkerStrokeOpacity:.25,handleWidth:10,labelFill:e,labelFillOpacity:u,labelFontSize:12,labelFontWeight:"normal",labelSpacing:3,tick:!0,tickLength:12,ribbonSize:12,ribbonFill:"#aaa",handle:!0,handleLabel:!1,handleShape:"slider",handleIconSize:12/1.8,indicator:!1,titleFontSize:12,titleSpacing:4,titleFontWeight:"normal",titleFillOpacity:c,tickStroke:e,tickStrokeOpacity:u},label:{fill:e,fillOpacity:.65,fontSize:12,fontWeight:"normal",stroke:void 0,offset:12,connectorStroke:e,connectorStrokeOpacity:.45,connectorLineWidth:1,connectorLength:12,connectorLength2:8,connectorDistance:4},innerLabel:{fill:n,fontSize:12,fillOpacity:.85,fontWeight:"normal",stroke:void 0,offset:0},htmlLabel:{fontSize:12,opacity:.65,color:e,fontWeight:"normal"},slider:{trackSize:16,trackFill:r,trackFillOpacity:1,selectionFill:t,selectionFillOpacity:.15,handleIconSize:10,handleIconFill:"#f7f7f7",handleIconFillOpacity:1,handleIconStroke:e,handleIconStrokeOpacity:.25,handleIconLineWidth:1,handleIconRadius:2,handleLabelFill:e,handleLabelFillOpacity:.45,handleLabelFontSize:12,handleLabelFontWeight:"normal"},scrollbar:{padding:[0,0,0,0],trackSize:6,isRound:!0,slidable:!0,scrollable:!0,trackFill:"#e5e5e5",trackFillOpacity:0,thumbFill:"#000",thumbFillOpacity:.15,thumbHighlightedFillOpacity:.2},title:{spacing:8,titleFill:e,titleFillOpacity:c,titleFontSize:16,titleFontWeight:"bold",titleTextBaseline:"top",subtitleFill:e,subtitleFillOpacity:l,subtitleFontSize:12,subtitleFontWeight:"normal",subtitleTextBaseline:"top"},tooltip:{css:{".g2-tooltip":{"font-family":"sans-serif"}}}}}US.props={};const ZS=XS({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}),KS=t=>Q({},ZS,t);KS.props={};const QS=t=>Q({},KS(),{category10:"category10",category20:"category20"},t);QS.props={};const JS=XS({colorBlack:"#fff",colorWhite:"#000",colorStroke:"#416180",colorDefault:"#1783FF",colorBackground:"transparent",category10:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F"],category20:["#1783FF","#00C9C9","#F0884D","#D580FF","#7863FF","#60C42D","#BD8F24","#FF80CA","#2491B3","#17C76F","#AABA01","#BC7CFC","#237CBC","#2DE379","#CE8032","#FF7AF4","#545FD3","#AFE410","#D8C608","#FFA1E0"],padding1:8,padding2:12,padding3:20,alpha90:.9,alpha65:.65,alpha45:.45,alpha25:.25,alpha10:.25}),tA=t=>Q({},JS,{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),eA=t=>Object.assign({},tA(),{category10:"category10",category20:"category20"},t);eA.props={};const nA=XS({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}),rA=t=>Q({},nA,{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 iA(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)]}rA.props={};var oA,aA=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function sA(t){if(!(e=aA.exec(t)))throw new Error("invalid format: "+t);var e;return new cA({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 cA(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 lA(t,e){var n=iA(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")}sA.prototype=cA.prototype,cA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var uA={"%":(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)=>lA(100*t,e),r:lA,s:function(t,e){var n=iA(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(oA=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")+iA(t,Math.max(0,e+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function fA(t){return t}var hA,dA,pA=Array.prototype.map,gA=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function vA(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?fA:(e=pA.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?fA:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(pA.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=sA(t)).fill,n=t.align,f=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,v=t.precision,y=t.trim,m=t.type;"n"===m?(g=!0,m="g"):uA[m]||(void 0===v&&(v=12),y=!0,m="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(m)?"0"+m.toLowerCase():"",x="$"===h?o:/[%p]/.test(m)?c:"",w=uA[m],k=/[defgprs%]/.test(m);function M(t){var i,o,c,h=b,M=x;if("c"===m)M=w(t)+M,t="";else{var E=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:w(Math.abs(t),v),y&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r<n;++r)switch(t[r]){case".":i=e=r;break;case"0":0===i&&(i=r),e=r;break;default:if(!+t[r])break t;i>0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),E&&0===+t&&"+"!==f&&(E=!1),h=(E?"("===f?f:l:"-"===f||"("===f?"":f)+h,M=("s"===m?gA[8+oA/3]:"")+M+(E&&"("===f?")":""),k)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 O=h.length+t.length+M.length,_=O<p?new Array(p-O+1).join(e):"";switch(g&&d&&(t=r(_+t,_.length?p-M.length:1/0),_=""),n){case"<":t=h+t+M+_;break;case"=":t=h+_+t+M;break;case"^":t=_.slice(0,O=_.length>>1)+h+t+M+_.slice(O);break;default:t=_+h+t+M}return s(t)}return v=void 0===v?6:/[gprs]/.test(m)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v)),M.toString=function(){return t+""},M}return{format:f,formatPrefix:function(t,e){var n=f(((t=sA(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(function(t){return(t=iA(Math.abs(t)))?t[1]:NaN}(e)/3))),i=Math.pow(10,-r),o=gA[8+r/3];return function(t){return n(i*t)+o}}}}function yA(t,e,n){return t.querySelector(e)?uy(t).select(e):uy(t).append(n)}function mA(t){return Array.isArray(t)?t.join(", "):`${t||""}`}function bA(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)}hA=vA({thousands:",",grouping:[3],currency:["$",""]}),dA=hA.format;class xA extends rk{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 wA extends xA{update(t){var e;const{subOptions:n}=t;this.attr(t),null===(e=this.child)||void 0===e||e.update(n)}}function kA(t,e){var n;return null===(n=t.filter((t=>t.getOptions().name===e)))||void 0===n?void 0:n[0]}function MA(t){return"vertical"===t||t===-Math.PI/2}function EA(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,v]=s?[d,h]:[h,d];return{orientation:p,width:g,height:v,size:h,length:d}}function OA(t){const e=["arrow","crosshairs","grid","handle","handleLabel","indicator","label","line","tick","tip","title","trunc"],{style:n}=t,r=Le(t,["style"]),i={};return Object.entries(r).forEach((([t,n])=>{e.includes(t)?i[`show${G(t)}`]=n:i[t]=n})),Object.assign(Object.assign({},i),n)}function _A(t,e){const{eulerAngles:n,origin:r}=e;r&&t.setOrigin(r),n&&t.rotate(n[0],n[1],n[2])}function SA(t){const{innerWidth:e,innerHeight:n,depth:r}=t.getOptions();return[e,n,r]}function AA(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]=Vn(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(Qc(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 po({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(!nl(e))return i;const o="bottom"===t?[i,1]:[0,i],a=e.map(o);if("bottom"===t){const t=a[0];return new po({domain:[0,n],range:[0,1]}).map(t)}if("left"===t){const t=a[1];return new po({domain:[0,r],range:[0,1]}).map(t)}return i}}(a,s),g=t=>["left","right"].includes(t);return Qc(s)||Kc(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:Jc(s)&&"center"===a||Kc(s)&&(null===(o=t.getTicks)||void 0===o?void 0:o.call(t))&&(t=>["top","bottom","center","outer"].includes(t))(a)||Kc(s)&&g(a)?1-l:l,label:f(h(dy(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(dy(e),n,r)),id:String(n)}}))}function TA(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 PA(t,e,n){return!function(t){return Qc(t)&&Kc(t)}(e)&&!el(e)&&(void 0===t?!!n.getTicks:t)}function NA(t,e,n,r,i,o){const a=function(t,e,n,r,i){const o=n.axis,a=["top","right","bottom","left"].includes(i)?n[`axis${Vo(i)}`]:n.axisLinear,s=t.getOptions().name,c=n[`axis${G(s)}`]||{};return Object.assign({},o,a,c)}(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:MA(o)?10:0,tick:"center"!==r&&void 0}):a}const CA=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?dA(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)}},LA=CA((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,v=Le(t,["direction","important","labelFormatter","order","orientation","actualPosition","position","size","style","title","tickCount","tickFilter","tickMethod","transform","indexBBox"]);return({scales:i,value:y,coordinate:m,theme:b})=>{const{bbox:x}=y,[w]=i,{domain:k,xScale:M}=w.getOptions(),E=NA(w,0,b,e,s,o),O=Object.assign(Object.assign(Object.assign({},E),l),v),_=function(t,e,n="xy"){const[r,i,o]=SA(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,m,t.plane),S=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]=il(r),[f,h]=ol(r),d=Math.min(s,c)/2,{insetLeft:p,insetTop:g}=r.getOptions(),v=l*d,y=u*d,[m,b]=[t+o-p,n+a-g],[x,w]=[Math.cos(e),Math.sin(e)],k=[m+y*x,b+y*w],M=[m+v*x,b+v*w],E=()=>{const{domain:t}=i.getOptions();return t.length},O=Qc(r)&&i?E():3;return{startPos:k,endPos:M,gridClosed:Math.abs(h-f-360)<1e-6,gridCenter:[m,b],gridControlAngles:new Array(O).fill(0).map(((t,e,n)=>(h-f)/O*e))}}}return{}}(s,o,x,m,M),A=function(t){const{depth:e}=t.getOptions();return e?{tickIsBillboard:!0,lineIsBillboard:!0,labelIsBillboard:!0,titleIsBillboard:!0,gridIsBillboard:!0}:{}}(m),T=AA(w,k,f,r,h,d,s,m),P=g?T.map(((t,e)=>{const n=g.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):T,N=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},O),{type:"linear",data:P,crossSize:c,titleText:mA(u),labelOverlap:TA(p,O),grid:PA(O.grid,m,w),gridLength:_,line:!0,indexBBox:g}),O.line?null:{lineOpacity:0}),S),A),n),C=N.labelOverlap.find((t=>"hide"===t.type));return C&&(N.crossSize=!1),new Ew({className:"axis",style:OA(N)})}})),jA=CA((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=Le(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(),v=AA(t,g,s,o,a,c,r,n),y=f?v.map(((t,e)=>{const n=f.get(e);return n?n[0]!==t.label?t:Object.assign(Object.assign({},t),{bbox:n[1]}):t})):v,[m,b]=il(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]=ol(i),[d,p]=SA(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,m,b,n),{axis:w,axisArc:k={}}=i,M=OA(Q({},w,k,x,Object.assign(Object.assign({type:"arc",data:y,titleText:mA(h),grid:d},p),l)));return new Ew({style:ot(M,["transform"])})}}));LA.props={defaultPosition:"center",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]},jA.props={defaultPosition:"outer",defaultOrientation:"vertical",defaultSize:45,defaultOrder:0,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const RA=t=>(...e)=>{const n=LA(Object.assign({},{crossPadding:50},t))(...e);return _A(n,t),n};RA.props=Object.assign(Object.assign({},LA.props),{defaultPosition:"bottom"});const IA=t=>(...e)=>{const n=LA(Object.assign({},{crossPadding:10},t))(...e);return _A(n,t),n};function DA(t,e,n,r){const{radar:i}=t,[o]=r,a=o.getOptions().name,[s,c]=ol(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))})}IA.props=Object.assign(Object.assign({},LA.props),{defaultPosition:"left"});const BA=t=>{const{important:e={}}=t,n=Le(t,["important"]);return r=>{const{theme:i,coordinate:o,scales:a}=r;return LA(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({},DA(t,i,o,a)),e)}))(r)}};function FA(t,e){const{scales:n,library:r,markState:i}=e,[o,a]=function(t,e){const n=kA(t,"shape"),r=kA(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)||j(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=Le(e,["d","fill","lineWidth","path","stroke","color"]);const l=dm.get(t)||dm.get("point");return(...t)=>new Gg({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 kA(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 zA(t){const e=kA(t,"opacity");if(e){const{range:t}=e.getOptions();return(e,n)=>t[n]}}function $A(t,e){const{labelFormatter:n=t=>`${t}`}=t,{scales:r,theme:i}=e,o=function(t,e){const n=kA(t,"size");return n instanceof co?2*n.map(NaN):e}(r,i.legendCategory.itemMarkerSize),a={itemMarker:FA(Object.assign(Object.assign({},t),{itemMarkerSize:o}),e),itemMarkerSize:o,itemMarkerOpacity:zA(r)},s="string"==typeof n?dA(n):n,c=kA(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)})))})}BA.props=Object.assign(Object.assign({},LA.props),{defaultPosition:"center"});const WA=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,cols:c,itemMarker:l}=t,u=Le(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}=EA(t,e,n);return{width:i,height:o}}(r,t,WA),d=bA(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:mA(s)}),$A(t,e)),{legendCategory:g={}}=i,v=OA(Object.assign({},g,function(t){return Object.assign(Object.assign({},t),{data:(null==t?void 0:t.data.filter((t=>""!==t.id)))||[]})}(p),u)),y=new wA({style:Object.assign(Object.assign({x:a.x,y:a.y,width:a.width,height:a.height},d),{subOptions:v})});return y.appendChild(new zw({className:"legend-category",style:v})),y}};function GA(t,e,n,r,i){const o=e.thresholds,a=function(t){return e=>({value:e/t,label:String(e)})}(r);return Object.assign(Object.assign({},t),{color:i,data:[n,...o,r].map(a)})}function HA(t){const{domain:e}=t.getOptions(),[n,r]=[e[0],ca(e)];return[n,r]}function YA(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:[lh(e).toString()]})),r}(s,c),[u,f]=HA(l),[h,d]=HA([e,n,r].filter((t=>void 0!==t)).find((t=>!(t instanceof Ki))));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})`))}))})}function qA(t,e,n,r,i,o){const a=kA(t,"color"),s=function(t,e,n){const{size:r}=e,i=EA(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 bo){const{range:t}=a.getOptions(),[e,n]=HA(a);return a instanceof ko||a instanceof Eo?GA(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 YA(s,a,kA(t,"size"),kA(t,"opacity"),e,o)}WA.props={defaultPosition:"top",defaultOrder:1,defaultSize:40,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const VA=t=>{const{labelFormatter:e,layout:n,order:r,orientation:i,position:o,size:a,title:s,style:c,crossPadding:l,padding:u}=t,f=Le(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,v=bA(o,n),{legendContinuous:y={}}=a,m=OA(Object.assign({},y,Object.assign(Object.assign({titleText:mA(s),labelAlign:"value",labelFormatter:"string"==typeof e?t=>dA(e)(t.label):e},qA(r,l,i,t,VA,a)),c),f)),b=new xA({style:Object.assign(Object.assign({x:h,y:d,width:p,height:g},v),{subOptions:m})});return b.appendChild(new Qw({className:"legend-continuous",style:m})),b}};VA.props={defaultPosition:"top",defaultOrientation:"vertical",defaultOrder:1,defaultSize:60,defaultLength:200,defaultLegendSize:60,defaultPadding:[20,10],defaultCrossPadding:[12,12]};const UA=t=>(...e)=>VA(Object.assign({},{block:!0},t))(...e);UA.props=Object.assign(Object.assign({},VA.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const XA=t=>e=>{const{scales:n}=e,r=kA(n,"size");return VA(Object.assign({},{type:"size",data:r.getTicks().map(((t,e)=>({value:t,label:String(t)})))},t))(e)};XA.props=Object.assign(Object.assign({},VA.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const ZA=t=>XA(Object.assign({},{block:!0},t));function KA(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"}}}ZA.props=Object.assign(Object.assign({},VA.props),{defaultPosition:"top",defaultOrientation:"horizontal"});const QA=(JA={render(t,e){const{width:n,title:r,subtitle:i,spacing:o=2,align:a="left",x:s,y:c}=t,l=Le(t,["width","title","subtitle","spacing","align","x","y"]);e.style.transform=`translate(${s}, ${c})`;const u=Qo(l,"title"),f=Qo(l,"subtitle"),h=yA(e,".title","text").attr("className","title").call(py,Object.assign(Object.assign(Object.assign({},KA(0,0,n,a)),{fontSize:14,textBaseline:"top",text:r}),u)).node().getLocalBounds();yA(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({},KA(0,h.max[1]+o,n,a)),{fontSize:12,textBaseline:"top",text:i}),f))}))}},class extends jg{constructor(t){super(t),this.descriptor=JA}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(Q({},this.attributes,t)),null===(n=(e=this.descriptor).render)||void 0===n||n.call(e,this.attributes,this)}});var JA;const tT=t=>({value:e,theme:n})=>{const{x:r,y:i,width:o,height:a}=e.bbox;return new QA({style:Q({},n.title,Object.assign({x:r,y:i,width:o,height:a},t))})};function eT(t){return!!t.getBandWidth}function nT(t,e,n){if(!eT(t))return t.invert(e);const{adjustedRange:r}=t,{domain:i}=t.getOptions(),o=n?-1:0,a=t.getStep(),s=n?r:r.map((t=>t+a)),c=function(t,e,n){return Math.min(n,Math.max(e,t))}(Wn(s,e)+o,0,i.length-1);return i[c]}function rT(t,e,n){if(!e)return t.getOptions().domain;if(!eT(t)){const r=ir(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 iT(t,e,n,r,i,o){const{x:a,y:s}=i,c=(t,e)=>{const[n,r]=o.invert(t);return[nT(a,n,e),nT(s,r,e)]},l=c([t,e],!0),u=c([n,r],!1);return[rT(a,[l[0],u[0]]),rT(s,[l[1],u[1]])]}function oT(t,e){const[n,r]=t;return[e.map(n),e.map(r)+(t=>t.getStep?t.getStep():0)(e)]}tT.props={defaultPosition:"top",defaultOrder:2,defaultSize:36,defaultCrossPadding:[20,20],defaultPadding:[12,12]};const aT=t=>{const{orientation:e,labelFormatter:n,size:r,style:i={},position:o}=t,a=Le(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,v=(null===(s=c.getFormatter)||void 0===s?void 0:s.call(c))||(t=>t+""),y="string"==typeof n?dA(n):n,m="horizontal"===e,b=Kc(f)&&m,{trackSize:x=g.trackSize}=i,[w,k]=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 kx({className:"slider",style:Object.assign({},g,Object.assign(Object.assign({x:w,y:k,trackLength:m?d:p,orientation:e,formatter:t=>(y||v)(nT(c,b?1-t:t,!0)),sparklineData:sT(t,r)},i),a))})}};function sT(t,e){const{markState:n}=e;return x(t.sparklineData)?t.sparklineData:function(t,e){const[n]=Array.from(t.entries()).filter((([t])=>"line"===t.type||"area"===t.type)).filter((([t])=>t.slider)).map((([t])=>{const{encode:n,slider:r}=t;if(null==r?void 0:r.x){const t=t=>{const e=n[t];return[t,e?e.value:void 0]};return Object.fromEntries(e.map(t))}}));if(!(null==n?void 0:n.series))return null==n?void 0:n.y;const r=n.series.reduce(((t,e,r)=>(t[e]=t[e]||[],t[e].push(n.y[r]),t)),{});return Object.values(r)}(n,["y","series"])}aT.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const cT=t=>aT(Object.assign(Object.assign({},t),{orientation:"horizontal"}));cT.props=Object.assign(Object.assign({},aT.props),{defaultPosition:"bottom"});const lT=t=>aT(Object.assign(Object.assign({},t),{orientation:"vertical"}));lT.props=Object.assign(Object.assign({},aT.props),{defaultPosition:"left"});const uT=t=>{const{orientation:e,labelFormatter:n,style:r}=t,i=Le(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,[v,y]=d,m=y>v?0:1;return new Mx({className:"g2-scrollbar",style:Object.assign({},f,Object.assign(Object.assign(Object.assign(Object.assign({},r),{x:s,y:c,trackLength:p,value:m}),i),{orientation:e,contentLength:g,viewportLength:p}))})}};uT.props={defaultPosition:"bottom",defaultSize:24,defaultOrder:1,defaultCrossPadding:[12,12],defaultPadding:[12,12]};const fT=t=>uT(Object.assign(Object.assign({},t),{orientation:"horizontal"}));fT.props=Object.assign(Object.assign({},uT.props),{defaultPosition:"bottom"});const hT=t=>uT(Object.assign(Object.assign({},t),{orientation:"vertical"}));hT.props=Object.assign(Object.assign({},uT.props),{defaultPosition:"left"});const dT=t=>()=>new Ig;dT.props={};const pT=(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]=Kc(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))}},gT=(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]=Kc(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))}},vT=(t,e)=>{const n=1e-4,{coordinate:r}=e;return Qg({name:"scaleInYRadius",inherits:!1,initialValue:"",interpolable:!0,syntax:Hu.NUMBER}),(e,i,o)=>{const[a]=e;return Qc(r)?(e=>{const{__data__:i,style:a}=e,{fillOpacity:s=1,strokeOpacity:c=1,opacity:l=1}=a,{points:u,y:f,y1:h}=i,d=my(r,u,[f,h]),{innerRadius:p,outerRadius:g}=d,v=[{scaleInYRadius:p+n,fillOpacity:0,strokeOpacity:0,opacity:0},{scaleInYRadius:p+n,fillOpacity:s,strokeOpacity:c,opacity:l,offset:.01},{scaleInYRadius:g,fillOpacity:s,strokeOpacity:c,opacity:l}];return e.animate(v,Object.assign(Object.assign({},o),t))})(a):(e=>{const{style:n}=e,{transform:i="",fillOpacity:a=1,strokeOpacity:s=1,opacity:c=1}=n,[l,u]=Kc(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)}},yT=(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]=Kc(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))}},mT=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))};mT.props={};const bT=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))};bT.props={};const xT={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},wT={[tu.CIRCLE]:["cx","cy","r"],[tu.ELLIPSE]:["cx","cy","rx","ry"],[tu.RECT]:["x","y","width","height"],[tu.IMAGE]:["x","y","width","height"],[tu.LINE]:["x1","y1","x2","y2"],[tu.POLYLINE]:["points"],[tu.POLYGON]:["points"]};function kT(t,e,n=!1){const r={};for(const i of e){const e=t.style[i];e?r[i]=e:n&&(r[i]=xT[i])}return r}const MT=["fill","stroke","fillOpacity","strokeOpacity","opacity","lineWidth"];function ET(t){const{min:e,max:n}=t.getLocalBounds(),[r,i]=e,[o,a]=n;return[r,i,o-r,a-i]}function OT(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 _T(t,e){const[n,r,i,o]=ET(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(OT([t,o,e,l]))}f-=t,u+=1}return c}function ST(t,e){t.__data__=e.__data__,t.className=e.className,t.markType=e.markType,e.parentNode.replaceChild(t,e)}function AT(t,e){return t.indexOf(e)===t.lastIndexOf(e)}function TT(t){const e=$h(t);if(e&&!function(t){return!AT(t,"m")||!AT(t,"M")}(e))return e}function PT(t){const{nodeName:e}=t;if("path"===e){const e=rt(t,"attributes");return e.markerEnd||e.markerStart}return!1}function NT(t,e,n,r){const{nodeName:i}=e,{nodeName:o}=n,a=TT(e),s=TT(n),c=i===o&&"path"!==i,l=void 0===a||void 0===s,u=PT(e)||PT(n);if(c||l||u)return function(t,e,n){let{transform:r}=t.style;const{transform:i}=e.style;ST(e,t);let o=MT;if(t.nodeName===tu.GROUP){const[n,i,o,a]=ET(t),[s,c,l,u]=ET(e);r=`translate(${n-s}, ${i-c}) scale(${o/l}, ${a/u})`}else o=o.concat(wT[t.nodeName]||[]);const a=[Object.assign({transform:null!=r?r:"none"},kT(t,o,!0)),Object.assign({transform:null!=i?i:"none"},kT(e,o,!0))];return e.animate(a,n)}(e,n,r);const f=function(t,e){const{nodeName:n}=t;if("path"===n)return t;const r=new Gg({style:Object.assign(Object.assign({},kT(t,MT)),{d:e})});return ST(r,t),r}(t,a),h=[Object.assign({},kT(e,MT)),Object.assign({},kT(n,MT))];if(a!==s){h[0].d=a,h[1].d=s;const t=f.animate(h,r);return t.onfinish=()=>{Xo(f,n),f.style.d=s,f.style.transform="none"},f.style.transform="none",t}return null}const CT=t=>(e,n,r)=>{const i=function(t="pack"){return"function"==typeof t?t:_T}(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 NT(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)=>NT(e,new Gg({style:Object.assign({d:i[r]},kT(t,MT))}),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)=>NT(t,t,new Gg({style:{d:i[r],fill:e.style.fill}}),n)));return[...u,l]}(e,t,o,i)}return null};CT.props={};const LT=(t,e)=>{const n=1e-4;Qg({name:"waveInArcAngle",inherits:!1,initialValue:"",interpolable:!0,syntax:Hu.NUMBER});const{coordinate:r}=e;return(i,o,a)=>{const[s]=i;if(!Qc(r))return pT(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:v,y1:y}=c,m=vc().cornerRadius(u).padAngle(f*Math.PI/180),b=my(r,g,[v,y]),{startAngle:x,endAngle:w}=b,k=[{waveInArcAngle:x+n,fillOpacity:0,strokeOpacity:0,opacity:0},{waveInArcAngle:x+n,fillOpacity:h,strokeOpacity:d,opacity:p,offset:.01},{waveInArcAngle:w,fillOpacity:h,strokeOpacity:d,opacity:p}],M=s.animate(k,Object.assign(Object.assign({},a),t));return M.onframe=function(){s.style.d=m(Object.assign(Object.assign({},b),{endAngle:Number(s.style.waveInArcAngle)}))},M.onfinish=function(){s.style.d=m(Object.assign(Object.assign({},b),{endAngle:w}))},M}};LT.props={};const jT=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))},RT=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))},IT=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))};IT.props={};const DT=(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 Gg({style:{d:`M${a},${s}L${a+l},${s}L${a+l},${s+u}L${a},${s+u}Z`}});o.appendChild(f),o.style.clipPath=f;return pT(t,e)([f],r,i)};DT.props={};const BT=(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 Gg({style:{d:`M${a},${s}L${a+l},${s}L${a+l},${s+u}L${a},${s+u}Z`}});o.appendChild(f),o.style.clipPath=f;return vT(t,e)([f],r,i)};BT.props={};const FT="main-layer",zT="label-layer",$T="element",WT="view",GT="plot",HT="component",YT="label",qT="area";
|
|
19
19
|
/*!
|
|
20
20
|
* @antv/g-plugin-canvas-path-generator
|
|
21
21
|
* @description A G plugin of path generator with Canvas2D API
|
|
@@ -64,4 +64,4 @@ function VT(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
|
|
|
64
64
|
* @date 5/9/2025, 8:22:49 AM
|
|
65
65
|
* @author AntVis
|
|
66
66
|
* @docs https://g.antv.antgroup.com/
|
|
67
|
-
*/sN.tag="Dragndrop";var cN=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hl(this,e),(t=wl(this,e)).name="dragndrop",t.options=n,t}return Ml(e,t),pl(e,[{key:"init",value:function(){this.addRenderingPlugin(new sN(fl({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(nu),lN=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}(),uN=lN;const fN={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"},hN={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,max:Math.max,min:Math.min,round:Math.round,sqrt:Math.sqrt,pow:Math.pow};class dN extends Error{constructor(t,e,n){super(t),this.position=e,this.token=n,this.name="ExpressionError"}}var pN;!function(t){t[t.STRING=0]="STRING",t[t.NUMBER=1]="NUMBER",t[t.BOOLEAN=2]="BOOLEAN",t[t.NULL=3]="NULL",t[t.IDENTIFIER=4]="IDENTIFIER",t[t.OPERATOR=5]="OPERATOR",t[t.FUNCTION=6]="FUNCTION",t[t.DOT=7]="DOT",t[t.BRACKET_LEFT=8]="BRACKET_LEFT",t[t.BRACKET_RIGHT=9]="BRACKET_RIGHT",t[t.PAREN_LEFT=10]="PAREN_LEFT",t[t.PAREN_RIGHT=11]="PAREN_RIGHT",t[t.COMMA=12]="COMMA",t[t.QUESTION=13]="QUESTION",t[t.COLON=14]="COLON",t[t.DOLLAR=15]="DOLLAR"}(pN||(pN={}));const gN=new Set([32,9,10,13]),vN=new Set([43,45,42,47,37,33,38,124,61,60,62]),yN=new Map([["true",pN.BOOLEAN],["false",pN.BOOLEAN],["null",pN.NULL]]),mN=new Map([["===",!0],["!==",!0],["<=",!0],[">=",!0],["&&",!0],["||",!0],["+",!0],["-",!0],["*",!0],["/",!0],["%",!0],["!",!0],["<",!0],[">",!0]]),bN=new Map([[46,pN.DOT],[91,pN.BRACKET_LEFT],[93,pN.BRACKET_RIGHT],[40,pN.PAREN_LEFT],[41,pN.PAREN_RIGHT],[44,pN.COMMA],[63,pN.QUESTION],[58,pN.COLON],[36,pN.DOLLAR]]),xN=new Map;for(const[t,e]of bN.entries())xN.set(t,{type:e,value:String.fromCharCode(t)});function wN(t){return t>=48&&t<=57}function kN(t){return t>=97&&t<=122||t>=65&&t<=90||95===t}function MN(t){return kN(t)||wN(t)}function EN(t){return vN.has(t)}var ON;!function(t){t[t.Program=0]="Program",t[t.Literal=1]="Literal",t[t.Identifier=2]="Identifier",t[t.MemberExpression=3]="MemberExpression",t[t.CallExpression=4]="CallExpression",t[t.BinaryExpression=5]="BinaryExpression",t[t.UnaryExpression=6]="UnaryExpression",t[t.ConditionalExpression=7]="ConditionalExpression"}(ON||(ON={}));const _N=new Map([["||",2],["&&",3],["===",4],["!==",4],[">",5],[">=",5],["<",5],["<=",5],["+",6],["-",6],["*",7],["/",7],["%",7],["!",8]]),SN={type:ON.Literal,value:null},AN={type:ON.Literal,value:!0},TN={type:ON.Literal,value:!1},PN=t=>{let e=0;const n=t.length,r=()=>e>=n?null:t[e],i=()=>t[e++],o=t=>{const e=r();return null!==e&&e.type===t},a=t=>t.type===pN.OPERATOR?_N.get(t.value)||-1:t.type===pN.DOT||t.type===pN.BRACKET_LEFT?9:t.type===pN.QUESTION?1:-1,s=t=>{let n,a;if(i().type===pN.DOT){if(!o(pN.IDENTIFIER)){const t=r();throw new dN("Expected property name",e,t?t.value:"<end of input>")}const t=i();n={type:ON.Identifier,name:t.value},a=!1}else{if(n=l(0),!o(pN.BRACKET_RIGHT)){const t=r();throw new dN("Expected closing bracket",e,t?t.value:"<end of input>")}i(),a=!0}return{type:ON.MemberExpression,object:t,property:n,computed:a}},c=()=>{const t=r();if(!t)throw new dN("Unexpected end of input",e,"<end of input>");if(t.type===pN.OPERATOR&&("!"===t.value||"-"===t.value)){i();const e=c();return{type:ON.UnaryExpression,operator:t.value,argument:e,prefix:!0}}switch(t.type){case pN.NUMBER:return i(),{type:ON.Literal,value:Number(t.value)};case pN.STRING:return i(),{type:ON.Literal,value:t.value};case pN.BOOLEAN:return i(),"true"===t.value?AN:TN;case pN.NULL:return i(),SN;case pN.IDENTIFIER:return i(),{type:ON.Identifier,name:t.value};case pN.FUNCTION:return(()=>{const t=i(),n=[];if(!o(pN.PAREN_LEFT)){const t=r();throw new dN("Expected opening parenthesis after function name",e,t?t.value:"<end of input>")}for(i();;){if(o(pN.PAREN_RIGHT)){i();break}if(!r()){const t=r();throw new dN("Expected closing parenthesis",e,t?t.value:"<end of input>")}if(n.length>0){if(!o(pN.COMMA)){const t=r();throw new dN("Expected comma between function arguments",e,t?t.value:"<end of input>")}i()}const t=l(0);n.push(t)}return{type:ON.CallExpression,callee:{type:ON.Identifier,name:t.value},arguments:n}})();case pN.PAREN_LEFT:{i();const t=l(0);if(!o(pN.PAREN_RIGHT)){const t=r();throw new dN("Expected closing parenthesis",e,t?t.value:"<end of input>")}return i(),t}default:throw new dN(`Unexpected token: ${t.type}`,e,t.value)}},l=(u=0)=>{let f=c();for(;e<n;){const n=t[e],c=a(n);if(c<=u)break;if(n.type!==pN.QUESTION)if(n.type!==pN.OPERATOR){if(n.type!==pN.DOT&&n.type!==pN.BRACKET_LEFT)break;f=s(f)}else{i();const t=l(c);f={type:ON.BinaryExpression,operator:n.value,left:f,right:t}}else{i();const t=l(0);if(!o(pN.COLON)){const t=r();throw new dN("Expected : in conditional expression",e,t?t.value:"<end of input>")}i();const n=l(0);f={type:ON.ConditionalExpression,test:f,consequent:t,alternate:n}}}return f},u=l();return{type:ON.Program,body:u}},NN=(t,e,n)=>{let r=e;n&&(r={...e,context:{...e.context,...n}});const i=t=>{switch(t.type){case ON.Literal:return(t=>t.value)(t);case ON.Identifier:return(t=>{if(!(t.name in r.context))throw new dN(`Undefined variable: ${t.name}`);return r.context[t.name]})(t);case ON.MemberExpression:return(t=>{const e=i(t.object);if(null==e)throw new dN("Cannot access property of null or undefined");return e[t.computed?i(t.property):t.property.name]})(t);case ON.CallExpression:return(t=>{const e=r.functions[t.callee.name];if(!e)throw new dN(`Undefined function: ${t.callee.name}`);return e(...t.arguments.map((t=>i(t))))})(t);case ON.BinaryExpression:return(t=>{if("&&"===t.operator){const e=i(t.left);return e?i(t.right):e}if("||"===t.operator)return i(t.left)||i(t.right);const e=i(t.left),n=i(t.right);switch(t.operator){case"+":return e+n;case"-":return e-n;case"*":return e*n;case"/":return e/n;case"%":return e%n;case"===":return e===n;case"!==":return e!==n;case">":return e>n;case">=":return e>=n;case"<":return e<n;case"<=":return e<=n;default:throw new dN(`Unknown operator: ${t.operator}`)}})(t);case ON.UnaryExpression:return(t=>{const e=i(t.argument);if(t.prefix)switch(t.operator){case"!":return!e;case"-":if("number"!=typeof e)throw new dN(`Cannot apply unary - to non-number: ${e}`);return-e;default:throw new dN(`Unknown operator: ${t.operator}`)}throw new dN(`Postfix operators are not supported: ${t.operator}`)})(t);case ON.ConditionalExpression:return(t=>{const e=i(t.test);return i(e?t.consequent:t.alternate)})(t);default:throw new dN(`Evaluation error: Unsupported node type: ${t.type}`)}};return i(t.body)};const CN=["style","encode","labels","children"],LN=gM((t=>{const e=function(t){const e=(t=>{const e=t,n=e.length,r=new Array(Math.ceil(n/3));let i=0,o=0;function a(t){const r=o+1;o++;let i="",a=!1;for(;o<n;){const n=e.charCodeAt(o);if(n===t)return a||(i=e.substring(r,o)),o++,{type:pN.STRING,value:i};92===n?(a||(i=e.substring(r,o),a=!0),o++,i+=e[o]):a&&(i+=e[o]),o++}throw new dN(`Unterminated string starting with ${String.fromCharCode(t)}`,o,e.substring(Math.max(0,o-10),o))}function s(){const t=o;for(45===e.charCodeAt(o)&&o++;o<n&&wN(e.charCodeAt(o));)o++;if(o<n&&46===e.charCodeAt(o))for(o++;o<n&&wN(e.charCodeAt(o));)o++;const r=e.slice(t,o);return{type:pN.NUMBER,value:r}}function c(){o++;const t=o;if(o<n&&kN(e.charCodeAt(o)))for(o++;o<n&&MN(e.charCodeAt(o));)o++;const r=e.slice(t,o);return{type:pN.FUNCTION,value:r}}function l(){const t=o++;for(;o<n&&MN(e.charCodeAt(o));)o++;const r=e.slice(t,o),i=yN.get(r);return i?{type:i,value:r}:{type:pN.IDENTIFIER,value:r}}function u(){if(o+2<n){const t=e.substring(o,o+3);if(mN.has(t))return o+=3,{type:pN.OPERATOR,value:t}}if(o+1<n){const t=e.substring(o,o+2);if(mN.has(t))return o+=2,{type:pN.OPERATOR,value:t}}const t=e[o];if(mN.has(t))return o++,{type:pN.OPERATOR,value:t};throw new dN(`Unknown operator at position ${o}: ${e.substring(o,o+1)}`,o,e.substring(Math.max(0,o-10),o))}for(;o<n;){const t=e.charCodeAt(o);if(f=t,gN.has(f)){o++;continue}const h=xN.get(t);if(h)r[i++]=h,o++;else if(34!==t&&39!==t)if(wN(t)||45===t&&o+1<n&&wN(e.charCodeAt(o+1)))r[i++]=s();else if(64!==t)if(kN(t))r[i++]=l();else{if(!EN(t))throw new dN(`Unexpected character: ${e[o]}`,o,e.substring(Math.max(0,o-10),o));r[i++]=u()}else r[i++]=c();else r[i++]=a(t)}var f;return i===r.length?r:r.slice(0,i)})(t),n=PN(e),r=((t={},e={})=>({context:t,functions:e}))({},hN);return(t={})=>NN(n,r,t)}(t);return(...t)=>{const n=Array.from({length:t.length},((t,e)=>String.fromCharCode(97+e))),r=Object.fromEntries(t.map(((t,e)=>[n[e],t])));return e(Object.assign(Object.assign({},r),{global:Object.assign({},r)}))}}),(t=>t),128);function jN(t,e=!0){if(Array.isArray(t))return t.map(((n,r)=>jN(t[r],e)));if("object"==typeof t&&t)return function(t,e){void 0===e&&(e=nt);var n={};return w(t)&&!b(t)&&Object.keys(t).forEach((function(r){n[r]=e(t[r],r)})),n}(t,((t,n)=>e&&CN.includes(n)?jN(t,"children"===n):e?t:jN(t,!1)));if("string"==typeof t){const e=t.trim();if(e.startsWith("{")&&e.endsWith("}"))return LN(e.slice(1,-1))}return t}const RN=[["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 IN={}.toString,DN=function(t,e){return IN.call(t)==="[object "+e+"]"},BN=function(t){return Array.isArray?Array.isArray(t):DN(t,"Array")},FN=function(t){return"object"==typeof t&&null!==t},zN=function(t){if(!FN(t)||!DN(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 $N(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&&zN(o)?(zN(t[i])||(t[i]={}),n<r?$N(t[i],o,n+1,r):t[i]=e[i]):BN(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var WN=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)$N(t,e[r]);return t},GN=function(t){return t};function HN(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):GN}function YN(t){return t instanceof Float32Array||t instanceof Array}var qN=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},VN=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function UN(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var XN=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},ZN=function(t,e,n,r,i){var o,a,s=XN(t,2),c=s[0],l=s[1],u=ht();return a=[c,l],(o=u)[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=a[0],o[7]=a[1],o[8]=1,o},KN=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},QN=function(t,e,n,r,i){var o=new po({range:[e,e+r]}),a=new po({range:[n,n+i]});return{transform:function(t){var e=KN(t,2),n=e[0],r=e[1];return[o.map(n),a.map(r)]},untransform:function(t){var e=KN(t,2),n=e[0],r=e[1];return[o.invert(n),a.invert(r)]}}},JN=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},tC=function(t,e,n,r,i){return(0,JN(t,1)[0])(e,n,r,i)},eC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},nC=function(t,e,n,r,i){return eC(t,1)[0]},rC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},iC=function(t,e,n,r,i){var o=rC(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new po({range:[c,l]}),f=new po({range:[a,s]}),h=i/r,d=h>1?1:h,p=h>1?1/h:1;return{transform:function(t){var e=rC(t,2),n=e[0],r=e[1],i=f.map(n),o=u.map(r);return[.5*(o*Math.cos(i)*d)+.5,.5*(o*Math.sin(i)*p)+.5]},untransform:function(t){var e=rC(t,2),n=e[0],r=e[1],i=2*(n-.5)/d,o=2*(r-.5)/p,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),l=UN(Math.atan2(o,i),a,s);return[f.invert(l),u.invert(c)]}}},oC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},aC=function(t,e,n,r,i){return{transform:function(t){var e=oC(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=oC(t,2),n=e[0];return[e[1],n]}}},sC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},cC=function(t,e,n,r,i){var o,a,s=sC(t,2),c=s[0],l=s[1],u=ht();return a=[c,l],(o=u)[0]=a[0],o[1]=0,o[2]=0,o[3]=0,o[4]=a[1],o[5]=0,o[6]=0,o[7]=0,o[8]=1,o},lC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},uC=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},fC=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return cC.apply(void 0,uC([[-1,-1]],lC(e),!1))},hC=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return cC.apply(void 0,uC([[-1,1]],lC(e),!1))},dC=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return cC.apply(void 0,uC([[1,-1]],lC(e),!1))},pC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},gC=function(t,e,n,r,i){var o=pC(t,1)[0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}(ht(),o)},vC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},yC=function(t,e,n,r,i){var o=vC(t,4),a=o[0],s=o[1],c=o[2],l=(o[3]-c)/((s-0)/(2*Math.PI)+1),u=l/(2*Math.PI),f=new po({range:[c,c+.99*l]}),h=new po({range:[a,s]}),d=i/r,p=d>1?1:d,g=d>1?1/d:1;return{transform:function(t){var e=vC(t,2),n=e[0],r=e[1],i=h.map(n),o=f.map(r);return[.5*(Math.cos(i)*(u*i+o)*p)+.5,.5*(Math.sin(i)*(u*i+o)*g)+.5]},untransform:function(t){var e=vC(t,2),n=e[0],r=e[1],i=2*(n-.5)/p,o=2*(r-.5)/g,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),d=UN(Math.atan2(o,i)+Math.floor(c/l)*Math.PI*2,a,s),v=c-u*d;return[h.invert(d),f.invert(v)]}}},mC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},bC=function(t,e,n,r,i){var o=mC(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new po({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new go({domain:new Array(n).fill(0).map((function(t,e){return e})),range:[a,s]}),i=0;i<n;i++){var o=t[i],c=r.map(i),l=u.map(o);e.push(c,l)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},xC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function wC(t){return 1/Math.tan(t)}var kC=function(t,e,n,r,i){var o=wC(xC(t,1)[0]);return{transform:function(t){var e=xC(t,2),n=e[0],r=e[1];return[n+r*o,r]},untransform:function(t){var e=xC(t,2),n=e[0],r=e[1];return[n-r*o,r]}}},MC=function(t,e,n,r,i){var o=wC(xC(t,1)[0]);return{transform:function(t){var e=xC(t,2),n=e[0];return[n,e[1]+n*o]},untransform:function(t){var e=xC(t,2),n=e[0];return[n,e[1]-n*o]}}},EC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function OC(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r,s=o?-1:1;return s*a*(n+1)/(n+a/((t-e)*s))+e}function _C(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r;return a/(a*(n+1)/(t-e)-n*(o?-1:1))+e}function SC(t,e,n){return n?new po({range:[0,1],domain:[0,e]}).map(t):t}var AC=function(t,e,n,r,i){var o=EC(t,3),a=o[0],s=o[1],c=o[2],l=SC(a,r,void 0!==c&&c);return{transform:function(t){var e=EC(t,2),n=e[0],r=e[1];return[OC(n,l,s,0,1),r]},untransform:function(t){var e=EC(t,2),n=e[0],r=e[1];return[_C(n,l,s,0,1),r]}}},TC=function(t,e,n,r,i){var o=EC(t,3),a=o[0],s=o[1],c=o[2],l=SC(a,i,void 0!==c&&c);return{transform:function(t){var e=EC(t,2);return[e[0],OC(e[1],l,s,0,1)]},untransform:function(t){var e=EC(t,2);return[e[0],_C(e[1],l,s,0,1)]}}},PC=function(t,e,n,r,i){var o=EC(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=SC(a,r,f),d=SC(s,i,f);return{transform:function(t){var e=EC(t,2),n=e[0],r=e[1];return[OC(n,h,c,0,1),OC(r,d,l,0,1)]},untransform:function(t){var e=EC(t,2),n=e[0],r=e[1];return[_C(n,h,c,0,1),_C(r,d,l,0,1)]}}},NC=function(t,e,n,r,i){var o=EC(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=new po({range:[0,r]}),d=new po({range:[0,i]}),p=f?a:h.map(a),g=f?s:d.map(s);return{transform:function(t){var e=EC(t,2),n=e[0],r=e[1],i=h.map(n)-p,o=d.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=OC(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]},untransform:function(t){var e=EC(t,2),n=e[0],r=e[1],i=h.map(n)-p,o=d.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=_C(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]}}},CC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},LC=function(t,e,n,r,i,o,a){var s=new po({range:[e,e+i]}),c=new po({range:[n,n+o]}),l=new po({range:[r,r+a]});return{transform:function(t){var e=CC(t,3),n=e[0],r=e[1],i=e[2];return[s.map(n),c.map(r),l.map(i)]},untransform:function(t){var e=CC(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},jC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},RC=function(t,e,n,r,i,o,a){var s=jC(t,3),c=s[0],l=s[1],u=s[2];return At(pt(),[c,l,u])},IC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},DC=function(t,e,n,r,i,o,a){return{transform:function(t){var e=IC(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=IC(t,3),n=e[0];return[e[1],n,e[2]]}}},BC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},FC=function(t,e,n,r,i,o,a){var s=BC(t,3),c=s[0],l=s[1],u=s[2];return Tt(pt(),[c,l,u])},zC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},$C=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},WC=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},GC=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:QN,translate:ZN,custom:tC,matrix:nC,polar:iC,transpose:aC,scale:cC,"shear.x":kC,"shear.y":MC,reflect:fC,"reflect.x":hC,"reflect.y":dC,rotate:gC,helix:yC,parallel:bC,fisheye:PC,"fisheye.x":AC,"fisheye.y":TC,"fisheye.circular":NC},this.update(t)}return t.prototype.update=function(t){this.options=WN({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:$C($C([],zC(n),!1),[$C([],zC(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?$C([],zC(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],o=t(i);n.push.apply(n,VN([],qN(o),!1))}return n}}(t):t)};try{for(var c=WC(r),l=c.next();!l.done;l=c.next()){var u=zC(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,y=p.width,m=p.height,b=d($C([],zC(h),!1),g,v,y,m);if(YN(b))o.push(b);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(b)||GN,"parallel"!==f)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return HN.apply(void 0,$C([],zC(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=ht();return e&&t.reverse(),t.forEach((function(t){return dt(n,n,t)})),e&&function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=u*a-s*l,h=-u*o+s*c,d=l*o-a*c,p=n*f+r*h+i*d;p&&(p=1/p,t[0]=f*p,t[1]=(-u*r+i*l)*p,t[2]=(s*r-i*a)*p,t[3]=h*p,t[4]=(u*n-i*c)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-l*n+r*c)*p,t[8]=(a*n-r*o)*p)}(n,function(t){var e=new ft(9);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}(n)),function(t){var e=[t[0],t[1],1];return fe(e,e,n),[e[0],e[1]]}},t}(),HC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},YC=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},qC=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},VC=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:LC,translate3D:RC,scale3D:FC,transpose3D:DC},this.update(t)}return t.prototype.update=function(t){this.options=WN({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y,r=t.z;return[(2*e+t.width)/2,(2*n+t.height)/2,(2*r+t.depth)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:YC(YC([],HC(n),!1),[YC([],HC(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?YC([],HC(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],o=t(i);n.push.apply(n,VN([],qN(o),!1))}return n}}(t):t)};try{for(var c=qC(r),l=c.next();!l.done;l=c.next()){var u=HC(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,y=p.z,m=p.width,b=p.height,x=p.depth,w=d(YC([],HC(h),!1),g,v,y,m,b,x);if(YN(w))o.push(w);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(w)||GN,!0)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return HN.apply(void 0,YC([],HC(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=pt();return e&&t.reverse(),t.forEach((function(t){return Ut(n,n,t)})),e&&wt(n,gt(n)),function(t){var e=[t[0],t[1],t[2],1];return me(e,e,n),[e[0],e[1],e[2]]}},t}();function UC(t){return(e,...n)=>Q({},t(e,...n),e)}function XC(t){return(e,...n)=>Q({},e,t(e,...n))}function ZC(t,e){if(!t)return e;if(Array.isArray(t))return t;if(function(t){return!(t instanceof Date)&&"object"==typeof t}(t)){const{value:n=e}=t,r=Le(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}return t}const KC=()=>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=Le(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:ZC(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})}))};KC.props={};const QC=()=>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=Le(r,["data"]),g=ZC(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};QC.props={};const JC=()=>t=>{const{children:e}=t,n=Le(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:c=[]}=n,l=Le(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=Le(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:ZC(e,r),scale:Q({},i,n),encode:Q({},s,f),transform:[...c,...h],axis:!(!l||!o)&&Q({},o,l),legend:!(!u||!a)&&Q({},a,u)},d)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};JC.props={};const tL=({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:v,marginBottom:y,marginTop:m,marginRight:b,data:x,coordinate:w,theme:k,component:M,interaction:E,x:O,y:_,z:S,key:A,frame:T,labelTransform:P,parentKey:N,clip:C,viewStyle:L,title:j}=e,R=Le(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:O,y:_,z:S,key:A,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:k,coordinate:w,component:M,interaction:E,frame:T,labelTransform:P,margin:g,marginLeft:v,marginBottom:y,marginTop:m,marginRight:b,parentKey:N,clip:C,style:L},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${A}-0`,data:x}),t&&{title:j})]})]};tL.props={};class eL{constructor(t){this.$value=t}static of(t){return new eL(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const nL=UC((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=Jn(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"))}}})),rL=XC((t=>{const{data:e,scale:n,legend:r}=t,i=[t];let o,a,s;for(;i.length;){const t=i.shift(),{children:e,encode:n={},scale:r={},legend:c={}}=t,{color:l}=n,{color:u}=r,{color:f}=c;void 0!==l&&(o=l),void 0!==u&&(a=u),void 0!==f&&(s=f),Array.isArray(e)&&i.push(...e)}const c="string"==typeof o?o:"",[l,u]=(()=>{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===o)return[void 0];const i="function"==typeof o?o:t=>t[o],a=e.map(i);return a.some((t=>"number"==typeof t))?[Vn(a)]:[Array.from(new Set(a)),"ordinal"]})();return Object.assign({encode:{color:{type:"column",value:null!=l?l:[]}},scale:{color:Q({},a,{domain:l,type:u})}},void 0===r&&{legend:{color:Q({title:c},s)}})})),iL=UC((()=>({animate:{enterType:"fadeIn"}}))),oL=XC((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),aL=XC((()=>({type:"cell"}))),sL=XC((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]}}})),cL=XC(((t,e=lL,n=fL,r=hL,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:v}=c,{domain:y}=v;return{children:(t,o,a)=>{const{x:c,y:v}=o,{paddingLeft:m,paddingTop:b,marginLeft:x,marginTop:w}=a,{domain:k}=c.getOptions(),{domain:M}=v.getOptions(),E=aa(t),O=t.map(e),_=t.map((({x:t,y:e})=>[c.invert(t),v.invert(e)])),S=_.map((([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)})),A=S.map((t=>d.filter(t))),T=f?vr(A,(t=>t.length)):void 0,P=_.map((([t,e])=>({columnField:p,columnIndex:k.indexOf(t),columnValue:t,columnValuesLength:k.length,rowField:g,rowIndex:M.indexOf(e),rowValue:e,rowValuesLength:M.length}))),N=P.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return E.flatMap((t=>{const[e,o,a,s]=O[t],c=P[t],f=A[t];return N[t].map((v=>{var k,M,{scale:E,key:O,facet:_=!0,axis:S={},legend:A={}}=v,P=Le(v,["scale","key","facet","axis","legend"]);const N=(null===(k=null==E?void 0:E.y)||void 0===k?void 0:k.guide)||S.y,C=(null===(M=null==E?void 0:E.x)||void 0===M?void 0:M.guide)||S.x,L={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=_?f:0===f.length?[]:d,R={color:{domain:y}},I={x:dL(C,n)(c,j),y:dL(N,r)(c,j)};return Object.assign(Object.assign({key:`${O}-${t}`,data:j,margin:0,x:e+m+l+x,y:o+b+u+w,parentKey:h,width:a,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:T,scale:Q(L,E,R),axis:Q({},S,I),legend:!1},P),i)}))}))}}}));function lL(t){const{points:e}=t;return Cs(e)}function uL(t,e){return e.length?Q({title:!1,tick:null,label:null},t):Q({title:!1,tick:null,label:null,grid:null},t)}function fL(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return uL(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return Q({title:s,grid:c},t)}}function hL(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return uL(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return Q({title:o,grid:a},t)}}function dL(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const pL=()=>t=>[eL.of(t).call(aL).call(rL).call(iL).call(nL).call(oL).call(sL).call(cL).value()];pL.props={};const gL=UC((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),vL=XC((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(),v=aa(t),y=t.map((({points:t})=>Cs(t))),m=t.map((({x:t,y:e})=>[c.invert(t),l.invert(e)])),b=m.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 v.flatMap((t=>{const[n,a,s,c]=y[t],[l,p]=m[t],g=b[t];return x[t].map((v=>{var y,m;const{scale:b,key:x,encode:w,axis:k,interaction:M}=v,E=Le(v,["scale","key","encode","axis","interaction"]),O=null===(y=null==b?void 0:b.y)||void 0===y?void 0:y.guide,_={x:mL(null===(m=null==b?void 0:b.x)||void 0===m?void 0:m.guide)(g,e),y:bL(O)(g,e)};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:Q({x:{facet:!1},y:{facet:!1}},b),axis:Q({x:{tickCount:5},y:{tickCount:5}},k,_),legend:!1,encode:Q({},w,{x:l,y:p}),interaction:Q({},M,{legendFilter:!1})},E)}))}))}}})),yL=XC((t=>{const{encode:e}=t,n=Le(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=Le(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 mL(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return uL(t,n)}}function bL(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return uL(t,n)}}const xL=()=>t=>[eL.of(t).call(aL).call(rL).call(vL).call(yL).call(iL).call(oL).call(gL).value()],wL=UC((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),kL=UC((t=>({coordinate:{type:"polar"}}))),ML=t=>{const{encode:e}=t,n=Le(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function EL(t){return t=>null}function OL(t){const{points:e}=t,[n,r,i,o]=e,a=As(n,o),s=_s(n,o),c=Ns(s,_s(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=Ps(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d-g*Math.cos(p)-f/2,f,f]}const _L=()=>t=>[eL.of(t).call(aL).call(ML).call(rL).call(kL).call(sL).call(cL,OL,EL,EL,{frame:!1}).call(iL).call(oL).call(wL).value()];function SL(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 AL=()=>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=Q({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]=SL(i,e,a);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield c[n]),t=n}e++}}};AL.props={};const TL=()=>t=>{const{type:e,data:n,scale:r,encode:i,style:o,animate:a,key:s,state:c}=t,l=Le(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}]})]};TL.props={};var PL=1e-6,NL=Math.PI,CL=NL/2,LL=NL/4,jL=2*NL,RL=180/NL,IL=NL/180,DL=Math.abs,BL=Math.atan,FL=Math.atan2,zL=Math.cos,$L=Math.ceil,WL=Math.exp,GL=Math.log,HL=Math.pow,YL=Math.sin,qL=Math.sign||function(t){return t>0?1:t<0?-1:0},VL=Math.sqrt,UL=Math.tan;function XL(t){return t>1?0:t<-1?NL:Math.acos(t)}function ZL(t){return t>1?CL:t<-1?-CL:Math.asin(t)}function KL(){}function QL(t,e){t&&tj.hasOwnProperty(t.type)&&tj[t.type](t,e)}var JL={Feature:function(t,e){QL(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)QL(n[r].geometry,e)}},tj={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){ej(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)ej(n[r],e,0)},Polygon:function(t,e){nj(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)nj(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)QL(n[r],e)}};function ej(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 nj(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)ej(t[n],e,1);e.polygonEnd()}function rj(t,e){t&&JL.hasOwnProperty(t.type)?JL[t.type](t,e):QL(t,e)}function ij(t){return[FL(t[1],t[0]),ZL(t[2])]}function oj(t){var e=t[0],n=t[1],r=zL(n);return[r*zL(e),r*YL(e),YL(n)]}function aj(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function sj(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 cj(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function lj(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function uj(t){var e=VL(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function fj(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 hj(t,e){return DL(t)>NL&&(t-=Math.round(t/jL)*jL),[t,e]}function dj(t,e,n){return(t%=jL)?e||n?fj(gj(t),vj(e,n)):gj(t):e||n?vj(e,n):hj}function pj(t){return function(e,n){return DL(e+=t)>NL&&(e-=Math.round(e/jL)*jL),[e,n]}}function gj(t){var e=pj(t);return e.invert=pj(-t),e}function vj(t,e){var n=zL(t),r=YL(t),i=zL(e),o=YL(e);function a(t,e){var a=zL(e),s=zL(t)*a,c=YL(t)*a,l=YL(e),u=l*n+s*r;return[FL(c*i-u*o,s*n-l*r),ZL(u*i+c*o)]}return a.invert=function(t,e){var a=zL(e),s=zL(t)*a,c=YL(t)*a,l=YL(e),u=l*i-c*o;return[FL(c*i+l*o,s*n+u*r),ZL(u*n-s*r)]},a}function yj(t,e){(e=oj(e))[0]-=t,uj(e);var n=XL(-e[1]);return((-e[2]<0?-n:n)+jL-PL)%jL}function mj(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:KL,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function bj(t,e){return DL(t[0]-e[0])<PL&&DL(t[1]-e[1])<PL}function xj(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 wj(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(bj(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]+=2e-6}s.push(n=new xj(r,t,null,!0)),c.push(n.o=new xj(r,null,n,!1)),s.push(n=new xj(a,t,null,!1)),c.push(n.o=new xj(a,null,n,!0))}})),s.length){for(c.sort(e),kj(s),kj(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 kj(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 Mj(t){return DL(t[0])<=NL?t[0]:qL(t[0])*((DL(t[0])+NL)%jL-NL)}function Ej(t,e,n,r){return function(i){var o,a,s,c=e(i),l=mj(),u=e(l),f=!1,h={point:d,lineStart:g,lineEnd:v,polygonStart:function(){h.point=y,h.lineStart=m,h.lineEnd=b,a=[],o=[]},polygonEnd:function(){h.point=d,h.lineStart=g,h.lineEnd=v,a=Sr(a);var t=function(t,e){var n=Mj(e),r=e[1],i=YL(r),o=[YL(n),-zL(n),0],a=0,s=0,c=new Un;1===i?r=CL+PL:-1===i&&(r=-CL-PL);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=Mj(d),g=d[1]/2+LL,v=YL(g),y=zL(g),m=0;m<h;++m,p=x,v=k,y=M,d=b){var b=f[m],x=Mj(b),w=b[1]/2+LL,k=YL(w),M=zL(w),E=x-p,O=E>=0?1:-1,_=O*E,S=_>NL,A=v*k;if(c.add(FL(A*O*YL(_),y*M+A*zL(_))),a+=S?E+O*jL:E,S^p>=n^x>=n){var T=sj(oj(d),oj(b));uj(T);var P=sj(o,T);uj(P);var N=(S^E>=0?-1:1)*ZL(P[2]);(r>N||r===N&&(T[0]||T[1]))&&(s+=S^E>=0?1:-1)}}return(a<-PL||a<PL&&c<-1e-12)^1&s}(o,r);a.length?(f||(i.polygonStart(),f=!0),wj(a,_j,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 v(){h.point=d,c.lineEnd()}function y(t,e){s.push([t,e]),u.point(t,e)}function m(){u.lineStart(),s=[]}function b(){y(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(Oj))}return h}}function Oj(t){return t.length>1}function _j(t,e){return((t=t.x)[0]<0?t[1]-CL-PL:CL-t[1])-((e=e.x)[0]<0?e[1]-CL-PL:CL-e[1])}hj.invert=hj;var Sj=Ej((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?NL:-NL,c=DL(o-n);DL(c-NL)<PL?(t.point(n,r=(r+a)/2>0?CL:-CL),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&c>=NL&&(DL(n-i)<PL&&(n-=i*PL),DL(o-s)<PL&&(o-=s*PL),r=function(t,e,n,r){var i,o,a=YL(t-n);return DL(a)>PL?BL((YL(e)*(o=zL(r))*YL(n)-YL(r)*(i=zL(e))*YL(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*CL,r.point(-NL,i),r.point(0,i),r.point(NL,i),r.point(NL,0),r.point(NL,-i),r.point(0,-i),r.point(-NL,-i),r.point(-NL,0),r.point(-NL,i);else if(DL(t[0]-e[0])>PL){var o=t[0]<e[0]?NL:-NL;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-NL,-CL]);function Aj(t){var e=zL(t),n=2*IL,r=e>0,i=DL(e)>PL;function o(t,n){return zL(t)*zL(n)>e}function a(t,n,r){var i=[1,0,0],o=sj(oj(t),oj(n)),a=aj(o,o),s=o[0],c=a-s*s;if(!c)return!r&&t;var l=e*a/c,u=-e*s/c,f=sj(i,o),h=lj(i,l);cj(h,lj(o,u));var d=f,p=aj(h,d),g=aj(d,d),v=p*p-g*(aj(h,h)-1);if(!(v<0)){var y=VL(v),m=lj(d,(-p-y)/g);if(cj(m,h),m=ij(m),!r)return m;var b,x=t[0],w=n[0],k=t[1],M=n[1];w<x&&(b=x,x=w,w=b);var E=w-x,O=DL(E-NL)<PL;if(!O&&M<k&&(b=k,k=M,M=b),O||E<PL?O?k+M>0^m[1]<(DL(m[0]-x)<PL?k:M):k<=m[1]&&m[1]<=M:E>NL^(x<=m[0]&&m[0]<=w)){var _=lj(d,(-p+y)/g);return cj(_,h),[m,ij(_)]}}}function s(e,n){var i=r?t:NL-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Ej(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),v=r?g?0:s(f,h):g?s(f+(f<0?NL:-NL),h):0;if(!e&&(l=c=g)&&t.lineStart(),g!==c&&(!(d=a(e,p))||bj(e,d)||bj(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 y;v&n||!(y=a(p,e,!0))||(u=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1],3)))}!g||e&&bj(e,p)||t.point(p[0],p[1]),e=p,c=g,n=v},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=zL(e),s=YL(e),c=r*n;null==i?(i=e+r*jL,o=e-c/2):(i=yj(a,i),o=yj(a,o),(r>0?i<o:i>o)&&(i+=r*jL));for(var l,u=i;r>0?u>o:u<o;u-=c)l=ij([a,-s*zL(u),-s*YL(u)]),t.point(l[0],l[1])}}(o,t,n,i,e,r)}),r?[0,-t]:[-NL,t-NL])}var Tj=1e9,Pj=-Tj;function Nj(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 DL(r[0]-t)<PL?i>0?0:3:DL(r[0]-n)<PL?i>0?2:1:DL(r[1]-e)<PL?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,v,y,m,b=a,x=mj(),w={point:k,lineStart:function(){w.point=M,l&&l.push(u=[]);y=!0,v=!1,p=g=NaN},lineEnd:function(){c&&(M(f,h),d&&v&&x.rejoin(),c.push(x.result()));w.point=k,v&&b.lineEnd()},polygonStart:function(){b=x,c=[],l=[],m=!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=m&&e,i=(c=Sr(c)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&wj(c,s,e,o,a),a.polygonEnd());b=a,c=l=u=null}};function k(t,e){i(t,e)&&b.point(t,e)}function M(o,a){var s=i(o,a);if(l&&u.push([o,a]),y)f=o,h=a,d=s,y=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&v)b.point(o,a);else{var c=[p=Math.max(Pj,Math.min(Tj,p)),g=Math.max(Pj,Math.min(Tj,g))],x=[o=Math.max(Pj,Math.min(Tj,o)),a=Math.max(Pj,Math.min(Tj,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),m=!1):(v||(b.lineStart(),b.point(c[0],c[1])),b.point(x[0],x[1]),s||b.lineEnd(),m=!1)}p=o,g=a,v=s}return w}}function Cj(t,e,n){var r=Ar(t,e-PL,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function Lj(t,e,n){var r=Ar(t,e-PL,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function jj(){return function(){var t,e,n,r,i,o,a,s,c,l,u,f,h=10,d=h,p=90,g=360,v=2.5;function y(){return{type:"MultiLineString",coordinates:m()}}function m(){return Ar($L(r/p)*p,n,p).map(u).concat(Ar($L(s/g)*g,a,g).map(f)).concat(Ar($L(e/h)*h,t,h).filter((function(t){return DL(t%p)>PL})).map(c)).concat(Ar($L(o/d)*d,i,d).filter((function(t){return DL(t%g)>PL})).map(l))}return y.lines=function(){return m().map((function(t){return{type:"LineString",coordinates:t}}))},y.outline=function(){return{type:"Polygon",coordinates:[u(r).concat(f(a).slice(1),u(n).reverse().slice(1),f(s).reverse().slice(1))]}},y.extent=function(t){return arguments.length?y.extentMajor(t).extentMinor(t):y.extentMinor()},y.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),y.precision(v)):[[r,s],[n,a]]},y.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),y.precision(v)):[[e,o],[t,i]]},y.step=function(t){return arguments.length?y.stepMajor(t).stepMinor(t):y.stepMinor()},y.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],y):[p,g]},y.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],y):[h,d]},y.precision=function(h){return arguments.length?(v=+h,c=Cj(o,i,90),l=Lj(e,t,v),u=Cj(s,a,90),f=Lj(r,n,v),y):v},y.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}()()}var Rj,Ij,Dj,Bj,Fj=t=>t,zj=new Un,$j=new Un,Wj={point:KL,lineStart:KL,lineEnd:KL,polygonStart:function(){Wj.lineStart=Gj,Wj.lineEnd=qj},polygonEnd:function(){Wj.lineStart=Wj.lineEnd=Wj.point=KL,zj.add(DL($j)),$j=new Un},result:function(){var t=zj/2;return zj=new Un,t}};function Gj(){Wj.point=Hj}function Hj(t,e){Wj.point=Yj,Rj=Dj=t,Ij=Bj=e}function Yj(t,e){$j.add(Bj*t-Dj*e),Dj=t,Bj=e}function qj(){Yj(Rj,Ij)}var Vj=Wj,Uj=1/0,Xj=Uj,Zj=-Uj,Kj=Zj,Qj={point:function(t,e){t<Uj&&(Uj=t);t>Zj&&(Zj=t);e<Xj&&(Xj=e);e>Kj&&(Kj=e)},lineStart:KL,lineEnd:KL,polygonStart:KL,polygonEnd:KL,result:function(){var t=[[Uj,Xj],[Zj,Kj]];return Zj=Kj=-(Xj=Uj=1/0),t}};var Jj,tR,eR,nR,rR=Qj,iR=0,oR=0,aR=0,sR=0,cR=0,lR=0,uR=0,fR=0,hR=0,dR={point:pR,lineStart:gR,lineEnd:mR,polygonStart:function(){dR.lineStart=bR,dR.lineEnd=xR},polygonEnd:function(){dR.point=pR,dR.lineStart=gR,dR.lineEnd=mR},result:function(){var t=hR?[uR/hR,fR/hR]:lR?[sR/lR,cR/lR]:aR?[iR/aR,oR/aR]:[NaN,NaN];return iR=oR=aR=sR=cR=lR=uR=fR=hR=0,t}};function pR(t,e){iR+=t,oR+=e,++aR}function gR(){dR.point=vR}function vR(t,e){dR.point=yR,pR(eR=t,nR=e)}function yR(t,e){var n=t-eR,r=e-nR,i=VL(n*n+r*r);sR+=i*(eR+t)/2,cR+=i*(nR+e)/2,lR+=i,pR(eR=t,nR=e)}function mR(){dR.point=pR}function bR(){dR.point=wR}function xR(){kR(Jj,tR)}function wR(t,e){dR.point=kR,pR(Jj=eR=t,tR=nR=e)}function kR(t,e){var n=t-eR,r=e-nR,i=VL(n*n+r*r);sR+=i*(eR+t)/2,cR+=i*(nR+e)/2,lR+=i,uR+=(i=nR*t-eR*e)*(eR+t),fR+=i*(nR+e),hR+=3*i,pR(eR=t,nR=e)}var MR=dR;function ER(t){this._context=t}ER.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,jL)}},result:KL};var OR,_R,SR,AR,TR,PR=new Un,NR={point:KL,lineStart:function(){NR.point=CR},lineEnd:function(){OR&&LR(_R,SR),NR.point=KL},polygonStart:function(){OR=!0},polygonEnd:function(){OR=null},result:function(){var t=+PR;return PR=new Un,t}};function CR(t,e){NR.point=LR,_R=AR=t,SR=TR=e}function LR(t,e){AR-=t,TR-=e,PR.add(VL(AR*AR+TR*TR)),AR=t,TR=e}var jR=NR;let RR,IR,DR,BR;class FR{constructor(t){this._append=null==t?zR:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return zR;if(e!==RR){const t=10**e;RR=e,IR=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 IR}(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!==DR||this._append!==IR){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`,DR=t,IR=this._append,BR=this._,this._=e}this._+=BR}}result(){const t=this._;return this._="",t.length?t:null}}function zR(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function $R(t,e){let n,r,i=3,o=4.5;function a(t){return t&&("function"==typeof o&&r.pointRadius(+o.apply(this,arguments)),rj(t,n(r))),r.result()}return a.area=function(t){return rj(t,n(Vj)),Vj.result()},a.measure=function(t){return rj(t,n(jR)),jR.result()},a.bounds=function(t){return rj(t,n(rR)),rR.result()},a.centroid=function(t){return rj(t,n(MR)),MR.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,Fj):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new FR(i)):new ER(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 FR(i)),a},a.projection(t).digits(i).context(e)}function WR(t){return function(e){var n=new GR;for(var r in t)n[r]=t[r];return n.stream=e,n}}function GR(){}function HR(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),rj(n,t.stream(rR)),e(rR.result()),null!=r&&t.clipExtent(r),t}function YR(t,e,n){return HR(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 qR(t,e,n){return YR(t,[[0,0],e],n)}function VR(t,e,n){return HR(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 UR(t,e,n){return HR(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)}GR.prototype={constructor:GR,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 XR=zL(30*IL);function ZR(t,e){return+e?function(t,e){function n(r,i,o,a,s,c,l,u,f,h,d,p,g,v){var y=l-r,m=u-i,b=y*y+m*m;if(b>4*e&&g--){var x=a+h,w=s+d,k=c+p,M=VL(x*x+w*w+k*k),E=ZL(k/=M),O=DL(DL(k)-1)<PL||DL(o-f)<PL?(o+f)/2:FL(w,x),_=t(O,E),S=_[0],A=_[1],T=S-r,P=A-i,N=m*T-y*P;(N*N/b>e||DL((y*T+m*P)/b-.5)>.3||a*h+s*d+c*p<XR)&&(n(r,i,o,a,s,c,S,A,O,x/=M,w/=M,k,g,v),v.point(S,A),n(S,A,O,x,w,k,l,u,f,h,d,p,g,v))}}return function(e){var r,i,o,a,s,c,l,u,f,h,d,p,g={point:v,lineStart:y,lineEnd:b,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=y}};function v(n,r){n=t(n,r),e.point(n[0],n[1])}function y(){u=NaN,g.point=m,e.lineStart()}function m(r,i){var o=oj([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],16,e),e.point(u,f)}function b(){g.point=v,e.lineEnd()}function x(){y(),g.point=w,g.lineEnd=k}function w(t,e){m(r=t,e),i=u,o=f,a=h,s=d,c=p,g.point=m}function k(){n(u,f,l,h,d,p,i,o,r,a,s,c,16,e),g.lineEnd=b,b()}return g}}(t,e):function(t){return WR({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var KR=WR({point:function(t,e){this.stream.point(t*IL,e*IL)}});function QR(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=zL(o),s=YL(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 JR(t){return tI((function(){return t}))()}function tI(t){var e,n,r,i,o,a,s,c,l,u,f=150,h=480,d=250,p=0,g=0,v=0,y=0,m=0,b=0,x=1,w=1,k=null,M=Sj,E=null,O=Fj,_=.5;function S(t){return c(t[0]*IL,t[1]*IL)}function A(t){return(t=c.invert(t[0],t[1]))&&[t[0]*RL,t[1]*RL]}function T(){var t=QR(f,0,0,x,w,b).apply(null,e(p,g)),r=QR(f,h-t[0],d-t[1],x,w,b);return n=dj(v,y,m),s=fj(e,r),c=fj(n,s),a=ZR(s,_),P()}function P(){return l=u=null,S}return S.stream=function(t){return l&&u===t?l:l=KR(function(t){return WR({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(M(a(O(u=t)))))},S.preclip=function(t){return arguments.length?(M=t,k=void 0,P()):M},S.postclip=function(t){return arguments.length?(O=t,E=r=i=o=null,P()):O},S.clipAngle=function(t){return arguments.length?(M=+t?Aj(k=t*IL):(k=null,Sj),P()):k*RL},S.clipExtent=function(t){return arguments.length?(O=null==t?(E=r=i=o=null,Fj):Nj(E=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),P()):null==E?null:[[E,r],[i,o]]},S.scale=function(t){return arguments.length?(f=+t,T()):f},S.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],T()):[h,d]},S.center=function(t){return arguments.length?(p=t[0]%360*IL,g=t[1]%360*IL,T()):[p*RL,g*RL]},S.rotate=function(t){return arguments.length?(v=t[0]%360*IL,y=t[1]%360*IL,m=t.length>2?t[2]%360*IL:0,T()):[v*RL,y*RL,m*RL]},S.angle=function(t){return arguments.length?(b=t%360*IL,T()):b*RL},S.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},S.reflectY=function(t){return arguments.length?(w=t?-1:1,T()):w<0},S.precision=function(t){return arguments.length?(a=ZR(s,_=t*t),P()):VL(_)},S.fitExtent=function(t,e){return YR(S,t,e)},S.fitSize=function(t,e){return qR(S,t,e)},S.fitWidth=function(t,e){return VR(S,t,e)},S.fitHeight=function(t,e){return UR(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&A,T()}}function eI(t){var e=0,n=NL/3,r=tI(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*IL,n=t[1]*IL):[e*RL,n*RL]},i}function nI(t,e){var n=YL(t),r=(n+YL(e))/2;if(DL(r)<PL)return function(t){var e=zL(t);function n(t,n){return[t*e,YL(n)/e]}return n.invert=function(t,n){return[t/e,ZL(n*e)]},n}(t);var i=1+n*(2*r-n),o=VL(i)/r;function a(t,e){var n=VL(i-2*r*YL(e))/r;return[n*YL(t*=r),o-n*zL(t)]}return a.invert=function(t,e){var n=o-e,a=FL(t,DL(n))*qL(n);return n*r<0&&(a-=NL*qL(t)*qL(n)),[a/r,ZL((i-(t*t+n*n)*r*r)/(2*r))]},a}function rI(){return eI(nI).scale(155.424).center([0,33.6442])}function iI(){return rI().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function oI(t){return function(e,n){var r=zL(e),i=zL(n),o=t(r*i);return o===1/0?[2,0]:[o*i*YL(e),o*YL(n)]}}function aI(t){return function(e,n){var r=VL(e*e+n*n),i=t(r),o=YL(i),a=zL(i);return[FL(e*o,r*a),ZL(r&&n*o/r)]}}var sI=oI((function(t){return VL(2/(1+t))}));sI.invert=aI((function(t){return 2*ZL(t/2)}));var cI=oI((function(t){return(t=XL(t))&&t/YL(t)}));function lI(t,e){return[t,GL(UL((CL+e)/2))]}function uI(t){var e,n,r,i=JR(t),o=i.center,a=i.scale,s=i.translate,c=i.clipExtent,l=null;function u(){var o=NL*a(),s=i(function(t){function e(e){return(e=t(e[0]*IL,e[1]*IL))[0]*=RL,e[1]*=RL,e}return t=dj(t[0]*IL,t[1]*IL,t.length>2?t[2]*IL:0),e.invert=function(e){return(e=t.invert(e[0]*IL,e[1]*IL))[0]*=RL,e[1]*=RL,e},e}(i.rotate()).invert([0,0]));return c(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===lI?[[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 fI(t){return UL((CL+t)/2)}function hI(t,e){var n=zL(t),r=t===e?YL(t):GL(n/zL(e))/GL(fI(e)/fI(t)),i=n*HL(fI(t),r)/r;if(!r)return lI;function o(t,e){i>0?e<-CL+PL&&(e=-CL+PL):e>CL-PL&&(e=CL-PL);var n=i/HL(fI(e),r);return[n*YL(r*t),i-n*zL(r*t)]}return o.invert=function(t,e){var n=i-e,o=qL(r)*VL(t*t+n*n),a=FL(t,DL(n))*qL(n);return n*r<0&&(a-=NL*qL(t)*qL(n)),[a/r,2*BL(HL(i/o,1/r))-CL]},o}function dI(t,e){return[t,e]}function pI(t,e){var n=zL(t),r=t===e?YL(t):(n-zL(e))/(e-t),i=n/r+t;if(DL(r)<PL)return dI;function o(t,e){var n=i-e,o=r*t;return[n*YL(o),i-n*zL(o)]}return o.invert=function(t,e){var n=i-e,o=FL(t,DL(n))*qL(n);return n*r<0&&(o-=NL*qL(t)*qL(n)),[o/r,i-qL(r)*VL(t*t+n*n)]},o}cI.invert=aI((function(t){return t})),lI.invert=function(t,e){return[t,2*BL(WL(e))-CL]},dI.invert=dI;var gI=1.340264,vI=-.081106,yI=893e-6,mI=.003796,bI=VL(3)/2;function xI(t,e){var n=ZL(bI*YL(e)),r=n*n,i=r*r*r;return[t*zL(n)/(bI*(gI+3*vI*r+i*(7*yI+9*mI*r))),n*(gI+vI*r+i*(yI+mI*r))]}function wI(t,e){var n=zL(e),r=zL(t)*n;return[n*YL(t)/r,YL(e)/r]}function kI(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 MI(t,e){return[zL(e)*YL(t),YL(e)]}function EI(t,e){var n=zL(e),r=1+zL(t)*n;return[n*YL(t)/r,YL(e)/r]}function OI(t,e){return[GL(UL((CL+e)/2)),-t]}xI.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*(gI+vI*i+o*(yI+mI*i))-e)/(gI+3*vI*i+o*(7*yI+9*mI*i)))*r)*i*i,!(DL(n)<1e-12));++a);return[bI*t*(gI+3*vI*i+o*(7*yI+9*mI*i))/zL(r),ZL(YL(r)/bI)]},wI.invert=aI(BL),kI.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(DL(n)>PL&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},MI.invert=aI(ZL),EI.invert=aI((function(t){return 2*BL(t)})),OI.invert=function(t,e){return[-e,2*BL(WL(t))-CL]};var _I=Object.freeze({__proto__:null,geoAlbersUsa:function(){var t,e,n,r,i,o,a=iI(),s=rI().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=rI().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:t=function(t){var e=t.length;return{point:function(n,r){for(var i=-1;++i<e;)t[i].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}([a.stream(e=n),s.stream(n),c.stream(n)])},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+PL,u+.12*e+PL],[o-.214*e-PL,u+.234*e-PL]]).stream(l),i=c.translate([o-.205*e,u+.212*e]).clipExtent([[o-.214*e+PL,u+.166*e+PL],[o-.115*e-PL,u+.234*e-PL]]).stream(l),f()},u.fitExtent=function(t,e){return YR(u,t,e)},u.fitSize=function(t,e){return qR(u,t,e)},u.fitWidth=function(t,e){return VR(u,t,e)},u.fitHeight=function(t,e){return UR(u,t,e)},u.scale(1070)},geoAlbers:iI,geoAzimuthalEqualArea:function(){return JR(sI).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:sI,geoAzimuthalEquidistant:function(){return JR(cI).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:cI,geoConicConformal:function(){return eI(hI).scale(109.5).parallels([30,30])},geoConicConformalRaw:hI,geoConicEqualArea:rI,geoConicEqualAreaRaw:nI,geoConicEquidistant:function(){return eI(pI).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:pI,geoEqualEarth:function(){return JR(xI).scale(177.158)},geoEqualEarthRaw:xI,geoEquirectangular:function(){return JR(dI).scale(152.63)},geoEquirectangularRaw:dI,geoGnomonic:function(){return JR(wI).scale(144.049).clipAngle(60)},geoGnomonicRaw:wI,geoIdentity:function(){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,v=WR({point:function(t,e){var n=b([t,e]);this.stream.point(n[0],n[1])}}),y=Fj;function m(){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=v(y(a=t))},b.postclip=function(t){return arguments.length?(y=t,d=n=r=i=null,m()):y},b.clipExtent=function(t){return arguments.length?(y=null==t?(d=n=r=i=null,Fj):Nj(d=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),m()):null==d?null:[[d,n],[r,i]]},b.scale=function(t){return arguments.length?(s=+t,m()):s},b.translate=function(t){return arguments.length?(c=+t[0],l=+t[1],m()):[c,l]},b.angle=function(n){return arguments.length?(e=YL(h=n%360*IL),t=zL(h),m()):h*RL},b.reflectX=function(t){return arguments.length?(u=t?-1:1,m()):u<0},b.reflectY=function(t){return arguments.length?(f=t?-1:1,m()):f<0},b.fitExtent=function(t,e){return YR(b,t,e)},b.fitSize=function(t,e){return qR(b,t,e)},b.fitWidth=function(t,e){return VR(b,t,e)},b.fitHeight=function(t,e){return UR(b,t,e)},b},geoProjection:JR,geoProjectionMutator:tI,geoMercator:function(){return uI(lI).scale(961/jL)},geoMercatorRaw:lI,geoNaturalEarth1:function(){return JR(kI).scale(175.295)},geoNaturalEarth1Raw:kI,geoOrthographic:function(){return JR(MI).scale(249.5).clipAngle(90.000001)},geoOrthographicRaw:MI,geoStereographic:function(){return JR(EI).scale(250).clipAngle(142)},geoStereographicRaw:EI,geoTransverseMercator:function(){var t=uI(OI),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)},geoTransverseMercatorRaw:OI});function SI(t,e,n,r){const i=()=>{const t=e.filter(TI),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){const e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"};if(!t||!t.type)return null;const n=e[t.type];return n?"geometry"===n?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===n?{type:"FeatureCollection",features:[t]}:"featureCollection"===n?t:void 0:null}(t).features))});var r},{outline:o=i()}=r,{size:a="fitExtent"}=r;return"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]]=$R(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):void 0}function AI(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:[jj()]}}):"sphere"===n?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t}function TI(t){return"geoPath"===t.type}const PI=()=>t=>{const{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,i=Le(n,["type"]),o=function(t){if("function"==typeof t)return t;const e=`geo${G(t)}`,n=_I[e];if(!n)throw new Error(`Unknown coordinate: ${t}`);return n}(r),a=e.map(AI);let s;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 c=o();SI(c,a,{x:t,y:e,width:n,height:r},i),function(t,e){var n;for(const[r,i]of Object.entries(e))null===(n=t[r])||void 0===n||n.call(t,i)}(c,i),s=$R(c);const l=new po({domain:[t,t+n]}),u=new po({domain:[e,e+r]});return{transform:t=>(t=>{const e=c(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 c.invert(r)})(t)}}]]}},children:a.flatMap((t=>TI(t)?function(t){const{style:e,tooltip:n={}}=t;return Object.assign(Object.assign({},t),{type:"path",tooltip:CE(n,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},e),{d:t=>s(t)||[]})})}(t):t))})]};function NI(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=I$(o,(t=>"element"===t.className));const c=function(t){return I$(t,(t=>"component"===t.className))}(o),l=function(t){return I$(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:Go(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 CI(){return(t,e,n)=>{const{container:r,view:i}=t,o=NI(fN.CLICK,i,n,(t=>1===t.detail)),a=NI(fN.DBLCLICK,i,n,(t=>2===t.detail)),s=NI(fN.POINTER_TAP,i,n),c=NI(fN.POINTER_DOWN,i,n),l=NI(fN.POINTER_UP,i,n),u=NI(fN.POINTER_OVER,i,n),f=NI(fN.POINTER_OUT,i,n),h=NI(fN.POINTER_MOVE,i,n),d=NI(fN.POINTER_ENTER,i,n),p=NI(fN.POINTER_LEAVE,i,n),g=NI(fN.POINTER_UPOUTSIDE,i,n),v=NI(fN.DRAG_START,i,n),y=NI(fN.DRAG,i,n),m=NI(fN.DRAG_END,i,n),b=NI(fN.DRAG_ENTER,i,n),x=NI(fN.DRAG_LEAVE,i,n),w=NI(fN.DRAG_OVER,i,n),k=NI(fN.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",v),r.addEventListener("drag",y),r.addEventListener("dragend",m),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",k),()=>{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",v),r.removeEventListener("drag",y),r.removeEventListener("dragend",m),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",k)}}}function LI(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":BA,"component.axisLinear":LA,"component.axisArc":jA,"component.legendContinuousBlock":UA,"component.legendContinuousBlockSize":ZA,"component.legendContinuousSize":XA,"interaction.event":CI,"composition.mark":tL,"composition.view":JC,"shape.label.label":lM}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||Uo(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=Le(t,["type"]);n||Uo("Plot type is required!");const o=r(n);return null==o?void 0:o(i,e)},r]}function jI(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||Uo("Cannot find library document")}function RI(t,e){const{coordinate:n={},coordinates:r}=t,i=Le(t,["coordinate","coordinates"]);if(r)return t;const{type:o,transform:a=[]}=n,s=Le(n,["type","transform"]);if(!o)return Object.assign(Object.assign({},i),{coordinates:a});const[,c]=LI("coordinate",e),{transform:l=!1}=c(o).props||{};if(l)throw new Error(`Unknown coordinate: ${o}.`);return Object.assign(Object.assign({},i),{coordinates:[Object.assign({type:o},s),...a]})}function II(t,e){return t.filter((t=>t.type===e))}function DI(t){return II(t,"polar").length>0}function BI(t){return II(t,"transpose").length%2==1}function FI(t){return II(t,"theta").length>0}function zI(t){return II(t,"radial").length>0}function $I(t){return II(t,"radar").length>0}function WI(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}PI.props={},CI.props={reapplyWhenUpdate:!0};var GI=WI("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),HI=WI("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),YI=WI("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),qI=WI("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),VI=WI("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),UI=WI("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),XI=WI("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),ZI=WI("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),KI=WI("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),QI=WI("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),JI=WI("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function tD(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function eD(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function nD(){}var rD=.7,iD=1/rD,oD="\\s*([+-]?\\d+)\\s*",aD="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sD="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cD=/^#([0-9a-f]{3,8})$/,lD=new RegExp(`^rgb\\(${oD},${oD},${oD}\\)$`),uD=new RegExp(`^rgb\\(${sD},${sD},${sD}\\)$`),fD=new RegExp(`^rgba\\(${oD},${oD},${oD},${aD}\\)$`),hD=new RegExp(`^rgba\\(${sD},${sD},${sD},${aD}\\)$`),dD=new RegExp(`^hsl\\(${aD},${sD},${sD}\\)$`),pD=new RegExp(`^hsla\\(${aD},${sD},${sD},${aD}\\)$`),gD={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 vD(){return this.rgb().formatHex()}function yD(){return this.rgb().formatRgb()}function mD(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=cD.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?bD(e):3===n?new MD(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?xD(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?xD(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=lD.exec(t))?new MD(e[1],e[2],e[3],1):(e=uD.exec(t))?new MD(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=fD.exec(t))?xD(e[1],e[2],e[3],e[4]):(e=hD.exec(t))?xD(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=dD.exec(t))?TD(e[1],e[2]/100,e[3]/100,1):(e=pD.exec(t))?TD(e[1],e[2]/100,e[3]/100,e[4]):gD.hasOwnProperty(t)?bD(gD[t]):"transparent"===t?new MD(NaN,NaN,NaN,0):null}function bD(t){return new MD(t>>16&255,t>>8&255,255&t,1)}function xD(t,e,n,r){return r<=0&&(t=e=n=NaN),new MD(t,e,n,r)}function wD(t){return t instanceof nD||(t=mD(t)),t?new MD((t=t.rgb()).r,t.g,t.b,t.opacity):new MD}function kD(t,e,n,r){return 1===arguments.length?wD(t):new MD(t,e,n,null==r?1:r)}function MD(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ED(){return`#${AD(this.r)}${AD(this.g)}${AD(this.b)}`}function OD(){const t=_D(this.opacity);return`${1===t?"rgb(":"rgba("}${SD(this.r)}, ${SD(this.g)}, ${SD(this.b)}${1===t?")":`, ${t})`}`}function _D(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function SD(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function AD(t){return((t=SD(t))<16?"0":"")+t.toString(16)}function TD(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ND(t,e,n,r)}function PD(t){if(t instanceof ND)return new ND(t.h,t.s,t.l,t.opacity);if(t instanceof nD||(t=mD(t)),!t)return new ND;if(t instanceof ND)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 ND(a,s,c,t.opacity)}function ND(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function CD(t){return(t=(t||0)%360)<0?t+360:t}function LD(t){return Math.max(0,Math.min(1,t||0))}function jD(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}tD(nD,mD,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:vD,formatHex:vD,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return PD(this).formatHsl()},formatRgb:yD,toString:yD}),tD(MD,kD,eD(nD,{brighter(t){return t=null==t?iD:Math.pow(iD,t),new MD(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?rD:Math.pow(rD,t),new MD(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new MD(SD(this.r),SD(this.g),SD(this.b),_D(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:ED,formatHex:ED,formatHex8:function(){return`#${AD(this.r)}${AD(this.g)}${AD(this.b)}${AD(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:OD,toString:OD})),tD(ND,(function(t,e,n,r){return 1===arguments.length?PD(t):new ND(t,e,n,null==r?1:r)}),eD(nD,{brighter(t){return t=null==t?iD:Math.pow(iD,t),new ND(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?rD:Math.pow(rD,t),new ND(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 MD(jD(t>=240?t-240:t+120,i,r),jD(t,i,r),jD(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new ND(CD(this.h),LD(this.s),LD(this.l),_D(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=_D(this.opacity);return`${1===t?"hsl(":"hsla("}${CD(this.h)}, ${100*LD(this.s)}%, ${100*LD(this.l)}%${1===t?")":`, ${t})`}`}}));const RD=Math.PI/180,ID=180/Math.PI;var DD=-.14861,BD=1.78277,FD=-.29227,zD=-.90649,$D=1.97294,WD=$D*zD,GD=$D*BD,HD=BD*FD-zD*DD;function YD(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof qD)return new qD(t.h,t.s,t.l,t.opacity);t instanceof MD||(t=wD(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(HD*r+WD*e-GD*n)/(HD+WD-GD),o=r-i,a=($D*(n-i)-FD*o)/zD,s=Math.sqrt(a*a+o*o)/($D*i*(1-i)),c=s?Math.atan2(a,o)*ID-120:NaN;return new qD(c<0?c+360:c,s,i,t.opacity)}(t):new qD(t,e,n,null==r?1:r)}function qD(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}tD(qD,YD,eD(nD,{brighter(t){return t=null==t?iD:Math.pow(iD,t),new qD(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?rD:Math.pow(rD,t),new qD(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*RD,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new MD(255*(e+n*(DD*r+BD*i)),255*(e+n*(FD*r+zD*i)),255*(e+n*($D*r)),this.opacity)}}));var VD=t=>()=>t;function UD(t,e){return function(n){return t+n*e}}function XD(t){return 1===(t=+t)?ZD: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)}}function ZD(t,e){var n=e-t;return n?UD(t,n):VD(isNaN(t)?e:t)}!function t(e){var n=XD(e);function r(t,e){var r=n((t=kD(t)).r,(e=kD(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=ZD(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 KD,QD=(KD=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return function(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}((n-r/e)*e,a,i,o,s)}},function(t){var e,n,r=t.length,i=new Array(r),o=new Array(r),a=new Array(r);for(e=0;e<r;++e)n=kD(t[e]),i[e]=n.r||0,o[e]=n.g||0,a[e]=n.b||0;return i=KD(i),o=KD(o),a=KD(a),n.opacity=1,function(t){return n.r=i(t),n.g=o(t),n.b=a(t),n+""}});function JD(t){return function e(n){function r(e,r){var i=t((e=YD(e)).h,(r=YD(r)).h),o=ZD(e.s,r.s),a=ZD(e.l,r.l),s=ZD(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)}JD((function(t,e){var n=e-t;return n?UD(t,n>180||n<-180?n-360*Math.round(n/360):n):VD(isNaN(t)?e:t)}));var tB=JD(ZD),eB=t=>QD(t[t.length-1]),nB=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(WI),rB=eB(nB),iB=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(WI),oB=eB(iB),aB=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(WI),sB=eB(aB),cB=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(WI),lB=eB(cB),uB=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(WI),fB=eB(uB),hB=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(WI),dB=eB(hB),pB=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(WI),gB=eB(pB),vB=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(WI),yB=eB(vB),mB=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(WI),bB=eB(mB),xB=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(WI),wB=eB(xB),kB=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(WI),MB=eB(kB),EB=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(WI),OB=eB(EB),_B=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(WI),SB=eB(_B),AB=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(WI),TB=eB(AB),PB=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(WI),NB=eB(PB),CB=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(WI),LB=eB(CB),jB=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(WI),RB=eB(jB),IB=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(WI),DB=eB(IB),BB=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(WI),FB=eB(BB),zB=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(WI),$B=eB(zB),WB=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(WI),GB=eB(WB),HB=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(WI),YB=eB(HB),qB=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(WI),VB=eB(qB),UB=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(WI),XB=eB(UB),ZB=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(WI),KB=eB(ZB),QB=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(WI),JB=eB(QB),tF=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(WI),eF=eB(tF);var nF=tB(YD(300,.5,0),YD(-240,.5,1)),rF=tB(YD(-100,.75,.35),YD(80,1.5,.8)),iF=tB(YD(260,.75,.35),YD(80,1.5,.8)),oF=YD();var aF=kD(),sF=Math.PI/3,cF=2*Math.PI/3;function lF(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var uF=lF(WI("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),fF=lF(WI("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),hF=lF(WI("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),dF=lF(WI("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),pF=Object.freeze({__proto__:null,schemeCategory10:GI,schemeAccent:HI,schemeDark2:YI,schemeObservable10:qI,schemePaired:VI,schemePastel1:UI,schemePastel2:XI,schemeSet1:ZI,schemeSet2:KI,schemeSet3:QI,schemeTableau10:JI,interpolateBrBG:rB,schemeBrBG:nB,interpolatePRGn:oB,schemePRGn:iB,interpolatePiYG:sB,schemePiYG:aB,interpolatePuOr:lB,schemePuOr:cB,interpolateRdBu:fB,schemeRdBu:uB,interpolateRdGy:dB,schemeRdGy:hB,interpolateRdYlBu:gB,schemeRdYlBu:pB,interpolateRdYlGn:yB,schemeRdYlGn:vB,interpolateSpectral:bB,schemeSpectral:mB,interpolateBuGn:wB,schemeBuGn:xB,interpolateBuPu:MB,schemeBuPu:kB,interpolateGnBu:OB,schemeGnBu:EB,interpolateOrRd:SB,schemeOrRd:_B,interpolatePuBuGn:TB,schemePuBuGn:AB,interpolatePuBu:NB,schemePuBu:PB,interpolatePuRd:LB,schemePuRd:CB,interpolateRdPu:RB,schemeRdPu:jB,interpolateYlGnBu:DB,schemeYlGnBu:IB,interpolateYlGn:FB,schemeYlGn:BB,interpolateYlOrBr:$B,schemeYlOrBr:zB,interpolateYlOrRd:GB,schemeYlOrRd:WB,interpolateBlues:YB,schemeBlues:HB,interpolateGreens:VB,schemeGreens:qB,interpolateGreys:XB,schemeGreys:UB,interpolatePurples:KB,schemePurples:ZB,interpolateReds:JB,schemeReds:QB,interpolateOranges:eF,schemeOranges:tF,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:nF,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return oF.h=360*t-100,oF.s=1.5-1.5*e,oF.l=.8-.9*e,oF+""},interpolateWarm:rF,interpolateCool:iF,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,aF.r=255*(e=Math.sin(t))*e,aF.g=255*(e=Math.sin(t+sF))*e,aF.b=255*(e=Math.sin(t+cF))*e,aF+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:uF,interpolateMagma:fF,interpolateInferno:hF,interpolatePlasma:dF});function gF(t,e,n,r,i,o){const{guide:a={}}=n,s=function(t,e,n){const{type:r,domain:i,range:o,quantitative:a,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return NF(t,na)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return _F(t,s);if(void 0!==i)return TF([i])?_F(t,s):PF(e)?"time":SF(t,o,a);return TF(e)?_F(t,s):PF(e)?"time":SF(t,o,a)}(t,e,n);if("string"!=typeof s)return n;const c=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return AF(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)Zo(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 AF(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)Zo(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),l=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(kF({type:t}))return function(t,e,n){const r=t.map(Number),i=new po({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map((t=>new Date(i.map(t)))):t.map((t=>i.map(t)))}(e,r,t);return MF({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,c,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=Ii,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?FI(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=G(e),i=pF[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(s,t,0,n,r)),{domain:l,range:EF(s,t,e,n,l,i,o),expectedDomain:c,guide:a,name:t,type:s})}function vF(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 yF(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=vr(i)+1,a=`${e}${o}`;t[a]=r,r.getOptions().key=a}else t[e]=r}return t}function mF(t,e){const[n]=LI("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[Yo,Yo];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 bF(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));wF(e,"x"),wF(e,"y")}function xF(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 wF(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(kF)?Vn(r):n.every(MF)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function kF(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function MF(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function EF(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=OF(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?[sa(e),ca(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 OF(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function OF(t,e,n,r,i){const[o]=LI("palette",i),{category10:a,category20:s}=r,c=function(t){return Array.from(new Set(t))}(n).length<=a.length?a:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return o({type:l})}catch(t){const e=function(t,e,n=t=>t){if(!t)return null;const r=G(t),i=pF[`scheme${r}`],o=pF[`interpolate${r}`];if(!i&&!o)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map(((t,r)=>o(n(r/e.length))))}(l,n,u);if(e)return e;throw new Error(`Unknown Component: ${l} `)}}function _F(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function SF(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function AF(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 TF(t){return NF(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function PF(t){return NF(t,(t=>t instanceof Date))}function NF(t,e){for(const n of t)if(n.some(e))return!0;return!1}const CF={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},LF={threshold:"threshold",quantize:"quantize",quantile:"quantile"},jF={ordinal:"ordinal",band:"band",point:"point"},RF={constant:"constant"};function IF(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=LI("component",n),a=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=LI("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?BI(n)?`${e}Y`:`${e}X`:"y"===t?BI(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[...FF(n),...$F(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=Q({},...e),{guide:v,field:y}=g,m=Array.isArray(v)?v:[v];for(const n of m){const[o,g]=HF(t,i,l,n,e,a,r);if(!o&&!g)continue;const v="left"===o||"right"===o,m=v?d[1]:d[0],b=v?p[1]:p[0],{size:x,order:w=f,length:k=h,padding:M=m,crossPadding:E=b}=n;s.push(Object.assign(Object.assign({title:y},n),{defaultSize:u,length:k,position:o,plane:c,orientation:g,padding:M,order:w,crossPadding:E,size:x,type:t,scales:e}))}})),s}function DF(t,e,n,r,i){const[o]=LI("component",r),{scaleInstances:a,scale:s,bbox:c}=t,l={bbox:c,library:r};return o(Le(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:a,theme:n,value:l,scale:s})}function BF(t,e){const n=["left","right","bottom","top"],r=tr(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=Tr(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=vr(t,(t=>t.size)),r=vr(t,(t=>t.order)),i=vr(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function FF(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=tr(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(...ua(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,zF(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 RN)for(const{option:r,combination:i}of n)if(e.some((t=>et(s(t),s(r)))))return[t,i];return null})).filter(Zo);return c}function zF(t){const{type:e}=t;return"string"!=typeof e?null:e in CF?"continuous":e in jF?"discrete":e in LF?"distribution":e in RF?"constant":null}function $F(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return II(t,"helix").length>0}(e)||FI(e))return null;if(BI(e)&&(DI(e)||zI(e)))return null;if(n.startsWith("x"))return DI(e)?["axisArc",[t]]:zI(e)?["axisLinear",[t]]:[BI(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return DI(e)?["axisLinear",[t]]:zI(e)?["axisArc",[t]]:[BI(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if($I(e))return["axisRadar",[t]];if(!DI(e))return["axisY",[t]]}return null})).filter(Zo)}function WF(t){const e=II(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=II(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=s(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function GF(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(null===e)return[null,null];const[n,a]=WF(i);return["center",(a-n)/($I(i)?t.length:t.length-1)*e+n]}if("axisY"===t&&function(t){return II(t,"parallel").length>0}(i))return BI(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=WF(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:DI(i)||zI(i)?["center",null]:"axisX"===t&&function(t){return II(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return II(t,"reflectY").length>0}(i)?["top",null]:e}function HF(t,e,n,r,i,o,a){const[s]=WF(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?GF(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&DI(a)&&"center"===r.position?["center","vertical"]:c}function YF(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")?ZF:s.startsWith("group")?qF:s.startsWith("legendContinuous")?KF:"legendCategory"===s?QF:s.startsWith("slider")?XF:"title"===s?UF:s.startsWith("scrollbar")?VF:()=>{})(t,e,n,r,i,o)}function qF(t,e,n,r,i,o){const{children:a}=t,s=vr(a,(t=>t.crossPadding));a.forEach((t=>t.crossPadding=s)),a.forEach((t=>YF(t,e,n,r,i,o)));const c=vr(a,(t=>t.size));t.size=c,a.forEach((t=>t.size=c))}function VF(t,e,n,r,i,o){const{trackSize:a=6}=Q({},i.scrollbar,t);t.size=a}function UF(t,e,n,r,i,o){const a=Q({},i.title,t),{title:s,subtitle:c,spacing:l=0}=a,u=Le(a,["title","subtitle","spacing"]);if(s){const e=iz(s,Qo(u,"title"));t.size=e.height}if(c){const e=iz(c,Qo(u,"subtitle"));t.size+=l+e.height}}function XF(t,e,n,r,i,o){const{trackSize:a,handleIconSize:s}=(()=>{const{slider:e}=i;return Q({},e,t)})(),c=Math.max(a,2.4*s);t.size=c}function ZF(t,e,n,r,i,o){var a;t.transform=t.transform||[{type:"hide"}];const s="left"===r||"right"===r,c=nz(t,r,i),{tickLength:l=0,labelSpacing:u=0,titleSpacing:f=0,labelAutoRotate:h}=c,d=Le(c,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),p=JF(t,o),g=tz(d,p),v=l+u;if(g&&g.length){const r=vr(g,(t=>t.width)),i=vr(g,(t=>t.height));if(s)t.size=r+v;else{const{tickFilter:o,labelTransform:s}=t;!function(t,e,n,r,i){const o=Tr(e,(t=>t.width));if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=rz(t,i),c=s.map((t=>a.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(a,t))),l=s.map(((t,e)=>e)),u=-r[0],f=n+r[1],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}(p,g,e,n,o)||s||!1===h||null===h?(t.labelTransform=null!==(a=t.labelTransform)&&void 0!==a?a:"rotate(0)",t.size=i+v):(t.labelTransform="rotate(90)",t.size=r+v)}}else t.size=l;const y=ez(d);y&&(t.size+=s?f+y.width:f+y.height)}function KF(t,e,n,r,i,o){const a=(()=>{const{legendContinuous:e}=i;return Q({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=a,l=Le(a,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=Qo(l,"ribbon"),{size:h}=f,d=Qo(l,"handleIcon"),{size:p}=d,g=Math.max(h,2.4*p);t.size=g;const v=tz(l,JF(t,o));if(v){const e=u?"width":"height",n=vr(v,(t=>t[e]));t.size+=n+s}const y=ez(l);y&&(u?t.size=Math.max(t.size,y.width):t.size+=c+y.height)}function QF(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 Q({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=Le(a,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:v}=t,y=t=>Math.min(t,d),m=t=>Math.min(t,h),b="left"===r||"right"===r,x=void 0===v?e+(b?0:n[0]+n[1]):v,w=ez(p),k=tz(p,JF(t,o),"itemLabel"),M=Math.max(k[0].height,c)+u,E=(t,e=0)=>c+t+s[0]+e;b?(()=>{let e=-1/0,n=0,r=1,i=0,o=-1/0,a=-1/0;const s=w?w.height:0,c=x-s;for(const{width:t}of k){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*m(r),t.length=a+s,Q(t,{cols:m(r),gridRow:o})})():"number"==typeof g?(()=>{const e=Math.ceil(k.length/g),n=vr(k,(t=>E(t.width)))*g;t.size=M*y(e)-u,t.length=Math.min(n,x)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of k){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*y(e)-u,t.length=r})(),w&&(b?t.size=Math.max(t.size,w.width):t.size+=l+w.height)}function JF(t,e){const[n]=LI("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 tz(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=Le(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=function(t,e,n){const r=rz(t,n),i=r.map((t=>"number"==typeof t?dy(t):t)),o=e?"string"==typeof e?dA(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(o)}(e,r,i),c=Qo(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)=>iz(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 ez(t){const{title:e}=t,n=Le(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=Qo(n,"title"),{direction:i,transform:o}=r,a=Array.isArray(e)?e.join(","):e;if("string"!=typeof a)return null;return iz(a,Object.assign(Object.assign({},r),{transform:o||("vertical"===i?"rotate(-90)":"")}))}function nz(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${Vo(e)}`]:s}=n;return Q({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function rz(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function iz(t,e){const n=function(t){return t instanceof Ng?t:new Zg({style:{text:`${t}`}})}(t),r=Le(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function oz(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:v=h,margin:y=(null!==(o=n.margin)&&void 0!==o?o:0),marginLeft:m=y,marginBottom:b=y,marginTop:x=y,marginRight:w=y,padding:k=n.padding,paddingBottom:M=k,paddingLeft:E=k,paddingRight:O=k,paddingTop:_=k}=function(t,e,n,r){const{coordinates:i}=e;if(!DI(i)&&!zI(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=>nz(t,"axisArc"===t.type?"arc":"linear",n))),s=vr(a,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=o.flatMap(((t,e)=>tz(a[e],JF(t,r)))).filter(Zo),l=vr(c,(t=>t.height))+s,u=o.flatMap(((t,e)=>ez(a[e]))).filter((t=>null!==t)),f=0===u.length?0:vr(u,(t=>t.height)),{inset:h=l,insetLeft:d=h,insetBottom:p=h,insetTop:g=h+f,insetRight:v=h}=e;return Object.assign(Object.assign({},e),{insetLeft:d,insetBottom:p,insetTop:g,insetRight:v})}(t,e,n,r),S=(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]},A=t=>"auto"===t?20:null!=t?t:20,T=A(_),P=A(M),N=az(t,s-T-P,[T+x,P+b],["left","right"],e,n,r),{paddingLeft:C,paddingRight:L}=N,j=a-m-w,[R,I]=S(j,E,O,C,L),D=j-R-I,B=az(t,D,[R+m,I+w],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=B,$=s-b-x,[W,G]=S($,M,_,z,F);return{width:a,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:g,insetRight:v,innerWidth:D,innerHeight:$-W-G,paddingLeft:R,paddingRight:I,paddingTop:G,paddingBottom:W,marginLeft:m,marginBottom:b,marginTop:x,marginRight:w,x:l,y:u,z:f}}function az(t,e,n,r,i,o,a){const s=Jn(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${Vo(pm(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=vr(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(YF(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=mr(i,(t=>t.order)),v=i.filter((t=>t.type.startsWith("axis")&&t.order==g));if(v.length&&(v[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(h);else if(0===i.length)d[r]=0;else{const t=BF(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 sz({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 v=n+a,y=i+s,m=r+l,b=o+c,x=t-a-l,w=[v+d,y+g,f-d-p,u-g-h,"center",null,null];return{top:[v,0,f,y,"vertical",!0,Rn,a,x],right:[t-m,y,m,u,"horizontal",!1,Rn],bottom:[v,e-b,f,b,"vertical",!1,Rn,a,x],left:[0,y,v,u,"horizontal",!0,Rn],"top-left":[v,0,f,y,"vertical",!0,Rn],"top-right":[v,0,f,y,"vertical",!0,Rn],"bottom-left":[v,e-b,f,b,"vertical",!1,Rn],"bottom-right":[v,e-b,f,b,"vertical",!1,Rn],center:w,inner:w,outer:w}}function cz(t,e,n,r){const[i,o]=la(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return el(t)&&Qc(t)}(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},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):Qc(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):el(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==1)).map((t=>t+i));for(let e=0;e<t.length;e++){const n=t[e],i=c[e],a=c[e+1]-i;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==0)).map((t=>t+r));for(let e=0;e<t.length;e++){const n=t[e],r=c[e],a=c[e+1]-r;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,o]=n,[a,s]=e.getCenter(),[c]=il(e),l=o/2,u=c*l,f=a-u,h=s-u;for(let e=0;e<t.length;e++){t[e].bbox={x:r+f,y:i+h,width:2*u,height:2*u}}}(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]=il(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 lz(t,e,n){const[r,i,o,a,s,c,l,u,f]=n,[h,d,p,g,v,y,m,b]="vertical"===s?["y",i,"x",r,"height",a,"width",o]:["x",r,"y",i,"width",o,"height",a];t.sort(((t,e)=>null==l?void 0:l(t.order,e.order)));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),w=(t,e,n)=>void 0===n?e:x(t)?n:e,k=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?d+y: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]:k(o,g,u),[v]:a,[m]:w(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[m],i=r/n.length,o=n.reduce(((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t}),"flex-start"),a=n.map(((t,e)=>{const{length:r=i,padding:o=0}=t;return r+(e===n.length-1?0:o)})),s=r-Tr(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={[v]:e[v],[h]:e[h],[p]:r,[m]:a[t]-c},Q(i,{layout:{justifyContent:o}}),r+=a[t]}}}const uz=Symbol("CALLBACK_ITEM");function fz(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=Le(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function hz(t,e,n){return Re(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=LI("data",t),o=function(t){if(I(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=Le(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:a=[]}=o,s=[Le(o,["transform"]),...a].map((t=>i(t,n))),c=yield function(t){return t.reduce(((t,e)=>n=>Re(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),Yo)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?aa(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function dz(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 pz(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=oa(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return Zo(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 gz(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=oa(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 vz(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=LI("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:Mz(n)})}(o),s=oa(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function yz(t,e,n){const{tooltip:r={}}=e;return ra(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:na(r)&&LE(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function mz(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(ra(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(na(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:c=t=>t}=e,l="string"==typeof c?dA(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);na(t)?n[o]=Object.assign(Object.assign({},t),{[uz]:!0}):n[o]={value:t}}return n}return e},{title:s,items:c=[]}=o,l=Le(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 bz(t,e,n){const{encode:r}=e,i=Le(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=Le(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 xz(t,e,n){const{axis:r={},legend:i={},slider:o={},scrollbar:a={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y","z",...Object.keys(r)])):["x","y","z"];return Q(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 wz(t,e,n){const{animate:r}=e;return r||void 0===r||Q(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function kz(t,e,n){return Re(this,void 0,void 0,(function*(){const[r,i]=yield function(t,e,n){return Re(this,void 0,void 0,(function*(){const{library:r}=n,[i]=LI("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[fz,hz,dz,pz,gz,vz,bz,wz,xz,yz,...o.map(i),...s.map(i),...a.map(i),mz];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]}))}(t,e,n),{encode:o,scale:a,data:s,tooltip:c}=i;if(!1===Array.isArray(s))return null;const{channels:l}=e,u=nr(Object.entries(o).filter((([,t])=>Zo(t))),(t=>t.map((([t,e])=>Object.assign({name:t},e)))),(([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=l.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),f=l.filter((t=>{const{name:e,required:n}=t;if(u.find((([t])=>t===e)))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1})).flatMap((t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:o,ordinal:s}=t;return u.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const l=e.some((t=>t.visual)),u=e.some((t=>t.constant)),f=a[t]||{},{independent:h=!1,key:d=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=Le(f,["independent","key","type"]),v="constant"===p,y=v?void 0:i;return{name:t,values:e,scaleKey:h||v?Symbol("independent"):d,scale:Object.assign(Object.assign({type:p,range:y},g),{quantitative:o,ordinal:s})}}))}));return[i,Object.assign(Object.assign({},e),{index:r,channels:f,tooltip:c})]}))}function Mz(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function Ez(t,e,n){var r;return Re(this,void 0,void 0,(function*(){const{library:i}=n,[o]=LI("composition",i),[a]=LI("interaction",i),s=new Set(Object.keys(i).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Zo)),c=new Set(Object.keys(i).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Zo)),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,v=new Map,y=[t],m=[];for(;y.length;){const t=y.shift();if(f(t)){const e=v.get(t),[r,o]=e?Pz(e,t,i):yield Sz(t,n);g.set(r,t),p.push(r);const a=o.flatMap(d).map((t=>RI(t,i)));if(y.push(...a),a.every(f)){const t=yield Promise.all(a.map((t=>Az(t,n))));bF(t);for(let e=0;e<a.length;e++){const n=a[e],r=t[e];v.set(n,r)}}}else{const e=d(u(t)?t:yield Yz(t,n));Array.isArray(e)?y.push(...e):"function"==typeof e&&m.push(e())}}n.emitter.emit(fN.BEFORE_PAINT);const b=new Map,w=new Map,k=[];e.selectAll(Xz(WT)).data(p,(t=>t.key)).join((t=>t.append("g").attr("className",WT).attr("id",(t=>t.key)).call(Oz).each((function(t,e,r){Nz(t,uy(r),k,n),b.set(t,r)}))),(t=>t.call(Oz).each((function(t,e,r){Nz(t,uy(r),k,n),w.set(t,r)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const M=(t,e,r)=>Array.from(t.entries()).map((([i,o])=>{const a=r||new Map,s=g.get(i),c=function(t,e,n){const{library:r}=n,i=function(t){const[,e]=LI("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(r),o=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,a=Hz(e),s=a.map(i).filter(o).map((t=>t[0]));return(e,r,i)=>Re(this,void 0,void 0,(function*(){const o=[],[a,c]=yield Sz(e,n);Nz(a,t,o,n);for(const i of s.filter((t=>t!==r)))_z(i,t,e,a,n);for(const e of c)Ez(e,t,n);return i(),{options:e,view:a}}))}(uy(o),s,n);return{view:i,container:o,options:s,setState:(t,e=t=>t)=>a.set(t,e),update:(n,r)=>Re(this,void 0,void 0,(function*(){const i=qo(Array.from(a.values()))(s);return yield c(i,n,(()=>{x(r)&&e(t,r,a)}))}))}})),E=(t=w,e,r)=>{var i;const o=M(t,E,r);for(const t of o){const{options:r,container:s}=t,c=s.nameInteraction;let l=Hz(r);e&&(l=l.filter((t=>e.includes(t[0]))));for(const e of l){const[r,s]=e,l=c.get(r);if(l&&(null===(i=l.destroy)||void 0===i||i.call(l)),s){const e=Tz(t.view,r,s,a)(t,o,n.emitter);c.set(r,{destroy:e})}}}},O=M(b,E);for(const t of O){const{options:e}=t,r=new Map;t.container.nameInteraction=r;for(const i of Hz(e)){const[e,o]=i;if(o){const i=Tz(t.view,e,o,a)(t,O,n.emitter);r.set(e,{destroy:i})}}}E();const{width:_,height:S}=t,A=[];for(const t of m){const r=new Promise((r=>Re(this,void 0,void 0,(function*(){for(const r of t){const t=Object.assign({width:_,height:S},r);yield Ez(t,e,n)}r()}))));A.push(r)}n.views=p,null===(r=n.animations)||void 0===r||r.forEach((t=>null==t?void 0:t.cancel())),n.animations=k,n.emitter.emit(fN.AFTER_PAINT);const T=k.filter(Zo).map(zz).map((t=>t.finished));return Promise.all([...T,...A])}))}function Oz(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function _z(t,e,n,r,i){var o;const{library:a}=i,[s]=LI("interaction",a),c=e.node().nameInteraction,l=Hz(n).find((([e])=>e===t)),u=c.get(t);if(!u)return;if(null===(o=u.destroy)||void 0===o||o.call(u),!l[1])return;const f=Tz(r,t,l[1],s),h={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},d=f(h,[],i.emitter);c.set(t,{destroy:d})}function Sz(t,e){return Re(this,void 0,void 0,(function*(){const{library:n}=e,r=yield function(t,e){return Re(this,void 0,void 0,(function*(){const{library:n}=e,[r,i]=LI("mark",n),o=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Zo)),{marks:a}=t,s=[],c=[],l=[...a],{width:u,height:f}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:o=r,paddingTop:a=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:h=c,inset:d=0,insetLeft:p=d,insetRight:g=d,insetTop:v=d,insetBottom:y=d}=t,m=t=>"auto"===t?20:t;return{width:n-m(i)-m(o)-l-u-p-g,height:e-m(a)-m(s)-f-h-v-y}}(t),h={options:t,width:u,height:f};for(;l.length;){const[t]=l.splice(0,1),n=yield Yz(t,e),{type:a=Uo("G2Mark type is required."),key:u}=n;if(o.has(a))c.push(n);else{const{props:t={}}=i(a),{composite:e=!0}=t;if(e){const{data:t}=n,e=Object.assign(Object.assign({},n),{data:t?Array.isArray(t)?t:t.value:t}),i=yield r(e,h),o=Array.isArray(i)?i:[i];l.unshift(...o.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else s.push(n)}}return Object.assign(Object.assign({},t),{marks:s,components:c})}))}(t,e),i=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=Le(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)=>Q(t,e)),{}),u=[n,...s].reduce(((t,e)=>Q(t,e)),{}),f=[...c,r].reduce(((t,e)=>Q(t,e)),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:l,interaction:u,style:f})}(r);t.interaction=i.interaction,t.coordinate=i.coordinate,t.marks=[...i.marks,...i.components];const o=RI(i,n);return Pz(yield Az(o,e),o,n)}))}function Az(t,e){return Re(this,void 0,void 0,(function*(){const{library:n}=e,[r]=LI("theme",n),[,i]=LI("mark",n),{theme:o,marks:a,coordinates:s=[]}=t,c=r(Gz(o)),l=new Map;for(const t of a){const{type:n}=t,{props:r={}}=i(n),o=yield kz(t,r,e);if(o){const[t,e]=o;l.set(t,e)}}const u=Jn(Array.from(l.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of u.values()){const e=t.reduce(((t,{scale:e})=>Q(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],o=Array.from(new Set(i.map((t=>t.field)).filter(Zo))),a=Q({guide:{title:0===o.length?void 0:o},field:o[0]},e),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},gF(l,u,a,s,c,n)),{uid:Symbol("scale"),key:r});t.forEach((t=>t.scale=f))}return l}))}function Tz(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(Q(o,Object.assign({type:e},n)))}function Pz(t,e,n){var r;const[i]=LI("mark",n),[o]=LI("theme",n),[a]=LI("labelTransform",n),{key:s,frame:c=!1,theme:l,clip:u,style:f={},labelTransform:h=[]}=e,d=o(Gz(l)),p=Array.from(t.values()),g=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=xF(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=Q({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:ot(t,i)});o.push(e)}}}return o}(p,e),v=function(t){return t.map((t=>{const e=Q(t,t.style);return delete e.style,e}))}(IF(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter((t=>"shape"!==t.name));if(1!==e.length||t.some((t=>"shape"===t.name)))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const o={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},a=(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,s={field:a,name:"shape",type:"constant",domain:[],range:[o[i]]};return[...t,s]}(Array.from(g),p,t),e,n)),y=oz(v,e,d,n),m=function(t,e,n){const[r]=LI("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 VC(p):new GC(p)}(y,e,n),b=c?Q({mainLineWidth:1,mainStroke:"#000"},f):f;!function(t,e,n){const r=Jn(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:v,insetTop:y,height:m,width:b,depth:x}=n,w={xy:sz({width:b,height:m,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:v,insetTop:y}),yz:sz({width:x,height:m,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:m,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:sz({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),o=w[r][i],[a,s]=la(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));a.length&&cz(a,e,o,i),s.length&&lz(n,0,o)}}(BF(v),m,y),function(t){const e=t.find((({type:t})=>"axisX"===t)),n=t.find((({type:t})=>"axisY"===t)),r=t.find((({type:t})=>"axisZ"===t));e&&n&&r&&(e.plane="xy",n.plane="xy",r.plane="yz",r.origin=[e.bbox.x,e.bbox.y,0],r.eulerAngles=[0,-90,0],r.bbox.x=e.bbox.x,r.bbox.y=e.bbox.y,t.push(Object.assign(Object.assign({},e),{plane:"xz",showLabel:!1,showTitle:!1,origin:[e.bbox.x,e.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},n),{plane:"yz",showLabel:!1,showTitle:!1,origin:[n.bbox.x+n.bbox.width,n.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},r),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]})))}(v);const x=new Map(Array.from(t.values()).flatMap((t=>{const{channels:e}=t;return e.map((({scale:t})=>[t.uid,mF(t,n)]))})));!function(t,e){const n=Array.from(t.values()).flatMap((t=>t.channels)),r=nr(n,(t=>t.map((t=>e.get(t.scale.uid)))),(t=>t.name)).filter((([,t])=>t.some((t=>"function"==typeof t.getOptions().groupTransform))&&t.every((t=>t.getTicks)))).map((t=>t[1]));r.forEach((t=>{const e=t.map((t=>t.getOptions().groupTransform))[0];e(t)}))}(t,x);const w={};for(const t of v){const{scales:e=[]}=t,i=[];for(const t of e){const{name:e,uid:o}=t,a=null!==(r=x.get(o))&&void 0!==r?r:mF(t,n);i.push(a),"y"===e&&a.update(Object.assign(Object.assign({},a.getOptions()),{xScale:w.x})),yF(w,{[e]:a})}t.scaleInstances=i}const k=[],M=new Map;for(const[e,n]of t.entries()){const{children:t,dataDomain:r,modifier:o,key:a,data:c}=e;M.set(a,c);const{index:l,channels:u,tooltip:f}=n,h=Object.fromEntries(u.map((({name:t,scale:e})=>[t,e]))),d=oa(h,(({uid:t})=>x.get(t)));yF(w,d);const p=vF(u,d),g=i(e),[v,b,E]=Cz(g(l,d,p,m)),O=r||v.length,_=o?o(b,O,y):[],S=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},A=t=>f.items.map((e=>e[t])),T=v.map(((t,e)=>{const n=Object.assign({points:b[e],transform:_[e],index:t,markKey:a,viewKey:s,data:c[t]},f&&{title:S(t),items:A(t)});for(const[r,i]of Object.entries(p))n[r]=i[t],E&&(n[`series${G(r)}`]=E[e].map((t=>i[t])));return E&&(n.seriesIndex=E[e]),E&&f&&(n.seriesItems=E[e].map((t=>A(t))),n.seriesTitle=E[e].map((t=>S(t)))),n}));n.data=T,n.index=v;const P=null==t?void 0:t(T,d,y);k.push(...P||[])}return[{layout:y,theme:d,coordinate:m,markState:t,key:s,clip:u,scale:w,style:b,components:v,data:M,labelTransform:qo(h.map(a))},k]}function Nz(t,e,n,r){return Re(this,void 0,void 0,(function*(){const{library:i}=r,{components:o,theme:a,layout:s,markState:c,coordinate:l,key:u,style:f,clip:h,scale:d}=t,{x:p,y:g,width:v,height:y}=s,m=Le(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),w=b.map((t=>Jo(Object.assign({},a.view,f),t))),k=["a","margin","padding","inset"].map((t=>Qo(m,t))),M=t=>t.style("x",(t=>A[t].x)).style("y",(t=>A[t].y)).style("width",(t=>A[t].width)).style("height",(t=>A[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(uy(n),w[t])}));let E=0,O=0,_=v,S=y;const A=x.map((t=>{const e=k[t],{left:n=0,top:r=0,bottom:i=0,right:o=0}=e;return E+=n,O+=r,_-=n+o,S-=r+i,{x:E,y:O,width:_,height:S}}));e.selectAll(Xz(qT)).data(x.filter((t=>Zo(w[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",qT).style("zIndex",-2).call(M)),(t=>t.call(M)),(t=>t.remove()));const T=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:o}=i,{enter:a={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:h,duration:d=300,delay:p=0}=a,{type:g,duration:v=300,delay:y=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:m=v,exitDelay:b=y,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+o),n=Math.min(n,o)),(void 0===x||x)&&(e=Math.max(e,m+b),n=Math.min(n,b)),(void 0===a||a)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(c),P=!!T&&{duration:T[1]};for(const[,t]of tr(o,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const N=e.selectAll(Xz(HT)).data(o,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",HT).append((t=>DF(Q({animate:P,scale:d},t),l,a,i,c)))),(t=>t.transition((function(t,e,n){const{preserve:r=!1}=t;if(r)return;const o=DF(Q({animate:P,scale:d},t),l,a,i,c),{attributes:s}=o,[u]=n.childNodes;return u.update(s,!1)})))).transitions();n.push(...N.flat().filter(Zo));const C=e.selectAll(Xz(GT)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",GT).call(qz).call(Uz,Array.from(c.keys())).call(Zz,h)),(t=>t.call(Uz,Array.from(c.keys())).call((t=>T?function(t,e){const[n,r]=e;t.transition((function(t,e,i){const{transform:o,width:a,height:s}=i.style,{paddingLeft:c,paddingTop:l,innerWidth:u,innerHeight:f,marginLeft: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,T):qz(t))).call(Zz,h))).transitions();n.push(...C.flat());for(const[o,a]of c.entries()){const{data:s}=a,{key:c,class:l,type:u}=o,f=e.select(`#${c}`),h=Iz(o,a,t,r),d=Fz(o,a,t,i),p=$z(o,a,t,i),g=Wz(o,a,t,i),v=jz(e,f,l,"element"),y=f.selectAll(Xz($T)).selectFacetAll(v).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(h).attr("className",$T).attr("markType",u).transition((function(t,e,n){return d(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=Ko((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){Rz(i,e,n);const o=h(t,r),a=p(t,[i],[o]);return(null==a?void 0:a.length)||(i.nodeName===o.nodeName&&"g"!==o.nodeName?Xo(i,o):(i.parentNode.replaceChild(o,i),o.className=$T,o.markType=u,o.__data__=i.__data__)),a})).attr("markType",u).attr("className",$T)}))),(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",$T).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new fy(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new fy([],n.__toData__,n.parentNode).append(h).attr("className",$T).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...y.flat())}!function(t,e,n,r,i){const[o]=LI("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(Xz(zT)).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]=LI("shape",r),{data:a,encode:s}=t,{data:c,defaultLabelShape:l}=e,u=c.map((t=>t.points)),f=oa(s,(t=>t.value)),{theme:h,coordinate:d}=n,p=Object.assign(Object.assign({},i),{document:jI(i),theme:h,coordinate:d});return t=>{const{index:e,points:n}=t,r=a[e],{formatter:i=t=>`${t}`,transform:s,style:c,render:d,selector:g,element:v}=t,y=Le(t,["formatter","transform","style","render","selector","element"]),m=oa(Object.assign(Object.assign({},y),c),(t=>Lz(t,r,e,a,{channel:f,element:v}))),{shape:b=l,text:x}=m,w=Le(m,["shape","text"]),k="string"==typeof i?dA(i):i,M=Object.assign(Object.assign({},w),{text:k(x,r,e,a),datum:r}),E=Object.assign({type:`label.${b}`,render:d},w);return o(E,p)(n,M,Dz(h,"label",b,"label"),u)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(Xz($T)).nodes().filter((t=>!t.__removed__));return a.flatMap(((t,e)=>{const n=Le(t,["transform"]);return f.flatMap((r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:o,key:a,index:s}=n.__data__,c=function(t){const e=t.cloneNode(!0),n=t.getAnimations();e.style.visibility="hidden",n.forEach((t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])})),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:o}=r;return[i,o]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${a}-${e}`,bounds:c,index:s,points:o,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map(((r,a)=>Object.assign(Object.assign({},t),{key:`${i[a]}-${e}`,bounds:[o[a]],index:r,points:o,dependentElement:n})));return l?l(u):u}(n,e,r);return i.forEach((e=>{l.set(e,(t=>c(Object.assign(Object.assign({},t),{element:r})))),u.set(e,t)})),i}))}))})),h=uy(c).selectAll(Xz(YT)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",YT)),(t=>t.each((function(t,e,n){Xo(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),d=Jn(h,(t=>u.get(t.__data__))),{coordinate:p,layout:g}=t,v={canvas:i.canvas,coordinate:p,layout:g};for(const[t,e]of d){const{transform:n=[]}=t;qo(n.map(o))(e,v)}s&&s(h,v)}(t,e,0,i,r)}))}function Cz([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])=>Zo(t)&&Zo(e)))&&(r.push(o),i.push(a))}return[r,i]}function Lz(t,e,n,r,i){return"function"==typeof t?t(e,n,r,i):"string"!=typeof t?t:na(e)&&void 0!==e[t]?e[t]:t}function jz(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 Rz(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 Iz(t,e,n,r){const{library:i}=r,[o]=LI("shape",i),{data:a,encode:s}=t,{defaultShape:c,data:l,shape:u}=e,f=oa(s,(t=>t.value)),h=l.map((t=>t.points)),{theme:d,coordinate:p}=n,{type:g,style:v={}}=t,y=Object.assign(Object.assign({},r),{document:jI(r),coordinate:p,theme:d});return e=>{const{shape:n=c}=v,{shape:r=n,points:i,seriesIndex:s,index:l}=e,p=Le(e,["shape","points","seriesIndex","index"]),m=Object.assign(Object.assign({},p),{index:l}),b=s?s.map((t=>a[t])):a[l],x=s||l,w=oa(v,(t=>Lz(t,b,x,a,{channel:f})));return(u[r]?u[r](w,y):o(Object.assign(Object.assign({},w),{type:Vz(t,r)}),y))(i,m,Dz(d,g,r,c),h)}}function Dz(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 Bz(t,e,n,r,i){var o,a;const[,s]=LI("shape",i),[c]=LI("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:h}=r,d=`default${G(t)}Animation`,{[d]:p}=(null===(o=u[l])||void 0===o?void 0:o.props)||s(Vz(e,l)).props,{[t]:g={}}=f,v=(null===(a=e.animate)||void 0===a?void 0:a[t])||{},y={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},v);if(!l.type)return null;const u=c(l,y)(n,r,Q(g,{delay:o,duration:a,easing:s}));let f=[];return f=Array.isArray(u)?u:[u],f.filter(Boolean)}}function Fz(t,e,n,r){return Bz("enter",t,e,n,r)}function zz(t){return t.finished.then((()=>{t.cancel()})),t}function $z(t,e,n,r){return Bz("update",t,e,n,r)}function Wz(t,e,n,r){return Bz("exit",t,e,n,r)}function Gz(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=Le(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function Hz(t){const{interaction:e={}}=t;return Object.entries(Q({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function Yz(t,e){return Re(this,void 0,void 0,(function*(){const{data:n}=t,r=Le(t,["data"]);if(null==n)return t;const[,{data:i}]=yield hz(0,{data:n},e);return Object.assign({data:i},r)}))}function qz(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 Vz(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function Uz(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(Xz(FT)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",FT).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(Xz(zT)).node()||t.append("g").attr("className",zT).style("zIndex",0)}function Xz(...t){return t.map((t=>`.${t}`)).join("")}function Zz(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 Ug({style:{x:r+i,y:n+o,width:a,height:s}})}))}function Kz(t){const{style:e,scale:n,type:r}=t,i={},o=rt(e,"columnWidthRatio");return o&&"interval"===r&&(i.x=Object.assign(Object.assign({},null==n?void 0:n.x),{padding:1-o})),Object.assign(Object.assign({},t),{scale:Object.assign(Object.assign({},n),i)})}function Qz(t){const e=function(t){return function(...t){return e=>t.reduce(((t,e)=>e(t)),e)}(Kz)(t)}(t);return e.children&&Array.isArray(e.children)&&(e.children=e.children.map((t=>Qz(t)))),e}function Jz(t){const e=Q({},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=Q({},e[o]);e[o]=a,n.set(a,t),r.set(a,o),i.push(a)}}return e}function t$(t,e){const n=new aN;return n.registerPlugin(new cN),new fv({width:t,height:e,container:document.createElement("div"),renderer:n})}function e$(t,e={},n=()=>{},r=t=>{throw t}){const i=jN(t),{width:o=640,height:a=480,depth:s=0}=i,c=Jz(Qz(i)),{canvas:l=t$(o,a),emitter:u=new uN,library:f}=e;e.canvas=l,e.emitter=u;const{width:h,height:d}=l.getConfig();h===o&&d===a||l.resize(o,a),u.emit(fN.BEFORE_RENDER);const p=uy(l.document.documentElement);return l.ready.then((()=>Ez(Object.assign(Object.assign({},c),{width:o,height:a,depth:s}),p,e))).then((()=>{if(s){const[t,e]=l.document.documentElement.getPosition();l.document.documentElement.setPosition(t,e,-s/2)}l.requestAnimationFrame((()=>{l.requestAnimationFrame((()=>{u.emit(fN.AFTER_RENDER),null==n||n()}))}))})).catch((t=>{null==r||r(t)})),"string"==typeof(g=l.getConfig().container)?document.getElementById(g):g;var g}function n$(t,e={},n=!1){const{canvas:r,emitter:i}=e;r&&(!function(t){const e=t.getRoot().querySelectorAll(`.${WT}`);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()}function r$(t,e){if(e(t))return!0;if("g"===t.tagName){const{childNodes:n=[]}=t;for(const t of n)if(r$(t,e))return!0}return!1}const i$={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function o$(t,e){let n;return r$(t,(t=>{var r;return"g"!==t.tagName&&void 0!==(null===(r=t.style)||void 0===r?void 0:r[e])&&(n=t.style[e],!0)})),null!=n?n:i$[e]}function a$(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>a$(t,e,n,r)))}function s$(t){a$(t,"visibility","hidden",!0)}function c$(t){a$(t,"visibility","visible",!0)}function l$(t){return uy(t).selectAll(`.${$T}`).nodes().filter((t=>!t.__removed__))}function u$(t,e){return f$(t,e).flatMap((({container:t})=>l$(t)))}function f$(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function h$(t){return uy(t).select(`.${GT}`).node()}function d$(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new uu;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function p$(t,e){const{offsetX:n,offsetY:r}=e,i=d$(t),{min:[o,a],max:[s,c]}=i;return n<o||n>s||(r<a||r>c)?null:[n-o,r-a]}function g$(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 v$(t){return t=>t.__data__.color}function y$(t){return t=>t.__data__.x}function m$(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[E$(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(E$(i,r))[e]}}const b$={selected:3,unselected:3,active:2,inactive:2,default:1},x$={selection:["selected","unselected"],highlight:["active","inactive"]},w$=(t,e,n)=>{r$(t,(t=>{"setAttribute"in t&&"function"==typeof t.setAttribute&&t.setAttribute(e,n)}))};function k$(t,e){return e.forEach((e=>{const n=e.__interactionStyle__;e.__interactionStyle__=n?Object.assign(Object.assign({},n),t):t})),(t=(t,e)=>t,e=w$)=>M$(void 0,t,e)}function M$(t,e=(t,e)=>t,n=w$){const r="__states__",i="__ordinal__",o=t=>b$[t]||b$.default,a=t=>{var e;return null===(e=Object.entries(x$).find((([e,n])=>n.includes(t))))||void 0===e?void 0:e[0]},s=a=>{var s;const{[r]:c=[],[i]:l={}}=a,u=[...c].sort(((t,e)=>o(e)-o(t))),f=new Map;for(const e of u){const n=(null===(s=null!=t?t:a.__interactionStyle__)||void 0===s?void 0:s[e])||{};for(const[t,e]of Object.entries(n))f.has(t)||f.set(t,e)}const h=Object.assign({},l);for(const[t,e]of f.entries())h[t]=e;if(0!==Object.keys(h).length){for(const[t,r]of Object.entries(h)){const i=o$(a,t),o=e(r,a);n(a,t,o),t in l||(l[t]=i)}a[i]=l}},c=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{c(t),t[r]=[...e],s(t)},updateState:(t,...e)=>{c(t);const n=t[r],i=new Set(e.map((t=>a(t))).filter((t=>void 0!==t))),o=n.filter((t=>!i.has(a(t))));t[r]=[...o,...e],s(t)},removeState:(t,...e)=>{c(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}s(t)},hasState:(t,e)=>(c(t),-1!==t[r].indexOf(e))}}function E$(t,e){return`${t},${e}`}function O$(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[E$(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=E$(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 _$(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 S$(t){var{link:e=!1,valueof:n=(t,e)=>t,coordinate:r}=t,i=Le(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=ir(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=cc(),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=oa(i,(t=>n(t,c))),{fill:g=c.getAttribute("fill")}=p,v=Le(p,["fill"]),y=new Gg({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},v)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(y),c.link=y}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function A$(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(Qc(n)){const{points:i}=t.__data__,[o,a]=Kc(n)?yy(i):i,s=n.getCenter(),c=_s(o,s),l=_s(a,s),u=Ts(c)+Ns(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return Kc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function T$(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=Le(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(!eT(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(!eT(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 ky(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=Le(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=oa(a,(e=>o(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,lineWidth:h=0}=e,d=Le(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(eT)})()?l:u,v=g(t,p);v.className=s,t.parentNode.parentNode.appendChild(v),t.background=v},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function P$(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 N$(t){P$(t,t.cursor)}function C$(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function L$(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function j$(t,e=!1){const n=y(t,(t=>!!t)).map(((t,e)=>[0===e?"M":"L",...t]));return e&&n.push(["Z"]),n}function R$(t){return t.querySelectorAll(".element")}function I$(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}const D$=["interval","point","density"];function B$({elementsof:t,root:e,coordinate:n,scale:r,validFindByXMarks:i=D$}){var o,a;let s=t(e);const c=t=>i.includes(t.markType);if(s.find(c)){s=s.filter(c);const t=r.x,i=r.series,l=null!==(a=null===(o=null==t?void 0:t.getBandWidth)||void 0===o?void 0:o.call(t))&&void 0!==a?a:0,u=i?t=>{const e=Math.round(1/i.valueBandWidth);return t.__data__.x+t.__data__.series*l+l/(2*e)}:t=>t.__data__.x+l/2;return s.sort(((t,e)=>u(t)-u(e))),t=>{const r=p$(e,t);if(!r)return;const[i]=n.invert(r),o=(0,Dn(u).center)(s,i);return s[o]}}return t=>{const{target:e}=t;return I$(e,(t=>!!t.classList&&t.classList.includes("element")))}}function F$(t){var{delay:e,createGroup:n,createRegionGroup:r,background:i=!1,link:o=!1}=t,a=Le(t,["delay","createGroup","createRegionGroup","background","link"]);return(t,s,c)=>{const{container:l,view:u,options:f}=t,{scale:h,coordinate:d}=u;return function(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:o=!1,background:a=!1,delay:s=60,scale:c,coordinate:l,emitter:u,state:f={},region:h=!1,regionEleFilter:d=t=>D$.includes(t.markType)}){var p,g;const v=null!==(p=e(t))&&void 0!==p?p:[],y=h?v.filter(d):v,m=new Set(y),b=h?i:r,x=Jn(y,b),w=B$({elementsof:e,root:t,coordinate:l,scale:c}),k=_$(y,n),[M,E]=S$(Object.assign({elements:y,valueof:k,link:o,coordinate:l},Qo(f.active,"link"))),[O,_,S]=T$(Object.assign({document:t.ownerDocument,scale:c,coordinate:l,background:a,valueof:k},Qo(f.active,"background"))),A=Q(f,{active:Object.assign({},(null===(g=f.active)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=f.active.offset(...t),[,n]=t;return A$(y[n],e,l)}})}),T=k$(A,y),{updateState:P,removeState:N,hasState:C}=T(k);let L;const j=t=>{const{nativeEvent:e=!0}=t;let r=t.target;if(h&&(r=w(t)),!m.has(r))return;L&&clearTimeout(L);const i=b(r),o=x.get(i),a=new Set(o);for(const t of y)a.has(t)?C(t,"active")||P(t,"active"):(P(t,"inactive"),E(t)),t!==r&&_(t);O(r),M(o),e&&u.emit("element:highlight",{nativeEvent:e,data:{data:n(r),group:o.map(n)}})},R=()=>{L&&clearTimeout(L),L=setTimeout((()=>{I(),L=null}),s)},I=(t=!0)=>{for(const t of y)N(t,"active","inactive"),_(t),E(t);t&&u.emit("element:unhighlight",{nativeEvent:t})},D=t=>{let e=t.target;h&&(e=w(t)),e?a&&!S(e)||(a||m.has(e))&&(s>0?R():I()):s>0?R():I()},B=()=>{I()};t.addEventListener("pointerover",j),t.addEventListener("pointermove",j),t.addEventListener("pointerout",D),t.addEventListener("pointerleave",B);const F=t=>{const{nativeEvent:e}=t;e||I(!1)},z=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=C$(y,r,n);i&&j({target:i,nativeEvent:!1})};return u.on("element:highlight",z),u.on("element:unhighlight",F),()=>{t.removeEventListener("pointerover",j),t.removeEventListener("pointermove",j),t.removeEventListener("pointerout",D),t.removeEventListener("pointerleave",B),u.off("element:highlight",z),u.off("element:unhighlight",F);for(const t of y)_(t),E(t)}}(h$(l),Object.assign({elements:l$,datum:m$(u),groupKey:n?n(u):void 0,regionGroupKey:r?r(u):t=>t.__data__.x,coordinate:d,scale:h,state:O$(f,[["active",i?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:i,link:o,delay:e,emitter:c},a))}}function z$(t){return F$(Object.assign(Object.assign({},t),{createGroup:y$}))}function $$(t){return F$(Object.assign(Object.assign({},t),{createGroup:v$}))}function W$(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:o=!1,single:a=!1,multipleSelectHotkey:s,coordinate:c,background:l=!1,scale:u,emitter:f,state:h={},region:d=!1,regionEleFilter:p=t=>D$.includes(t.markType)}){var g;const v=e(t),y=new Set(v),m=B$({elementsof:e,root:t,coordinate:c,scale:u}),b=Jn(v,r),x=Jn(v,i),w=_$(v,n),[k,M]=S$(Object.assign({link:o,elements:v,valueof:w,coordinate:c},Qo(h.selected,"link"))),[E,O]=T$(Object.assign({document:t.ownerDocument,background:l,coordinate:c,scale:u,valueof:w},Qo(h.selected,"background"))),_=Q(h,{selected:Object.assign({},(null===(g=h.selected)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=h.selected.offset(...t),[,n]=t;return A$(v[n],e,c)}})}),S=k$(_,v),{updateState:A,removeState:T,hasState:P}=S(w);let N=!a,C=null;const L=(t=!0)=>{for(const t of v)T(t,"selected","unselected"),M(t),O(t);t&&f.emit("element:unselect",{nativeEvent:!0})},j=({event:t,element:e,nativeEvent:i=!0,filter:o=t=>!0,groupBy:a=r,groupMap:s=b})=>{const c=v.filter(o);if(P(e,"selected"))L();else{const r=a(e),o=s.get(r),l=new Set(o);for(const t of c)l.has(t)?A(t,"selected"):(A(t,"unselected"),M(t)),t!==e&&O(t);if(k(o),E(e),!i)return;f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...o.map(n)]}}))}},R=({event:t,element:e,nativeEvent:i=!0,filter:a=t=>!0,groupBy:s=r,groupMap:c=b})=>{const l=s(e),u=c.get(l),h=new Set(u),d=v.filter(a);if(P(e,"selected")){const t=v.some((t=>!h.has(t)&&P(t,"selected")));if(!t)return L();for(const t of u)A(t,"unselected"),M(t),O(t)}else{const t=u.some((t=>P(t,"selected")));for(const t of d)h.has(t)?A(t,"selected"):P(t,"selected")||A(t,"unselected");!t&&o&&k(u),E(e)}i&&f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:v.filter((t=>P(t,"selected"))).map(n)}}))},I=t=>{if(y.has(t))return t;for(const e of y){let n=null;if(r$(e,(r=>{r===t&&(n=e)})),n)return n}return t},D=t=>{const{target:e,nativeEvent:n=!0}=t,o=N?R:j;let a=e;const s=(t=>{if(y.has(t))return!0;for(const e of y)if(r$(e,(e=>e===t)))return!0;return!1})(e);return!d||s?s?o({event:t,element:I(a),nativeEvent:n,groupBy:r}):L():(a=m(t),y.has(a)?o({event:t,element:a,nativeEvent:n,filter:p,groupBy:i,groupMap:x}):L())},B=Array.isArray(s)?s:[s],F=t=>{B.includes(t.code)&&!C&&(C=t.code,N=!0)},z=t=>{t.code===C&&(C=null,N=!1)};t.addEventListener("click",D),s&&(N=!1,document.addEventListener("keydown",F),document.addEventListener("keyup",z));const $=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=N?r.data:r.data.slice(0,1);for(const t of i){const e=C$(v,t,n);D({target:e,nativeEvent:!1})}},W=()=>{L(!1)};return f.on("element:select",$),f.on("element:unselect",W),()=>{for(const t of v)M(t);t.removeEventListener("click",D),s&&(document.removeEventListener("keydown",F),document.removeEventListener("keyup",z)),f.off("element:select",$),f.off("element:unselect",W)}}function G$(t){var{createGroup:e,createRegionGroup:n,background:r=!1,link:i=!1}=t,o=Le(t,["createGroup","createRegionGroup","background","link"]);return(t,a,s)=>{const{container:c,view:l,options:u}=t,{coordinate:f,scale:h}=l;return W$(h$(c),Object.assign({elements:l$,datum:m$(l),groupKey:e?e(l):void 0,regionGroupKey:n?n(l):t=>t.__data__.x,coordinate:f,scale:h,state:O$(u,[["selected",r?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:r,link:i,emitter:s},o))}}function H$(t){return G$(Object.assign(Object.assign({},t),{createGroup:y$}))}function Y$(t){return G$(Object.assign(Object.assign({},t),{createGroup:v$}))}function q$(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=t=>`${t}`}=t,o=Le(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])=>t.type===e)).map((([t])=>{const{encode:e}=t;return Object.fromEntries(n.map((t=>{const n=e[t];return[t,n?n.value:void 0]})))}));return r}(u,"line",["x","y","series"]);if(!d)return;const{y:p,x:g,series:v=[]}=d,y=p.map(((t,e)=>e)),m=ir(y.map((t=>g[t]))),b=h$(s),x=s.getElementsByClassName($T),w=Jn(s.getElementsByClassName(YT),(t=>t.__data__.key.split("-")[0])),k=new $g({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},Qo(o,"rule"))}),M=new Zg({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},Qo(o,"label"))});k.append(M),b.appendChild(k);const E=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return m[Gn(m,i)]},O=(t,e)=>{k.setAttribute("x1",t[0]),k.setAttribute("x2",t[0]),M.setAttribute("text",i(e))};let _;const S=at((t=>{const e=p$(b,t);e&&(t=>{const{scale:e,coordinate:n}=_,{x:r,y:i}=e,o=E(n,r,t);O(t,o);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,a=e[Dn((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=w.get(r)||[];for(const t of h)t.setAttribute("dy",f)}})(e)}),e,{leading:n,trailing:r});return(t=>{Re(this,void 0,void 0,(function*(){const{x:e}=f,n=E(h,e,t);O(t,n),l("chartIndex",(t=>{const e=Q({},t),r=e.marks.find((t=>"line"===t.type)),i=vr(er(y,(t=>vr(t,(t=>+p[t]))/mr(t,(t=>+p[t]))),(t=>v[t])).values());Q(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[Dn((t=>g[+t])).center(t,n)]];for(const t of e.marks)t.animate=!1;return e}));const r=yield c("chartIndex");_=r.view}))})([0,0]),b.addEventListener("pointerenter",S),b.addEventListener("pointermove",S),b.addEventListener("pointerleave",S),()=>{k.remove(),b.removeEventListener("pointerenter",S),b.removeEventListener("pointermove",S),b.removeEventListener("pointerleave",S)}}}function V$({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=h$(s),l=at((t=>{const e=p$(c,t);if(!e)return a("fisheye"),void o();a("fisheye",(t=>{const n=Q({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,o=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find((t=>"fisheye"===t.type));if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return o.focusX=r,o.focusY=i,o.visual=!0,n})),o()}),t,{leading:e,trailing:n});return c.addEventListener("pointerenter",l),c.addEventListener("pointermove",l),c.addEventListener("pointerleave",l),()=>{c.removeEventListener("pointerenter",l),c.removeEventListener("pointermove",l),c.removeEventListener("pointerleave",l)}}}function U$(t,e){if(e)return"string"==typeof e?document.querySelector(e):e;return t.ownerDocument.defaultView.getContextService().getDomElement().parentElement}function X$(t,e,n,r,i,o,a,s={},c=[10,10]){const l=new nk({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:c,template:{prefixCls:"g2-"},style:Q({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(l.HTMLTooltipElement),l}function Z$({root:t,data:e,x:n,y:r,render:i,event:o,single:a,position:s="right-bottom",enterable:c=!1,css:l,mount:u,bounding:f,offset:h}){const d=U$(t,u),p=U$(t),g=a?p:t,v=f||function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return{x:n,y:r,width:i-n,height:o-r}}(t),y=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(p,d),{tooltipElement:m=X$(d,n,r,s,c,v,y,l,h)}=g,{items:b,title:x=""}=e;m.update(Object.assign({x:n,y:r,data:b,title:x,position:s,enterable:c,container:y},void 0!==i&&{content:i(o,{items:b,title:x})})),g.tooltipElement=m}function K$({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const o=U$(t),a=e?o:t,{tooltipElement:s}=a;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY),oW(t),aW(t),sW(t)}function Q$({root:t,single:e}){const n=U$(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0),oW(t),aW(t),sW(t)}function J$(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function tW(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function eW(t,e=t=>t){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function nW(t,e,n,r=t.map((t=>t.__data__)),i={}){const o=t=>t instanceof Date?+t:t,a=eW(r.map((t=>t.title)),o).filter(Zo),s=r.flatMap(((r,o)=>{const a=t[o],{items:s=[],title:c}=r,l=s.filter(Zo),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=tW(a)||i.color,name:o}=t,s=Le(t,["color","name"]);const l=Ho(e,r),f=u&&!(uz in s)?l||o:o||l;return Object.assign(Object.assign({},s),{color:n,name:f||c})}))})).map(J$);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:eW(s,(t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`))})}function rW(t,e,n,r){var{plotWidth:i,plotHeight:o,mainWidth:a,mainHeight:s,startX:c,startY:l,transposed:u,polar:f,insetLeft:h,insetTop:d}=r,p=Le(r,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const g=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},p),v=((t,e)=>{if(1===e.length)return e[0];const n=e.map((e=>As(e,t))),r=br(n,(t=>t));return e[r]})(n,e);if(f){const[e,n,r]=(()=>{const t=c+h+a/2,e=l+d+s/2;return[t,e,As([t,e],v)]})(),i=t.ruleX||((e,n,r)=>{const i=new Cg({style:Object.assign({cx:e,cy:n,r:r},g)});return t.appendChild(i),i})(e,n,r);i.style.cx=e,i.style.cy=n,i.style.r=r,t.ruleX=i}else{const[e,n,r,a]=u?[c+v[0],c+v[0],l,l+o]:[c,c+i,v[1]+l,v[1]+l],s=t.ruleX||((e,n,r,i)=>{const o=new $g({style:Object.assign({x1:e,x2:n,y1:r,y2:i},g)});return t.appendChild(o),o})(e,n,r,a);s.style.x1=e,s.style.x2=n,s.style.y1=r,s.style.y2=a,t.ruleX=s}}function iW(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=Le(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])),v=e.map((t=>t[0])),y=Er(g),m=Er(v),[b,x,w,k]=(()=>{if(u){const t=Math.min(o,a)/2,e=s+f+o/2,n=c+h+a/2,r=Ts(_s([m,y],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,y+c,y+c]:[m+s,m+s,c,c+i]})();if(v.length>0){const e=t.ruleY||(()=>{const e=new $g({style:Object.assign({x1:b,x2:x,y1:w,y2:k},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=w,e.style.y2=k,t.ruleY=e}}function oW(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function aW(t){t.ruleX&&(t.ruleX.remove(),t.ruleX=void 0)}function sW(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function cW(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function lW(t,e){return void 0===t?e:t}function uW(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function fW({root:t,event:e,elements:n,coordinate:r,scale:i,shared:o}){var a,s;const c=n.every((t=>"interval"===t.markType))&&!Qc(r),l=i.x,u=i.series,f=null!==(s=null===(a=null==l?void 0:l.getBandWidth)||void 0===a?void 0:a.call(l))&&void 0!==s?s:0,h=u?t=>{const e=Math.round(1/u.valueBandWidth);return t.__data__.x+t.__data__.series*f+f/(2*e)}:t=>t.__data__.x+f/2;c&&n.sort(((t,e)=>h(t)-h(e)));const d=t=>{const{target:e}=t;return I$(e,(t=>!!t.classList&&t.classList.includes("element")))},p=c?e=>{const i=p$(t,e);if(!i)return;const[a]=r.invert(i),s=(0,Dn(h).center)(n,a),c=n[s];if(!o){const t=n.find((t=>t!==c&&h(t)===h(c)));if(t)return d(e)}return c}:d;return p(e)}function hW({root:t,event:e,elements:n,coordinate:r,scale:i,startX:o,startY:a}){const s=Kc(r),c=[],l=[];for(const t of n){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?c.push(t):(r||i)&&l.push(t)}const u=l.length&&l.every((t=>"interval"===t.markType))&&!Qc(r),f=t=>t.__data__.x,h=!!i.x.getBandWidth&&l.length>0;c.sort(((t,e)=>{const n=s?0:1,r=t=>t.getBounds().min[n];return s?r(e)-r(t):r(t)-r(e)}));const d=t=>{const e=s?1:0,{min:n,max:r}=t.getLocalBounds();return ir([n[e],r[e]])};u?n.sort(((t,e)=>f(t)-f(e))):l.sort(((t,e)=>{const[n,r]=d(t),[i,o]=d(e),a=(n+r)/2,c=(i+o)/2;return s?c-a:a-c}));const p=new Map(c.map((t=>{const{__data__:e}=t,{seriesX:n}=e,r=n.map(((t,e)=>e)),i=ir(r,(t=>n[+t]));return[t,[i,n]]}))),{x:g}=i,v=(null==g?void 0:g.getBandWidth)?g.getBandWidth()/2:0,y=t=>{const[e]=r.invert(t);return e-v},m=(t,e,n,r)=>{const{_x:i}=t,o=void 0!==i?g.map(i):y(e),a=r.filter(Zo),[s,c]=ir([a[0],a[a.length-1]]);if(!h&&(o<s||o>c)&&!(s===c))return null;const l=Dn((t=>r[+t])).center;return n[l(n,o)]},b=u?(t,e)=>{const n=e[(0,Dn(f).center)(e,y(t))];return Jn(e,f).get(f(n))}:(t,e)=>{const n=t[s?1:0],r=e.filter((t=>{const[e,r]=d(t);return n>=e&&n<=r}));if(!h||r.length>0)return r;const i=Dn((t=>{const[e,n]=d(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(Zo)},x=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter((([t])=>t.startsWith("series")&&"series"!==t)).map((([t,n])=>{const r=n[e];return[W(t.replace("series","")),r]})))},w=p$(t,e);if(!w)return;const k=[w[0]-o,w[1]-a];if(!k)return;const M=b(k,l),E=[],O=[];for(const t of c){const[n,i]=p.get(t),o=m(e,k,n,i);if(null!==o){E.push(t);const e=x(t,o),{x:n,y:i}=e,a=r.map([(n||0)+v,i||0]);O.push([Object.assign(Object.assign({},e),{element:t}),a])}}const _=Array.from(new Set(O.map((t=>t[0].x)))),S=_[br(_,(t=>Math.abs(t-y(k))))],A=O.filter((t=>t[0].x===S)),T=[...A.map((t=>t[0])),...M.map((t=>t.__data__))];return{selectedElements:[...E,...M],selectedData:T,filteredSeriesData:A,abstractX:y}}function dW(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,crosshairsX:c,crosshairsY:l,render:u,groupName:f,emitter:h,wait:d=50,leading:p=!0,trailing:g=!1,startX:v=0,startY:y=0,body:m=!0,single:b=!0,position:x,enterable:w,mount:k,bounding:M,theme:E,offset:O,disableNative:_=!1,marker:S=!0,preserve:A=!1,style:T={},css:P={}}=e,N=Le(e,["elements","sort","filter","scale","coordinate","crosshairs","crosshairsX","crosshairsY","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","offset","disableNative","marker","preserve","style","css"]);const C=n(t),L=Q(T,N),j=Qc(a),R=Kc(a),{innerWidth:I,innerHeight:D,width:B,height:F,insetLeft:z,insetTop:$}=a.getOptions(),W=at((e=>{var n;const d=p$(t,e);if(!d)return;const p=d$(t),g=p.min[0],_=p.min[1],{selectedElements:A,selectedData:T,filteredSeriesData:N,abstractX:W}=hW({root:t,event:e,elements:C,coordinate:a,scale:o,startX:v,startY:y}),H=nW(A,o,f,T,E);if(r&&H.items.sort(((t,e)=>r(t)-r(e))),i&&(H.items=H.items.filter(i)),0===A.length||uW(H))return void G(e);if(m&&Z$({root:t,data:H,x:d[0]+g,y:d[1]+_,render:u,event:e,single:b,position:x,enterable:w,mount:k,bounding:M,css:P,offset:O}),s||c||l){const e=Qo(L,"crosshairs"),n=Object.assign(Object.assign({},e),Qo(L,"crosshairsX")),r=Object.assign(Object.assign({},e),Qo(L,"crosshairsY")),i=N.map((t=>t[1]));c&&rW(t,i,d,Object.assign(Object.assign({},n),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:$,startX:v,startY:y,transposed:R,polar:j})),l&&iW(t,i,Object.assign(Object.assign({},r),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:$,startX:v,startY:y,transposed:R,polar:j}))}if(S){const e=Qo(L,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const{type:i=""}=n,o=e.filter((t=>{const[{x:e,y:n}]=t;return Zo(e)&&Zo(n)})).map((t=>{const[{color:e,element:o},a]=t,s=e||o.style.fill||o.style.stroke||r.color,c="hollow"===i?"transparent":s,l="hollow"===i?s:"#fff";return new Cg({className:"g2-tooltip-marker",style:Object.assign({cx:a[0],cy:a[1],fill:c,r:4,stroke:l,lineWidth:2,pointerEvents:"none"},n)})}));for(const e of o)t.appendChild(e);t.markers=o}(t,{data:N,style:e,theme:E})}const Y=null===(n=N[0])||void 0===n?void 0:n[0].x,q=null!=Y?Y:W(focus);h.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},H),{data:{x:nT(o.x,q,!0)}})}))}),d,{leading:p,trailing:g}),G=e=>{K$({root:t,single:b,emitter:h,event:e})},H=()=>{Q$({root:t,single:b})},Y=e=>{var n,{nativeEvent:r,data:i,offsetX:s,offsetY:c}=e,l=Le(e,["nativeEvent","data","offsetX","offsetY"]);if(r)return;const u=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.x,f=o.x.map(u),[h,d]=a.map([f,.5]),p=t.getRenderBounds(),g=p.min[0],v=p.min[1];W(Object.assign(Object.assign({},l),{offsetX:void 0!==s?s:g+h,offsetY:void 0!==c?c:v+d,_x:u}))},q=()=>{K$({root:t,single:b,emitter:h,nativeEvent:!1})},V=()=>{Z(),H()},U=()=>{X()},X=()=>{_||(t.addEventListener("pointerdown",W),t.addEventListener("pointerenter",W),t.addEventListener("pointermove",W),t.addEventListener("pointerleave",(e=>{p$(t,e)||G(e)})),t.addEventListener("pointerup",G))},Z=()=>{_||(t.removeEventListener("pointerdown",W),t.removeEventListener("pointerenter",W),t.removeEventListener("pointermove",W),t.removeEventListener("pointerleave",G),t.removeEventListener("pointerup",G))};return X(),h.on("tooltip:show",Y),h.on("tooltip:hide",q),h.on("tooltip:disable",V),h.on("tooltip:enable",U),()=>{Z(),h.off("tooltip:show",Y),h.off("tooltip:hide",q),h.off("tooltip:disable",V),h.off("tooltip:enable",U),A?K$({root:t,single:b,emitter:h,nativeEvent:!1}):H()}}function pW(t,{elements:e,coordinate:n,scale:r,render:i,groupName:o,sort:a,filter:s,emitter:c,wait:l=50,leading:u=!0,trailing:f=!1,groupKey:h=t=>t,single:d=!0,position:p,enterable:g,datum:v,view:y,mount:m,bounding:b,theme:x,offset:w,shared:k=!1,body:M=!0,disableNative:E=!1,preserve:O=!1,css:_={}}){const S=e(t),A=Jn(S,h),T=at((e=>{const l=fW({root:t,event:e,elements:S,coordinate:n,scale:r,shared:k});if(!l)return void K$({root:t,single:d,emitter:c,event:e});const u=h(l),f=A.get(u);if(!f)return;const v=1!==f.length||k?nW(f,r,o,void 0,x):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(Zo).map((e=>{var{color:n=tW(t)}=e,r=Le(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(J$);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(f[0]);if(a&&v.items.sort(((t,e)=>a(t)-a(e))),s&&(v.items=v.items.filter(s)),uW(v))return void K$({root:t,single:d,emitter:c,event:e});const{offsetX:E,offsetY:O}=e;M&&Z$({root:t,data:v,x:E,y:O,render:i,event:e,single:d,position:p,enterable:g,mount:m,bounding:b,css:_,offset:w}),c.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},v),{data:Go(l,y)})}))}),l,{leading:u,trailing:f}),P=e=>{K$({root:t,single:d,emitter:c,event:e})},N=()=>{E||(t.addEventListener("pointerdown",T),t.addEventListener("pointermove",T),t.addEventListener("pointerleave",P),t.addEventListener("pointerup",P))},C=()=>{E||(t.removeEventListener("pointerdown",T),t.removeEventListener("pointermove",T),t.removeEventListener("pointerleave",P),t.removeEventListener("pointerup",P))},L=({nativeEvent:e,offsetX:n,offsetY:r,data:i})=>{if(e)return;const{data:o}=i,a=C$(S,o,v);if(!a)return;const s=a.getBBox(),{x:c,y:l,width:u,height:f}=s,h=t.getBBox();T({target:a,offsetX:void 0!==n?n+h.x:c+u/2,offsetY:void 0!==r?r+h.y:l+f/2})},j=({nativeEvent:e}={})=>{e||K$({root:t,single:d,emitter:c,nativeEvent:!1})};return c.on("tooltip:show",L),c.on("tooltip:hide",j),c.on("tooltip:enable",(()=>{N()})),c.on("tooltip:disable",(()=>{C(),Q$({root:t,single:d})})),N(),()=>{C(),c.off("tooltip:show",L),c.off("tooltip:hide",j),O?K$({root:t,single:d,emitter:c,nativeEvent:!1}):Q$({root:t,single:d})}}function gW(t){const{shared:e,crosshairs:n,crosshairsX:r,crosshairsY:i,series:o,name:a,item:s=()=>({}),facet:c=!1}=t,l=Le(t,["shared","crosshairs","crosshairsX","crosshairsY","series","name","item","facet"]);return(t,a,u)=>{const{container:f,view:h}=t,{scale:d,markState:p,coordinate:g,theme:v}=h,y=cW(p,"seriesTooltip"),m=cW(p,"crosshairs"),b=h$(f),x=lW(o,y),w=lW(n,m);if(x&&function(t){return Array.from(t.values()).some((t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip}))}(p)&&!c)return dW(b,Object.assign(Object.assign({},l),{theme:v,elements:l$,scale:d,coordinate:g,crosshairs:w,crosshairsX:lW(lW(r,n),!1),crosshairsY:lW(i,w),item:s,emitter:u}));if(x&&c){const e=a.filter((e=>e!==t&&e.options.parentKey===t.options.key)),o=u$(t,a),c=e[0].view.scale,f=b.getBounds(),h=f.min[0],d=f.min[1];return Object.assign(c,{facet:!0}),dW(b.parentNode.parentNode,Object.assign(Object.assign({},l),{theme:v,elements:()=>o,scale:c,coordinate:g,crosshairs:lW(n,m),crosshairsX:lW(lW(r,n),!1),crosshairsY:lW(i,w),item:s,startX:h,startY:d,emitter:u}))}return pW(b,Object.assign(Object.assign({},l),{datum:m$(h),elements:l$,scale:d,coordinate:g,groupKey:e?t=>t.__data__.x:void 0,item:s,emitter:u,view:h,theme:v,shared:e}))}}F$.props={reapplyWhenUpdate:!0},z$.props={reapplyWhenUpdate:!0},$$.props={reapplyWhenUpdate:!0},G$.props={reapplyWhenUpdate:!0},H$.props={reapplyWhenUpdate:!0},Y$.props={reapplyWhenUpdate:!0},q$.props={reapplyWhenUpdate:!0},gW.props={reapplyWhenUpdate:!0};const vW="legend-category";function yW(t){return t.getElementsByClassName("legend-category-item-marker")[0]}function mW(t){return t.getElementsByClassName("legend-category-item-label")[0]}function bW(t){return t.getElementsByClassName("items-item")}function xW(t){return t.getElementsByClassName(vW)}function wW(t){return t.getElementsByClassName("legend-continuous")}function kW(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function MW(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){return Re(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=[],data:l=[]}=t,u=e.findIndex((({type:t})=>t.startsWith("group")||t.startsWith("bin"))),f=[...e];l.length&&f.splice(u+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const h=Object.fromEntries(o.map((t=>[t,{domain:c.scale[t].getOptions().domain}])));return Q({},t,Object.assign(Object.assign({transform:f,scale:h},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(a.map((t=>[t,{preserve:!0}])))}))}));return Object.assign(Object.assign({},t),{marks:l})})),yield l()}))}function EW(t,e){for(const n of t)MW(n,Object.assign(Object.assign({},e),{facet:!0}))}function OW(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),o=i.length>0,a=t=>kW(t).scales.map((t=>t.name)),s=[...xW(r),...wW(r)],c=s.flatMap(a),l=at(o?EW:MW,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=kW(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===vW?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:Qo(h,"marker")},p={unselected:Qo(h,"label")},{setState:g,removeState:v}=M$(d,void 0),{setState:y,removeState:m}=M$(p,void 0),b=Array.from(e(t));let x=b.map(i);const w=()=>{for(const t of b){const e=i(t),o=n(t),a=r(t);x.includes(e)?(v(o,"unselected"),m(a,"unselected")):(g(o,"unselected"),y(a,"unselected"))}};for(const e of b){const n=()=>{P$(t,"pointer")},r=()=>{N$(t)},c=t=>Re(this,void 0,void 0,(function*(){const n=i(e),r=x.indexOf(n);-1===r?x.push(n):x.splice(r,1),yield o(x),w();const{nativeEvent:c=!0}=t;c&&(x.length===b.length?a.emit("legend:reset",{nativeEvent:c}):a.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:s,values:x}})))}));e.addEventListener("click",c),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),l.set(e,c),u.set(e,n),f.set(e,r)}const k=t=>Re(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===s&&(x=i,yield o(x),w())})),M=t=>Re(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;e||(x=b.map(i),yield o(x),w())}));return a.on("legend:filter",k),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",k),a.off("legend:reset",M)}}(r,{legends:bW,marker:yW,label:mW,datum:t=>{const{__data__:e}=t,{index:n}=e;return u[n]},filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});l(o?i:t,n)},state:e.attributes.state,channel:s,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const o=({detail:{value:t}})=>{n(t),r.emit({nativeEvent:!0,data:{channel:i,values:t}})};return e.addEventListener("valuechange",o),()=>{e.removeEventListener("valuechange",o)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!1});l(o?i:t,n)},emitter:n,channel:s})}));return()=>{u.forEach((t=>t()))}}}function _W(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=xW(r),s=l$(r),c=t=>kW(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=O$(o,["active","inactive"]),f=_$(s,m$(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=bW(t),o=l(r),a=Jn(s,(t=>o.invert(t.__data__[r]))),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:v}=M$(u,f),y={inactive:Qo(p,"marker")},m={inactive:Qo(p,"label")},{setState:b,removeState:x}=M$(y),{setState:w,removeState:k}=M$(m),M=t=>{for(const e of i){const n=yW(e),r=mW(e);e===t||null===t?(x(n,"inactive"),k(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},E=(t,i)=>{const o=e(i),c=new Set(a.get(o));for(const t of s)c.has(t)?g(t,"active"):g(t,"inactive");M(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:o}}))},O=new Map;for(const t of i){const e=e=>{E(e,t)};t.addEventListener("pointerover",e),O.set(t,e)}const _=t=>{for(const t of s)v(t,"inactive","active");M(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},S=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)},A=t=>{const{nativeEvent:e}=t;e||_({nativeEvent:!1})};t.addEventListener("pointerleave",_),n.on("legend:highlight",S),n.on("legend:unhighlight",A);const T=()=>{t.removeEventListener(_),n.off("legend:highlight",S),n.off("legend:unhighlight",A);for(const[t,e]of O)t.removeEventListener(e)};h.push(T)}return()=>h.forEach((t=>t()))}}function SW(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function AW(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function TW(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const PW=Py((t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:c=10,document:l}=e,u=Le(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=Qo(ta(u,"handleNW","handleNE"),"handleN"),{render:p=h}=d,g=Le(d,["render"]),v=Qo(u,"handleE"),{render:y=h}=v,m=Le(v,["render"]),b=Qo(ta(u,"handleSE","handleSW"),"handleS"),{render:x=h}=b,w=Le(b,["render"]),k=Qo(u,"handleW"),{render:M=h}=k,E=Le(k,["render"]),O=Qo(u,"handleNW"),{render:_=h}=O,S=Le(O,["render"]),A=Qo(u,"handleNE"),{render:T=h}=A,P=Le(A,["render"]),N=Qo(u,"handleSE"),{render:C=h}=N,L=Le(N,["render"]),j=Qo(u,"handleSW"),{render:R=h}=j,I=Le(j,["render"]),D=t=>()=>{const e=Py((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({})},B=uy(t).attr("className",a).style("transform",`translate(${n}, ${r})`).style("draggable",!0);B.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(TW,Object.assign(Object.assign({width:i,height:o},ta(u,"handle")),{transform:void 0})),B.maybeAppend("handle-n",D(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(TW,g),B.maybeAppend("handle-e",D(y)).style("x",i-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(TW,m),B.maybeAppend("handle-s",D(x)).style("x",f).style("y",o-f).style("width",i-c).style("height",c).style("fill","transparent").call(TW,w),B.maybeAppend("handle-w",D(M)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(TW,E),B.maybeAppend("handle-nw",D(_)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(TW,S),B.maybeAppend("handle-ne",D(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(TW,P),B.maybeAppend("handle-se",D(C)).style("x",i-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(TW,L),B.maybeAppend("handle-sw",D(R)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(TW,I)}));function NW(t,e){var{brushed:n=()=>{},brushended:r=()=>{},brushcreated:i=()=>{},brushstarted:o=()=>{},brushupdated:a=()=>{},extent:s=AW(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=Le(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,v=null,y=null,m=null,b=null,x=!1;const[w,k,M,E]=s;P$(t,"crosshair"),t.style.draggable=!0;const O=(t,e,n)=>{if(o(n),m&&m.remove(),b&&b.remove(),g=[t,e],l)return _();S()},_=()=>{b=new Gg({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),m=new PW({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(m)},S=()=>{m=new PW({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(m)},A=(t=!0)=>{m&&m.remove(),b&&b.remove(),g=null,v=null,y=null,x=!1,m=null,b=null,r(t)},T=(t,e,r=!0)=>{const[i,o,a,u]=function(t,e,n,r,i){const[o,a,s,c]=i;return[Math.max(o,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,h,d,p]=c(i,o,a,u,s);return l?N(f,h,d,p):P(f,h,d,p),n(f,h,d,p,r),[f,h,d,p]},P=(t,e,n,r)=>{m.style.x=t,m.style.y=e,m.style.width=n-t,m.style.height=r-e},N=(t,e,n,r)=>{b.style.d=`\n M${w},${k}L${M},${k}L${M},${E}L${w},${E}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,m.style.x=t,m.style.y=e,m.style.width=n-t,m.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"}},L=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==d.indexOf(e)&&new Set(Object.keys(C)).has(e)},R=t=>t===m.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=g$(t,e);if(!m||!L(n))return O(r,i,e),void(x=!0);L(n)&&(y=[r,i])},D=e=>{const{target:n}=e,r=g$(t,e);if(!g)return;if(!y)return T(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-y[0],r=t[1]-y[1],i=e(n,g[0],v[0],w,M),o=e(r,g[1],v[1],k,E),a=[g[0]+i,g[1]+o],s=[v[0]+i,v[1]+o];T(a,s)})(r);const[i,o]=[r[0]-y[0],r[1]-y[1]],{id:a}=n;if(C[a]){const[t,e,n,r]=C[a].vector;return T([g[0]+i*t,g[1]+o*e],[v[0]+i*n,v[1]+o*r])}},B=e=>{if(y){y=null;const{x:t,y:n,width:r,height:i}=m.style;return g=[t,n],v=[t+r,n+i],void a(t,n,t+r,n+i,e)}v=g$(t,e);const[n,r,o,s]=T(g,v);x=!1,i(n,r,o,s,e)},F=t=>{const{target:e}=t;m&&!L(e)&&A()},z=e=>{const{target:n}=e;m&&L(n)&&!x?R(n)?P$(t,"move"):j(n)&&P$(t,C[n.id].cursor):P$(t,"crosshair")},$=()=>{P$(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",D),t.addEventListener("dragend",B),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",$),{mask:m,move(t,e,n,r,i=!0){m||O(t,e,{}),g=[t,e],v=[n,r],T([t,e],[n,r],i)},remove(t=!0){m&&A(t)},destroy(){m&&A(!1),P$(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",D),t.removeEventListener("dragend",B),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",$)}}}function CW(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 LW(t,e,n){return CW(t,e,n).map((t=>t.options))}function jW(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,v=Le(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),m=i(t),b=m.flatMap(n),x=_$(y,o),w=Qo(v,"mask"),{setState:k,removeState:M}=M$(p,x),E=new Map,{width:O,height:_,x:S=0,y:A=0}=d(t),T=s||[0,0,O,_],P=()=>{for(const t of[...y,...b])M(t,"active","inactive")},N=(t,e,n,r)=>{var i;for(const t of m)null===(i=t.brush)||void 0===i||i.remove();const o=new Set;for(const i of y){const{min:a,max:s}=i.getLocalBounds(),[c,l]=a,[u,f]=s;SW([c,l,u,f],[t,e,n,r])?(k(i,"active"),o.add(h(i))):k(i,"inactive")}for(const t of b)o.has(h(t))?k(t,"active"):k(t,"inactive")},C=()=>{for(const t of y)M(t,"inactive");for(const t of E.values())t.remove();E.clear()},L=(e,n,r,i)=>{const o=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),E.set(t,e),e},a=new Ug({style:{x:e+S,y:n+A,width:r-e,height:i-n}});t.appendChild(a);for(const t of y){const e=E.get(t)||o(t);e.style.clipPath=a,k(t,"inactive"),k(e,"active")}},j=NW(t,Object.assign(Object.assign({},w),{extent:T,brushRegion:a,reverse:c,selectedHandles:r,brushended:t=>{const e=f?C:P;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const o=iT(t,e,n,r,l,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:o}});(f?L:N)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const o=iT(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=iT(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=oT(o,r),c=oT(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);j.move(r,i,o,a,!1)};g.on("brush:highlight",R);const I=({nativeEvent:t}={})=>{t||j.remove(!1)};g.on("brush:remove",I);const D=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),D()},j}function RW(t){var{facet:e,brushKey:n}=t,r=Le(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:c}=t,l=h$(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 jW(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>u$(t,i),datum:m$(f$(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:O$(f$(t,i).map((t=>t.options)),f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=jW(l,Object.assign(Object.assign({elements:l$,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return CW(t,e,n).map((t=>h$(t.container)))}(t,i,n),datum:m$([s,...CW(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:O$([c,...LW(t,i,n)],f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function IW(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function DW(t){return RW(Object.assign(Object.assign({},t),{brushRegion:IW,selectedHandles:["handle-e","handle-w"]}))}function BW(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function FW(t){return RW(Object.assign(Object.assign({},t),{brushRegion:BW,selectedHandles:["handle-n","handle-s"]}))}const zW="axis-hot-area";function $W(t){return t.getElementsByClassName("axis")}function WW(t){return t.getElementsByClassName("axis-line")[0]}function GW(t){return function(t){return t.getElementsByClassName("axis-main-group")[0]}(t).getLocalBounds()}function HW(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=Le(e,["cross","offsetX","offsetY"]);const a=GW(t),s=WW(t),[c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=2*(f-l);return{brushRegion:BW,hotZone:new Ug({className:zW,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 YW(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=Le(e,["offsetY","offsetX","cross"]);const a=GW(t),s=WW(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=h-u;return{brushRegion:IW,hotZone:new Ug({className:zW,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)]}}function qW(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=h$(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=Le(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),v=_$(p,a),{setState:y,removeState:m}=M$(u,v),b=new Map,x=Qo(d,"mask"),w=t=>Array.from(b.values()).every((([e,n,r,i])=>t.some((([t,o])=>t>=e&&t<=r&&o>=n&&o<=i)))),k=g.map((t=>t.attributes.scale)),M=t=>t.length>2?[t[0],t[t.length-1]]:t,E=new Map,O=()=>{E.clear();for(let t=0;t<g.length;t++){const e=k[t],{domain:n}=e.getOptions();E.set(t,M(n))}};O();const _=(t,e)=>{const n=[];for(const t of p){const e=i(t);w(e)?(y(t,"active"),n.push(t)):y(t,"inactive")}E.set(t,A(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)return Array.from(E.values());const t=[];for(const[e,n]of E){const r=k[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},S=t=>{for(const t of p)m(t,"active","inactive");O(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},A=(t,e)=>{const n=k[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return M(rT(n,i))},T=g.some(o)&&g.some((t=>!o(t))),P=[];for(let t=0;t<g.length;t++){const e=g[t],n=o(e)?YW:HW,{hotZone:r,brushRegion:i,extent:a}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=NW(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?S(n):_(t,n)},brushed(n,r,i,o,s){b.set(e,a(n,r,i,o)),_(t,s)}}));P.push(u)}const N=(t={})=>{const{nativeEvent:e}=t;e||P.forEach((t=>t.remove(!1)))},C=(t,e,n)=>{const[r,i]=t,a=L(r,e,n),s=L(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return o(n)?[a,-1/0,s,1/0]:[-1/0,a,1/0,s]},L=(t,e,n)=>{const{height:r,width:i}=h.getOptions(),a=e.clone();return o(n)?a.update({range:[0,i]}):a.update({range:[r,0]}),a.map(t)},j=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<P.length;t++){const e=n[t],r=P[t],i=g[t];if(e){const n=k[t];r.move(...C(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",N),f.on("brushAxis:highlight",j),()=>{P.forEach((t=>t.destroy())),f.off("brushAxis:remove",N),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:l$,axes:$W,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:m$(o),state:O$(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function VW(t){var{hideX:e=!0,hideY:n=!0}=t,r=Le(t,["hideX","hideY"]);return(t,i,o)=>{const{container:a,view:s,options:c,update:l,setState:u}=t,f=h$(a);let h=!1,d=!1,p=s;const{scale:g,coordinate:v}=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=Qo(Le(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:d,height:p}=t.getBBox(),g=o||[0,0,d,p],v=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),y=NW(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:a,brushcreated:function(t,e,r,i,o){t===r&&e===i||(o.nativeEvent=!0,n(u(t,e,r,i),o),y.remove())}}));function m(t){v(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",m);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{y.destroy(),s.off("brush:filter",b),t.removeEventListener("click",m)}}(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 iT(t,e,n,r,i,o)},filter:(t,r)=>Re(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=>Q({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:v},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function UW(t){return VW(Object.assign(Object.assign({hideX:!0},t),{brushRegion:IW}))}function XW(t){return VW(Object.assign(Object.assign({hideY:!0},t),{brushRegion:BW}))}function ZW(t,e,n,r=!1,i="x",o="y"){const{marks:a}=t,s=a.map((t=>{var a,s;return Q({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 KW(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return rT(e,[nT(e,o(r),!0),nT(e,o(i),!1)])}function QW(t){return[t[0],t[t.length-1]]}function JW({initDomain:t={},className:e="slider",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,v=h.getElementsByClassName(e);if(!v.length)return()=>{};let y=!1;const{scale:m,coordinate:b,layout:x}=d,{paddingLeft:w,paddingTop:k,paddingBottom:M,paddingRight:E}=x,{x:O,y:_}=m,S=Kc(b),A=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return S?[n,e]:[e,n]},T=new Map,P=new Set,N={x:t.x||O.getOptions().domain,y:t.y||_.getOptions().domain};for(const t of v){const{orientation:e}=t.attributes,[l,u]=A(e),h=`${n}${G(l)}:filter`,d="x"===l,{ratio:v}=O.getOptions(),{ratio:b}=_.getOptions(),x=t=>{if(t.data){const{selection:e}=t.data,[n=QW(N.x),r=QW(N.y)]=e;return d?[rT(O,n,v),rT(_,r,b)]:[rT(_,r,b),rT(O,n,v)]}const{value:n}=t.detail;return[KW(n,m[l],S&&"horizontal"===e),N[u]]},C=at((e=>Re(this,void 0,void 0,(function*(){const{initValue:r=!1}=e;if(y&&!r)return;y=!0;const{nativeEvent:o=!0}=e,[a,s]=x(e);if(N[l]=a,N[u]=s,o){const t=d?a:s,n=d?s:a;f.emit(h,Object.assign(Object.assign({},e),{nativeEvent:o,data:{selection:[QW(t),QW(n)]}}))}g(t,(t=>Object.assign(Object.assign({},ZW(t,{[l]:{domain:a,nice:!1}},n,i,l,u)),{paddingLeft:w,paddingTop:k,paddingBottom:M,paddingRight:E}))),yield p(),y=!1}))),o,{leading:a,trailing:s}),L=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:o}=i,[a,s]=o;t.dispatchEvent(new Np("valuechange",{data:i,nativeEvent:!1}));const c=d?oT(a,O):oT(s,_);r(t,c)};f.on(h,L),t.addEventListener("valuechange",C),T.set(t,C),P.add([h,L]);const j=c(t);j&&t.dispatchEvent(new Np("valuechange",{detail:{value:j},nativeEvent:!1,initValue:!0}))}return()=>{for(const[t,e]of T)t.removeEventListener("valuechange",e);for(const[t,e]of P)f.off(t,e)}}}const tG="g2-scrollbar";function eG(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(tG).length)return()=>{};const{scale:a}=i,{x:s,y:c}=a,l={x:[...s.getOptions().domain],y:[...c.getOptions().domain]};s.update({domain:s.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain});return JW(Object.assign(Object.assign({},t),{initDomain:l,className:tG,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0]),getInitValues:t=>{const e=t.slider.attributes.values;if(0!==e[0])return e}}))(e,n,r)}}function nG(t,e,n){return`<${t} style="${Object.entries(n).map((([t,e])=>`${function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}(t)}:${e}`)).join(";")}">${e}</${t}>`}const rG={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 iG(t){return"text"===t.nodeName&&!!t.isOverflowing()}function oG(t){var{offsetX:e=8,offsetY:n=8}=t,r=Le(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=Qo(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!iG(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 Bg({className:"poptip",style:{innerHTML:nG("div",d,Object.assign(Object.assign({},rG),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;iG(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()))}}}oG.props={reapplyWhenUpdate:!0};const aG={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function sG(t={}){const{originData:e=[],layout:n}=t,r=Le(t,["originData","layout"]),i=Q({},aG,r),o=Qo(i,"breadCrumb"),a=Qo(i,"active");return t=>{const{update:r,setState:i,container:s,options:c}=t,l=function(t){return uy(t).select(`.${GT}`).node()}(s),u=c.marks[0],{state:f}=u,h=new Ig;l.appendChild(h);const d=(t,c)=>Re(this,void 0,void 0,(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 Zg({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 Zg({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===lt(t)-1&&u.remove(),l}));c.forEach(((t,e)=>{if(e===lt(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(rt(t,["style","path"]),rt(t,["style","depth"]))}))}))}!function(t,e){[...xW(t),...wW(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=rt(t,["id"]);return e&&(e.match(`${o}/`)||o.match(e))})).map((t=>({value:0===t.height?rt(t,["value"]):void 0,name:rt(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=n_(t,l,{value:"value"})[0]}else r=e.filter((t=>1===t.depth));const i=[];return r.forEach((({path:t})=>{i.push(j(t))})),Q({},t,{data:r,scale:{color:{domain:i}}})}));return Object.assign(Object.assign({},r),{marks:a})})),yield r(void 0,["legendFilter"])})),p=t=>{const n=t.target,{markType:r,nodeName:i,attributes:o}=n||{};if("rect"!==r&&i!==tu.TEXT)return;const a=i===tu.TEXT&&!0===rt(o,"isTreemapLabel")?(t=>t.attributes.key.split("-")[0])(n):(t=>rt(t,["__data__","key"]))(n),s=A(e,(t=>t.id===a));rt(s,"height")&&d(rt(s,"path"),rt(s,"depth"))};l.addEventListener("click",p);const g=M(Object.assign(Object.assign({},f.active),f.inactive)),v=()=>{R$(l).forEach((t=>{const n=rt(t,["style","cursor"]),r=A(e,(e=>e.id===rt(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 k(e,(function(e){it.call(t,e)&&(n[e]=t[e])})),n}(t.attributes,g);t.addEventListener("mouseenter",(()=>{t.attr(f.active)})),t.addEventListener("mouseleave",(()=>{t.attr(Q(e,f.inactive))}))}}))};return v(),l.addEventListener("mousemove",v),()=>{h.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",v)}}}const cG={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},lG="movePoint",uG=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")))},fG=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},hG=(t,e,n)=>{t.forEach(((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)}))},dG=(t,e,n,r)=>{const i=new Gg({style:n}),o=new Zg({style:r});return e.appendChild(o),t.appendChild(i),[i,o]},pG=(t,e)=>{if(!rt(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},gG=(t,e,n)=>{const r=L$(t,e),i=L$(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function vG(t={}){const{selection:e=[],precision:n=2}=t,r=Le(t,["selection","precision"]),i=Object.assign(Object.assign({},cG),r||{}),o=Qo(i,"path"),a=Qo(i,"label"),s=Qo(i,"point");return(t,r,i)=>{const{update:c,setState:l,container:u,view:f,options:{marks:h,coordinate:d}}=t,p=h$(u);let g,v=R$(p),y=e;const{transform:m=[],type:b}=d,x=!!A(m,(({type:t})=>"transpose"===t)),w="polar"===b,k="theta"===b,M=!!A(v,(({markType:t})=>"area"===t));M&&(v=v.filter((({markType:t})=>"area"===t)));const E=new Ig({style:{zIndex:2}});p.appendChild(E);const O=()=>{i.emit("element-point:select",{nativeEvent:!0,data:{selection:y}})},_=t=>{const e=t.target;y=[e.parentNode.childNodes.indexOf(e)],O(),T(e)},S=t=>{const{data:{selection:e},nativeEvent:n}=t;if(n)return;y=e;const r=rt(v,[null==y?void 0:y[0]]);r&&T(r)},T=t=>{const{attributes:e,markType:r,__data__:d}=t,{stroke:p}=e,{points:v,seriesTitle:m,color:b,title:_,seriesX:S,y1:P}=d;if(x&&"interval"!==r)return;const{scale:N,coordinate:C}=(null==g?void 0:g.view)||f,{color:L,y:j,x:R}=N,I=C.getCenter();let D;E.removeChildren();const B=(t,e,n,r)=>Re(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),Q({},o,{data:l,animate:!1})}));return Object.assign(Object.assign({},o),{marks:s})})),yield c("elementPointMove")}));if(["line","area"].includes(r))v.forEach(((e,r)=>{const i=R.invert(S[r]);if(!i)return;const c=new Cg({name:lG,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),l=((t,e)=>{const n=rt(t,["__data__","seriesItems",e,"0","value"]),r=rt(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:o,transform:a}}=t.parentNode,s=A(a,(({type:t})=>"normalizeY"===t)),c=rt(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([S[r],0]),d=null==m?void 0:m.length;u.attr("cursor","move"),y[1]!==r&&(y[1]=r,O()),hG(E.childNodes,y,s);const[p,x]=dG(E,c,o,a),k=t=>{const i=e[1]+t.clientY-D[1];if(M)if(w){const o=e[0]+t.clientX-D[0],[a,s]=gG(I,h,[o,i]),[,u]=C.output([1,j.output(0)]),[,f]=C.invert([a,u-(v[r+d][1]-s)]),g=(r+1)%d,y=j$([v[(r-1+d)%d],[a,s],m[g]&&v[g]]);x.attr("text",l(j.invert(f)).toFixed(n)),p.attr("d",y),c.attr("cx",a),c.attr("cy",s)}else{const[,t]=C.output([1,j.output(0)]),[,o]=C.invert([e[0],t-(v[r+d][1]-i)]),a=j$([v[r-1],[e[0],i],m[r+1]&&v[r+1]]);x.attr("text",l(j.invert(o)).toFixed(n)),p.attr("d",a),c.attr("cy",i)}else{const[,t]=C.invert([e[0],i]),o=j$([v[r-1],[e[0],i],v[r+1]]);x.attr("text",j.invert(t).toFixed(n)),p.attr("d",o),c.attr("cy",i)}};D=[f.clientX,f.clientY],window.addEventListener("mousemove",k);const _=()=>Re(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",k),u.removeEventListener("mouseup",_),Y(x.attr("text")))return;const e=Number(x.attr("text")),n=pG(L,b);g=yield B(i,e,n,["line","area"]),x.remove(),p.remove(),T(t)}));u.addEventListener("mouseup",_)})),E.appendChild(c)})),hG(E.childNodes,y,s);else if("interval"===r){let e=[(v[0][0]+v[1][0])/2,v[0][1]];x?e=[v[0][0],(v[0][1]+v[1][1])/2]:k&&(e=v[0]);const i=(t=>{const e=rt(t,["__data__","y"]),n=rt(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:o},childNodes:a}=t.parentNode,s=A(o,(({type:t})=>"normalizeY"===t)),c=rt(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 Cg({name:lG,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=pG(L,b),[f,h]=dG(E,c,o,a),d=t=>{if(x){const r=e[0]+t.clientX-D[0],[o]=C.output([j.output(0),j.output(0)]),[,a]=C.invert([o+(r-v[2][0]),e[1]]),s=j$([[r,v[0][1]],[r,v[1][1]],v[2],v[3]],!0);h.attr("text",i(j.invert(a)).toFixed(n)),f.attr("d",s),c.attr("cx",r)}else if(k){const r=e[1]+t.clientY-D[1],o=e[0]+t.clientX-D[0],[a,s]=gG(I,[o,r],e),[l,u]=gG(I,[o,r],v[1]),d=C.invert([a,s])[1],p=P-d;if(p<0)return;const g=function(t,e,n=0){const r=[["M",...e[1]]],i=L$(t,e[1]),o=L$(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],v[2],v[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-D[1],[,o]=C.output([1,j.output(0)]),[,a]=C.invert([e[0],o-(v[2][1]-r)]),s=j$([[v[0][0],r],[v[1][0],r],v[2],v[3]],!0);h.attr("text",i(j.invert(a)).toFixed(n)),f.attr("d",s),c.attr("cy",r)}};D=[s.clientX,s.clientY],window.addEventListener("mousemove",d);const p=()=>Re(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",d),Y(h.attr("text")))return;const e=Number(h.attr("text"));g=yield B(_,e,l,[r]),h.remove(),f.remove(),T(t)}));u.addEventListener("mouseup",p)})),E.appendChild(c)}};v.forEach(((t,e)=>{y[0]===e&&T(t),t.addEventListener("click",_),t.addEventListener("mouseenter",uG),t.addEventListener("mouseleave",fG)}));const P=t=>{const e=null==t?void 0:t.target;e&&(e.name===lG||v.includes(e))||(y=[],O(),E.removeChildren())};return i.on("element-point:select",S),i.on("element-point:unselect",P),u.addEventListener("mousedown",P),()=>{E.remove(),i.off("element-point:select",S),i.off("element-point:unselect",P),u.removeEventListener("mousedown",P),v.forEach((t=>{t.removeEventListener("click",_),t.removeEventListener("mouseenter",uG),t.removeEventListener("mouseleave",fG)}))}}}var yG={},mG={};function bG(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function xG(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 wG(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function kG(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+wG(-t,6):t>9999?"+"+wG(t,6):wG(t,4)}(t.getUTCFullYear())+"-"+wG(t.getUTCMonth()+1,2)+"-"+wG(t.getUTCDate(),2)+(i?"T"+wG(e,2)+":"+wG(n,2)+":"+wG(r,2)+"."+wG(i,3)+"Z":r?"T"+wG(e,2)+":"+wG(n,2)+":"+wG(r,2)+"Z":n||e?"T"+wG(e,2)+":"+wG(n,2)+"Z":"")}function MG(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 mG;if(l)return l=!1,yG;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())!==mG;){for(var f=[];r!==yG&&r!==mG;)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?kG(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=bG(t);return function(r,i){return e(n(r),i,t)}}(t,e):bG(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=xG(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=xG(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function EG(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;OG&&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 OG=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),_G=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>Re(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return MG(r).parse(e,i?EG:Yo)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};_G.props={};const SG=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap((t=>e.map((e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))))):t;var i}};function AG(t){return null!=t&&!Number.isNaN(t)}SG.props={};const TG=t=>{const{callback:e=AG}=t;return t=>t.filter(e)};TG.props={};const PG=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};PG.props={};const NG=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)))};NG.props={};const CG=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map((e=>Object.entries(e).reduce(((e,[n,r])=>(e[t[n]||n]=r,e)),{})))};CG.props={};const LG=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)))};LG.props={};const jG=t=>{const{value:e}=t;return()=>e};jG.props={};const RG=t=>{const{callback:e=Yo}=t;return t=>e(t)};RG.props={};const IG=t=>{const{callback:e=Yo}=t;return t=>Array.isArray(t)?t.map(e):t};IG.props={};const DG=Math.PI/180,BG=2048;function FG(t){return t.text}function zG(){return"serif"}function $G(){return"normal"}function WG(t){return t.value}function GG(){return 90*~~(2*Math.random())}function HG(){return 1}function YG(){}function qG(t,e,n,r){if(e.sprite)return;const i=t.context,o=t.ratio;i.clearRect(0,0,2048/o,BG/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*DG),r=Math.cos(e.rotate*DG),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>=2048&&(a=0,s+=c,c=0),s+l>=BG)break;i.translate((a+(t>>1))/o,(s+(l>>1))/o),e.rotate&&i.rotate(e.rotate*DG),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,2048/o,BG/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[2048*(s+n)+(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 VG(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 UG(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 XG(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 ZG(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function KG(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function QG(){return document.createElement("canvas")}function JG(t){return"function"==typeof t?t:function(){return t}}const tH={archimedean:ZG,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 eH(){let t=[256,256],e=FG,n=zG,r=WG,i=$G,o=GG,a=HG,s=ZG,c=Math.random,l=YG,u=[],f=null,h=1/0,d=QG;const p=$G,g={};function v(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||!VG(n,e,t[0]))&&(!r||XG(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,y]=t,m=function(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=BG/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",n.textBaseline="middle",{context:n,ratio:e}}(d()),b=g.board?g.board:KG((t[0]>>5)*t[1]),x=u.length,w=[],k=u.map((function(t,s,c){return t.text=e.call(this,t,s,c),t.font=n.call(this,t,s,c),t.style=p.call(this,t,s,c),t.weight=i.call(this,t,s,c),t.rotate=o.call(this,t,s,c),t.size=~~r.call(this,t,s,c),t.padding=a.call(this,t,s,c),t})).sort((function(t,e){return e.size-t.size}));let M=-1,E=g.board?[{x:0,y:0},{x:s,y:y}]:void 0;function O(){const e=Date.now();for(;Date.now()-e<h&&++M<x;){const e=k[M];e.x=s*(c()+.5)>>1,e.y=y*(c()+.5)>>1,qG(m,e,k,M),e.hasText&&v(b,e,E)&&(l.call(null,"word",{cloud:g,word:e}),w.push(e),E?g.hasImage||UG(E,e):E=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=t[0]>>1,e.y-=t[1]>>1)}g._tags=w,g._bounds=E,M>=x&&(g.stop(),l.call(null,"end",{cloud:g,words:w,bounds:E}))}return f&&clearInterval(f),f=setInterval(O,0),O(),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=KG((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=JG(t)},g.font=function(t){n=JG(t)},g.fontWeight=function(t){i=JG(t)},g.rotate=function(t){o=JG(t)},g.canvas=function(t){d=JG(t)},g.spiral=function(t){s=tH[t]||t},g.fontSize=function(t){r=JG(t)},g.padding=function(t){a=JG(t)},g.random=function(t){c=JG(t)},g.on=function(t){l=JG(t)},g}const nH={fontSize:[20,60],font:"Impact",padding:2,rotate:function(){return 30*(~~(6*Math.random())-3)}};function rH(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 iH=(t,e)=>n=>Re(void 0,void 0,void 0,(function*(){const r=Object.assign({},nH,t,{canvas:e.createCanvas}),i=eH();var o,a;yield(o=i,a=r,{set(t,e,n){if(void 0===a[t])return this;const r=e?e.call(null,a[t]):a[t];return n?n.call(null,r):"function"==typeof o[t]?o[t](r):o[t]=r,this},setAsync(t,e,n){return Re(this,void 0,void 0,(function*(){if(void 0===a[t])return this;const r=e?yield e.call(null,a[t]):a[t];return n?n.call(null,r):"function"==typeof o[t]?o[t](r):o[t]=r,this}))}}).set("fontSize",(t=>{const e=n.map((t=>t.value));return function(t,e){if("function"==typeof t)return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,o]=e;return o===i?()=>(r+n)/2:({value:t})=>(r-n)/(o-i)*(t-i)+n}return()=>t}(t,[mr(e),vr(e)])})).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").set("canvas").setAsync("imageMask",rH,i.createMask),i.words([...n]);const s=i.start(),[c,l]=r.size,u=[{x:0,y:0},{x:c,y:l}],{_bounds:f=u,_tags:h,hasImage:d}=s,p=h.map((t=>{var{x:e,y:n,font:r}=t,i=Le(t,["x","y","font"]);return Object.assign(Object.assign({},i),{x:e+c/2,y:n+l/2,fontFamily:r})})),[{x:g,y:v},{x:y,y:m}]=f,b={text:"",value:0,opacity:0,fontSize:0};return p.push(Object.assign(Object.assign({},b),{x:d?0:g,y:d?0:v}),Object.assign(Object.assign({},b),{x:d?c:y,y:d?l:m})),p}));function oH(t){return"string"==typeof t?e=>e[t]:t}iH.props={};const aH=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=oH(s),l=oH(a),u=er(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)),{}))}))};aH.props={};const sH=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};sH.props={};var cH={exports:{}},lH={exports:{}};!function(t){var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}}(lH),function(t){var e=Math.log(2),n=t.exports,r=lH.exports;function i(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return n.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,o=r.isNumber(e.width)?e.width:2,a=r.isNumber(e.size)?e.size:50,s=r.isNumber(e.min)?e.min:(n=!0,r.findMinMulti(t)),c=r.isNumber(e.max)?e.max:(i=!0,r.findMaxMulti(t)),l=(c-s)/(a-1);return n&&(s-=2*o*l),i&&(c+=2*o*l),{min:s,max:c}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var o=r.isNumber(e.size)?e.size:50,a=r.isNumber(e.width)?e.width:2,s=n.getUnifiedMinMax(t,{size:o,width:a,min:e.min,max:e.max}),c=s.min,l=s.max-c,u=l/(o-1);if(0===l)return[{x:c,y:1}];for(var f=[],h=0;h<o;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}(i,a),p=d[a],g=d[a-1]-d[a-2],v=0;t.forEach((function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+a<0||e-a>=f.length)){var n=Math.max(e-a,0),i=e,o=Math.min(e+a,f.length-1),s=n-(e-a),l=e+a-o,h=d[-a-1+s]||0,y=d[-a-1+l]||0,m=p/(p-h-y);s>0&&(v+=m*(s-1)*g);var b=Math.max(0,e-a+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*m*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*m*g),r.inside(0,f.length-1,o+1)&&(f[o+1].y+=1*m*g)}}));var y=v,m=0,b=0;return f.forEach((function(t){m+=t.y,y+=m,t.y=y,b+=y})),b>0&&f.forEach((function(t){t.y/=b})),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach((function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)})),n=-n/e,Math.pow(2,n)}}}(cH);var uH=cH.exports;const fH=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(Jn(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=uH.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})}))}};function hH(t){const e=new Array(t);for(let n=0;n<t;++n)e[n]=0;return e}function dH(t,e){return hH(t).map((()=>hH(e)))}function pH(t,e){let n=0;for(let r=0;r<t.length;++r)n+=t[r]*e[r];return n}function gH(t){return Math.sqrt(pH(t,t))}function vH(t,e,n){for(let r=0;r<e.length;++r)t[r]=e[r]*n}function yH(t,e,n,r,i){for(let o=0;o<t.length;++o)t[o]=e*n[o]+r*i[o]}function mH(t,e,n,r,i,o,a){const s=n.fx,c=pH(n.fxprime,e);let l=s,u=s,f=c,h=0;function d(u,h,d){for(let p=0;p<16;++p)if(i=(u+h)/2,yH(r.x,1,n.x,i,e),l=r.fx=t(r.x,r.fxprime),f=pH(r.fxprime,e),l>s+o*i*c||l>=d)h=i;else{if(Math.abs(f)<=-a*c)return i;f*(h-u)>=0&&(h=u),u=i,d=l}return 0}i=i||1,o=o||1e-6,a=a||.1;for(let p=0;p<10;++p){if(yH(r.x,1,n.x,i,e),l=r.fx=t(r.x,r.fxprime),f=pH(r.fxprime,e),l>s+o*i*c||p&&l>=u)return d(h,i,u);if(Math.abs(f)<=-a*c)return i;if(f>=0)return d(i,h,l);u=l,h=i,i*=2}return i}function bH(t,e,n){let r={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const o=e.slice();let a,s=1;const c=(n=n||{}).maxIterations||20*e.length;r.fx=t(r.x,r.fxprime);const l=r.fxprime.slice();vH(l,r.fxprime,-1);for(let e=0;e<c;++e){if(s=mH(t,l,r,i,s),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:s}),s){yH(o,1,i.fxprime,-1,r.fxprime);const t=pH(r.fxprime,r.fxprime);yH(l,Math.max(0,pH(o,i.fxprime)/t),l,-1,i.fxprime),a=r,r=i,i=a}else vH(l,r.fxprime,-1);if(gH(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:s}),r}fH.props={};const xH=1e-10;function wH(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=OH(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(MH(t,e[n])>e[n].radius+xH)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=MH(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+=kH(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(MH(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-xH,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 kH(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function MH(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function EH(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 kH(t,t-(n*n-e*e+t*t)/(2*n))+kH(e,r)}function OH(t,e){const n=MH(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}]}function _H(t,e){(e=e||{}).maxIterations=e.maxIterations||500;const n=e.initialLayout||TH,r=e.lossFunction||PH;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=function(t,e,n){const r=(n=n||{}).maxIterations||200*e.length,i=n.nonZeroDelta||1.05,o=n.zeroDelta||.001,a=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=void 0!==n.rho?n.rho:1,l=void 0!==n.chi?n.chi:2,u=void 0!==n.psi?n.psi:-.5,f=void 0!==n.sigma?n.sigma:.5;let h;const d=e.length,p=new Array(d+1);p[0]=e,p[0].fx=t(e),p[0].id=0;for(let n=0;n<d;++n){const r=e.slice();r[n]=r[n]?r[n]*i:o,p[n+1]=r,p[n+1].fx=t(r),p[n+1].id=n+1}function g(t){for(let e=0;e<t.length;e++)p[d][e]=t[e];p[d].fx=t.fx}const v=(t,e)=>t.fx-e.fx,y=e.slice(),m=e.slice(),b=e.slice(),x=e.slice();for(let e=0;e<r;++e){if(p.sort(v),n.history){const t=p.map((t=>{const e=t.slice();return e.fx=t.fx,e.id=t.id,e}));t.sort(((t,e)=>t.id-e.id)),n.history.push({x:p[0].slice(),fx:p[0].fx,simplex:t})}h=0;for(let t=0;t<d;++t)h=Math.max(h,Math.abs(p[0][t]-p[1][t]));if(Math.abs(p[0].fx-p[d].fx)<a&&h<s)break;for(let t=0;t<d;++t){y[t]=0;for(let e=0;e<d;++e)y[t]+=p[e][t];y[t]/=d}const e=p[d];if(yH(m,1+c,y,-c,e),m.fx=t(m),m.fx<p[0].fx)yH(x,1+l,y,-l,e),x.fx=t(x),x.fx<m.fx?g(x):g(m);else if(m.fx>=p[d-1].fx){let n=!1;if(m.fx>e.fx?(yH(b,1+u,y,-u,e),b.fx=t(b),b.fx<e.fx?g(b):n=!0):(yH(b,1-u*c,y,u*c,e),b.fx=t(b),b.fx<m.fx?g(b):n=!0),n){if(f>=1)break;for(let e=1;e<p.length;++e)yH(p[e],1-f,p[0],f,p[e]),p[e].fx=t(p[e])}}else g(m)}return p.sort(v),{fx:p[0].fx,x:p[0]}}((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}const SH=1e-10;function AH(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+SH?Math.abs(t-e):function(t,e,n,r){const i=(r=r||{}).maxIterations||100,o=r.tolerance||1e-10,a=t(e),s=t(n);let 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(let n=0;n<i;++n){c/=2;const n=e+c,r=t(n);if(r*a>=0&&(e=n),Math.abs(c)<o||0===r)return n}return e+c}((function(r){return EH(t,e,r)-n}),0,t+e)}function TH(t,e){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:PH,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+SH>=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=AH(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=AH(o.radius,t.radius,f[i].size),s=OH({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||PH;if(t.length>=8){const i=function(t,e){e=e||{};const n=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=dH(e.length,e.length),i=dH(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=AH(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=gH(s.map(gH))/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){h=bH(u,hH(2*s.length).map(Math.random),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)vH(e.history[o].x,l);return p}(t,e);r(i,t)+1e-8<r(n,t)&&(n=i)}return n}function PH(t,e){let n=0;for(let r=0;r<e.length;++r){const i=e[r];let o;if(1==i.sets.length)continue;if(2==i.sets.length){const e=t[i.sets[0]],n=t[i.sets[1]];o=EH(e.radius,n.radius,MH(e,n))}else o=wH(i.sets.map((function(e){return t[e]})));n+=(i.hasOwnProperty("weight")?i.weight:1)*(o-i.size)*(o-i.size)}return n}function NH(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}const CH=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=_H(r);let c;return r.map((t=>{const n=t[e];return Object.assign(Object.assign({},t),{[a]:({width:t,height:e})=>{c=c||NH(s,t,e,i);const r=n.map((t=>c[t]));let o=function(t){const e={};wH(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}})}))}};CH.props={};const LH=()=>t=>(console.log("G2 data section:",t),t);LH.props={};const jH=t=>{const{field:e="y",alpha:n=.6,as:r=e}=t;return t=>{const i=t.map((t=>t[e])),o=function(t,e){if(e<0||e>1)throw new Error("alpha must be between 0 and 1.");if(0===t.length)return[];let n=t[0];const r=[];for(const i of t){if(null==i){r.push(i),console.warn("EMA:The value is null or undefined",t);continue}null==n&&(n=i);const o=n*e+(1-e)*i;r.push(o),n=o}return r}(i,n);return t.map(((t,e)=>Object.assign(Object.assign({},t),{[r]:o[e]})))}};jH.props={};function RH(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function IH(t,e,n=.01){const[r,i]=t,[o,a]=e;return r>=o[0]-n&&r<=a[0]+n&&i>=o[1]-n&&i<=a[1]+n}const DH=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{c$(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]}(RH(e),RH(t.getLocalBounds()))));r?s$(t):n.push(t)})),t}};function BH([t,e],[n,r]){return r>t&&e>n}function FH(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function zH(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const $H=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]=FH(),[s,c]=FH(),[l,u]=FH(),[f,h]=FH();for(const e of t){const{min:t,max:n}=zH(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)=>Rn(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])&&!BH(f(i),f(o));)a+=1;if(o){const t=s(i),n=l(i),a=s(o),u=a-(t+n);if(u<r){const n=(r-u)/2;e=Math.max(e,n),c(i,t-n),c(o,a+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-o(e);return t}};function WH(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function GH(t,e,n){return.2126*WH(t)+.7152*WH(e)+.0722*WH(n)}function HH(t,e){if(!t||!e||t===e)return 1;const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=GH(n,r,i),l=GH(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function YH(t,e){const n=yr(e,(e=>HH(t,function(t){return"object"==typeof t?t:lh(t)}(e))));return e[n]}const qH=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;HH(t.parsedStyle.fill,r)<e&&t.attr("fill",YH(r,n))})),t)},VH=()=>t=>(t.forEach((t=>{c$(t);const e=t.attr("bounds"),n=function(t,e,n=.01){const[r,i]=t;return!(IH(r,e,n)&&IH(i,e,n))}(RH(t.getLocalBounds()),e);n&&s$(t)})),t),UH=()=>(t,{canvas:e,layout:n})=>(t.forEach((t=>{c$(t);const{max:e,min:r}=t.getRenderBounds(),[i,o]=e,[a,s]=r,c=((t,e)=>{const[[n,r],[i,o]]=e,[[a,s],[c,l]]=t;let u=0,f=0;return a<n?u=n-a:c>i&&(u=i-c),s<r?f=r-s:l>o&&(f=o-l),[u,f]})([[a,s],[i,o]],[[n.x,n.y],[n.x+n.width,n.y+n.height]]);t.style.connector&&t.style.connectorPoints&&(t.style.connectorPoints[0][0]-=c[0],t.style.connectorPoints[0][1]-=c[1]),t.style.x+=c[0],t.style.y+=c[1]})),t);function XH(){return{"data.fetch":_G,"data.inline":jG,"data.sortBy":LG,"data.sort":PG,"data.filter":TG,"data.pick":NG,"data.rename":CG,"data.fold":SG,"data.slice":sH,"data.custom":RG,"data.map":IG,"data.join":aH,"data.kde":fH,"data.log":LH,"data.wordCloud":iH,"data.ema":jH,"transform.stackY":xa,"transform.binX":Fs,"transform.bin":Bs,"transform.dodgeX":Ha,"transform.jitter":Xa,"transform.jitterX":Za,"transform.jitterY":Ka,"transform.symmetryY":Qa,"transform.diffY":Ja,"transform.stackEnter":Ya,"transform.normalizeY":qa,"transform.select":is,"transform.selectX":os,"transform.selectY":as,"transform.groupX":ms,"transform.groupY":bs,"transform.groupColor":xs,"transform.group":ys,"transform.sortX":ks,"transform.sortY":Es,"transform.sortColor":Ms,"transform.flexX":Os,"transform.pack":Rs,"transform.sample":$s,"transform.filter":Ws,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":o,"coordinate.theta":a,"coordinate.parallel":l,"coordinate.fisheye":u,"coordinate.radial":c,"coordinate.radar":f,"coordinate.helix":i,"encode.constant":h,"encode.field":p,"encode.transform":d,"encode.column":g,"mark.interval":PM,"mark.rect":CM,"mark.line":IM,"mark.point":BM,"mark.text":zM,"mark.cell":WM,"mark.area":HM,"mark.link":qM,"mark.image":UM,"mark.polygon":ZM,"mark.box":QM,"mark.vector":tE,"mark.lineX":iE,"mark.lineY":nE,"mark.connector":aE,"mark.range":uE,"mark.rangeX":hE,"mark.rangeY":pE,"mark.path":ZE,"mark.shape":b_,"mark.density":SS,"mark.heatmap":TS,"mark.wordCloud":bS,"palette.category10":LS,"palette.category20":jS,"scale.linear":IS,"scale.ordinal":DS,"scale.band":RS,"scale.identity":BS,"scale.point":FS,"scale.time":zS,"scale.log":$S,"scale.pow":WS,"scale.sqrt":qS,"scale.threshold":GS,"scale.quantile":HS,"scale.quantize":YS,"scale.sequential":VS,"scale.constant":US,"theme.classic":QS,"theme.classicDark":eA,"theme.academy":rA,"theme.light":KS,"theme.dark":tA,"component.axisX":RA,"component.axisY":IA,"component.legendCategory":WA,"component.legendContinuous":VA,"component.legends":dT,"component.title":tT,"component.sliderX":cT,"component.sliderY":lT,"component.scrollbarX":fT,"component.scrollbarY":hT,"animation.scaleInX":pT,"animation.scaleOutX":gT,"animation.scaleInY":vT,"animation.scaleOutY":yT,"animation.waveIn":LT,"animation.fadeIn":mT,"animation.fadeOut":bT,"animation.zoomIn":jT,"animation.zoomOut":RT,"animation.pathIn":IT,"animation.morphing":CT,"animation.growInX":DT,"animation.growInY":BT,"interaction.elementHighlight":F$,"interaction.elementHighlightByX":z$,"interaction.elementHighlightByColor":$$,"interaction.elementSelect":G$,"interaction.elementSelectByX":H$,"interaction.elementSelectByColor":Y$,"interaction.fisheye":V$,"interaction.chartIndex":q$,"interaction.tooltip":gW,"interaction.legendFilter":OW,"interaction.legendHighlight":_W,"interaction.brushHighlight":RW,"interaction.brushXHighlight":DW,"interaction.brushYHighlight":FW,"interaction.brushAxisHighlight":qW,"interaction.brushFilter":VW,"interaction.brushXFilter":UW,"interaction.brushYFilter":XW,"interaction.sliderFilter":JW,"interaction.scrollbarFilter":eG,"interaction.poptip":oG,"interaction.treemapDrillDown":sG,"interaction.elementPointMove":vG,"composition.spaceLayer":KC,"composition.spaceFlex":QC,"composition.facetRect":pL,"composition.repeatMatrix":xL,"composition.facetCircle":_L,"composition.timingKeyframe":AL,"labelTransform.overlapHide":DH,"labelTransform.overlapDodgeY":$H,"labelTransform.overflowHide":VH,"labelTransform.contrastReverse":qH,"labelTransform.exceedAdjust":UH}}function ZH(){return{"composition.geoView":PI,"composition.geoPath":TL}}function KH(){return{"data.arc":GE,"data.cluster":hS,"mark.forceGraph":uS,"mark.tree":mS,"mark.pack":l_,"mark.sankey":FE,"mark.chord":UE,"mark.treemap":a_}}function QH(){return{"data.venn":CH,"mark.boxplot":m_,"mark.gauge":OS,"mark.wordCloud":bS,"mark.liquid":CS}}function JH(){return Object.assign(Object.assign(Object.assign(Object.assign({},ZH()),KH()),QH()),XH())}function tY(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const eY={};const nY=t=>t?parseInt(t):0;function rY(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 iY{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 rY(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return rY(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return rY(this,(n=>{e||t===n.type&&(e=n)})),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}const oY=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title","interaction"],aY="__remove__",sY="__callback__";function cY(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function lY(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||nY(e.width),r=t.clientHeight||nY(e.height);return{width:n-(nY(e.paddingLeft)+nY(e.paddingRight)),height:r-(nY(e.paddingTop)+nY(e.paddingBottom))}}(e);a=t||a,s=n||s}return a=n||a,s=r||s,{width:Math.max(I(a)?a:1,1),height:Math.max(I(s)?s:1,1),depth:o}}function uY(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of oY)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,cY(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===sY)e.children=t.value;else{const i=cY(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}function fY(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 oY)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 oY)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function hY(t,e,n){if("function"==typeof t){const e=new iY;return e.value=t,e.type=sY,e}const{type:r,children:i}=t,o=Le(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 dY(t,e){const{type:n,children:r}=e,i=Le(e,["type","children"]);t.type===n||void 0===n?ia(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function pY(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=hY(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 gY(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function vY(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 yY(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 mY(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(na(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 bY(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function xY(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function wY(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?gY(e,n,r):"array"===t?vY(e,n,r):"object"===t?yY(e,n,r):"node"===t?bY(e,n,r):"container"===t?xY(e,n,r):"mix"===t&&mY(e,n)}return e}}function kY(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const MY={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"}},EY=Object.assign(Object.assign({},MY),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),OY=Object.assign(Object.assign({},MY),{labelTransform:{type:"array"}});let _Y=class extends iY{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach((e=>{e.attr("data",t)})),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find((t=>t.key===this._key))}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&c$(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&s$(t)}};_Y=je([wY(OY)],_Y);let SY=class extends iY{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find((t=>t.key===this.attr("key")));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};SY=je([wY(EY)],SY);const AY="G2_CHART_KEY";class TY extends _Y{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:o,createCanvas:a}=t;super(Le(t,["container","canvas","renderer","plugins","lib","createCanvas"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=U((()=>{this.forceFit()}),300),this._renderer=r||new aN,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[aY]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new uN,this._context={library:Object.assign(Object.assign({},o),eY),emitter:this._emitter,canvas:n,createCanvas:a},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;const t=new Promise(((t,e)=>e$(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 uY(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,fY(t,e,n,r,i)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){dY(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 pY(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(fN.BEFORE_CLEAR),this._reset(),n$(0,this._context,!1),this.emit(fN.AFTER_CLEAR)}destroy(){this.options();this.emit(fN.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),n$(0,this._context,!0),this._container[aY]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(fN.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=lY(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(fN.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(fN.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(fN.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(fN.AFTER_CHANGE_SIZE)})),n}getDataByXY(t,e={}){const{shared:n=!1,series:r,facet:i=!1,startX:o=0,startY:a=0}=e,{canvas:s,views:c}=this._context,{document:l}=s,{x:u,y:f}=t,{coordinate:h,scale:d,markState:p,data:g,key:v}=c[0],y=l.getElementsByClassName($T),m=n?t=>t.__data__.x:t=>t,b=Jn(y,m),x=h$(l.getElementsByClassName(WT)[0]),w=t=>Array.from(t.values()).some((t=>{var e,n;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)||(null===(n=t.channels)||void 0===n?void 0:n.some((t=>"series"===t.name&&void 0!==t.values)))})),k=lW(r,w(p)),M=t=>rt(t,"__data__.data",null);try{if(k&&w(p)&&!i){const{selectedData:t}=hW({root:x,event:{offsetX:u,offsetY:f},elements:y,coordinate:h,scale:d,startX:o,startY:a}),e=g.get(`${v}-0`);return t.map((({index:t})=>e[t]))}const t=m(fW({root:x,event:{offsetX:u,offsetY:f},elements:y,coordinate:h,scale:d,shared:n})),e=b.get(t);return e?e.map(M):[]}catch(t){const e=s.document.elementFromPointSync(u,f);return e?M(e):[]}}_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 SY{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 _Y{constructor(){super({},e)}};return n=je([wY(kY(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))wY(kY(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=AY}=t,{width:n,height:r,depth:i}=lY(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}=lY(this.options(),this._container);this._plugins.push(new cN),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new fv({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise(((t,e)=>{this._trailingResolve=t,this._trailingReject=e}))}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}const PY=tY(TY,Object.assign({},JH()));t.AREA_CLASS_NAME=qT,t.Academy=rA,t.Bin=Bs,t.BinX=Fs,t.COMPONENT_CLASS_NAME=HT,t.Chart=PY,t.ChartEvent=fN,t.Classic=QS,t.ClassicDark=eA,t.Dark=tA,t.DiffY=Ja,t.DodgeX=Ha,t.ELEMENT_CLASS_NAME=$T,t.Filter=Ws,t.FlexX=Os,t.Group=ys,t.GroupColor=xs,t.GroupX=ms,t.GroupY=bs,t.Jitter=Xa,t.JitterX=Za,t.JitterY=Ka,t.LABEL_CLASS_NAME=YT,t.LABEL_LAYER_CLASS_NAME=zT,t.Light=KS,t.LinearAxis=LA,t.MAIN_LAYER_CLASS_NAME=FT,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=Ia,t.MaybeDefaultY=Da,t.MaybeFunctionAttribute=$a,t.MaybeGradient=Ga,t.MaybeIdentityX=Ra,t.MaybeIdentityY=ja,t.MaybeKey=Pa,t.MaybeSeries=Na,t.MaybeSize=Ta,t.MaybeStackY=ka,t.MaybeTitle=Oa,t.MaybeTooltip=Ba,t.MaybeTuple=Wa,t.MaybeTupleX=La,t.MaybeTupleY=Ca,t.MaybeVisualPosition=za,t.MaybeZeroPadding=Fa,t.MaybeZeroX=_a,t.MaybeZeroY=Sa,t.MaybeZeroY1=jn,t.MaybeZeroZ=Aa,t.NormalizeY=qa,t.PLOT_CLASS_NAME=GT,t.Pack=Rs,t.Runtime=TY,t.Sample=$s,t.Select=is,t.SelectX=os,t.SelectY=as,t.Selection=fy,t.SortColor=Ms,t.SortX=ks,t.SortY=Es,t.StackEnter=Ya,t.StackY=xa,t.SymmetryY=Qa,t.VIEW_CLASS_NAME=WT,t.corelib=XH,t.dataOf=Go,t.extend=tY,t.geolib=ZH,t.graphlib=KH,t.plotlib=QH,t.register=function(t,e){var n,r;t.startsWith("symbol.")?(n=t.split(".").pop(),r=e,dm.set(n,r)):Object.assign(eY,{[t]:e})},t.render=e$,t.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var i;const{width:o=640,height:a=480}=t,s=Jz(t),{group:c=new Ig,emitter:l=new uN,library:u}=e;(null==c?void 0:c.parentElement)||Uo("renderToMountedElement can't render chart to unmounted group.");const f=uy(c);return e.group=c,e.emitter=l,e.canvas=e.canvas||(null===(i=null==c?void 0:c.ownerDocument)||void 0===i?void 0:i.defaultView),l.emit(fN.BEFORE_RENDER),Ez(Object.assign(Object.assign({},s),{width:o,height:a}),f,e).then((()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame((()=>{l.emit(fN.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),c},t.select=uy,t.selectG2Elements=l$,t.selectPlotArea=h$,t.seriesOf=function(t){const e=Wo(t).__data__,{scale:n}=e;return Ho(n,t.__data__)},t.stdlib=JH,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
67
|
+
*/sN.tag="Dragndrop";var cN=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return hl(this,e),(t=wl(this,e)).name="dragndrop",t.options=n,t}return Ml(e,t),pl(e,[{key:"init",value:function(){this.addRenderingPlugin(new sN(fl({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(nu),lN=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}(),uN=lN;const fN={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"},hN={abs:Math.abs,ceil:Math.ceil,floor:Math.floor,max:Math.max,min:Math.min,round:Math.round,sqrt:Math.sqrt,pow:Math.pow};class dN extends Error{constructor(t,e,n){super(t),this.position=e,this.token=n,this.name="ExpressionError"}}var pN;!function(t){t[t.STRING=0]="STRING",t[t.NUMBER=1]="NUMBER",t[t.BOOLEAN=2]="BOOLEAN",t[t.NULL=3]="NULL",t[t.IDENTIFIER=4]="IDENTIFIER",t[t.OPERATOR=5]="OPERATOR",t[t.FUNCTION=6]="FUNCTION",t[t.DOT=7]="DOT",t[t.BRACKET_LEFT=8]="BRACKET_LEFT",t[t.BRACKET_RIGHT=9]="BRACKET_RIGHT",t[t.PAREN_LEFT=10]="PAREN_LEFT",t[t.PAREN_RIGHT=11]="PAREN_RIGHT",t[t.COMMA=12]="COMMA",t[t.QUESTION=13]="QUESTION",t[t.COLON=14]="COLON",t[t.DOLLAR=15]="DOLLAR"}(pN||(pN={}));const gN=new Set([32,9,10,13]),vN=new Set([43,45,42,47,37,33,38,124,61,60,62]),yN=new Map([["true",pN.BOOLEAN],["false",pN.BOOLEAN],["null",pN.NULL]]),mN=new Map([["===",!0],["!==",!0],["<=",!0],[">=",!0],["&&",!0],["||",!0],["+",!0],["-",!0],["*",!0],["/",!0],["%",!0],["!",!0],["<",!0],[">",!0]]),bN=new Map([[46,pN.DOT],[91,pN.BRACKET_LEFT],[93,pN.BRACKET_RIGHT],[40,pN.PAREN_LEFT],[41,pN.PAREN_RIGHT],[44,pN.COMMA],[63,pN.QUESTION],[58,pN.COLON],[36,pN.DOLLAR]]),xN=new Map;for(const[t,e]of bN.entries())xN.set(t,{type:e,value:String.fromCharCode(t)});function wN(t){return t>=48&&t<=57}function kN(t){return t>=97&&t<=122||t>=65&&t<=90||95===t}function MN(t){return kN(t)||wN(t)}function EN(t){return vN.has(t)}var ON;!function(t){t[t.Program=0]="Program",t[t.Literal=1]="Literal",t[t.Identifier=2]="Identifier",t[t.MemberExpression=3]="MemberExpression",t[t.CallExpression=4]="CallExpression",t[t.BinaryExpression=5]="BinaryExpression",t[t.UnaryExpression=6]="UnaryExpression",t[t.ConditionalExpression=7]="ConditionalExpression"}(ON||(ON={}));const _N=new Map([["||",2],["&&",3],["===",4],["!==",4],[">",5],[">=",5],["<",5],["<=",5],["+",6],["-",6],["*",7],["/",7],["%",7],["!",8]]),SN={type:ON.Literal,value:null},AN={type:ON.Literal,value:!0},TN={type:ON.Literal,value:!1},PN=t=>{let e=0;const n=t.length,r=()=>e>=n?null:t[e],i=()=>t[e++],o=t=>{const e=r();return null!==e&&e.type===t},a=t=>t.type===pN.OPERATOR?_N.get(t.value)||-1:t.type===pN.DOT||t.type===pN.BRACKET_LEFT?9:t.type===pN.QUESTION?1:-1,s=t=>{let n,a;if(i().type===pN.DOT){if(!o(pN.IDENTIFIER)){const t=r();throw new dN("Expected property name",e,t?t.value:"<end of input>")}const t=i();n={type:ON.Identifier,name:t.value},a=!1}else{if(n=l(0),!o(pN.BRACKET_RIGHT)){const t=r();throw new dN("Expected closing bracket",e,t?t.value:"<end of input>")}i(),a=!0}return{type:ON.MemberExpression,object:t,property:n,computed:a}},c=()=>{const t=r();if(!t)throw new dN("Unexpected end of input",e,"<end of input>");if(t.type===pN.OPERATOR&&("!"===t.value||"-"===t.value)){i();const e=c();return{type:ON.UnaryExpression,operator:t.value,argument:e,prefix:!0}}switch(t.type){case pN.NUMBER:return i(),{type:ON.Literal,value:Number(t.value)};case pN.STRING:return i(),{type:ON.Literal,value:t.value};case pN.BOOLEAN:return i(),"true"===t.value?AN:TN;case pN.NULL:return i(),SN;case pN.IDENTIFIER:return i(),{type:ON.Identifier,name:t.value};case pN.FUNCTION:return(()=>{const t=i(),n=[];if(!o(pN.PAREN_LEFT)){const t=r();throw new dN("Expected opening parenthesis after function name",e,t?t.value:"<end of input>")}for(i();;){if(o(pN.PAREN_RIGHT)){i();break}if(!r()){const t=r();throw new dN("Expected closing parenthesis",e,t?t.value:"<end of input>")}if(n.length>0){if(!o(pN.COMMA)){const t=r();throw new dN("Expected comma between function arguments",e,t?t.value:"<end of input>")}i()}const t=l(0);n.push(t)}return{type:ON.CallExpression,callee:{type:ON.Identifier,name:t.value},arguments:n}})();case pN.PAREN_LEFT:{i();const t=l(0);if(!o(pN.PAREN_RIGHT)){const t=r();throw new dN("Expected closing parenthesis",e,t?t.value:"<end of input>")}return i(),t}default:throw new dN(`Unexpected token: ${t.type}`,e,t.value)}},l=(u=0)=>{let f=c();for(;e<n;){const n=t[e],c=a(n);if(c<=u)break;if(n.type!==pN.QUESTION)if(n.type!==pN.OPERATOR){if(n.type!==pN.DOT&&n.type!==pN.BRACKET_LEFT)break;f=s(f)}else{i();const t=l(c);f={type:ON.BinaryExpression,operator:n.value,left:f,right:t}}else{i();const t=l(0);if(!o(pN.COLON)){const t=r();throw new dN("Expected : in conditional expression",e,t?t.value:"<end of input>")}i();const n=l(0);f={type:ON.ConditionalExpression,test:f,consequent:t,alternate:n}}}return f},u=l();return{type:ON.Program,body:u}},NN=(t,e,n)=>{let r=e;n&&(r={...e,context:{...e.context,...n}});const i=t=>{switch(t.type){case ON.Literal:return(t=>t.value)(t);case ON.Identifier:return(t=>{if(!(t.name in r.context))throw new dN(`Undefined variable: ${t.name}`);return r.context[t.name]})(t);case ON.MemberExpression:return(t=>{const e=i(t.object);if(null==e)throw new dN("Cannot access property of null or undefined");return e[t.computed?i(t.property):t.property.name]})(t);case ON.CallExpression:return(t=>{const e=r.functions[t.callee.name];if(!e)throw new dN(`Undefined function: ${t.callee.name}`);return e(...t.arguments.map((t=>i(t))))})(t);case ON.BinaryExpression:return(t=>{if("&&"===t.operator){const e=i(t.left);return e?i(t.right):e}if("||"===t.operator)return i(t.left)||i(t.right);const e=i(t.left),n=i(t.right);switch(t.operator){case"+":return e+n;case"-":return e-n;case"*":return e*n;case"/":return e/n;case"%":return e%n;case"===":return e===n;case"!==":return e!==n;case">":return e>n;case">=":return e>=n;case"<":return e<n;case"<=":return e<=n;default:throw new dN(`Unknown operator: ${t.operator}`)}})(t);case ON.UnaryExpression:return(t=>{const e=i(t.argument);if(t.prefix)switch(t.operator){case"!":return!e;case"-":if("number"!=typeof e)throw new dN(`Cannot apply unary - to non-number: ${e}`);return-e;default:throw new dN(`Unknown operator: ${t.operator}`)}throw new dN(`Postfix operators are not supported: ${t.operator}`)})(t);case ON.ConditionalExpression:return(t=>{const e=i(t.test);return i(e?t.consequent:t.alternate)})(t);default:throw new dN(`Evaluation error: Unsupported node type: ${t.type}`)}};return i(t.body)};const CN=["style","encode","labels","children"],LN=gM((t=>{const e=function(t){const e=(t=>{const e=t,n=e.length,r=new Array(Math.ceil(n/3));let i=0,o=0;function a(t){const r=o+1;o++;let i="",a=!1;for(;o<n;){const n=e.charCodeAt(o);if(n===t)return a||(i=e.substring(r,o)),o++,{type:pN.STRING,value:i};92===n?(a||(i=e.substring(r,o),a=!0),o++,i+=e[o]):a&&(i+=e[o]),o++}throw new dN(`Unterminated string starting with ${String.fromCharCode(t)}`,o,e.substring(Math.max(0,o-10),o))}function s(){const t=o;for(45===e.charCodeAt(o)&&o++;o<n&&wN(e.charCodeAt(o));)o++;if(o<n&&46===e.charCodeAt(o))for(o++;o<n&&wN(e.charCodeAt(o));)o++;const r=e.slice(t,o);return{type:pN.NUMBER,value:r}}function c(){o++;const t=o;if(o<n&&kN(e.charCodeAt(o)))for(o++;o<n&&MN(e.charCodeAt(o));)o++;const r=e.slice(t,o);return{type:pN.FUNCTION,value:r}}function l(){const t=o++;for(;o<n&&MN(e.charCodeAt(o));)o++;const r=e.slice(t,o),i=yN.get(r);return i?{type:i,value:r}:{type:pN.IDENTIFIER,value:r}}function u(){if(o+2<n){const t=e.substring(o,o+3);if(mN.has(t))return o+=3,{type:pN.OPERATOR,value:t}}if(o+1<n){const t=e.substring(o,o+2);if(mN.has(t))return o+=2,{type:pN.OPERATOR,value:t}}const t=e[o];if(mN.has(t))return o++,{type:pN.OPERATOR,value:t};throw new dN(`Unknown operator at position ${o}: ${e.substring(o,o+1)}`,o,e.substring(Math.max(0,o-10),o))}for(;o<n;){const t=e.charCodeAt(o);if(f=t,gN.has(f)){o++;continue}const h=xN.get(t);if(h)r[i++]=h,o++;else if(34!==t&&39!==t)if(wN(t)||45===t&&o+1<n&&wN(e.charCodeAt(o+1)))r[i++]=s();else if(64!==t)if(kN(t))r[i++]=l();else{if(!EN(t))throw new dN(`Unexpected character: ${e[o]}`,o,e.substring(Math.max(0,o-10),o));r[i++]=u()}else r[i++]=c();else r[i++]=a(t)}var f;return i===r.length?r:r.slice(0,i)})(t),n=PN(e),r=((t={},e={})=>({context:t,functions:e}))({},hN);return(t={})=>NN(n,r,t)}(t);return(...t)=>{const n=Array.from({length:t.length},((t,e)=>String.fromCharCode(97+e))),r=Object.fromEntries(t.map(((t,e)=>[n[e],t])));return e(Object.assign(Object.assign({},r),{global:Object.assign({},r)}))}}),(t=>t),128);function jN(t,e=!0){if(Array.isArray(t))return t.map(((n,r)=>jN(t[r],e)));if("object"==typeof t&&t)return function(t,e){void 0===e&&(e=nt);var n={};return w(t)&&!b(t)&&Object.keys(t).forEach((function(r){n[r]=e(t[r],r)})),n}(t,((t,n)=>e&&CN.includes(n)?jN(t,"children"===n):e?t:jN(t,!1)));if("string"==typeof t){const e=t.trim();if(e.startsWith("{")&&e.endsWith("}"))return LN(e.slice(1,-1))}return t}const RN=[["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 IN={}.toString,DN=function(t,e){return IN.call(t)==="[object "+e+"]"},BN=function(t){return Array.isArray?Array.isArray(t):DN(t,"Array")},FN=function(t){return"object"==typeof t&&null!==t},zN=function(t){if(!FN(t)||!DN(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 $N(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&&zN(o)?(zN(t[i])||(t[i]={}),n<r?$N(t[i],o,n+1,r):t[i]=e[i]):BN(o)?(t[i]=[],t[i]=t[i].concat(o)):void 0!==o&&(t[i]=o)}}var WN=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)$N(t,e[r]);return t},GN=function(t){return t};function HN(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):GN}function YN(t){return t instanceof Float32Array||t instanceof Array}var qN=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},VN=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))};function UN(t,e,n){for(;t<e;)t+=2*Math.PI;for(;t>n;)t-=2*Math.PI;return t}var XN=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},ZN=function(t,e,n,r,i){var o,a,s=XN(t,2),c=s[0],l=s[1],u=ht();return a=[c,l],(o=u)[0]=1,o[1]=0,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=a[0],o[7]=a[1],o[8]=1,o},KN=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},QN=function(t,e,n,r,i){var o=new po({range:[e,e+r]}),a=new po({range:[n,n+i]});return{transform:function(t){var e=KN(t,2),n=e[0],r=e[1];return[o.map(n),a.map(r)]},untransform:function(t){var e=KN(t,2),n=e[0],r=e[1];return[o.invert(n),a.invert(r)]}}},JN=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},tC=function(t,e,n,r,i){return(0,JN(t,1)[0])(e,n,r,i)},eC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},nC=function(t,e,n,r,i){return eC(t,1)[0]},rC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},iC=function(t,e,n,r,i){var o=rC(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new po({range:[c,l]}),f=new po({range:[a,s]}),h=i/r,d=h>1?1:h,p=h>1?1/h:1;return{transform:function(t){var e=rC(t,2),n=e[0],r=e[1],i=f.map(n),o=u.map(r);return[.5*(o*Math.cos(i)*d)+.5,.5*(o*Math.sin(i)*p)+.5]},untransform:function(t){var e=rC(t,2),n=e[0],r=e[1],i=2*(n-.5)/d,o=2*(r-.5)/p,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),l=UN(Math.atan2(o,i),a,s);return[f.invert(l),u.invert(c)]}}},oC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},aC=function(t,e,n,r,i){return{transform:function(t){var e=oC(t,2),n=e[0];return[e[1],n]},untransform:function(t){var e=oC(t,2),n=e[0];return[e[1],n]}}},sC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},cC=function(t,e,n,r,i){var o,a,s=sC(t,2),c=s[0],l=s[1],u=ht();return a=[c,l],(o=u)[0]=a[0],o[1]=0,o[2]=0,o[3]=0,o[4]=a[1],o[5]=0,o[6]=0,o[7]=0,o[8]=1,o},lC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},uC=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},fC=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return cC.apply(void 0,uC([[-1,-1]],lC(e),!1))},hC=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return cC.apply(void 0,uC([[-1,1]],lC(e),!1))},dC=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return cC.apply(void 0,uC([[1,-1]],lC(e),!1))},pC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},gC=function(t,e,n,r,i){var o=pC(t,1)[0];return function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t}(ht(),o)},vC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},yC=function(t,e,n,r,i){var o=vC(t,4),a=o[0],s=o[1],c=o[2],l=(o[3]-c)/((s-0)/(2*Math.PI)+1),u=l/(2*Math.PI),f=new po({range:[c,c+.99*l]}),h=new po({range:[a,s]}),d=i/r,p=d>1?1:d,g=d>1?1/d:1;return{transform:function(t){var e=vC(t,2),n=e[0],r=e[1],i=h.map(n),o=f.map(r);return[.5*(Math.cos(i)*(u*i+o)*p)+.5,.5*(Math.sin(i)*(u*i+o)*g)+.5]},untransform:function(t){var e=vC(t,2),n=e[0],r=e[1],i=2*(n-.5)/p,o=2*(r-.5)/g,c=Math.sqrt(Math.pow(i,2)+Math.pow(o,2)),d=UN(Math.atan2(o,i)+Math.floor(c/l)*Math.PI*2,a,s),v=c-u*d;return[h.invert(d),f.invert(v)]}}},mC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},bC=function(t,e,n,r,i){var o=mC(t,4),a=o[0],s=o[1],c=o[2],l=o[3],u=new po({range:[c,l]});return{transform:function(t){for(var e=[],n=t.length,r=new go({domain:new Array(n).fill(0).map((function(t,e){return e})),range:[a,s]}),i=0;i<n;i++){var o=t[i],c=r.map(i),l=u.map(o);e.push(c,l)}return e},untransform:function(t){for(var e=[],n=0;n<t.length;n+=2){var r=t[n+1];e.push(u.invert(r))}return e}}},xC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function wC(t){return 1/Math.tan(t)}var kC=function(t,e,n,r,i){var o=wC(xC(t,1)[0]);return{transform:function(t){var e=xC(t,2),n=e[0],r=e[1];return[n+r*o,r]},untransform:function(t){var e=xC(t,2),n=e[0],r=e[1];return[n-r*o,r]}}},MC=function(t,e,n,r,i){var o=wC(xC(t,1)[0]);return{transform:function(t){var e=xC(t,2),n=e[0];return[n,e[1]+n*o]},untransform:function(t){var e=xC(t,2),n=e[0];return[n,e[1]-n*o]}}},EC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};function OC(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r,s=o?-1:1;return s*a*(n+1)/(n+a/((t-e)*s))+e}function _C(t,e,n,r,i){var o=t<e,a=(o?e-r:i-e)||i-r;return a/(a*(n+1)/(t-e)-n*(o?-1:1))+e}function SC(t,e,n){return n?new po({range:[0,1],domain:[0,e]}).map(t):t}var AC=function(t,e,n,r,i){var o=EC(t,3),a=o[0],s=o[1],c=o[2],l=SC(a,r,void 0!==c&&c);return{transform:function(t){var e=EC(t,2),n=e[0],r=e[1];return[OC(n,l,s,0,1),r]},untransform:function(t){var e=EC(t,2),n=e[0],r=e[1];return[_C(n,l,s,0,1),r]}}},TC=function(t,e,n,r,i){var o=EC(t,3),a=o[0],s=o[1],c=o[2],l=SC(a,i,void 0!==c&&c);return{transform:function(t){var e=EC(t,2);return[e[0],OC(e[1],l,s,0,1)]},untransform:function(t){var e=EC(t,2);return[e[0],_C(e[1],l,s,0,1)]}}},PC=function(t,e,n,r,i){var o=EC(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=SC(a,r,f),d=SC(s,i,f);return{transform:function(t){var e=EC(t,2),n=e[0],r=e[1];return[OC(n,h,c,0,1),OC(r,d,l,0,1)]},untransform:function(t){var e=EC(t,2),n=e[0],r=e[1];return[_C(n,h,c,0,1),_C(r,d,l,0,1)]}}},NC=function(t,e,n,r,i){var o=EC(t,5),a=o[0],s=o[1],c=o[2],l=o[3],u=o[4],f=void 0!==u&&u,h=new po({range:[0,r]}),d=new po({range:[0,i]}),p=f?a:h.map(a),g=f?s:d.map(s);return{transform:function(t){var e=EC(t,2),n=e[0],r=e[1],i=h.map(n)-p,o=d.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=OC(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]},untransform:function(t){var e=EC(t,2),n=e[0],r=e[1],i=h.map(n)-p,o=d.map(r)-g,a=Math.sqrt(i*i+o*o);if(a>c)return[n,r];var s=_C(a,0,l,0,c),u=Math.atan2(o,i),f=p+s*Math.cos(u),v=g+s*Math.sin(u);return[h.invert(f),d.invert(v)]}}},CC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},LC=function(t,e,n,r,i,o,a){var s=new po({range:[e,e+i]}),c=new po({range:[n,n+o]}),l=new po({range:[r,r+a]});return{transform:function(t){var e=CC(t,3),n=e[0],r=e[1],i=e[2];return[s.map(n),c.map(r),l.map(i)]},untransform:function(t){var e=CC(t,3),n=e[0],r=e[1],i=e[2];return[s.invert(n),c.invert(r),l.invert(i)]}}},jC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},RC=function(t,e,n,r,i,o,a){var s=jC(t,3),c=s[0],l=s[1],u=s[2];return At(pt(),[c,l,u])},IC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},DC=function(t,e,n,r,i,o,a){return{transform:function(t){var e=IC(t,3),n=e[0];return[e[1],n,e[2]]},untransform:function(t){var e=IC(t,3),n=e[0];return[e[1],n,e[2]]}}},BC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},FC=function(t,e,n,r,i,o,a){var s=BC(t,3),c=s[0],l=s[1],u=s[2];return Tt(pt(),[c,l,u])},zC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},$C=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},WC=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},GC=function(){function t(t){this.options={x:0,y:0,width:300,height:150,transformations:[]},this.transformers={cartesian:QN,translate:ZN,custom:tC,matrix:nC,polar:iC,transpose:aC,scale:cC,"shear.x":kC,"shear.y":MC,reflect:fC,"reflect.x":hC,"reflect.y":dC,rotate:gC,helix:yC,parallel:bC,fisheye:PC,"fisheye.x":AC,"fisheye.y":TC,"fisheye.circular":NC},this.update(t)}return t.prototype.update=function(t){this.options=WN({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y;return[(2*e+t.width)/2,(2*n+t.height)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:$C($C([],zC(n),!1),[$C([],zC(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?$C([],zC(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=2){var i=[e[r],e[r+1]],o=t(i);n.push.apply(n,VN([],qN(o),!1))}return n}}(t):t)};try{for(var c=WC(r),l=c.next();!l.done;l=c.next()){var u=zC(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,y=p.width,m=p.height,b=d($C([],zC(h),!1),g,v,y,m);if(YN(b))o.push(b);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(b)||GN,"parallel"!==f)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return HN.apply(void 0,$C([],zC(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=ht();return e&&t.reverse(),t.forEach((function(t){return dt(n,n,t)})),e&&function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],c=e[6],l=e[7],u=e[8],f=u*a-s*l,h=-u*o+s*c,d=l*o-a*c,p=n*f+r*h+i*d;p&&(p=1/p,t[0]=f*p,t[1]=(-u*r+i*l)*p,t[2]=(s*r-i*a)*p,t[3]=h*p,t[4]=(u*n-i*c)*p,t[5]=(-s*n+i*o)*p,t[6]=d*p,t[7]=(-l*n+r*c)*p,t[8]=(a*n-r*o)*p)}(n,function(t){var e=new ft(9);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}(n)),function(t){var e=[t[0],t[1],1];return fe(e,e,n),[e[0],e[1]]}},t}(),HC=window&&window.__read||function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},YC=window&&window.__spreadArray||function(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))},qC=window&&window.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},VC=function(){function t(t){this.options={x:0,y:0,z:0,width:300,height:150,depth:150,transformations:[]},this.transformers={cartesian3D:LC,translate3D:RC,scale3D:FC,transpose3D:DC},this.update(t)}return t.prototype.update=function(t){this.options=WN({},this.options,t),this.recoordinate()},t.prototype.clone=function(){return new t(this.options)},t.prototype.getOptions=function(){return this.options},t.prototype.clear=function(){this.update({transformations:[]})},t.prototype.getSize=function(){var t=this.options;return[t.width,t.height,t.depth]},t.prototype.getCenter=function(){var t=this.options,e=t.x,n=t.y,r=t.z;return[(2*e+t.width)/2,(2*n+t.height)/2,(2*r+t.depth)/2]},t.prototype.transform=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.options.transformations;return this.update({transformations:YC(YC([],HC(n),!1),[YC([],HC(t),!1)],!1)}),this},t.prototype.map=function(t){return this.output(t)},t.prototype.invert=function(t){return this.input(t)},t.prototype.recoordinate=function(){this.output=this.compose(),this.input=this.compose(!0)},t.prototype.compose=function(t){var e,n;void 0===t&&(t=!1);var r=t?YC([],HC(this.options.transformations),!1).reverse():this.options.transformations,i=t?function(t){return t.untransform}:function(t){return t.transform},o=[],a=[],s=function(t,e){return void 0===e&&(e=!0),a.push(e?function(t){return function(e){for(var n=[],r=0;r<e.length-1;r+=3){var i=[e[r],e[r+1],e[r+2]],o=t(i);n.push.apply(n,VN([],qN(o),!1))}return n}}(t):t)};try{for(var c=qC(r),l=c.next();!l.done;l=c.next()){var u=HC(l.value),f=u[0],h=u.slice(1),d=this.transformers[f];if(d){var p=this.options,g=p.x,v=p.y,y=p.z,m=p.width,b=p.height,x=p.depth,w=d(YC([],HC(h),!1),g,v,y,m,b,x);if(YN(w))o.push(w);else{if(o.length)s(this.createMatrixTransform(o,t)),o.splice(0,o.length);s(i(w)||GN,!0)}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}o.length&&s(this.createMatrixTransform(o,t));return HN.apply(void 0,YC([],HC(a),!1))},t.prototype.createMatrixTransform=function(t,e){var n=pt();return e&&t.reverse(),t.forEach((function(t){return Ut(n,n,t)})),e&&wt(n,gt(n)),function(t){var e=[t[0],t[1],t[2],1];return me(e,e,n),[e[0],e[1],e[2]]}},t}();function UC(t){return(e,...n)=>Q({},t(e,...n),e)}function XC(t){return(e,...n)=>Q({},e,t(e,...n))}function ZC(t,e){if(!t)return e;if(Array.isArray(t))return t;if(function(t){return!(t instanceof Date)&&"object"==typeof t}(t)){const{value:n=e}=t,r=Le(t,["value"]);return Object.assign(Object.assign({},r),{value:n})}return t}const KC=()=>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=Le(t,["data","x","y","width","height"]);return Object.assign(Object.assign({},f),{data:ZC(e,a),x:null!=s?s:n,y:null!=c?c:r,width:null!=l?l:i,height:null!=u?u:o})}))};KC.props={};const QC=()=>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=Le(r,["data"]),g=ZC(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};QC.props={};const JC=()=>t=>{const{children:e}=t,n=Le(t,["children"]);if(!Array.isArray(e))return[];const{data:r,scale:i={},axis:o={},legend:a={},encode:s={},transform:c=[]}=n,l=Le(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=Le(t,["data","scale","axis","legend","encode","transform"]);return Object.assign({data:ZC(e,r),scale:Q({},i,n),encode:Q({},s,f),transform:[...c,...h],axis:!(!l||!o)&&Q({},o,l),legend:!(!u||!a)&&Q({},a,u)},d)}));return[Object.assign(Object.assign({},l),{marks:u,type:"standardView"})]};JC.props={};const tL=({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:v,marginBottom:y,marginTop:m,marginRight:b,data:x,coordinate:w,theme:k,component:M,interaction:E,x:O,y:_,z:S,key:A,frame:T,labelTransform:P,parentKey:N,clip:C,viewStyle:L,title:j}=e,R=Le(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:O,y:_,z:S,key:A,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:k,coordinate:w,component:M,interaction:E,frame:T,labelTransform:P,margin:g,marginLeft:v,marginBottom:y,marginTop:m,marginRight:b,parentKey:N,clip:C,style:L},!t&&{title:j}),{marks:[Object.assign(Object.assign(Object.assign({},R),{key:`${A}-0`,data:x}),t&&{title:j})]})]};tL.props={};class eL{constructor(t){this.$value=t}static of(t){return new eL(t)}call(t,...e){return this.$value=t(this.$value,...e),this}value(){return this.$value}}const nL=UC((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=Jn(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"))}}})),rL=XC((t=>{const{data:e,scale:n,legend:r}=t,i=[t];let o,a,s;for(;i.length;){const t=i.shift(),{children:e,encode:n={},scale:r={},legend:c={}}=t,{color:l}=n,{color:u}=r,{color:f}=c;void 0!==l&&(o=l),void 0!==u&&(a=u),void 0!==f&&(s=f),Array.isArray(e)&&i.push(...e)}const c="string"==typeof o?o:"",[l,u]=(()=>{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===o)return[void 0];const i="function"==typeof o?o:t=>t[o],a=e.map(i);return a.some((t=>"number"==typeof t))?[Vn(a)]:[Array.from(new Set(a)),"ordinal"]})();return Object.assign({encode:{color:{type:"column",value:null!=l?l:[]}},scale:{color:Q({},a,{domain:l,type:u})}},void 0===r&&{legend:{color:Q({title:c},s)}})})),iL=UC((()=>({animate:{enterType:"fadeIn"}}))),oL=XC((()=>({frame:!1,encode:{shape:"hollow"},style:{lineWidth:0}}))),aL=XC((()=>({type:"cell"}))),sL=XC((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]}}})),cL=XC(((t,e=lL,n=fL,r=hL,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:v}=c,{domain:y}=v;return{children:(t,o,a)=>{const{x:c,y:v}=o,{paddingLeft:m,paddingTop:b,marginLeft:x,marginTop:w}=a,{domain:k}=c.getOptions(),{domain:M}=v.getOptions(),E=aa(t),O=t.map(e),_=t.map((({x:t,y:e})=>[c.invert(t),v.invert(e)])),S=_.map((([t,e])=>n=>{const{[p]:r,[g]:i}=n;return(void 0===p||r===t)&&(void 0===g||i===e)})),A=S.map((t=>d.filter(t))),T=f?vr(A,(t=>t.length)):void 0,P=_.map((([t,e])=>({columnField:p,columnIndex:k.indexOf(t),columnValue:t,columnValuesLength:k.length,rowField:g,rowIndex:M.indexOf(e),rowValue:e,rowValuesLength:M.length}))),N=P.map((t=>Array.isArray(s)?s:[s(t)].flat(1)));return E.flatMap((t=>{const[e,o,a,s]=O[t],c=P[t],f=A[t];return N[t].map((v=>{var k,M,{scale:E,key:O,facet:_=!0,axis:S={},legend:A={}}=v,P=Le(v,["scale","key","facet","axis","legend"]);const N=(null===(k=null==E?void 0:E.y)||void 0===k?void 0:k.guide)||S.y,C=(null===(M=null==E?void 0:E.x)||void 0===M?void 0:M.guide)||S.x,L={x:{tickCount:p?5:void 0},y:{tickCount:g?5:void 0}},j=_?f:0===f.length?[]:d,R={color:{domain:y}},I={x:dL(C,n)(c,j),y:dL(N,r)(c,j)};return Object.assign(Object.assign({key:`${O}-${t}`,data:j,margin:0,x:e+m+l+x,y:o+b+u+w,parentKey:h,width:a,height:s,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,frame:!!j.length,dataDomain:T,scale:Q(L,E,R),axis:Q({},S,I),legend:!1},P),i)}))}))}}}));function lL(t){const{points:e}=t;return Cs(e)}function uL(t,e){return e.length?Q({title:!1,tick:null,label:null},t):Q({title:!1,tick:null,label:null,grid:null},t)}function fL(t){return(e,n)=>{const{rowIndex:r,rowValuesLength:i,columnIndex:o,columnValuesLength:a}=e;if(r!==i-1)return uL(t,n);const s=o===a-1&&void 0,c=n.length?void 0:null;return Q({title:s,grid:c},t)}}function hL(t){return(e,n)=>{const{rowIndex:r,columnIndex:i}=e;if(0!==i)return uL(t,n);const o=0===r&&void 0,a=n.length?void 0:null;return Q({title:o,grid:a},t)}}function dL(t,e){return"function"==typeof t?t:null===t||!1===t?()=>null:e(t)}const pL=()=>t=>[eL.of(t).call(aL).call(rL).call(iL).call(nL).call(oL).call(sL).call(cL).value()];pL.props={};const gL=UC((t=>({scale:{x:{guide:null,paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),vL=XC((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(),v=aa(t),y=t.map((({points:t})=>Cs(t))),m=t.map((({x:t,y:e})=>[c.invert(t),l.invert(e)])),b=m.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 v.flatMap((t=>{const[n,a,s,c]=y[t],[l,p]=m[t],g=b[t];return x[t].map((v=>{var y,m;const{scale:b,key:x,encode:w,axis:k,interaction:M}=v,E=Le(v,["scale","key","encode","axis","interaction"]),O=null===(y=null==b?void 0:b.y)||void 0===y?void 0:y.guide,_={x:mL(null===(m=null==b?void 0:b.x)||void 0===m?void 0:m.guide)(g,e),y:bL(O)(g,e)};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:Q({x:{facet:!1},y:{facet:!1}},b),axis:Q({x:{tickCount:5},y:{tickCount:5}},k,_),legend:!1,encode:Q({},w,{x:l,y:p}),interaction:Q({},M,{legendFilter:!1})},E)}))}))}}})),yL=XC((t=>{const{encode:e}=t,n=Le(t,["encode"]),{position:r=[],x:i=r,y:o=[...r].reverse()}=e,a=Le(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 mL(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{rowIndex:r,rowValuesLength:i}=e;if(r!==i-1)return uL(t,n)}}function bL(t){return"function"==typeof t?t:null===t?()=>null:(e,n)=>{const{columnIndex:r}=e;if(0!==r)return uL(t,n)}}const xL=()=>t=>[eL.of(t).call(aL).call(rL).call(vL).call(yL).call(iL).call(oL).call(gL).value()],wL=UC((t=>({scale:{x:{guide:{type:"axisArc"},paddingOuter:0,paddingInner:.1},y:{guide:null,range:[0,1],paddingOuter:0,paddingInner:.1}}}))),kL=UC((t=>({coordinate:{type:"polar"}}))),ML=t=>{const{encode:e}=t,n=Le(t,["encode"]),{position:r}=e;return Object.assign(Object.assign({},n),{encode:{x:r}})};function EL(t){return t=>null}function OL(t){const{points:e}=t,[n,r,i,o]=e,a=As(n,o),s=_s(n,o),c=Ns(s,_s(r,i)),l=1/Math.sin(c/2),u=a/(1+l),f=u*Math.sqrt(2),[h,d]=i,p=Ps(s)+c/2,g=u*l;return[h+g*Math.sin(p)-f/2,d-g*Math.cos(p)-f/2,f,f]}const _L=()=>t=>[eL.of(t).call(aL).call(ML).call(rL).call(kL).call(sL).call(cL,OL,EL,EL,{frame:!1}).call(iL).call(oL).call(wL).value()];function SL(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 AL=()=>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=Q({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]=SL(i,e,a);for(let e=n;e<r;e+=1){const n=Math.abs(e);t!==n&&(yield c[n]),t=n}e++}}};AL.props={};const TL=()=>t=>{const{type:e,data:n,scale:r,encode:i,style:o,animate:a,key:s,state:c}=t,l=Le(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}]})]};TL.props={};var PL=1e-6,NL=Math.PI,CL=NL/2,LL=NL/4,jL=2*NL,RL=180/NL,IL=NL/180,DL=Math.abs,BL=Math.atan,FL=Math.atan2,zL=Math.cos,$L=Math.ceil,WL=Math.exp,GL=Math.log,HL=Math.pow,YL=Math.sin,qL=Math.sign||function(t){return t>0?1:t<0?-1:0},VL=Math.sqrt,UL=Math.tan;function XL(t){return t>1?0:t<-1?NL:Math.acos(t)}function ZL(t){return t>1?CL:t<-1?-CL:Math.asin(t)}function KL(){}function QL(t,e){t&&tj.hasOwnProperty(t.type)&&tj[t.type](t,e)}var JL={Feature:function(t,e){QL(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)QL(n[r].geometry,e)}},tj={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){ej(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)ej(n[r],e,0)},Polygon:function(t,e){nj(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)nj(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)QL(n[r],e)}};function ej(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 nj(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)ej(t[n],e,1);e.polygonEnd()}function rj(t,e){t&&JL.hasOwnProperty(t.type)?JL[t.type](t,e):QL(t,e)}function ij(t){return[FL(t[1],t[0]),ZL(t[2])]}function oj(t){var e=t[0],n=t[1],r=zL(n);return[r*zL(e),r*YL(e),YL(n)]}function aj(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function sj(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 cj(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function lj(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function uj(t){var e=VL(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function fj(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 hj(t,e){return DL(t)>NL&&(t-=Math.round(t/jL)*jL),[t,e]}function dj(t,e,n){return(t%=jL)?e||n?fj(gj(t),vj(e,n)):gj(t):e||n?vj(e,n):hj}function pj(t){return function(e,n){return DL(e+=t)>NL&&(e-=Math.round(e/jL)*jL),[e,n]}}function gj(t){var e=pj(t);return e.invert=pj(-t),e}function vj(t,e){var n=zL(t),r=YL(t),i=zL(e),o=YL(e);function a(t,e){var a=zL(e),s=zL(t)*a,c=YL(t)*a,l=YL(e),u=l*n+s*r;return[FL(c*i-u*o,s*n-l*r),ZL(u*i+c*o)]}return a.invert=function(t,e){var a=zL(e),s=zL(t)*a,c=YL(t)*a,l=YL(e),u=l*i-c*o;return[FL(c*i+l*o,s*n+u*r),ZL(u*n-s*r)]},a}function yj(t,e){(e=oj(e))[0]-=t,uj(e);var n=XL(-e[1]);return((-e[2]<0?-n:n)+jL-PL)%jL}function mj(){var t,e=[];return{point:function(e,n,r){t.push([e,n,r])},lineStart:function(){e.push(t=[])},lineEnd:KL,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function bj(t,e){return DL(t[0]-e[0])<PL&&DL(t[1]-e[1])<PL}function xj(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 wj(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(bj(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]+=2e-6}s.push(n=new xj(r,t,null,!0)),c.push(n.o=new xj(r,null,n,!1)),s.push(n=new xj(a,t,null,!1)),c.push(n.o=new xj(a,null,n,!0))}})),s.length){for(c.sort(e),kj(s),kj(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 kj(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 Mj(t){return DL(t[0])<=NL?t[0]:qL(t[0])*((DL(t[0])+NL)%jL-NL)}function Ej(t,e,n,r){return function(i){var o,a,s,c=e(i),l=mj(),u=e(l),f=!1,h={point:d,lineStart:g,lineEnd:v,polygonStart:function(){h.point=y,h.lineStart=m,h.lineEnd=b,a=[],o=[]},polygonEnd:function(){h.point=d,h.lineStart=g,h.lineEnd=v,a=Sr(a);var t=function(t,e){var n=Mj(e),r=e[1],i=YL(r),o=[YL(n),-zL(n),0],a=0,s=0,c=new Un;1===i?r=CL+PL:-1===i&&(r=-CL-PL);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=Mj(d),g=d[1]/2+LL,v=YL(g),y=zL(g),m=0;m<h;++m,p=x,v=k,y=M,d=b){var b=f[m],x=Mj(b),w=b[1]/2+LL,k=YL(w),M=zL(w),E=x-p,O=E>=0?1:-1,_=O*E,S=_>NL,A=v*k;if(c.add(FL(A*O*YL(_),y*M+A*zL(_))),a+=S?E+O*jL:E,S^p>=n^x>=n){var T=sj(oj(d),oj(b));uj(T);var P=sj(o,T);uj(P);var N=(S^E>=0?-1:1)*ZL(P[2]);(r>N||r===N&&(T[0]||T[1]))&&(s+=S^E>=0?1:-1)}}return(a<-PL||a<PL&&c<-1e-12)^1&s}(o,r);a.length?(f||(i.polygonStart(),f=!0),wj(a,_j,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 v(){h.point=d,c.lineEnd()}function y(t,e){s.push([t,e]),u.point(t,e)}function m(){u.lineStart(),s=[]}function b(){y(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(Oj))}return h}}function Oj(t){return t.length>1}function _j(t,e){return((t=t.x)[0]<0?t[1]-CL-PL:CL-t[1])-((e=e.x)[0]<0?e[1]-CL-PL:CL-e[1])}hj.invert=hj;var Sj=Ej((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?NL:-NL,c=DL(o-n);DL(c-NL)<PL?(t.point(n,r=(r+a)/2>0?CL:-CL),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&c>=NL&&(DL(n-i)<PL&&(n-=i*PL),DL(o-s)<PL&&(o-=s*PL),r=function(t,e,n,r){var i,o,a=YL(t-n);return DL(a)>PL?BL((YL(e)*(o=zL(r))*YL(n)-YL(r)*(i=zL(e))*YL(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*CL,r.point(-NL,i),r.point(0,i),r.point(NL,i),r.point(NL,0),r.point(NL,-i),r.point(0,-i),r.point(-NL,-i),r.point(-NL,0),r.point(-NL,i);else if(DL(t[0]-e[0])>PL){var o=t[0]<e[0]?NL:-NL;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}),[-NL,-CL]);function Aj(t){var e=zL(t),n=2*IL,r=e>0,i=DL(e)>PL;function o(t,n){return zL(t)*zL(n)>e}function a(t,n,r){var i=[1,0,0],o=sj(oj(t),oj(n)),a=aj(o,o),s=o[0],c=a-s*s;if(!c)return!r&&t;var l=e*a/c,u=-e*s/c,f=sj(i,o),h=lj(i,l);cj(h,lj(o,u));var d=f,p=aj(h,d),g=aj(d,d),v=p*p-g*(aj(h,h)-1);if(!(v<0)){var y=VL(v),m=lj(d,(-p-y)/g);if(cj(m,h),m=ij(m),!r)return m;var b,x=t[0],w=n[0],k=t[1],M=n[1];w<x&&(b=x,x=w,w=b);var E=w-x,O=DL(E-NL)<PL;if(!O&&M<k&&(b=k,k=M,M=b),O||E<PL?O?k+M>0^m[1]<(DL(m[0]-x)<PL?k:M):k<=m[1]&&m[1]<=M:E>NL^(x<=m[0]&&m[0]<=w)){var _=lj(d,(-p+y)/g);return cj(_,h),[m,ij(_)]}}}function s(e,n){var i=r?t:NL-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return Ej(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),v=r?g?0:s(f,h):g?s(f+(f<0?NL:-NL),h):0;if(!e&&(l=c=g)&&t.lineStart(),g!==c&&(!(d=a(e,p))||bj(e,d)||bj(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 y;v&n||!(y=a(p,e,!0))||(u=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1],3)))}!g||e&&bj(e,p)||t.point(p[0],p[1]),e=p,c=g,n=v},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=zL(e),s=YL(e),c=r*n;null==i?(i=e+r*jL,o=e-c/2):(i=yj(a,i),o=yj(a,o),(r>0?i<o:i>o)&&(i+=r*jL));for(var l,u=i;r>0?u>o:u<o;u-=c)l=ij([a,-s*zL(u),-s*YL(u)]),t.point(l[0],l[1])}}(o,t,n,i,e,r)}),r?[0,-t]:[-NL,t-NL])}var Tj=1e9,Pj=-Tj;function Nj(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 DL(r[0]-t)<PL?i>0?0:3:DL(r[0]-n)<PL?i>0?2:1:DL(r[1]-e)<PL?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,v,y,m,b=a,x=mj(),w={point:k,lineStart:function(){w.point=M,l&&l.push(u=[]);y=!0,v=!1,p=g=NaN},lineEnd:function(){c&&(M(f,h),d&&v&&x.rejoin(),c.push(x.result()));w.point=k,v&&b.lineEnd()},polygonStart:function(){b=x,c=[],l=[],m=!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=m&&e,i=(c=Sr(c)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&wj(c,s,e,o,a),a.polygonEnd());b=a,c=l=u=null}};function k(t,e){i(t,e)&&b.point(t,e)}function M(o,a){var s=i(o,a);if(l&&u.push([o,a]),y)f=o,h=a,d=s,y=!1,s&&(b.lineStart(),b.point(o,a));else if(s&&v)b.point(o,a);else{var c=[p=Math.max(Pj,Math.min(Tj,p)),g=Math.max(Pj,Math.min(Tj,g))],x=[o=Math.max(Pj,Math.min(Tj,o)),a=Math.max(Pj,Math.min(Tj,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),m=!1):(v||(b.lineStart(),b.point(c[0],c[1])),b.point(x[0],x[1]),s||b.lineEnd(),m=!1)}p=o,g=a,v=s}return w}}function Cj(t,e,n){var r=Ar(t,e-PL,n).concat(e);return function(t){return r.map((function(e){return[t,e]}))}}function Lj(t,e,n){var r=Ar(t,e-PL,n).concat(e);return function(t){return r.map((function(e){return[e,t]}))}}function jj(){return function(){var t,e,n,r,i,o,a,s,c,l,u,f,h=10,d=h,p=90,g=360,v=2.5;function y(){return{type:"MultiLineString",coordinates:m()}}function m(){return Ar($L(r/p)*p,n,p).map(u).concat(Ar($L(s/g)*g,a,g).map(f)).concat(Ar($L(e/h)*h,t,h).filter((function(t){return DL(t%p)>PL})).map(c)).concat(Ar($L(o/d)*d,i,d).filter((function(t){return DL(t%g)>PL})).map(l))}return y.lines=function(){return m().map((function(t){return{type:"LineString",coordinates:t}}))},y.outline=function(){return{type:"Polygon",coordinates:[u(r).concat(f(a).slice(1),u(n).reverse().slice(1),f(s).reverse().slice(1))]}},y.extent=function(t){return arguments.length?y.extentMajor(t).extentMinor(t):y.extentMinor()},y.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),y.precision(v)):[[r,s],[n,a]]},y.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),y.precision(v)):[[e,o],[t,i]]},y.step=function(t){return arguments.length?y.stepMajor(t).stepMinor(t):y.stepMinor()},y.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],y):[p,g]},y.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],y):[h,d]},y.precision=function(h){return arguments.length?(v=+h,c=Cj(o,i,90),l=Lj(e,t,v),u=Cj(s,a,90),f=Lj(r,n,v),y):v},y.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}()()}var Rj,Ij,Dj,Bj,Fj=t=>t,zj=new Un,$j=new Un,Wj={point:KL,lineStart:KL,lineEnd:KL,polygonStart:function(){Wj.lineStart=Gj,Wj.lineEnd=qj},polygonEnd:function(){Wj.lineStart=Wj.lineEnd=Wj.point=KL,zj.add(DL($j)),$j=new Un},result:function(){var t=zj/2;return zj=new Un,t}};function Gj(){Wj.point=Hj}function Hj(t,e){Wj.point=Yj,Rj=Dj=t,Ij=Bj=e}function Yj(t,e){$j.add(Bj*t-Dj*e),Dj=t,Bj=e}function qj(){Yj(Rj,Ij)}var Vj=Wj,Uj=1/0,Xj=Uj,Zj=-Uj,Kj=Zj,Qj={point:function(t,e){t<Uj&&(Uj=t);t>Zj&&(Zj=t);e<Xj&&(Xj=e);e>Kj&&(Kj=e)},lineStart:KL,lineEnd:KL,polygonStart:KL,polygonEnd:KL,result:function(){var t=[[Uj,Xj],[Zj,Kj]];return Zj=Kj=-(Xj=Uj=1/0),t}};var Jj,tR,eR,nR,rR=Qj,iR=0,oR=0,aR=0,sR=0,cR=0,lR=0,uR=0,fR=0,hR=0,dR={point:pR,lineStart:gR,lineEnd:mR,polygonStart:function(){dR.lineStart=bR,dR.lineEnd=xR},polygonEnd:function(){dR.point=pR,dR.lineStart=gR,dR.lineEnd=mR},result:function(){var t=hR?[uR/hR,fR/hR]:lR?[sR/lR,cR/lR]:aR?[iR/aR,oR/aR]:[NaN,NaN];return iR=oR=aR=sR=cR=lR=uR=fR=hR=0,t}};function pR(t,e){iR+=t,oR+=e,++aR}function gR(){dR.point=vR}function vR(t,e){dR.point=yR,pR(eR=t,nR=e)}function yR(t,e){var n=t-eR,r=e-nR,i=VL(n*n+r*r);sR+=i*(eR+t)/2,cR+=i*(nR+e)/2,lR+=i,pR(eR=t,nR=e)}function mR(){dR.point=pR}function bR(){dR.point=wR}function xR(){kR(Jj,tR)}function wR(t,e){dR.point=kR,pR(Jj=eR=t,tR=nR=e)}function kR(t,e){var n=t-eR,r=e-nR,i=VL(n*n+r*r);sR+=i*(eR+t)/2,cR+=i*(nR+e)/2,lR+=i,uR+=(i=nR*t-eR*e)*(eR+t),fR+=i*(nR+e),hR+=3*i,pR(eR=t,nR=e)}var MR=dR;function ER(t){this._context=t}ER.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,jL)}},result:KL};var OR,_R,SR,AR,TR,PR=new Un,NR={point:KL,lineStart:function(){NR.point=CR},lineEnd:function(){OR&&LR(_R,SR),NR.point=KL},polygonStart:function(){OR=!0},polygonEnd:function(){OR=null},result:function(){var t=+PR;return PR=new Un,t}};function CR(t,e){NR.point=LR,_R=AR=t,SR=TR=e}function LR(t,e){AR-=t,TR-=e,PR.add(VL(AR*AR+TR*TR)),AR=t,TR=e}var jR=NR;let RR,IR,DR,BR;class FR{constructor(t){this._append=null==t?zR:function(t){const e=Math.floor(t);if(!(e>=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return zR;if(e!==RR){const t=10**e;RR=e,IR=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 IR}(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!==DR||this._append!==IR){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`,DR=t,IR=this._append,BR=this._,this._=e}this._+=BR}}result(){const t=this._;return this._="",t.length?t:null}}function zR(t){let e=1;this._+=t[0];for(const n=t.length;e<n;++e)this._+=arguments[e]+t[e]}function $R(t,e){let n,r,i=3,o=4.5;function a(t){return t&&("function"==typeof o&&r.pointRadius(+o.apply(this,arguments)),rj(t,n(r))),r.result()}return a.area=function(t){return rj(t,n(Vj)),Vj.result()},a.measure=function(t){return rj(t,n(jR)),jR.result()},a.bounds=function(t){return rj(t,n(rR)),rR.result()},a.centroid=function(t){return rj(t,n(MR)),MR.result()},a.projection=function(e){return arguments.length?(n=null==e?(t=null,Fj):(t=e).stream,a):t},a.context=function(t){return arguments.length?(r=null==t?(e=null,new FR(i)):new ER(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 FR(i)),a},a.projection(t).digits(i).context(e)}function WR(t){return function(e){var n=new GR;for(var r in t)n[r]=t[r];return n.stream=e,n}}function GR(){}function HR(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),rj(n,t.stream(rR)),e(rR.result()),null!=r&&t.clipExtent(r),t}function YR(t,e,n){return HR(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 qR(t,e,n){return YR(t,[[0,0],e],n)}function VR(t,e,n){return HR(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 UR(t,e,n){return HR(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)}GR.prototype={constructor:GR,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 XR=zL(30*IL);function ZR(t,e){return+e?function(t,e){function n(r,i,o,a,s,c,l,u,f,h,d,p,g,v){var y=l-r,m=u-i,b=y*y+m*m;if(b>4*e&&g--){var x=a+h,w=s+d,k=c+p,M=VL(x*x+w*w+k*k),E=ZL(k/=M),O=DL(DL(k)-1)<PL||DL(o-f)<PL?(o+f)/2:FL(w,x),_=t(O,E),S=_[0],A=_[1],T=S-r,P=A-i,N=m*T-y*P;(N*N/b>e||DL((y*T+m*P)/b-.5)>.3||a*h+s*d+c*p<XR)&&(n(r,i,o,a,s,c,S,A,O,x/=M,w/=M,k,g,v),v.point(S,A),n(S,A,O,x,w,k,l,u,f,h,d,p,g,v))}}return function(e){var r,i,o,a,s,c,l,u,f,h,d,p,g={point:v,lineStart:y,lineEnd:b,polygonStart:function(){e.polygonStart(),g.lineStart=x},polygonEnd:function(){e.polygonEnd(),g.lineStart=y}};function v(n,r){n=t(n,r),e.point(n[0],n[1])}function y(){u=NaN,g.point=m,e.lineStart()}function m(r,i){var o=oj([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],16,e),e.point(u,f)}function b(){g.point=v,e.lineEnd()}function x(){y(),g.point=w,g.lineEnd=k}function w(t,e){m(r=t,e),i=u,o=f,a=h,s=d,c=p,g.point=m}function k(){n(u,f,l,h,d,p,i,o,r,a,s,c,16,e),g.lineEnd=b,b()}return g}}(t,e):function(t){return WR({point:function(e,n){e=t(e,n),this.stream.point(e[0],e[1])}})}(t)}var KR=WR({point:function(t,e){this.stream.point(t*IL,e*IL)}});function QR(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=zL(o),s=YL(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 JR(t){return tI((function(){return t}))()}function tI(t){var e,n,r,i,o,a,s,c,l,u,f=150,h=480,d=250,p=0,g=0,v=0,y=0,m=0,b=0,x=1,w=1,k=null,M=Sj,E=null,O=Fj,_=.5;function S(t){return c(t[0]*IL,t[1]*IL)}function A(t){return(t=c.invert(t[0],t[1]))&&[t[0]*RL,t[1]*RL]}function T(){var t=QR(f,0,0,x,w,b).apply(null,e(p,g)),r=QR(f,h-t[0],d-t[1],x,w,b);return n=dj(v,y,m),s=fj(e,r),c=fj(n,s),a=ZR(s,_),P()}function P(){return l=u=null,S}return S.stream=function(t){return l&&u===t?l:l=KR(function(t){return WR({point:function(e,n){var r=t(e,n);return this.stream.point(r[0],r[1])}})}(n)(M(a(O(u=t)))))},S.preclip=function(t){return arguments.length?(M=t,k=void 0,P()):M},S.postclip=function(t){return arguments.length?(O=t,E=r=i=o=null,P()):O},S.clipAngle=function(t){return arguments.length?(M=+t?Aj(k=t*IL):(k=null,Sj),P()):k*RL},S.clipExtent=function(t){return arguments.length?(O=null==t?(E=r=i=o=null,Fj):Nj(E=+t[0][0],r=+t[0][1],i=+t[1][0],o=+t[1][1]),P()):null==E?null:[[E,r],[i,o]]},S.scale=function(t){return arguments.length?(f=+t,T()):f},S.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],T()):[h,d]},S.center=function(t){return arguments.length?(p=t[0]%360*IL,g=t[1]%360*IL,T()):[p*RL,g*RL]},S.rotate=function(t){return arguments.length?(v=t[0]%360*IL,y=t[1]%360*IL,m=t.length>2?t[2]%360*IL:0,T()):[v*RL,y*RL,m*RL]},S.angle=function(t){return arguments.length?(b=t%360*IL,T()):b*RL},S.reflectX=function(t){return arguments.length?(x=t?-1:1,T()):x<0},S.reflectY=function(t){return arguments.length?(w=t?-1:1,T()):w<0},S.precision=function(t){return arguments.length?(a=ZR(s,_=t*t),P()):VL(_)},S.fitExtent=function(t,e){return YR(S,t,e)},S.fitSize=function(t,e){return qR(S,t,e)},S.fitWidth=function(t,e){return VR(S,t,e)},S.fitHeight=function(t,e){return UR(S,t,e)},function(){return e=t.apply(this,arguments),S.invert=e.invert&&A,T()}}function eI(t){var e=0,n=NL/3,r=tI(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*IL,n=t[1]*IL):[e*RL,n*RL]},i}function nI(t,e){var n=YL(t),r=(n+YL(e))/2;if(DL(r)<PL)return function(t){var e=zL(t);function n(t,n){return[t*e,YL(n)/e]}return n.invert=function(t,n){return[t/e,ZL(n*e)]},n}(t);var i=1+n*(2*r-n),o=VL(i)/r;function a(t,e){var n=VL(i-2*r*YL(e))/r;return[n*YL(t*=r),o-n*zL(t)]}return a.invert=function(t,e){var n=o-e,a=FL(t,DL(n))*qL(n);return n*r<0&&(a-=NL*qL(t)*qL(n)),[a/r,ZL((i-(t*t+n*n)*r*r)/(2*r))]},a}function rI(){return eI(nI).scale(155.424).center([0,33.6442])}function iI(){return rI().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function oI(t){return function(e,n){var r=zL(e),i=zL(n),o=t(r*i);return o===1/0?[2,0]:[o*i*YL(e),o*YL(n)]}}function aI(t){return function(e,n){var r=VL(e*e+n*n),i=t(r),o=YL(i),a=zL(i);return[FL(e*o,r*a),ZL(r&&n*o/r)]}}var sI=oI((function(t){return VL(2/(1+t))}));sI.invert=aI((function(t){return 2*ZL(t/2)}));var cI=oI((function(t){return(t=XL(t))&&t/YL(t)}));function lI(t,e){return[t,GL(UL((CL+e)/2))]}function uI(t){var e,n,r,i=JR(t),o=i.center,a=i.scale,s=i.translate,c=i.clipExtent,l=null;function u(){var o=NL*a(),s=i(function(t){function e(e){return(e=t(e[0]*IL,e[1]*IL))[0]*=RL,e[1]*=RL,e}return t=dj(t[0]*IL,t[1]*IL,t.length>2?t[2]*IL:0),e.invert=function(e){return(e=t.invert(e[0]*IL,e[1]*IL))[0]*=RL,e[1]*=RL,e},e}(i.rotate()).invert([0,0]));return c(null==l?[[s[0]-o,s[1]-o],[s[0]+o,s[1]+o]]:t===lI?[[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 fI(t){return UL((CL+t)/2)}function hI(t,e){var n=zL(t),r=t===e?YL(t):GL(n/zL(e))/GL(fI(e)/fI(t)),i=n*HL(fI(t),r)/r;if(!r)return lI;function o(t,e){i>0?e<-CL+PL&&(e=-CL+PL):e>CL-PL&&(e=CL-PL);var n=i/HL(fI(e),r);return[n*YL(r*t),i-n*zL(r*t)]}return o.invert=function(t,e){var n=i-e,o=qL(r)*VL(t*t+n*n),a=FL(t,DL(n))*qL(n);return n*r<0&&(a-=NL*qL(t)*qL(n)),[a/r,2*BL(HL(i/o,1/r))-CL]},o}function dI(t,e){return[t,e]}function pI(t,e){var n=zL(t),r=t===e?YL(t):(n-zL(e))/(e-t),i=n/r+t;if(DL(r)<PL)return dI;function o(t,e){var n=i-e,o=r*t;return[n*YL(o),i-n*zL(o)]}return o.invert=function(t,e){var n=i-e,o=FL(t,DL(n))*qL(n);return n*r<0&&(o-=NL*qL(t)*qL(n)),[o/r,i-qL(r)*VL(t*t+n*n)]},o}cI.invert=aI((function(t){return t})),lI.invert=function(t,e){return[t,2*BL(WL(e))-CL]},dI.invert=dI;var gI=1.340264,vI=-.081106,yI=893e-6,mI=.003796,bI=VL(3)/2;function xI(t,e){var n=ZL(bI*YL(e)),r=n*n,i=r*r*r;return[t*zL(n)/(bI*(gI+3*vI*r+i*(7*yI+9*mI*r))),n*(gI+vI*r+i*(yI+mI*r))]}function wI(t,e){var n=zL(e),r=zL(t)*n;return[n*YL(t)/r,YL(e)/r]}function kI(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 MI(t,e){return[zL(e)*YL(t),YL(e)]}function EI(t,e){var n=zL(e),r=1+zL(t)*n;return[n*YL(t)/r,YL(e)/r]}function OI(t,e){return[GL(UL((CL+e)/2)),-t]}xI.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*(gI+vI*i+o*(yI+mI*i))-e)/(gI+3*vI*i+o*(7*yI+9*mI*i)))*r)*i*i,!(DL(n)<1e-12));++a);return[bI*t*(gI+3*vI*i+o*(7*yI+9*mI*i))/zL(r),ZL(YL(r)/bI)]},wI.invert=aI(BL),kI.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(DL(n)>PL&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},MI.invert=aI(ZL),EI.invert=aI((function(t){return 2*BL(t)})),OI.invert=function(t,e){return[-e,2*BL(WL(t))-CL]};var _I=Object.freeze({__proto__:null,geoAlbersUsa:function(){var t,e,n,r,i,o,a=iI(),s=rI().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=rI().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:t=function(t){var e=t.length;return{point:function(n,r){for(var i=-1;++i<e;)t[i].point(n,r)},sphere:function(){for(var n=-1;++n<e;)t[n].sphere()},lineStart:function(){for(var n=-1;++n<e;)t[n].lineStart()},lineEnd:function(){for(var n=-1;++n<e;)t[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<e;)t[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<e;)t[n].polygonEnd()}}}([a.stream(e=n),s.stream(n),c.stream(n)])},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+PL,u+.12*e+PL],[o-.214*e-PL,u+.234*e-PL]]).stream(l),i=c.translate([o-.205*e,u+.212*e]).clipExtent([[o-.214*e+PL,u+.166*e+PL],[o-.115*e-PL,u+.234*e-PL]]).stream(l),f()},u.fitExtent=function(t,e){return YR(u,t,e)},u.fitSize=function(t,e){return qR(u,t,e)},u.fitWidth=function(t,e){return VR(u,t,e)},u.fitHeight=function(t,e){return UR(u,t,e)},u.scale(1070)},geoAlbers:iI,geoAzimuthalEqualArea:function(){return JR(sI).scale(124.75).clipAngle(179.999)},geoAzimuthalEqualAreaRaw:sI,geoAzimuthalEquidistant:function(){return JR(cI).scale(79.4188).clipAngle(179.999)},geoAzimuthalEquidistantRaw:cI,geoConicConformal:function(){return eI(hI).scale(109.5).parallels([30,30])},geoConicConformalRaw:hI,geoConicEqualArea:rI,geoConicEqualAreaRaw:nI,geoConicEquidistant:function(){return eI(pI).scale(131.154).center([0,13.9389])},geoConicEquidistantRaw:pI,geoEqualEarth:function(){return JR(xI).scale(177.158)},geoEqualEarthRaw:xI,geoEquirectangular:function(){return JR(dI).scale(152.63)},geoEquirectangularRaw:dI,geoGnomonic:function(){return JR(wI).scale(144.049).clipAngle(60)},geoGnomonicRaw:wI,geoIdentity:function(){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,v=WR({point:function(t,e){var n=b([t,e]);this.stream.point(n[0],n[1])}}),y=Fj;function m(){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=v(y(a=t))},b.postclip=function(t){return arguments.length?(y=t,d=n=r=i=null,m()):y},b.clipExtent=function(t){return arguments.length?(y=null==t?(d=n=r=i=null,Fj):Nj(d=+t[0][0],n=+t[0][1],r=+t[1][0],i=+t[1][1]),m()):null==d?null:[[d,n],[r,i]]},b.scale=function(t){return arguments.length?(s=+t,m()):s},b.translate=function(t){return arguments.length?(c=+t[0],l=+t[1],m()):[c,l]},b.angle=function(n){return arguments.length?(e=YL(h=n%360*IL),t=zL(h),m()):h*RL},b.reflectX=function(t){return arguments.length?(u=t?-1:1,m()):u<0},b.reflectY=function(t){return arguments.length?(f=t?-1:1,m()):f<0},b.fitExtent=function(t,e){return YR(b,t,e)},b.fitSize=function(t,e){return qR(b,t,e)},b.fitWidth=function(t,e){return VR(b,t,e)},b.fitHeight=function(t,e){return UR(b,t,e)},b},geoProjection:JR,geoProjectionMutator:tI,geoMercator:function(){return uI(lI).scale(961/jL)},geoMercatorRaw:lI,geoNaturalEarth1:function(){return JR(kI).scale(175.295)},geoNaturalEarth1Raw:kI,geoOrthographic:function(){return JR(MI).scale(249.5).clipAngle(90.000001)},geoOrthographicRaw:MI,geoStereographic:function(){return JR(EI).scale(250).clipAngle(142)},geoStereographicRaw:EI,geoTransverseMercator:function(){var t=uI(OI),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)},geoTransverseMercatorRaw:OI});function SI(t,e,n,r){const i=()=>{const t=e.filter(TI),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){const e={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featureCollection"};if(!t||!t.type)return null;const n=e[t.type];return n?"geometry"===n?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===n?{type:"FeatureCollection",features:[t]}:"featureCollection"===n?t:void 0:null}(t).features))});var r},{outline:o=i()}=r,{size:a="fitExtent"}=r;return"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]]=$R(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):void 0}function AI(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:[jj()]}}):"sphere"===n?Object.assign(Object.assign({},t),{sphere:!0,data:{value:[{type:"Sphere"}]}}):t}function TI(t){return"geoPath"===t.type}const PI=()=>t=>{const{children:e,coordinate:n={}}=t;if(!Array.isArray(e))return[];const{type:r="equalEarth"}=n,i=Le(n,["type"]),o=function(t){if("function"==typeof t)return t;const e=`geo${G(t)}`,n=_I[e];if(!n)throw new Error(`Unknown coordinate: ${t}`);return n}(r),a=e.map(AI);let s;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 c=o();SI(c,a,{x:t,y:e,width:n,height:r},i),function(t,e){var n;for(const[r,i]of Object.entries(e))null===(n=t[r])||void 0===n||n.call(t,i)}(c,i),s=$R(c);const l=new po({domain:[t,t+n]}),u=new po({domain:[e,e+r]});return{transform:t=>(t=>{const e=c(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 c.invert(r)})(t)}}]]}},children:a.flatMap((t=>TI(t)?function(t){const{style:e,tooltip:n={}}=t;return Object.assign(Object.assign({},t),{type:"path",tooltip:CE(n,{title:"id",items:[{channel:"color"}]}),style:Object.assign(Object.assign({},e),{d:t=>s(t)||[]})})}(t):t))})]};function NI(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=I$(o,(t=>"element"===t.className));const c=function(t){return I$(t,(t=>"component"===t.className))}(o),l=function(t){return I$(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:Go(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 CI(){return(t,e,n)=>{const{container:r,view:i}=t,o=NI(fN.CLICK,i,n,(t=>1===t.detail)),a=NI(fN.DBLCLICK,i,n,(t=>2===t.detail)),s=NI(fN.POINTER_TAP,i,n),c=NI(fN.POINTER_DOWN,i,n),l=NI(fN.POINTER_UP,i,n),u=NI(fN.POINTER_OVER,i,n),f=NI(fN.POINTER_OUT,i,n),h=NI(fN.POINTER_MOVE,i,n),d=NI(fN.POINTER_ENTER,i,n),p=NI(fN.POINTER_LEAVE,i,n),g=NI(fN.POINTER_UPOUTSIDE,i,n),v=NI(fN.DRAG_START,i,n),y=NI(fN.DRAG,i,n),m=NI(fN.DRAG_END,i,n),b=NI(fN.DRAG_ENTER,i,n),x=NI(fN.DRAG_LEAVE,i,n),w=NI(fN.DRAG_OVER,i,n),k=NI(fN.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",v),r.addEventListener("drag",y),r.addEventListener("dragend",m),r.addEventListener("dragenter",b),r.addEventListener("dragleave",x),r.addEventListener("dragover",w),r.addEventListener("drop",k),()=>{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",v),r.removeEventListener("drag",y),r.removeEventListener("dragend",m),r.removeEventListener("dragenter",b),r.removeEventListener("dragleave",x),r.removeEventListener("dragover",w),r.removeEventListener("drop",k)}}}function LI(t,e){const n=Object.assign(Object.assign({},{"component.axisRadar":BA,"component.axisLinear":LA,"component.axisArc":jA,"component.legendContinuousBlock":UA,"component.legendContinuousBlockSize":ZA,"component.legendContinuousSize":XA,"interaction.event":CI,"composition.mark":tL,"composition.view":JC,"shape.label.label":lM}),e),r=e=>{if("string"!=typeof e)return e;const r=`${t}.${e}`;return n[r]||Uo(`Unknown Component: ${r}`)};return[(t,e)=>{const{type:n}=t,i=Le(t,["type"]);n||Uo("Plot type is required!");const o=r(n);return null==o?void 0:o(i,e)},r]}function jI(t){const{canvas:e,group:n}=t;return(null==e?void 0:e.document)||(null==n?void 0:n.ownerDocument)||Uo("Cannot find library document")}function RI(t,e){const{coordinate:n={},coordinates:r}=t,i=Le(t,["coordinate","coordinates"]);if(r)return t;const{type:o,transform:a=[]}=n,s=Le(n,["type","transform"]);if(!o)return Object.assign(Object.assign({},i),{coordinates:a});const[,c]=LI("coordinate",e),{transform:l=!1}=c(o).props||{};if(l)throw new Error(`Unknown coordinate: ${o}.`);return Object.assign(Object.assign({},i),{coordinates:[Object.assign({type:o},s),...a]})}function II(t,e){return t.filter((t=>t.type===e))}function DI(t){return II(t,"polar").length>0}function BI(t){return II(t,"transpose").length%2==1}function FI(t){return II(t,"theta").length>0}function zI(t){return II(t,"radial").length>0}function $I(t){return II(t,"radar").length>0}function WI(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}PI.props={},CI.props={reapplyWhenUpdate:!0};var GI=WI("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf"),HI=WI("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666"),YI=WI("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666"),qI=WI("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0"),VI=WI("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928"),UI=WI("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2"),XI=WI("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc"),ZI=WI("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999"),KI=WI("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3"),QI=WI("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"),JI=WI("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function tD(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function eD(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function nD(){}var rD=.7,iD=1/rD,oD="\\s*([+-]?\\d+)\\s*",aD="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",sD="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cD=/^#([0-9a-f]{3,8})$/,lD=new RegExp(`^rgb\\(${oD},${oD},${oD}\\)$`),uD=new RegExp(`^rgb\\(${sD},${sD},${sD}\\)$`),fD=new RegExp(`^rgba\\(${oD},${oD},${oD},${aD}\\)$`),hD=new RegExp(`^rgba\\(${sD},${sD},${sD},${aD}\\)$`),dD=new RegExp(`^hsl\\(${aD},${sD},${sD}\\)$`),pD=new RegExp(`^hsla\\(${aD},${sD},${sD},${aD}\\)$`),gD={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 vD(){return this.rgb().formatHex()}function yD(){return this.rgb().formatRgb()}function mD(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=cD.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?bD(e):3===n?new MD(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?xD(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?xD(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=lD.exec(t))?new MD(e[1],e[2],e[3],1):(e=uD.exec(t))?new MD(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=fD.exec(t))?xD(e[1],e[2],e[3],e[4]):(e=hD.exec(t))?xD(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=dD.exec(t))?TD(e[1],e[2]/100,e[3]/100,1):(e=pD.exec(t))?TD(e[1],e[2]/100,e[3]/100,e[4]):gD.hasOwnProperty(t)?bD(gD[t]):"transparent"===t?new MD(NaN,NaN,NaN,0):null}function bD(t){return new MD(t>>16&255,t>>8&255,255&t,1)}function xD(t,e,n,r){return r<=0&&(t=e=n=NaN),new MD(t,e,n,r)}function wD(t){return t instanceof nD||(t=mD(t)),t?new MD((t=t.rgb()).r,t.g,t.b,t.opacity):new MD}function kD(t,e,n,r){return 1===arguments.length?wD(t):new MD(t,e,n,null==r?1:r)}function MD(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function ED(){return`#${AD(this.r)}${AD(this.g)}${AD(this.b)}`}function OD(){const t=_D(this.opacity);return`${1===t?"rgb(":"rgba("}${SD(this.r)}, ${SD(this.g)}, ${SD(this.b)}${1===t?")":`, ${t})`}`}function _D(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function SD(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function AD(t){return((t=SD(t))<16?"0":"")+t.toString(16)}function TD(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new ND(t,e,n,r)}function PD(t){if(t instanceof ND)return new ND(t.h,t.s,t.l,t.opacity);if(t instanceof nD||(t=mD(t)),!t)return new ND;if(t instanceof ND)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 ND(a,s,c,t.opacity)}function ND(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function CD(t){return(t=(t||0)%360)<0?t+360:t}function LD(t){return Math.max(0,Math.min(1,t||0))}function jD(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}tD(nD,mD,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:vD,formatHex:vD,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return PD(this).formatHsl()},formatRgb:yD,toString:yD}),tD(MD,kD,eD(nD,{brighter(t){return t=null==t?iD:Math.pow(iD,t),new MD(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?rD:Math.pow(rD,t),new MD(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new MD(SD(this.r),SD(this.g),SD(this.b),_D(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:ED,formatHex:ED,formatHex8:function(){return`#${AD(this.r)}${AD(this.g)}${AD(this.b)}${AD(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:OD,toString:OD})),tD(ND,(function(t,e,n,r){return 1===arguments.length?PD(t):new ND(t,e,n,null==r?1:r)}),eD(nD,{brighter(t){return t=null==t?iD:Math.pow(iD,t),new ND(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?rD:Math.pow(rD,t),new ND(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 MD(jD(t>=240?t-240:t+120,i,r),jD(t,i,r),jD(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new ND(CD(this.h),LD(this.s),LD(this.l),_D(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=_D(this.opacity);return`${1===t?"hsl(":"hsla("}${CD(this.h)}, ${100*LD(this.s)}%, ${100*LD(this.l)}%${1===t?")":`, ${t})`}`}}));const RD=Math.PI/180,ID=180/Math.PI;var DD=-.14861,BD=1.78277,FD=-.29227,zD=-.90649,$D=1.97294,WD=$D*zD,GD=$D*BD,HD=BD*FD-zD*DD;function YD(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof qD)return new qD(t.h,t.s,t.l,t.opacity);t instanceof MD||(t=wD(t));var e=t.r/255,n=t.g/255,r=t.b/255,i=(HD*r+WD*e-GD*n)/(HD+WD-GD),o=r-i,a=($D*(n-i)-FD*o)/zD,s=Math.sqrt(a*a+o*o)/($D*i*(1-i)),c=s?Math.atan2(a,o)*ID-120:NaN;return new qD(c<0?c+360:c,s,i,t.opacity)}(t):new qD(t,e,n,null==r?1:r)}function qD(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}tD(qD,YD,eD(nD,{brighter(t){return t=null==t?iD:Math.pow(iD,t),new qD(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?rD:Math.pow(rD,t),new qD(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=isNaN(this.h)?0:(this.h+120)*RD,e=+this.l,n=isNaN(this.s)?0:this.s*e*(1-e),r=Math.cos(t),i=Math.sin(t);return new MD(255*(e+n*(DD*r+BD*i)),255*(e+n*(FD*r+zD*i)),255*(e+n*($D*r)),this.opacity)}}));var VD=t=>()=>t;function UD(t,e){return function(n){return t+n*e}}function XD(t){return 1===(t=+t)?ZD: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)}}function ZD(t,e){var n=e-t;return n?UD(t,n):VD(isNaN(t)?e:t)}!function t(e){var n=XD(e);function r(t,e){var r=n((t=kD(t)).r,(e=kD(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=ZD(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 KD,QD=(KD=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return function(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}((n-r/e)*e,a,i,o,s)}},function(t){var e,n,r=t.length,i=new Array(r),o=new Array(r),a=new Array(r);for(e=0;e<r;++e)n=kD(t[e]),i[e]=n.r||0,o[e]=n.g||0,a[e]=n.b||0;return i=KD(i),o=KD(o),a=KD(a),n.opacity=1,function(t){return n.r=i(t),n.g=o(t),n.b=a(t),n+""}});function JD(t){return function e(n){function r(e,r){var i=t((e=YD(e)).h,(r=YD(r)).h),o=ZD(e.s,r.s),a=ZD(e.l,r.l),s=ZD(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)}JD((function(t,e){var n=e-t;return n?UD(t,n>180||n<-180?n-360*Math.round(n/360):n):VD(isNaN(t)?e:t)}));var tB=JD(ZD),eB=t=>QD(t[t.length-1]),nB=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(WI),rB=eB(nB),iB=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(WI),oB=eB(iB),aB=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(WI),sB=eB(aB),cB=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(WI),lB=eB(cB),uB=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(WI),fB=eB(uB),hB=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(WI),dB=eB(hB),pB=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(WI),gB=eB(pB),vB=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(WI),yB=eB(vB),mB=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(WI),bB=eB(mB),xB=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(WI),wB=eB(xB),kB=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(WI),MB=eB(kB),EB=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(WI),OB=eB(EB),_B=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(WI),SB=eB(_B),AB=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(WI),TB=eB(AB),PB=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(WI),NB=eB(PB),CB=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(WI),LB=eB(CB),jB=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(WI),RB=eB(jB),IB=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(WI),DB=eB(IB),BB=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(WI),FB=eB(BB),zB=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(WI),$B=eB(zB),WB=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(WI),GB=eB(WB),HB=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(WI),YB=eB(HB),qB=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(WI),VB=eB(qB),UB=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(WI),XB=eB(UB),ZB=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(WI),KB=eB(ZB),QB=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(WI),JB=eB(QB),tF=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(WI),eF=eB(tF);var nF=tB(YD(300,.5,0),YD(-240,.5,1)),rF=tB(YD(-100,.75,.35),YD(80,1.5,.8)),iF=tB(YD(260,.75,.35),YD(80,1.5,.8)),oF=YD();var aF=kD(),sF=Math.PI/3,cF=2*Math.PI/3;function lF(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var uF=lF(WI("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),fF=lF(WI("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),hF=lF(WI("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),dF=lF(WI("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),pF=Object.freeze({__proto__:null,schemeCategory10:GI,schemeAccent:HI,schemeDark2:YI,schemeObservable10:qI,schemePaired:VI,schemePastel1:UI,schemePastel2:XI,schemeSet1:ZI,schemeSet2:KI,schemeSet3:QI,schemeTableau10:JI,interpolateBrBG:rB,schemeBrBG:nB,interpolatePRGn:oB,schemePRGn:iB,interpolatePiYG:sB,schemePiYG:aB,interpolatePuOr:lB,schemePuOr:cB,interpolateRdBu:fB,schemeRdBu:uB,interpolateRdGy:dB,schemeRdGy:hB,interpolateRdYlBu:gB,schemeRdYlBu:pB,interpolateRdYlGn:yB,schemeRdYlGn:vB,interpolateSpectral:bB,schemeSpectral:mB,interpolateBuGn:wB,schemeBuGn:xB,interpolateBuPu:MB,schemeBuPu:kB,interpolateGnBu:OB,schemeGnBu:EB,interpolateOrRd:SB,schemeOrRd:_B,interpolatePuBuGn:TB,schemePuBuGn:AB,interpolatePuBu:NB,schemePuBu:PB,interpolatePuRd:LB,schemePuRd:CB,interpolateRdPu:RB,schemeRdPu:jB,interpolateYlGnBu:DB,schemeYlGnBu:IB,interpolateYlGn:FB,schemeYlGn:BB,interpolateYlOrBr:$B,schemeYlOrBr:zB,interpolateYlOrRd:GB,schemeYlOrRd:WB,interpolateBlues:YB,schemeBlues:HB,interpolateGreens:VB,schemeGreens:qB,interpolateGreys:XB,schemeGreys:UB,interpolatePurples:KB,schemePurples:ZB,interpolateReds:JB,schemeReds:QB,interpolateOranges:eF,schemeOranges:tF,interpolateCividis:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},interpolateCubehelixDefault:nF,interpolateRainbow:function(t){(t<0||t>1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return oF.h=360*t-100,oF.s=1.5-1.5*e,oF.l=.8-.9*e,oF+""},interpolateWarm:rF,interpolateCool:iF,interpolateSinebow:function(t){var e;return t=(.5-t)*Math.PI,aF.r=255*(e=Math.sin(t))*e,aF.g=255*(e=Math.sin(t+sF))*e,aF.b=255*(e=Math.sin(t+cF))*e,aF+""},interpolateTurbo:function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},interpolateViridis:uF,interpolateMagma:fF,interpolateInferno:hF,interpolatePlasma:dF});function gF(t,e,n,r,i,o){const{guide:a={}}=n,s=function(t,e,n){const{type:r,domain:i,range:o,quantitative:a,ordinal:s}=n;if(void 0!==r)return r;if(function(t){return NF(t,na)}(e))return"identity";if("string"==typeof o)return"linear";if((i||o||[]).length>2)return _F(t,s);if(void 0!==i)return TF([i])?_F(t,s):PF(e)?"time":SF(t,o,a);return TF(e)?_F(t,s):PF(e)?"time":SF(t,o,a)}(t,e,n);if("string"!=typeof s)return n;const c=function(t,e,n,r){const{domain:i}=r;if(void 0!==i)return i;switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":case"quantize":case"threshold":return AF(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)Zo(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 AF(function(t){let e=1/0,n=-1/0;for(const r of t)for(const t of r)Zo(t)&&(e=Math.min(e,+t),n=Math.max(n,+t));return e===1/0?[]:[e<0?-n:e,n]}(n),r);default:return[]}}(s,0,e,n),l=function(t,e,n){const{ratio:r}=n;if(null==r)return e;if(kF({type:t}))return function(t,e,n){const r=t.map(Number),i=new po({domain:r,range:[r[0],r[0]+(r[r.length-1]-r[0])*e]});return"time"===n?t.map((t=>new Date(i.map(t)))):t.map((t=>i.map(t)))}(e,r,t);return MF({type:t})?function(t,e){const n=Math.round(t.length*e);return t.slice(0,n)}(e,r):e}(s,c,n);return Object.assign(Object.assign(Object.assign({},n),function(t,e,n,r,i){switch(t){case"linear":case"time":case"log":case"pow":case"sqrt":return function(t,e){const{interpolate:n=Ii,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?FI(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=G(e),i=pF[`interpolate${r}`];if(!i)throw new Error(`Unknown palette: ${r}`);return{interpolator:n?t=>i(n(t)):i}}(r);default:return r}}(s,t,0,n,r)),{domain:l,range:EF(s,t,e,n,l,i,o),expectedDomain:c,guide:a,name:t,type:s})}function vF(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 yF(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=vr(i)+1,a=`${e}${o}`;t[a]=r,r.getOptions().key=a}else t[e]=r}return t}function mF(t,e){const[n]=LI("scale",e),{relations:r}=t,[i]=function(t){if(!t||!Array.isArray(t))return[Yo,Yo];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 bF(t){const e=t.flatMap((t=>Array.from(t.values()))).flatMap((t=>t.channels.map((t=>t.scale))));wF(e,"x"),wF(e,"y")}function xF(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 wF(t,e){const n=t.filter((({name:t,facet:n=!0})=>n&&t===e)),r=n.flatMap((t=>t.domain)),i=n.every(kF)?Vn(r):n.every(MF)?Array.from(new Set(r)):null;if(null!==i)for(const t of n)t.domain=i}function kF(t){const{type:e}=t;if("string"!=typeof e)return!1;return["linear","log","pow","time"].includes(e)}function MF(t){const{type:e}=t;if("string"!=typeof e)return!1;return["band","point","ordinal"].includes(e)}function EF(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=OF(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?[sa(e),ca(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 OF(n,r,i,o,a);case"sequential":return;case"constant":return[n[0][0]];default:return[]}}function OF(t,e,n,r,i){const[o]=LI("palette",i),{category10:a,category20:s}=r,c=function(t){return Array.from(new Set(t))}(n).length<=a.length?a:s,{palette:l=c,offset:u}=e;if(Array.isArray(l))return l;try{return o({type:l})}catch(t){const e=function(t,e,n=t=>t){if(!t)return null;const r=G(t),i=pF[`scheme${r}`],o=pF[`interpolate${r}`];if(!i&&!o)return null;if(i){if(!i.some(Array.isArray))return i;const t=i[e.length];if(t)return t}return e.map(((t,r)=>o(n(r/e.length))))}(l,n,u);if(e)return e;throw new Error(`Unknown Component: ${l} `)}}function _F(t,e){return e||(function(t){return t.startsWith("x")||t.startsWith("y")||t.startsWith("position")||t.startsWith("size")}(t)?"point":"ordinal")}function SF(t,e,n){return n||("color"!==t||e?"linear":"sequential")}function AF(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 TF(t){return NF(t,(t=>{const e=typeof t;return"string"===e||"boolean"===e}))}function PF(t){return NF(t,(t=>t instanceof Date))}function NF(t,e){for(const n of t)if(n.some(e))return!0;return!1}const CF={linear:"linear",identity:"identity",log:"log",pow:"pow",sqrt:"sqrt",sequential:"sequential"},LF={threshold:"threshold",quantize:"quantize",quantile:"quantile"},jF={ordinal:"ordinal",band:"band",point:"point"},RF={constant:"constant"};function IF(t,e,n){const{coordinates:r=[],title:i}=e,[,o]=LI("component",n),a=t.filter((({guide:t})=>null!==t)),s=[],c=function(t,e,n){const[,r]=LI("component",n),{coordinates:i}=t;function o(t,e,n,o){const a=function(t,e,n=[]){return"x"===t?BI(n)?`${e}Y`:`${e}X`:"y"===t?BI(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[...FF(n),...$F(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=Q({},...e),{guide:v,field:y}=g,m=Array.isArray(v)?v:[v];for(const n of m){const[o,g]=HF(t,i,l,n,e,a,r);if(!o&&!g)continue;const v="left"===o||"right"===o,m=v?d[1]:d[0],b=v?p[1]:p[0],{size:x,order:w=f,length:k=h,padding:M=m,crossPadding:E=b}=n;s.push(Object.assign(Object.assign({title:y},n),{defaultSize:u,length:k,position:o,plane:c,orientation:g,padding:M,order:w,crossPadding:E,size:x,type:t,scales:e}))}})),s}function DF(t,e,n,r,i){const[o]=LI("component",r),{scaleInstances:a,scale:s,bbox:c}=t,l={bbox:c,library:r};return o(Le(t,["scaleInstances","scale","bbox"]))({coordinate:e,library:r,markState:i,scales:a,theme:n,value:l,scale:s})}function BF(t,e){const n=["left","right","bottom","top"],r=tr(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=Tr(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=vr(t,(t=>t.size)),r=vr(t,(t=>t.order)),i=vr(t,(t=>t.crossPadding));return{type:"group",size:n,order:r,position:t[0].position,children:t,crossPadding:i}}))}function FF(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=tr(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(...ua(t,n));return e}(t).sort(((t,e)=>e.length-t.length)),n=e.map((t=>({combination:t,option:t.map((t=>[t.name,zF(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 RN)for(const{option:r,combination:i}of n)if(e.some((t=>et(s(t),s(r)))))return[t,i];return null})).filter(Zo);return c}function zF(t){const{type:e}=t;return"string"!=typeof e?null:e in CF?"continuous":e in jF?"discrete":e in LF?"distribution":e in RF?"constant":null}function $F(t,e){return t.map((t=>{const{name:n}=t;if(function(t){return II(t,"helix").length>0}(e)||FI(e))return null;if(BI(e)&&(DI(e)||zI(e)))return null;if(n.startsWith("x"))return DI(e)?["axisArc",[t]]:zI(e)?["axisLinear",[t]]:[BI(e)?"axisY":"axisX",[t]];if(n.startsWith("y"))return DI(e)?["axisLinear",[t]]:zI(e)?["axisArc",[t]]:[BI(e)?"axisX":"axisY",[t]];if(n.startsWith("z"))return["axisZ",[t]];if(n.startsWith("position")){if($I(e))return["axisRadar",[t]];if(!DI(e))return["axisY",[t]]}return null})).filter(Zo)}function WF(t){const e=II(t,"polar");if(e.length){const t=e[e.length-1],{startAngle:r,endAngle:i}=n(t);return[r,i]}const r=II(t,"radial");if(r.length){const t=r[r.length-1],{startAngle:e,endAngle:n}=s(t);return[e,n]}return[-Math.PI/2,Math.PI/2*3]}function GF(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(null===e)return[null,null];const[n,a]=WF(i);return["center",(a-n)/($I(i)?t.length:t.length-1)*e+n]}if("axisY"===t&&function(t){return II(t,"parallel").length>0}(i))return BI(i)?["center","horizontal"]:["center","vertical"];if("axisLinear"===t){const[t]=WF(i);return["center",t]}return"axisArc"===t?"inner"===e[0]?["inner",null]:["outer",null]:DI(i)||zI(i)?["center",null]:"axisX"===t&&function(t){return II(t,"reflect").length>0}(i)||"axisX"===t&&function(t){return II(t,"reflectY").length>0}(i)?["top",null]:e}function HF(t,e,n,r,i,o,a){const[s]=WF(a),c=[r.position||e,null!=s?s:n];return"string"==typeof t&&t.startsWith("axis")?GF(t,c,i,o,a):"string"==typeof t&&t.startsWith("legend")&&DI(a)&&"center"===r.position?["center","vertical"]:c}function YF(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")?ZF:s.startsWith("group")?qF:s.startsWith("legendContinuous")?KF:"legendCategory"===s?QF:s.startsWith("slider")?XF:"title"===s?UF:s.startsWith("scrollbar")?VF:()=>{})(t,e,n,r,i,o)}function qF(t,e,n,r,i,o){const{children:a}=t,s=vr(a,(t=>t.crossPadding));a.forEach((t=>t.crossPadding=s)),a.forEach((t=>YF(t,e,n,r,i,o)));const c=vr(a,(t=>t.size));t.size=c,a.forEach((t=>t.size=c))}function VF(t,e,n,r,i,o){const{trackSize:a=6}=Q({},i.scrollbar,t);t.size=a}function UF(t,e,n,r,i,o){const a=Q({},i.title,t),{title:s,subtitle:c,spacing:l=0}=a,u=Le(a,["title","subtitle","spacing"]);if(s){const e=iz(s,Qo(u,"title"));t.size=e.height}if(c){const e=iz(c,Qo(u,"subtitle"));t.size+=l+e.height}}function XF(t,e,n,r,i,o){const{trackSize:a,handleIconSize:s}=(()=>{const{slider:e}=i;return Q({},e,t)})(),c=Math.max(a,2.4*s);t.size=c}function ZF(t,e,n,r,i,o){var a;t.transform=t.transform||[{type:"hide"}];const s="left"===r||"right"===r,c=nz(t,r,i),{tickLength:l=0,labelSpacing:u=0,titleSpacing:f=0,labelAutoRotate:h}=c,d=Le(c,["tickLength","labelSpacing","titleSpacing","labelAutoRotate"]),p=JF(t,o),g=tz(d,p),v=l+u;if(g&&g.length){const r=vr(g,(t=>t.width)),i=vr(g,(t=>t.height));if(s)t.size=r+v;else{const{tickFilter:o,labelTransform:s}=t;!function(t,e,n,r,i){const o=Tr(e,(t=>t.width));if(o>n)return!0;const a=t.clone();a.update({range:[0,n]});const s=rz(t,i),c=s.map((t=>a.map(t)+function(t,e){if(!t.getBandWidth)return 0;const n=t.getBandWidth(e)/2;return n}(a,t))),l=s.map(((t,e)=>e)),u=-r[0],f=n+r[1],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}(p,g,e,n,o)||s||!1===h||null===h?(t.labelTransform=null!==(a=t.labelTransform)&&void 0!==a?a:"rotate(0)",t.size=i+v):(t.labelTransform="rotate(90)",t.size=r+v)}}else t.size=l;const y=ez(d);y&&(t.size+=s?f+y.width:f+y.height)}function KF(t,e,n,r,i,o){const a=(()=>{const{legendContinuous:e}=i;return Q({},e,t)})(),{labelSpacing:s=0,titleSpacing:c=0}=a,l=Le(a,["labelSpacing","titleSpacing"]),u="left"===r||"right"===r,f=Qo(l,"ribbon"),{size:h}=f,d=Qo(l,"handleIcon"),{size:p}=d,g=Math.max(h,2.4*p);t.size=g;const v=tz(l,JF(t,o));if(v){const e=u?"width":"height",n=vr(v,(t=>t[e]));t.size+=n+s}const y=ez(l);y&&(u?t.size=Math.max(t.size,y.width):t.size+=c+y.height)}function QF(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 Q({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=Le(a,["itemSpacing","itemMarkerSize","titleSpacing","rowPadding","colPadding","maxCols","maxRows"]),{cols:g,length:v}=t,y=t=>Math.min(t,d),m=t=>Math.min(t,h),b="left"===r||"right"===r,x=void 0===v?e+(b?0:n[0]+n[1]):v,w=ez(p),k=tz(p,JF(t,o),"itemLabel"),M=Math.max(k[0].height,c)+u,E=(t,e=0)=>c+t+s[0]+e;b?(()=>{let e=-1/0,n=0,r=1,i=0,o=-1/0,a=-1/0;const s=w?w.height:0,c=x-s;for(const{width:t}of k){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*m(r),t.length=a+s,Q(t,{cols:m(r),gridRow:o})})():"number"==typeof g?(()=>{const e=Math.ceil(k.length/g),n=vr(k,(t=>E(t.width)))*g;t.size=M*y(e)-u,t.length=Math.min(n,x)})():(()=>{let e=1,n=0,r=-1/0;for(const{width:t}of k){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*y(e)-u,t.length=r})(),w&&(b?t.size=Math.max(t.size,w.width):t.size+=l+w.height)}function JF(t,e){const[n]=LI("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 tz(t,e,n="label"){const{labelFormatter:r,tickFilter:i,label:o=!0}=t,a=Le(t,["labelFormatter","tickFilter","label"]);if(!o)return null;const s=function(t,e,n){const r=rz(t,n),i=r.map((t=>"number"==typeof t?dy(t):t)),o=e?"string"==typeof e?dA(e):e:t.getFormatter?t.getFormatter():t=>`${t}`;return i.map(o)}(e,r,i),c=Qo(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)=>iz(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 ez(t){const{title:e}=t,n=Le(t,["title"]);if((t=>!1===t||null===t)(e)||void 0===e)return null;const r=Qo(n,"title"),{direction:i,transform:o}=r,a=Array.isArray(e)?e.join(","):e;if("string"!=typeof a)return null;return iz(a,Object.assign(Object.assign({},r),{transform:o||("vertical"===i?"rotate(-90)":"")}))}function nz(t,e,n){const{title:r}=t,[i,o]=Array.isArray(r)?[r,void 0]:[void 0,r],{axis:a,[`axis${Vo(e)}`]:s}=n;return Q({title:i},a,s,Object.assign(Object.assign({},t),{title:o}))}function rz(t,e){const n=t.getTicks?t.getTicks():t.getOptions().domain;return e?n.filter(e):n}function iz(t,e){const n=function(t){return t instanceof Ng?t:new Zg({style:{text:`${t}`}})}(t),r=Le(e,["filter"]);n.attr(Object.assign(Object.assign({},r),{visibility:"none"}));return n.getBBox()}function oz(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:v=h,margin:y=(null!==(o=n.margin)&&void 0!==o?o:0),marginLeft:m=y,marginBottom:b=y,marginTop:x=y,marginRight:w=y,padding:k=n.padding,paddingBottom:M=k,paddingLeft:E=k,paddingRight:O=k,paddingTop:_=k}=function(t,e,n,r){const{coordinates:i}=e;if(!DI(i)&&!zI(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=>nz(t,"axisArc"===t.type?"arc":"linear",n))),s=vr(a,(t=>{var e;return null!==(e=t.labelSpacing)&&void 0!==e?e:0})),c=o.flatMap(((t,e)=>tz(a[e],JF(t,r)))).filter(Zo),l=vr(c,(t=>t.height))+s,u=o.flatMap(((t,e)=>ez(a[e]))).filter((t=>null!==t)),f=0===u.length?0:vr(u,(t=>t.height)),{inset:h=l,insetLeft:d=h,insetBottom:p=h,insetTop:g=h+f,insetRight:v=h}=e;return Object.assign(Object.assign({},e),{insetLeft:d,insetBottom:p,insetTop:g,insetRight:v})}(t,e,n,r),S=(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]},A=t=>"auto"===t?20:null!=t?t:20,T=A(_),P=A(M),N=az(t,s-T-P,[T+x,P+b],["left","right"],e,n,r),{paddingLeft:C,paddingRight:L}=N,j=a-m-w,[R,I]=S(j,E,O,C,L),D=j-R-I,B=az(t,D,[R+m,I+w],["bottom","top"],e,n,r),{paddingTop:F,paddingBottom:z}=B,$=s-b-x,[W,G]=S($,M,_,z,F);return{width:a,height:s,depth:c,insetLeft:d,insetTop:p,insetBottom:g,insetRight:v,innerWidth:D,innerHeight:$-W-G,paddingLeft:R,paddingRight:I,paddingTop:G,paddingBottom:W,marginLeft:m,marginBottom:b,marginTop:x,marginRight:w,x:l,y:u,z:f}}function az(t,e,n,r,i,o,a){const s=Jn(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${Vo(pm(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=vr(t.children,(t=>t.size))):t.size=t.defaultSize},f=r=>{r.size||("auto"!==c?u(r):(YF(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=mr(i,(t=>t.order)),v=i.filter((t=>t.type.startsWith("axis")&&t.order==g));if(v.length&&(v[0].crossPadding=0),"number"==typeof c)i.forEach(l),i.forEach(h);else if(0===i.length)d[r]=0;else{const t=BF(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 sz({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 v=n+a,y=i+s,m=r+l,b=o+c,x=t-a-l,w=[v+d,y+g,f-d-p,u-g-h,"center",null,null];return{top:[v,0,f,y,"vertical",!0,Rn,a,x],right:[t-m,y,m,u,"horizontal",!1,Rn],bottom:[v,e-b,f,b,"vertical",!1,Rn,a,x],left:[0,y,v,u,"horizontal",!0,Rn],"top-left":[v,0,f,y,"vertical",!0,Rn],"top-right":[v,0,f,y,"vertical",!0,Rn],"bottom-left":[v,e-b,f,b,"vertical",!1,Rn],"bottom-right":[v,e-b,f,b,"vertical",!1,Rn],center:w,inner:w,outer:w}}function cz(t,e,n,r){const[i,o]=la(t,(t=>!("string"!=typeof t.type||!t.type.startsWith("axis"))));!function(t,e,n,r){"center"===r?function(t){return el(t)&&Qc(t)}(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},e.radar={index:t.indexOf(e),count:t.length}}(t,0,n):Qc(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):el(e)&&function(t,e,n,r){"horizontal"===r?function(t,e,n){const[r,i,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==1)).map((t=>t+i));for(let e=0;e<t.length;e++){const n=t[e],i=c[e],a=c[e+1]-i;n.bbox={x:r,y:i,width:o,height:a}}}(t,e,n):"vertical"===r&&function(t,e,n){const[r,i,,o]=n,a=new Array(t.length).fill(0),s=e.map(a),c=s.filter(((t,e)=>e%2==0)).map((t=>t+r));for(let e=0;e<t.length;e++){const n=t[e],r=c[e],a=c[e+1]-r;n.bbox={x:r,y:i,width:a,height:o}}}(t,e,n)}(t,e,n,t[0].orientation):"inner"===r?function(t,e,n){const[r,i,,o]=n,[a,s]=e.getCenter(),[c]=il(e),l=o/2,u=c*l,f=a-u,h=s-u;for(let e=0;e<t.length;e++){t[e].bbox={x:r+f,y:i+h,width:2*u,height:2*u}}}(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]=il(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 lz(t,e,n){const[r,i,o,a,s,c,l,u,f]=n,[h,d,p,g,v,y,m,b]="vertical"===s?["y",i,"x",r,"height",a,"width",o]:["x",r,"y",i,"width",o,"height",a];t.sort(((t,e)=>null==l?void 0:l(t.order,e.order)));const x=t=>"title"===t||"group"===t||t.startsWith("legend"),w=(t,e,n)=>void 0===n?e:x(t)?n:e,k=(t,e,n)=>void 0===n?e:x(t)?n:e;for(let e=0,n=c?d+y: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]:k(o,g,u),[v]:a,[m]:w(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[m],i=r/n.length,o=n.reduce(((t,e)=>{var n;const r=null===(n=e.layout)||void 0===n?void 0:n.justifyContent;return r||t}),"flex-start"),a=n.map(((t,e)=>{const{length:r=i,padding:o=0}=t;return r+(e===n.length-1?0:o)})),s=r-Tr(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={[v]:e[v],[h]:e[h],[p]:r,[m]:a[t]-c},Q(i,{layout:{justifyContent:o}}),r+=a[t]}}}const uz=Symbol("CALLBACK_ITEM");function fz(t,e,n){const{encode:r={},scale:i={},transform:o=[]}=e,a=Le(e,["encode","scale","transform"]);return[t,Object.assign(Object.assign({},a),{encode:r,scale:i,transform:o})]}function hz(t,e,n){return Re(this,void 0,void 0,(function*(){const{library:t}=n,{data:r}=e,[i]=LI("data",t),o=function(t){if(I(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=Le(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}(r),{transform:a=[]}=o,s=[Le(o,["transform"]),...a].map((t=>i(t,n))),c=yield function(t){return t.reduce(((t,e)=>n=>Re(this,void 0,void 0,(function*(){const r=yield t(n);return e(r)}))),Yo)}(s)(r),l=!r||Array.isArray(r)||Array.isArray(c)?c:{value:c};return[Array.isArray(c)?aa(c):[],Object.assign(Object.assign({},e),{data:l})]}))}function dz(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 pz(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const o=oa(r,(t=>{if(function(t){if("object"!=typeof t||t instanceof Date||null===t)return!1;const{type:e}=t;return Zo(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 gz(t,e,n){const{encode:r}=e;if(!r)return[t,e];const i=oa(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 vz(t,e,n){const{encode:r,data:i}=e;if(!r)return[t,e];const{library:o}=n,a=function(t){const[e]=LI("encode",t);return(t,n)=>void 0===n||void 0===t?null:Object.assign(Object.assign({},n),{type:"column",value:e(n)(t),field:Mz(n)})}(o),s=oa(r,(t=>a(i,t)));return[t,Object.assign(Object.assign({},e),{encode:s})]}function yz(t,e,n){const{tooltip:r={}}=e;return ra(r)?[t,e]:Array.isArray(r)?[t,Object.assign(Object.assign({},e),{tooltip:{items:r}})]:na(r)&&LE(r)?[t,Object.assign(Object.assign({},e),{tooltip:r})]:[t,Object.assign(Object.assign({},e),{tooltip:{items:[r]}})]}function mz(t,e,n){const{data:r,encode:i,tooltip:o={}}=e;if(ra(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(na(e)){const{field:n,channel:o,color:a,name:s=n,valueFormatter:c=t=>t}=e,l="string"==typeof c?dA(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);na(t)?n[o]=Object.assign(Object.assign({},t),{[uz]:!0}):n[o]={value:t}}return n}return e},{title:s,items:c=[]}=o,l=Le(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 bz(t,e,n){const{encode:r}=e,i=Le(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=Le(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 xz(t,e,n){const{axis:r={},legend:i={},slider:o={},scrollbar:a={}}=e,s=(t,e)=>{if("boolean"==typeof t)return t?{}:null;const n=t[e];return void 0===n||n?n:null},c="object"==typeof r?Array.from(new Set(["x","y","z",...Object.keys(r)])):["x","y","z"];return Q(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 wz(t,e,n){const{animate:r}=e;return r||void 0===r||Q(e,{animate:{enter:{type:null},exit:{type:null},update:{type:null}}}),[t,e]}function kz(t,e,n){return Re(this,void 0,void 0,(function*(){const[r,i]=yield function(t,e,n){return Re(this,void 0,void 0,(function*(){const{library:r}=n,[i]=LI("transform",r),{preInference:o=[],postInference:a=[]}=e,{transform:s=[]}=t,c=[fz,hz,dz,pz,gz,vz,bz,wz,xz,yz,...o.map(i),...s.map(i),...a.map(i),mz];let l=[],u=t;for(const t of c)[l,u]=yield t(l,u,n);return[l,u]}))}(t,e,n),{encode:o,scale:a,data:s,tooltip:c}=i;if(!1===Array.isArray(s))return null;const{channels:l}=e,u=nr(Object.entries(o).filter((([,t])=>Zo(t))),(t=>t.map((([t,e])=>Object.assign({name:t},e)))),(([t])=>{var e;const n=null===(e=/([^\d]+)\d*$/.exec(t))||void 0===e?void 0:e[1],r=l.find((t=>t.name===n));return(null==r?void 0:r.independent)?t:n})),f=l.filter((t=>{const{name:e,required:n}=t;if(u.find((([t])=>t===e)))return!0;if(n)throw new Error(`Missing encoding for channel: ${e}.`);return!1})).flatMap((t=>{const{name:e,scale:n,scaleKey:r,range:i,quantitative:o,ordinal:s}=t;return u.filter((([t])=>t.startsWith(e))).map((([t,e],c)=>{const l=e.some((t=>t.visual)),u=e.some((t=>t.constant)),f=a[t]||{},{independent:h=!1,key:d=r||t,type:p=(u?"constant":l?"identity":n)}=f,g=Le(f,["independent","key","type"]),v="constant"===p,y=v?void 0:i;return{name:t,values:e,scaleKey:h||v?Symbol("independent"):d,scale:Object.assign(Object.assign({type:p,range:y},g),{quantitative:o,ordinal:s})}}))}));return[i,Object.assign(Object.assign({},e),{index:r,channels:f,tooltip:c})]}))}function Mz(t){const{type:e,value:n}=t;return"field"===e&&"string"==typeof n?n:null}function Ez(t,e,n){var r;return Re(this,void 0,void 0,(function*(){const{library:i}=n,[o]=LI("composition",i),[a]=LI("interaction",i),s=new Set(Object.keys(i).map((t=>{var e;return null===(e=/mark\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Zo)),c=new Set(Object.keys(i).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Zo)),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,v=new Map,y=[t],m=[];for(;y.length;){const t=y.shift();if(f(t)){const e=v.get(t),[r,o]=e?Pz(e,t,i):yield Sz(t,n);g.set(r,t),p.push(r);const a=o.flatMap(d).map((t=>RI(t,i)));if(y.push(...a),a.every(f)){const t=yield Promise.all(a.map((t=>Az(t,n))));bF(t);for(let e=0;e<a.length;e++){const n=a[e],r=t[e];v.set(n,r)}}}else{const e=d(u(t)?t:yield Yz(t,n));Array.isArray(e)?y.push(...e):"function"==typeof e&&m.push(e())}}n.emitter.emit(fN.BEFORE_PAINT);const b=new Map,w=new Map,k=[];e.selectAll(Xz(WT)).data(p,(t=>t.key)).join((t=>t.append("g").attr("className",WT).attr("id",(t=>t.key)).call(Oz).each((function(t,e,r){Nz(t,uy(r),k,n),b.set(t,r)}))),(t=>t.call(Oz).each((function(t,e,r){Nz(t,uy(r),k,n),w.set(t,r)}))),(t=>t.each((function(t,e,n){const r=n.nameInteraction.values();for(const t of r)t.destroy()})).remove()));const M=(t,e,r)=>Array.from(t.entries()).map((([i,o])=>{const a=r||new Map,s=g.get(i),c=function(t,e,n){const{library:r}=n,i=function(t){const[,e]=LI("interaction",t);return t=>{const[n,r]=t;try{return[n,e(n)]}catch(t){return[n,r.type]}}}(r),o=t=>t[1]&&t[1].props&&t[1].props.reapplyWhenUpdate,a=Hz(e),s=a.map(i).filter(o).map((t=>t[0]));return(e,r,i)=>Re(this,void 0,void 0,(function*(){const o=[],[a,c]=yield Sz(e,n);Nz(a,t,o,n);for(const i of s.filter((t=>t!==r)))_z(i,t,e,a,n);for(const e of c)Ez(e,t,n);return i(),{options:e,view:a}}))}(uy(o),s,n);return{view:i,container:o,options:s,setState:(t,e=t=>t)=>a.set(t,e),update:(n,r)=>Re(this,void 0,void 0,(function*(){const i=qo(Array.from(a.values()))(s);return yield c(i,n,(()=>{x(r)&&e(t,r,a)}))}))}})),E=(t=w,e,r)=>{var i;const o=M(t,E,r);for(const t of o){const{options:r,container:s}=t,c=s.nameInteraction;let l=Hz(r);e&&(l=l.filter((t=>e.includes(t[0]))));for(const e of l){const[r,s]=e,l=c.get(r);if(l&&(null===(i=l.destroy)||void 0===i||i.call(l)),s){const e=Tz(t.view,r,s,a)(t,o,n.emitter);c.set(r,{destroy:e})}}}},O=M(b,E);for(const t of O){const{options:e}=t,r=new Map;t.container.nameInteraction=r;for(const i of Hz(e)){const[e,o]=i;if(o){const i=Tz(t.view,e,o,a)(t,O,n.emitter);r.set(e,{destroy:i})}}}E();const{width:_,height:S}=t,A=[];for(const t of m){const r=new Promise((r=>Re(this,void 0,void 0,(function*(){for(const r of t){const t=Object.assign({width:_,height:S},r);yield Ez(t,e,n)}r()}))));A.push(r)}n.views=p,null===(r=n.animations)||void 0===r||r.forEach((t=>null==t?void 0:t.cancel())),n.animations=k,n.emitter.emit(fN.AFTER_PAINT);const T=k.filter(Zo).map(zz).map((t=>t.finished));return Promise.all([...T,...A])}))}function Oz(t){t.style("transform",(t=>`translate(${t.layout.x}, ${t.layout.y})`))}function _z(t,e,n,r,i){var o;const{library:a}=i,[s]=LI("interaction",a),c=e.node().nameInteraction,l=Hz(n).find((([e])=>e===t)),u=c.get(t);if(!u)return;if(null===(o=u.destroy)||void 0===o||o.call(u),!l[1])return;const f=Tz(r,t,l[1],s),h={options:n,view:r,container:e.node(),update:t=>Promise.resolve(t)},d=f(h,[],i.emitter);c.set(t,{destroy:d})}function Sz(t,e){return Re(this,void 0,void 0,(function*(){const{library:n}=e,r=yield function(t,e){return Re(this,void 0,void 0,(function*(){const{library:n}=e,[r,i]=LI("mark",n),o=new Set(Object.keys(n).map((t=>{var e;return null===(e=/component\.(.*)/.exec(t))||void 0===e?void 0:e[1]})).filter(Zo)),{marks:a}=t,s=[],c=[],l=[...a],{width:u,height:f}=function(t){const{height:e,width:n,padding:r=0,paddingLeft:i=r,paddingRight:o=r,paddingTop:a=r,paddingBottom:s=r,margin:c=16,marginLeft:l=c,marginRight:u=c,marginTop:f=c,marginBottom:h=c,inset:d=0,insetLeft:p=d,insetRight:g=d,insetTop:v=d,insetBottom:y=d}=t,m=t=>"auto"===t?20:t;return{width:n-m(i)-m(o)-l-u-p-g,height:e-m(a)-m(s)-f-h-v-y}}(t),h={options:t,width:u,height:f};for(;l.length;){const[t]=l.splice(0,1),n=yield Yz(t,e),{type:a=Uo("G2Mark type is required."),key:u}=n;if(o.has(a))c.push(n);else{const{props:t={}}=i(a),{composite:e=!0}=t;if(e){const{data:t}=n,e=Object.assign(Object.assign({},n),{data:t?Array.isArray(t)?t:t.value:t}),i=yield r(e,h),o=Array.isArray(i)?i:[i];l.unshift(...o.map(((t,e)=>Object.assign(Object.assign({},t),{key:`${u}-${e}`}))))}else s.push(n)}}return Object.assign(Object.assign({},t),{marks:s,components:c})}))}(t,e),i=function(t){const{coordinate:e={},interaction:n={},style:r={},marks:i}=t,o=Le(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)=>Q(t,e)),{}),u=[n,...s].reduce(((t,e)=>Q(t,e)),{}),f=[...c,r].reduce(((t,e)=>Q(t,e)),{});return Object.assign(Object.assign({},o),{marks:i,coordinate:l,interaction:u,style:f})}(r);t.interaction=i.interaction,t.coordinate=i.coordinate,t.marks=[...i.marks,...i.components];const o=RI(i,n);return Pz(yield Az(o,e),o,n)}))}function Az(t,e){return Re(this,void 0,void 0,(function*(){const{library:n}=e,[r]=LI("theme",n),[,i]=LI("mark",n),{theme:o,marks:a,coordinates:s=[]}=t,c=r(Gz(o)),l=new Map;for(const t of a){const{type:n}=t,{props:r={}}=i(n),o=yield kz(t,r,e);if(o){const[t,e]=o;l.set(t,e)}}const u=Jn(Array.from(l.values()).flatMap((t=>t.channels)),(({scaleKey:t})=>t));for(const t of u.values()){const e=t.reduce(((t,{scale:e})=>Q(t,e)),{}),{scaleKey:r}=t[0],{values:i}=t[0],o=Array.from(new Set(i.map((t=>t.field)).filter(Zo))),a=Q({guide:{title:0===o.length?void 0:o},field:o[0]},e),{name:l}=t[0],u=t.flatMap((({values:t})=>t.map((t=>t.value)))),f=Object.assign(Object.assign({},gF(l,u,a,s,c,n)),{uid:Symbol("scale"),key:r});t.forEach((t=>t.scale=f))}return l}))}function Tz(t,e,n,r){const i=t.theme,o="string"==typeof e&&i[e]||{};return r(Q(o,Object.assign({type:e},n)))}function Pz(t,e,n){var r;const[i]=LI("mark",n),[o]=LI("theme",n),[a]=LI("labelTransform",n),{key:s,frame:c=!1,theme:l,clip:u,style:f={},labelTransform:h=[]}=e,d=o(Gz(l)),p=Array.from(t.values()),g=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=xF(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=Q({},r,t),Object.assign(e,s)}else{const e=Object.assign(Object.assign({},s),{expectedDomain:s.domain,name:r,guide:ot(t,i)});o.push(e)}}}return o}(p,e),v=function(t){return t.map((t=>{const e=Q(t,t.style);return delete e.style,e}))}(IF(function(t,e,n){var r;for(const[e]of n.entries())if("cell"===e.type)return t.filter((t=>"shape"!==t.name));if(1!==e.length||t.some((t=>"shape"===t.name)))return t;const{defaultShape:i}=e[0];if(!["point","line","rect","hollow"].includes(i))return t;const o={point:"point",line:"hyphen",rect:"square",hollow:"hollow"},a=(null===(r=t.find((t=>"color"===t.name)))||void 0===r?void 0:r.field)||null,s={field:a,name:"shape",type:"constant",domain:[],range:[o[i]]};return[...t,s]}(Array.from(g),p,t),e,n)),y=oz(v,e,d,n),m=function(t,e,n){const[r]=LI("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 VC(p):new GC(p)}(y,e,n),b=c?Q({mainLineWidth:1,mainStroke:"#000"},f):f;!function(t,e,n){const r=Jn(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:v,insetTop:y,height:m,width:b,depth:x}=n,w={xy:sz({width:b,height:m,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:v,insetTop:y}),yz:sz({width:x,height:m,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:x,innerHeight:m,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0}),xz:sz({width:b,height:x,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,marginLeft:0,marginTop:0,marginBottom:0,marginRight:0,innerWidth:b,innerHeight:x,insetBottom:0,insetLeft:0,insetRight:0,insetTop:0})};for(const[t,n]of r.entries()){const[r,i]=t.split("-"),o=w[r][i],[a,s]=la(n,(t=>"string"==typeof t.type&&("center"===i||!(!t.type.startsWith("axis")||!["inner","outer"].includes(i)))));a.length&&cz(a,e,o,i),s.length&&lz(n,0,o)}}(BF(v),m,y),function(t){const e=t.find((({type:t})=>"axisX"===t)),n=t.find((({type:t})=>"axisY"===t)),r=t.find((({type:t})=>"axisZ"===t));e&&n&&r&&(e.plane="xy",n.plane="xy",r.plane="yz",r.origin=[e.bbox.x,e.bbox.y,0],r.eulerAngles=[0,-90,0],r.bbox.x=e.bbox.x,r.bbox.y=e.bbox.y,t.push(Object.assign(Object.assign({},e),{plane:"xz",showLabel:!1,showTitle:!1,origin:[e.bbox.x,e.bbox.y,0],eulerAngles:[-90,0,0]})),t.push(Object.assign(Object.assign({},n),{plane:"yz",showLabel:!1,showTitle:!1,origin:[n.bbox.x+n.bbox.width,n.bbox.y,0],eulerAngles:[0,-90,0]})),t.push(Object.assign(Object.assign({},r),{plane:"xz",actualPosition:"left",showLabel:!1,showTitle:!1,eulerAngles:[90,-90,0]})))}(v);const x=new Map(Array.from(t.values()).flatMap((t=>{const{channels:e}=t;return e.map((({scale:t})=>[t.uid,mF(t,n)]))})));!function(t,e){const n=Array.from(t.values()).flatMap((t=>t.channels)),r=nr(n,(t=>t.map((t=>e.get(t.scale.uid)))),(t=>t.name)).filter((([,t])=>t.some((t=>"function"==typeof t.getOptions().groupTransform))&&t.every((t=>t.getTicks)))).map((t=>t[1]));r.forEach((t=>{const e=t.map((t=>t.getOptions().groupTransform))[0];e(t)}))}(t,x);const w={};for(const t of v){const{scales:e=[]}=t,i=[];for(const t of e){const{name:e,uid:o}=t,a=null!==(r=x.get(o))&&void 0!==r?r:mF(t,n);i.push(a),"y"===e&&a.update(Object.assign(Object.assign({},a.getOptions()),{xScale:w.x})),yF(w,{[e]:a})}t.scaleInstances=i}const k=[],M=new Map;for(const[e,n]of t.entries()){const{children:t,dataDomain:r,modifier:o,key:a,data:c}=e;M.set(a,c);const{index:l,channels:u,tooltip:f}=n,h=Object.fromEntries(u.map((({name:t,scale:e})=>[t,e]))),d=oa(h,(({uid:t})=>x.get(t)));yF(w,d);const p=vF(u,d),g=i(e),[v,b,E]=Cz(g(l,d,p,m)),O=r||v.length,_=o?o(b,O,y):[],S=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},A=t=>f.items.map((e=>e[t])),T=v.map(((t,e)=>{const n=Object.assign({points:b[e],transform:_[e],index:t,markKey:a,viewKey:s,data:c[t]},f&&{title:S(t),items:A(t)});for(const[r,i]of Object.entries(p))n[r]=i[t],E&&(n[`series${G(r)}`]=E[e].map((t=>i[t])));return E&&(n.seriesIndex=E[e]),E&&f&&(n.seriesItems=E[e].map((t=>A(t))),n.seriesTitle=E[e].map((t=>S(t)))),n}));n.data=T,n.index=v;const P=null==t?void 0:t(T,d,y);k.push(...P||[])}return[{layout:y,theme:d,coordinate:m,markState:t,key:s,clip:u,scale:w,style:b,components:v,data:M,labelTransform:qo(h.map(a))},k]}function Nz(t,e,n,r){return Re(this,void 0,void 0,(function*(){const{library:i}=r,{components:o,theme:a,layout:s,markState:c,coordinate:l,key:u,style:f,clip:h,scale:d}=t,{x:p,y:g,width:v,height:y}=s,m=Le(s,["x","y","width","height"]),b=["view","plot","main","content"],x=b.map(((t,e)=>e)),w=b.map((t=>Jo(Object.assign({},a.view,f),t))),k=["a","margin","padding","inset"].map((t=>Qo(m,t))),M=t=>t.style("x",(t=>A[t].x)).style("y",(t=>A[t].y)).style("width",(t=>A[t].width)).style("height",(t=>A[t].height)).each((function(t,e,n){!function(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}(uy(n),w[t])}));let E=0,O=0,_=v,S=y;const A=x.map((t=>{const e=k[t],{left:n=0,top:r=0,bottom:i=0,right:o=0}=e;return E+=n,O+=r,_-=n+o,S-=r+i,{x:E,y:O,width:_,height:S}}));e.selectAll(Xz(qT)).data(x.filter((t=>Zo(w[t]))),(t=>b[t])).join((t=>t.append("rect").attr("className",qT).style("zIndex",-2).call(M)),(t=>t.call(M)),(t=>t.remove()));const T=function(t){let e=-1/0,n=1/0;for(const[r,i]of t){const{animate:t={}}=r,{data:o}=i,{enter:a={},update:s={},exit:c={}}=t,{type:l,duration:u=300,delay:f=0}=s,{type:h,duration:d=300,delay:p=0}=a,{type:g,duration:v=300,delay:y=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:m=v,exitDelay:b=y,exitType:x=g}=t;(void 0===r||r)&&(e=Math.max(e,i+o),n=Math.min(n,o)),(void 0===x||x)&&(e=Math.max(e,m+b),n=Math.min(n,b)),(void 0===a||a)&&(e=Math.max(e,s+c),n=Math.min(n,c))}}return e===-1/0?null:[n,e-n]}(c),P=!!T&&{duration:T[1]};for(const[,t]of tr(o,(t=>`${t.type}-${t.position}`)))t.forEach(((t,e)=>t.index=e));const N=e.selectAll(Xz(HT)).data(o,(t=>`${t.type}-${t.position}-${t.index}`)).join((t=>t.append("g").style("zIndex",(({zIndex:t})=>t||-1)).attr("className",HT).append((t=>DF(Q({animate:P,scale:d},t),l,a,i,c)))),(t=>t.transition((function(t,e,n){const{preserve:r=!1}=t;if(r)return;const o=DF(Q({animate:P,scale:d},t),l,a,i,c),{attributes:s}=o,[u]=n.childNodes;return u.update(s,!1)})))).transitions();n.push(...N.flat().filter(Zo));const C=e.selectAll(Xz(GT)).data([s],(()=>u)).join((t=>t.append("rect").style("zIndex",0).style("fill","transparent").attr("className",GT).call(qz).call(Uz,Array.from(c.keys())).call(Zz,h)),(t=>t.call(Uz,Array.from(c.keys())).call((t=>T?function(t,e){const[n,r]=e;t.transition((function(t,e,i){const{transform:o,width:a,height:s}=i.style,{paddingLeft:c,paddingTop:l,innerWidth:u,innerHeight:f,marginLeft: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,T):qz(t))).call(Zz,h))).transitions();n.push(...C.flat());for(const[o,a]of c.entries()){const{data:s}=a,{key:c,class:l,type:u}=o,f=e.select(`#${c}`),h=Iz(o,a,t,r),d=Fz(o,a,t,i),p=$z(o,a,t,i),g=Wz(o,a,t,i),v=jz(e,f,l,"element"),y=f.selectAll(Xz($T)).selectFacetAll(v).data(s,(t=>t.key),(t=>t.groupKey)).join((t=>t.append(h).attr("className",$T).attr("markType",u).transition((function(t,e,n){return d(t,[n])}))),(t=>t.call((t=>{const e=t.parent(),n=Ko((t=>{const[e,n]=t.getBounds().min;return[e,n]}));t.transition((function(t,r,i){Rz(i,e,n);const o=h(t,r),a=p(t,[i],[o]);return(null==a?void 0:a.length)||(i.nodeName===o.nodeName&&"g"!==o.nodeName?Xo(i,o):(i.parentNode.replaceChild(o,i),o.className=$T,o.markType=u,o.__data__=i.__data__)),a})).attr("markType",u).attr("className",$T)}))),(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",$T).attr("markType",u).transition((function(t,e,n){const{__fromElements__:r}=n,i=p(t,r,[n]);return new fy(r,null,n.parentNode).transition(i).remove(),i}))),(t=>t.transition((function(t,e,n){const r=new fy([],n.__toData__,n.parentNode).append(h).attr("className",$T).attr("markType",u).nodes();return p(t,[n],r)})).remove())).transitions();n.push(...y.flat())}!function(t,e,n,r,i){const[o]=LI("labelTransform",r),{markState:a,labelTransform:s}=t,c=e.select(Xz(zT)).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]=LI("shape",r),{data:a,encode:s}=t,{data:c,defaultLabelShape:l}=e,u=c.map((t=>t.points)),f=oa(s,(t=>t.value)),{theme:h,coordinate:d}=n,p=Object.assign(Object.assign({},i),{document:jI(i),theme:h,coordinate:d});return t=>{const{index:e,points:n}=t,r=a[e],{formatter:i=t=>`${t}`,transform:s,style:c,render:d,selector:g,element:v}=t,y=Le(t,["formatter","transform","style","render","selector","element"]),m=oa(Object.assign(Object.assign({},y),c),(t=>Lz(t,r,e,a,{channel:f,element:v}))),{shape:b=l,text:x}=m,w=Le(m,["shape","text"]),k="string"==typeof i?dA(i):i,M=Object.assign(Object.assign({},w),{text:k(x,r,e,a),datum:r}),E=Object.assign({type:`label.${b}`,render:d},w);return o(E,p)(n,M,Dz(h,"label",b,"label"),u)}}(n,o,t,r,i),f=e.select(`#${s}`).selectAll(Xz($T)).nodes().filter((t=>!t.__removed__));return a.flatMap(((t,e)=>{const n=Le(t,["transform"]);return f.flatMap((r=>{const i=function(t,e,n){const{seriesIndex:r,seriesKey:i,points:o,key:a,index:s}=n.__data__,c=function(t){const e=t.cloneNode(!0),n=t.getAnimations();e.style.visibility="hidden",n.forEach((t=>{const n=t.effect.getKeyframes();e.attr(n[n.length-1])})),t.parentNode.appendChild(e);const r=e.getLocalBounds();e.destroy();const{min:i,max:o}=r;return[i,o]}(n);if(!r)return[Object.assign(Object.assign({},t),{key:`${a}-${e}`,bounds:c,index:s,points:o,dependentElement:n})];const l=function(t){const{selector:e}=t;if(!e)return null;if("function"==typeof e)return e;if("first"===e)return t=>[t[0]];if("last"===e)return t=>[t[t.length-1]];throw new Error(`Unknown selector: ${e}`)}(t),u=r.map(((r,a)=>Object.assign(Object.assign({},t),{key:`${i[a]}-${e}`,bounds:[o[a]],index:r,points:o,dependentElement:n})));return l?l(u):u}(n,e,r);return i.forEach((e=>{l.set(e,(t=>c(Object.assign(Object.assign({},t),{element:r})))),u.set(e,t)})),i}))}))})),h=uy(c).selectAll(Xz(YT)).data(f,(t=>t.key)).join((t=>t.append((t=>l.get(t)(t))).attr("className",YT)),(t=>t.each((function(t,e,n){Xo(n,l.get(t)(t))}))),(t=>t.remove())).nodes(),d=Jn(h,(t=>u.get(t.__data__))),{coordinate:p,layout:g}=t,v={canvas:i.canvas,coordinate:p,layout:g};for(const[t,e]of d){const{transform:n=[]}=t;qo(n.map(o))(e,v)}s&&s(h,v)}(t,e,0,i,r)}))}function Cz([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])=>Zo(t)&&Zo(e)))&&(r.push(o),i.push(a))}return[r,i]}function Lz(t,e,n,r,i){return"function"==typeof t?t(e,n,r,i):"string"!=typeof t?t:na(e)&&void 0!==e[t]?e[t]:t}function jz(t,e,n,r){const i=t.node().parentElement;return i&&"function"==typeof i.findAll?i.findAll((t=>void 0!==t.style.facet&&t.style.facet===n&&t!==e.node())).flatMap((t=>t.getElementsByClassName(r))):[]}function Rz(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 Iz(t,e,n,r){const{library:i}=r,[o]=LI("shape",i),{data:a,encode:s}=t,{defaultShape:c,data:l,shape:u}=e,f=oa(s,(t=>t.value)),h=l.map((t=>t.points)),{theme:d,coordinate:p}=n,{type:g,style:v={}}=t,y=Object.assign(Object.assign({},r),{document:jI(r),coordinate:p,theme:d});return e=>{const{shape:n=c}=v,{shape:r=n,points:i,seriesIndex:s,index:l}=e,p=Le(e,["shape","points","seriesIndex","index"]),m=Object.assign(Object.assign({},p),{index:l}),b=s?s.map((t=>a[t])):a[l],x=s||l,w=oa(v,(t=>Lz(t,b,x,a,{channel:f})));return(u[r]?u[r](w,y):o(Object.assign(Object.assign({},w),{type:Vz(t,r)}),y))(i,m,Dz(d,g,r,c),h)}}function Dz(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 Bz(t,e,n,r,i){var o,a;const[,s]=LI("shape",i),[c]=LI("animation",i),{defaultShape:l,shape:u}=n,{theme:f,coordinate:h}=r,d=`default${G(t)}Animation`,{[d]:p}=(null===(o=u[l])||void 0===o?void 0:o.props)||s(Vz(e,l)).props,{[t]:g={}}=f,v=(null===(a=e.animate)||void 0===a?void 0:a[t])||{},y={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},v);if(!l.type)return null;const u=c(l,y)(n,r,Q(g,{delay:o,duration:a,easing:s}));let f=[];return f=Array.isArray(u)?u:[u],f.filter(Boolean)}}function Fz(t,e,n,r){return Bz("enter",t,e,n,r)}function zz(t){return t.finished.then((()=>{t.cancel()})),t}function $z(t,e,n,r){return Bz("update",t,e,n,r)}function Wz(t,e,n,r){return Bz("exit",t,e,n,r)}function Gz(t={}){if("string"==typeof t)return{type:t};const{type:e="light"}=t,n=Le(t,["type"]);return Object.assign(Object.assign({},n),{type:e})}function Hz(t){const{interaction:e={}}=t;return Object.entries(Q({event:!0,tooltip:!0,sliderFilter:!0,legendFilter:!0,scrollbarFilter:!0},e)).reverse()}function Yz(t,e){return Re(this,void 0,void 0,(function*(){const{data:n}=t,r=Le(t,["data"]);if(null==n)return t;const[,{data:i}]=yield hz(0,{data:n},e);return Object.assign({data:i},r)}))}function qz(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 Vz(t,e){const{type:n}=t;return"string"==typeof e?`${n}.${e}`:e}function Uz(t,e){const n=t=>void 0!==t.class?`${t.class}`:"";if(0===t.nodes().length)return;t.selectAll(Xz(FT)).data(e,(t=>t.key)).join((t=>t.append("g").attr("className",FT).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(Xz(zT)).node()||t.append("g").attr("className",zT).style("zIndex",0)}function Xz(...t){return t.map((t=>`.${t}`)).join("")}function Zz(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 Ug({style:{x:r+i,y:n+o,width:a,height:s}})}))}function Kz(t){const{style:e,scale:n,type:r}=t,i={},o=rt(e,"columnWidthRatio");return o&&"interval"===r&&(i.x=Object.assign(Object.assign({},null==n?void 0:n.x),{padding:1-o})),Object.assign(Object.assign({},t),{scale:Object.assign(Object.assign({},n),i)})}function Qz(t){const e=function(t){return function(...t){return e=>t.reduce(((t,e)=>e(t)),e)}(Kz)(t)}(t);return e.children&&Array.isArray(e.children)&&(e.children=e.children.map((t=>Qz(t)))),e}function Jz(t){const e=Q({},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=Q({},e[o]);e[o]=a,n.set(a,t),r.set(a,o),i.push(a)}}return e}function t$(t,e){const n=new aN;return n.registerPlugin(new cN),new fv({width:t,height:e,container:document.createElement("div"),renderer:n})}function e$(t,e={},n=()=>{},r=t=>{throw t}){const i=jN(t),{width:o=640,height:a=480,depth:s=0}=i,c=Jz(Qz(i)),{canvas:l=t$(o,a),emitter:u=new uN,library:f}=e;e.canvas=l,e.emitter=u;const{width:h,height:d}=l.getConfig();h===o&&d===a||l.resize(o,a),u.emit(fN.BEFORE_RENDER);const p=uy(l.document.documentElement);return l.ready.then((()=>Ez(Object.assign(Object.assign({},c),{width:o,height:a,depth:s}),p,e))).then((()=>{if(s){const[t,e]=l.document.documentElement.getPosition();l.document.documentElement.setPosition(t,e,-s/2)}l.requestAnimationFrame((()=>{l.requestAnimationFrame((()=>{u.emit(fN.AFTER_RENDER),null==n||n()}))}))})).catch((t=>{null==r||r(t)})),"string"==typeof(g=l.getConfig().container)?document.getElementById(g):g;var g}function n$(t,e={},n=!1,r=!0){const{canvas:i,emitter:o}=e;i&&(!function(t){const e=t.getRoot().querySelectorAll(`.${WT}`);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()}))}))}(i),n?i.destroy():i.destroyChildren()),r&&o.off()}function r$(t,e){if(e(t))return!0;if("g"===t.tagName){const{childNodes:n=[]}=t;for(const t of n)if(r$(t,e))return!0}return!1}const i$={visibility:"visible",opacity:1,fillOpacity:1,strokeOpacity:1};function o$(t,e){let n;return r$(t,(t=>{var r;return"g"!==t.tagName&&void 0!==(null===(r=t.style)||void 0===r?void 0:r[e])&&(n=t.style[e],!0)})),null!=n?n:i$[e]}function a$(t,e,n,r){t.style[e]=n,r&&t.children.forEach((t=>a$(t,e,n,r)))}function s$(t){a$(t,"visibility","hidden",!0)}function c$(t){a$(t,"visibility","visible",!0)}function l$(t){return uy(t).selectAll(`.${$T}`).nodes().filter((t=>!t.__removed__))}function u$(t,e){return f$(t,e).flatMap((({container:t})=>l$(t)))}function f$(t,e){return e.filter((e=>e!==t&&e.options.parentKey===t.options.key))}function h$(t){return uy(t).select(`.${GT}`).node()}function d$(t){if("g"===t.tagName)return t.getRenderBounds();const e=t.getGeometryBounds(),n=new uu;return n.setFromTransformedAABB(e,t.getWorldTransform()),n}function p$(t,e){const{offsetX:n,offsetY:r}=e,i=d$(t),{min:[o,a],max:[s,c]}=i;return n<o||n>s||(r<a||r>c)?null:[n-o,r-a]}function g$(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 v$(t){return t=>t.__data__.color}function y$(t){return t=>t.__data__.x}function m$(t){const e=Array.isArray(t)?t:[t],n=new Map(e.flatMap((t=>Array.from(t.markState.keys()).map((e=>[E$(t.key,e.key),e.data])))));return t=>{const{index:e,markKey:r,viewKey:i}=t.__data__;return n.get(E$(i,r))[e]}}const b$={selected:3,unselected:3,active:2,inactive:2,default:1},x$={selection:["selected","unselected"],highlight:["active","inactive"]},w$=(t,e,n)=>{r$(t,(t=>{"setAttribute"in t&&"function"==typeof t.setAttribute&&t.setAttribute(e,n)}))};function k$(t,e){return e.forEach((e=>{const n=e.__interactionStyle__;e.__interactionStyle__=n?Object.assign(Object.assign({},n),t):t})),(t=(t,e)=>t,e=w$)=>M$(void 0,t,e)}function M$(t,e=(t,e)=>t,n=w$){const r="__states__",i="__ordinal__",o=t=>b$[t]||b$.default,a=t=>{var e;return null===(e=Object.entries(x$).find((([e,n])=>n.includes(t))))||void 0===e?void 0:e[0]},s=a=>{var s;const{[r]:c=[],[i]:l={}}=a,u=[...c].sort(((t,e)=>o(e)-o(t))),f=new Map;for(const e of u){const n=(null===(s=null!=t?t:a.__interactionStyle__)||void 0===s?void 0:s[e])||{};for(const[t,e]of Object.entries(n))f.has(t)||f.set(t,e)}const h=Object.assign({},l);for(const[t,e]of f.entries())h[t]=e;if(0!==Object.keys(h).length){for(const[t,r]of Object.entries(h)){const i=o$(a,t),o=e(r,a);n(a,t,o),t in l||(l[t]=i)}a[i]=l}},c=t=>{t[r]||(t[r]=[])};return{setState:(t,...e)=>{c(t),t[r]=[...e],s(t)},updateState:(t,...e)=>{c(t);const n=t[r],i=new Set(e.map((t=>a(t))).filter((t=>void 0!==t))),o=n.filter((t=>!i.has(a(t))));t[r]=[...o,...e],s(t)},removeState:(t,...e)=>{c(t);for(const n of e){const e=t[r].indexOf(n);-1!==e&&t[r].splice(e,1)}s(t)},hasState:(t,e)=>(c(t),-1!==t[r].indexOf(e))}}function E$(t,e){return`${t},${e}`}function O$(t,e){const n=(Array.isArray(t)?t:[t]).flatMap((t=>t.marks.map((e=>[E$(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=E$(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 _$(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 S$(t){var{link:e=!1,valueof:n=(t,e)=>t,coordinate:r}=t,i=Le(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=ir(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=cc(),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=oa(i,(t=>n(t,c))),{fill:g=c.getAttribute("fill")}=p,v=Le(p,["fill"]),y=new Gg({className:"element-link",style:Object.assign({d:s.toString(),fill:g,zIndex:-2},v)});null===(e=c.link)||void 0===e||e.remove(),c.parentNode.appendChild(y),c.link=y}},t=>{var e;null===(e=t.link)||void 0===e||e.remove(),t.link=null}]}function A$(t,e,n){const r=e=>{const{transform:n}=t.style;return n?`${n} ${e}`:e};if(Qc(n)){const{points:i}=t.__data__,[o,a]=Kc(n)?yy(i):i,s=n.getCenter(),c=_s(o,s),l=_s(a,s),u=Ts(c)+Ns(c,l)/2;return r(`translate(${e*Math.cos(u)}, ${e*Math.sin(u)})`)}return Kc(n)?r(`translate(${e}, 0)`):r(`translate(0, ${-e})`)}function T$(t){var{document:e,background:n,scale:r,coordinate:i,valueof:o}=t,a=Le(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(!eT(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(!eT(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 ky(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=Le(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=oa(a,(e=>o(e,t))),{fill:n="#CCD6EC",fillOpacity:i=.3,zIndex:c=-2,padding:f=.001,lineWidth:h=0}=e,d=Le(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(eT)})()?l:u,v=g(t,p);v.className=s,t.parentNode.parentNode.appendChild(v),t.background=v},t=>{var e;null===(e=t.background)||void 0===e||e.remove(),t.background=null},t=>t.className===s]}function P$(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 N$(t){P$(t,t.cursor)}function C$(t,e,n){return t.find((t=>Object.entries(e).every((([e,r])=>n(t)[e]===r))))}function L$(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function j$(t,e=!1){const n=y(t,(t=>!!t)).map(((t,e)=>[0===e?"M":"L",...t]));return e&&n.push(["Z"]),n}function R$(t){return t.querySelectorAll(".element")}function I$(t,e){if(e(t))return t;let n=t.parent;for(;n&&!e(n);)n=n.parent;return n}const D$=["interval","point","density"];function B$({elementsof:t,root:e,coordinate:n,scale:r,validFindByXMarks:i=D$}){var o,a;let s=t(e);const c=t=>i.includes(t.markType);if(s.find(c)){s=s.filter(c);const t=r.x,i=r.series,l=null!==(a=null===(o=null==t?void 0:t.getBandWidth)||void 0===o?void 0:o.call(t))&&void 0!==a?a:0,u=i?t=>{const e=Math.round(1/i.valueBandWidth);return t.__data__.x+t.__data__.series*l+l/(2*e)}:t=>t.__data__.x+l/2;return s.sort(((t,e)=>u(t)-u(e))),t=>{const r=p$(e,t);if(!r)return;const[i]=n.invert(r),o=(0,Dn(u).center)(s,i);return s[o]}}return t=>{const{target:e}=t;return I$(e,(t=>!!t.classList&&t.classList.includes("element")))}}function F$(t){var{delay:e,createGroup:n,createRegionGroup:r,background:i=!1,link:o=!1}=t,a=Le(t,["delay","createGroup","createRegionGroup","background","link"]);return(t,s,c)=>{const{container:l,view:u,options:f}=t,{scale:h,coordinate:d}=u;return function(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:o=!1,background:a=!1,delay:s=60,scale:c,coordinate:l,emitter:u,state:f={},region:h=!1,regionEleFilter:d=t=>D$.includes(t.markType)}){var p,g;const v=null!==(p=e(t))&&void 0!==p?p:[],y=h?v.filter(d):v,m=new Set(y),b=h?i:r,x=Jn(y,b),w=B$({elementsof:e,root:t,coordinate:l,scale:c}),k=_$(y,n),[M,E]=S$(Object.assign({elements:y,valueof:k,link:o,coordinate:l},Qo(f.active,"link"))),[O,_,S]=T$(Object.assign({document:t.ownerDocument,scale:c,coordinate:l,background:a,valueof:k},Qo(f.active,"background"))),A=Q(f,{active:Object.assign({},(null===(g=f.active)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=f.active.offset(...t),[,n]=t;return A$(y[n],e,l)}})}),T=k$(A,y),{updateState:P,removeState:N,hasState:C}=T(k);let L;const j=t=>{const{nativeEvent:e=!0}=t;let r=t.target;if(h&&(r=w(t)),!m.has(r))return;L&&clearTimeout(L);const i=b(r),o=x.get(i),a=new Set(o);for(const t of y)a.has(t)?C(t,"active")||P(t,"active"):(P(t,"inactive"),E(t)),t!==r&&_(t);O(r),M(o),e&&u.emit("element:highlight",{nativeEvent:e,data:{data:n(r),group:o.map(n)}})},R=()=>{L&&clearTimeout(L),L=setTimeout((()=>{I(),L=null}),s)},I=(t=!0)=>{for(const t of y)N(t,"active","inactive"),_(t),E(t);t&&u.emit("element:unhighlight",{nativeEvent:t})},D=t=>{let e=t.target;h&&(e=w(t)),e?a&&!S(e)||(a||m.has(e))&&(s>0?R():I()):s>0?R():I()},B=()=>{I()};t.addEventListener("pointerover",j),t.addEventListener("pointermove",j),t.addEventListener("pointerout",D),t.addEventListener("pointerleave",B);const F=t=>{const{nativeEvent:e}=t;e||I(!1)},z=t=>{const{nativeEvent:e}=t;if(e)return;const{data:r}=t.data,i=C$(y,r,n);i&&j({target:i,nativeEvent:!1})};return u.on("element:highlight",z),u.on("element:unhighlight",F),()=>{t.removeEventListener("pointerover",j),t.removeEventListener("pointermove",j),t.removeEventListener("pointerout",D),t.removeEventListener("pointerleave",B),u.off("element:highlight",z),u.off("element:unhighlight",F);for(const t of y)_(t),E(t)}}(h$(l),Object.assign({elements:l$,datum:m$(u),groupKey:n?n(u):void 0,regionGroupKey:r?r(u):t=>t.__data__.x,coordinate:d,scale:h,state:O$(f,[["active",i?{}:{lineWidth:"1",stroke:"#000"}],"inactive"]),background:i,link:o,delay:e,emitter:c},a))}}function z$(t){return F$(Object.assign(Object.assign({},t),{createGroup:y$}))}function $$(t){return F$(Object.assign(Object.assign({},t),{createGroup:v$}))}function W$(t,{elements:e,datum:n,groupKey:r=t=>t,regionGroupKey:i=t=>t,link:o=!1,single:a=!1,multipleSelectHotkey:s,coordinate:c,background:l=!1,scale:u,emitter:f,state:h={},region:d=!1,regionEleFilter:p=t=>D$.includes(t.markType)}){var g;const v=e(t),y=new Set(v),m=B$({elementsof:e,root:t,coordinate:c,scale:u}),b=Jn(v,r),x=Jn(v,i),w=_$(v,n),[k,M]=S$(Object.assign({link:o,elements:v,valueof:w,coordinate:c},Qo(h.selected,"link"))),[E,O]=T$(Object.assign({document:t.ownerDocument,background:l,coordinate:c,scale:u,valueof:w},Qo(h.selected,"background"))),_=Q(h,{selected:Object.assign({},(null===(g=h.selected)||void 0===g?void 0:g.offset)&&{transform:(...t)=>{const e=h.selected.offset(...t),[,n]=t;return A$(v[n],e,c)}})}),S=k$(_,v),{updateState:A,removeState:T,hasState:P}=S(w);let N=!a,C=null;const L=(t=!0)=>{for(const t of v)T(t,"selected","unselected"),M(t),O(t);t&&f.emit("element:unselect",{nativeEvent:!0})},j=({event:t,element:e,nativeEvent:i=!0,filter:o=t=>!0,groupBy:a=r,groupMap:s=b})=>{const c=v.filter(o);if(P(e,"selected"))L();else{const r=a(e),o=s.get(r),l=new Set(o);for(const t of c)l.has(t)?A(t,"selected"):(A(t,"unselected"),M(t)),t!==e&&O(t);if(k(o),E(e),!i)return;f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:[n(e),...o.map(n)]}}))}},R=({event:t,element:e,nativeEvent:i=!0,filter:a=t=>!0,groupBy:s=r,groupMap:c=b})=>{const l=s(e),u=c.get(l),h=new Set(u),d=v.filter(a);if(P(e,"selected")){const t=v.some((t=>!h.has(t)&&P(t,"selected")));if(!t)return L();for(const t of u)A(t,"unselected"),M(t),O(t)}else{const t=u.some((t=>P(t,"selected")));for(const t of d)h.has(t)?A(t,"selected"):P(t,"selected")||A(t,"unselected");!t&&o&&k(u),E(e)}i&&f.emit("element:select",Object.assign(Object.assign({},t),{nativeEvent:i,data:{data:v.filter((t=>P(t,"selected"))).map(n)}}))},I=t=>{if(y.has(t))return t;for(const e of y){let n=null;if(r$(e,(r=>{r===t&&(n=e)})),n)return n}return t},D=t=>{const{target:e,nativeEvent:n=!0}=t,o=N?R:j;let a=e;const s=(t=>{if(y.has(t))return!0;for(const e of y)if(r$(e,(e=>e===t)))return!0;return!1})(e);return!d||s?s?o({event:t,element:I(a),nativeEvent:n,groupBy:r}):L():(a=m(t),y.has(a)?o({event:t,element:a,nativeEvent:n,filter:p,groupBy:i,groupMap:x}):L())},B=Array.isArray(s)?s:[s],F=t=>{B.includes(t.code)&&!C&&(C=t.code,N=!0)},z=t=>{t.code===C&&(C=null,N=!1)};t.addEventListener("click",D),s&&(N=!1,document.addEventListener("keydown",F),document.addEventListener("keyup",z));const $=t=>{const{nativeEvent:e,data:r}=t;if(e)return;const i=N?r.data:r.data.slice(0,1);for(const t of i){const e=C$(v,t,n);D({target:e,nativeEvent:!1})}},W=()=>{L(!1)};return f.on("element:select",$),f.on("element:unselect",W),()=>{for(const t of v)M(t);t.removeEventListener("click",D),s&&(document.removeEventListener("keydown",F),document.removeEventListener("keyup",z)),f.off("element:select",$),f.off("element:unselect",W)}}function G$(t){var{createGroup:e,createRegionGroup:n,background:r=!1,link:i=!1}=t,o=Le(t,["createGroup","createRegionGroup","background","link"]);return(t,a,s)=>{const{container:c,view:l,options:u}=t,{coordinate:f,scale:h}=l;return W$(h$(c),Object.assign({elements:l$,datum:m$(l),groupKey:e?e(l):void 0,regionGroupKey:n?n(l):t=>t.__data__.x,coordinate:f,scale:h,state:O$(u,[["selected",r?{}:{lineWidth:"1",stroke:"#000"}],"unselected"]),background:r,link:i,emitter:s},o))}}function H$(t){return G$(Object.assign(Object.assign({},t),{createGroup:y$}))}function Y$(t){return G$(Object.assign(Object.assign({},t),{createGroup:v$}))}function q$(t){var{wait:e=20,leading:n,trailing:r=!1,labelFormatter:i=t=>`${t}`}=t,o=Le(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])=>t.type===e)).map((([t])=>{const{encode:e}=t;return Object.fromEntries(n.map((t=>{const n=e[t];return[t,n?n.value:void 0]})))}));return r}(u,"line",["x","y","series"]);if(!d)return;const{y:p,x:g,series:v=[]}=d,y=p.map(((t,e)=>e)),m=ir(y.map((t=>g[t]))),b=h$(s),x=s.getElementsByClassName($T),w=Jn(s.getElementsByClassName(YT),(t=>t.__data__.key.split("-")[0])),k=new $g({style:Object.assign({x1:0,y1:0,x2:0,y2:b.getAttribute("height"),stroke:"black",lineWidth:1},Qo(o,"rule"))}),M=new Zg({style:Object.assign({x:0,y:b.getAttribute("height"),text:"",fontSize:10},Qo(o,"label"))});k.append(M),b.appendChild(k);const E=(t,e,n)=>{const[r]=t.invert(n),i=e.invert(r);return m[Gn(m,i)]},O=(t,e)=>{k.setAttribute("x1",t[0]),k.setAttribute("x2",t[0]),M.setAttribute("text",i(e))};let _;const S=at((t=>{const e=p$(b,t);e&&(t=>{const{scale:e,coordinate:n}=_,{x:r,y:i}=e,o=E(n,r,t);O(t,o);for(const t of x){const{seriesIndex:e,key:r}=t.__data__,a=e[Dn((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=w.get(r)||[];for(const t of h)t.setAttribute("dy",f)}})(e)}),e,{leading:n,trailing:r});return(t=>{Re(this,void 0,void 0,(function*(){const{x:e}=f,n=E(h,e,t);O(t,n),l("chartIndex",(t=>{const e=Q({},t),r=e.marks.find((t=>"line"===t.type)),i=vr(er(y,(t=>vr(t,(t=>+p[t]))/mr(t,(t=>+p[t]))),(t=>v[t])).values());Q(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[Dn((t=>g[+t])).center(t,n)]];for(const t of e.marks)t.animate=!1;return e}));const r=yield c("chartIndex");_=r.view}))})([0,0]),b.addEventListener("pointerenter",S),b.addEventListener("pointermove",S),b.addEventListener("pointerleave",S),()=>{k.remove(),b.removeEventListener("pointerenter",S),b.removeEventListener("pointermove",S),b.removeEventListener("pointerleave",S)}}}function V$({wait:t=30,leading:e,trailing:n=!1}){return r=>{const{options:i,update:o,setState:a,container:s}=r,c=h$(s),l=at((t=>{const e=p$(c,t);if(!e)return a("fisheye"),void o();a("fisheye",(t=>{const n=Q({},t,{interaction:{tooltip:{preserve:!0}}});for(const t of n.marks)t.animate=!1;const[r,i]=e,o=function(t){const{coordinate:e={}}=t,{transform:n=[]}=e,r=n.find((t=>"fisheye"===t.type));if(r)return r;const i={type:"fisheye"};return n.push(i),e.transform=n,t.coordinate=e,i}(n);return o.focusX=r,o.focusY=i,o.visual=!0,n})),o()}),t,{leading:e,trailing:n});return c.addEventListener("pointerenter",l),c.addEventListener("pointermove",l),c.addEventListener("pointerleave",l),()=>{c.removeEventListener("pointerenter",l),c.removeEventListener("pointermove",l),c.removeEventListener("pointerleave",l)}}}function U$(t,e){var n;if(e)return"string"==typeof e?document.querySelector(e):e;const r=null===(n=t.ownerDocument)||void 0===n?void 0:n.defaultView;if(!r)return;return r.getContextService().getDomElement().parentElement}function X$(t,e,n,r,i,o,a,s={},c=[10,10]){const l=new nk({className:"tooltip",style:{x:e,y:n,container:a,data:[],bounding:o,position:r,enterable:i,title:"",offset:c,template:{prefixCls:"g2-"},style:Q({".g2-tooltip":{},".g2-tooltip-title":{overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"}},s)}});return t.appendChild(l.HTMLTooltipElement),l}function Z$({root:t,data:e,x:n,y:r,render:i,event:o,single:a,position:s="right-bottom",enterable:c=!1,css:l,mount:u,bounding:f,offset:h}){const d=U$(t,u),p=U$(t),g=a?p:t,v=f||function(t){const e=t.getRenderBounds(),{min:[n,r],max:[i,o]}=e;return{x:n,y:r,width:i-n,height:o-r}}(t),y=function(t,e){const n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return{x:n.x-r.x,y:n.y-r.y}}(p,d),{tooltipElement:m=X$(d,n,r,s,c,v,y,l,h)}=g,{items:b,title:x=""}=e;m.update(Object.assign({x:n,y:r,data:b,title:x,position:s,enterable:c,container:y},void 0!==i&&{content:i(o,{items:b,title:x})})),g.tooltipElement=m}function K$({root:t,single:e,emitter:n,nativeEvent:r=!0,event:i=null}){r&&n.emit("tooltip:hide",{nativeEvent:r});const o=U$(t),a=e?o:t,{tooltipElement:s}=a;s&&s.hide(null==i?void 0:i.clientX,null==i?void 0:i.clientY),oW(t),aW(t),sW(t)}function Q$({root:t,single:e}){const n=U$(t),r=e?n:t;if(!r)return;const{tooltipElement:i}=r;i&&(i.destroy(),r.tooltipElement=void 0),oW(t),aW(t),sW(t)}function J$(t){const{value:e}=t;return Object.assign(Object.assign({},t),{value:void 0===e?"undefined":e})}function tW(t){const e=t.getAttribute("fill"),n=t.getAttribute("stroke"),{__data__:r}=t,{color:i=(e&&"transparent"!==e?e:n)}=r;return i}function eW(t,e=t=>t){const n=new Map(t.map((t=>[e(t),t])));return Array.from(n.values())}function nW(t,e,n,r=t.map((t=>t.__data__)),i={}){const o=t=>t instanceof Date?+t:t,a=eW(r.map((t=>t.title)),o).filter(Zo),s=r.flatMap(((r,o)=>{const a=t[o],{items:s=[],title:c}=r,l=s.filter(Zo),u=void 0!==n?n:s.length<=1;return l.map((t=>{var{color:n=tW(a)||i.color,name:o}=t,s=Le(t,["color","name"]);const l=Ho(e,r),f=u&&!(uz in s)?l||o:o||l;return Object.assign(Object.assign({},s),{color:n,name:f||c})}))})).map(J$);return Object.assign(Object.assign({},a.length>0&&{title:a.join(",")}),{items:eW(s,(t=>`(${o(t.name)}, ${o(t.value)}, ${o(t.color)})`))})}function rW(t,e,n,r){var{plotWidth:i,plotHeight:o,mainWidth:a,mainHeight:s,startX:c,startY:l,transposed:u,polar:f,insetLeft:h,insetTop:d}=r,p=Le(r,["plotWidth","plotHeight","mainWidth","mainHeight","startX","startY","transposed","polar","insetLeft","insetTop"]);const g=Object.assign({lineWidth:1,stroke:"#1b1e23",strokeOpacity:.5},p),v=((t,e)=>{if(1===e.length)return e[0];const n=e.map((e=>As(e,t))),r=br(n,(t=>t));return e[r]})(n,e);if(f){const[e,n,r]=(()=>{const t=c+h+a/2,e=l+d+s/2;return[t,e,As([t,e],v)]})(),i=t.ruleX||((e,n,r)=>{const i=new Cg({style:Object.assign({cx:e,cy:n,r:r},g)});return t.appendChild(i),i})(e,n,r);i.style.cx=e,i.style.cy=n,i.style.r=r,t.ruleX=i}else{const[e,n,r,a]=u?[c+v[0],c+v[0],l,l+o]:[c,c+i,v[1]+l,v[1]+l],s=t.ruleX||((e,n,r,i)=>{const o=new $g({style:Object.assign({x1:e,x2:n,y1:r,y2:i},g)});return t.appendChild(o),o})(e,n,r,a);s.style.x1=e,s.style.x2=n,s.style.y1=r,s.style.y2=a,t.ruleX=s}}function iW(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=Le(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])),v=e.map((t=>t[0])),y=Er(g),m=Er(v),[b,x,w,k]=(()=>{if(u){const t=Math.min(o,a)/2,e=s+f+o/2,n=c+h+a/2,r=Ts(_s([m,y],[e,n]));return[e,e+t*Math.cos(r),n,n+t*Math.sin(r)]}return l?[s,s+r,y+c,y+c]:[m+s,m+s,c,c+i]})();if(v.length>0){const e=t.ruleY||(()=>{const e=new $g({style:Object.assign({x1:b,x2:x,y1:w,y2:k},p)});return t.appendChild(e),e})();e.style.x1=b,e.style.x2=x,e.style.y1=w,e.style.y2=k,t.ruleY=e}}function oW(t){t.ruleY&&(t.ruleY.remove(),t.ruleY=void 0)}function aW(t){t.ruleX&&(t.ruleX.remove(),t.ruleX=void 0)}function sW(t){t.markers&&(t.markers.forEach((t=>t.remove())),t.markers=[])}function cW(t,e){return Array.from(t.values()).some((t=>{var n;return null===(n=t.interaction)||void 0===n?void 0:n[e]}))}function lW(t,e){return void 0===t?e:t}function uW(t){const{title:e,items:n}=t;return 0===n.length&&void 0===e}function fW({root:t,event:e,elements:n,coordinate:r,scale:i,shared:o}){var a,s;const c=n.every((t=>"interval"===t.markType))&&!Qc(r),l=i.x,u=i.series,f=null!==(s=null===(a=null==l?void 0:l.getBandWidth)||void 0===a?void 0:a.call(l))&&void 0!==s?s:0,h=u?t=>{const e=Math.round(1/u.valueBandWidth);return t.__data__.x+t.__data__.series*f+f/(2*e)}:t=>t.__data__.x+f/2;c&&n.sort(((t,e)=>h(t)-h(e)));const d=t=>{const{target:e}=t;return I$(e,(t=>!!t.classList&&t.classList.includes("element")))},p=c?e=>{const i=p$(t,e);if(!i)return;const[a]=r.invert(i),s=(0,Dn(h).center)(n,a),c=n[s];if(!o){const t=n.find((t=>t!==c&&h(t)===h(c)));if(t)return d(e)}return c}:d;return p(e)}function hW({root:t,event:e,elements:n,coordinate:r,scale:i,startX:o,startY:a}){const s=Kc(r),c=[],l=[];for(const t of n){const{__data__:e}=t,{seriesX:n,title:r,items:i}=e;n?c.push(t):(r||i)&&l.push(t)}const u=l.length&&l.every((t=>"interval"===t.markType))&&!Qc(r),f=t=>t.__data__.x,h=!!i.x.getBandWidth&&l.length>0;c.sort(((t,e)=>{const n=s?0:1,r=t=>t.getBounds().min[n];return s?r(e)-r(t):r(t)-r(e)}));const d=t=>{const e=s?1:0,{min:n,max:r}=t.getLocalBounds();return ir([n[e],r[e]])};u?n.sort(((t,e)=>f(t)-f(e))):l.sort(((t,e)=>{const[n,r]=d(t),[i,o]=d(e),a=(n+r)/2,c=(i+o)/2;return s?c-a:a-c}));const p=new Map(c.map((t=>{const{__data__:e}=t,{seriesX:n}=e,r=n.map(((t,e)=>e)),i=ir(r,(t=>n[+t]));return[t,[i,n]]}))),{x:g}=i,v=(null==g?void 0:g.getBandWidth)?g.getBandWidth()/2:0,y=t=>{const[e]=r.invert(t);return e-v},m=(t,e,n,r)=>{const{_x:i}=t,o=void 0!==i?g.map(i):y(e),a=r.filter(Zo),[s,c]=ir([a[0],a[a.length-1]]);if(!h&&(o<s||o>c)&&!(s===c))return null;const l=Dn((t=>r[+t])).center;return n[l(n,o)]},b=u?(t,e)=>{const n=e[(0,Dn(f).center)(e,y(t))];return Jn(e,f).get(f(n))}:(t,e)=>{const n=t[s?1:0],r=e.filter((t=>{const[e,r]=d(t);return n>=e&&n<=r}));if(!h||r.length>0)return r;const i=Dn((t=>{const[e,n]=d(t);return(e+n)/2})).center;return[e[i(e,n)]].filter(Zo)},x=(t,e)=>{const{__data__:n}=t;return Object.fromEntries(Object.entries(n).filter((([t])=>t.startsWith("series")&&"series"!==t)).map((([t,n])=>{const r=n[e];return[W(t.replace("series","")),r]})))},w=p$(t,e);if(!w)return;const k=[w[0]-o,w[1]-a];if(!k)return;const M=b(k,l),E=[],O=[];for(const t of c){const[n,i]=p.get(t),o=m(e,k,n,i);if(null!==o){E.push(t);const e=x(t,o),{x:n,y:i}=e,a=r.map([(n||0)+v,i||0]);O.push([Object.assign(Object.assign({},e),{element:t}),a])}}const _=Array.from(new Set(O.map((t=>t[0].x)))),S=_[br(_,(t=>Math.abs(t-y(k))))],A=O.filter((t=>t[0].x===S)),T=[...A.map((t=>t[0])),...M.map((t=>t.__data__))];return{selectedElements:[...E,...M],selectedData:T,filteredSeriesData:A,abstractX:y}}function dW(t,e){var{elements:n,sort:r,filter:i,scale:o,coordinate:a,crosshairs:s,crosshairsX:c,crosshairsY:l,render:u,groupName:f,emitter:h,wait:d=50,leading:p=!0,trailing:g=!1,startX:v=0,startY:y=0,body:m=!0,single:b=!0,position:x,enterable:w,mount:k,bounding:M,theme:E,offset:O,disableNative:_=!1,marker:S=!0,preserve:A=!1,style:T={},css:P={}}=e,N=Le(e,["elements","sort","filter","scale","coordinate","crosshairs","crosshairsX","crosshairsY","render","groupName","emitter","wait","leading","trailing","startX","startY","body","single","position","enterable","mount","bounding","theme","offset","disableNative","marker","preserve","style","css"]);const C=n(t),L=Q(T,N),j=Qc(a),R=Kc(a),{innerWidth:I,innerHeight:D,width:B,height:F,insetLeft:z,insetTop:$}=a.getOptions(),W=at((e=>{var n;const d=p$(t,e);if(!d)return;const p=d$(t),g=p.min[0],_=p.min[1],{selectedElements:A,selectedData:T,filteredSeriesData:N,abstractX:W}=hW({root:t,event:e,elements:C,coordinate:a,scale:o,startX:v,startY:y}),H=nW(A,o,f,T,E);if(r&&H.items.sort(((t,e)=>r(t)-r(e))),i&&(H.items=H.items.filter(i)),0===A.length||uW(H))return void G(e);if(m&&Z$({root:t,data:H,x:d[0]+g,y:d[1]+_,render:u,event:e,single:b,position:x,enterable:w,mount:k,bounding:M,css:P,offset:O}),s||c||l){const e=Qo(L,"crosshairs"),n=Object.assign(Object.assign({},e),Qo(L,"crosshairsX")),r=Object.assign(Object.assign({},e),Qo(L,"crosshairsY")),i=N.map((t=>t[1]));c&&rW(t,i,d,Object.assign(Object.assign({},n),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:$,startX:v,startY:y,transposed:R,polar:j})),l&&iW(t,i,Object.assign(Object.assign({},r),{plotWidth:I,plotHeight:D,mainWidth:B,mainHeight:F,insetLeft:z,insetTop:$,startX:v,startY:y,transposed:R,polar:j}))}if(S){const e=Qo(L,"marker");!function(t,{data:e,style:n,theme:r}){t.markers&&t.markers.forEach((t=>t.remove()));const{type:i=""}=n,o=e.filter((t=>{const[{x:e,y:n}]=t;return Zo(e)&&Zo(n)})).map((t=>{const[{color:e,element:o},a]=t,s=e||o.style.fill||o.style.stroke||r.color,c="hollow"===i?"transparent":s,l="hollow"===i?s:"#fff";return new Cg({className:"g2-tooltip-marker",style:Object.assign({cx:a[0],cy:a[1],fill:c,r:4,stroke:l,lineWidth:2,pointerEvents:"none"},n)})}));for(const e of o)t.appendChild(e);t.markers=o}(t,{data:N,style:e,theme:E})}const Y=null===(n=N[0])||void 0===n?void 0:n[0].x,q=null!=Y?Y:W(focus);h.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},H),{data:{x:nT(o.x,q,!0)}})}))}),d,{leading:p,trailing:g}),G=e=>{K$({root:t,single:b,emitter:h,event:e})},H=()=>{Q$({root:t,single:b})},Y=e=>{var n,{nativeEvent:r,data:i,offsetX:s,offsetY:c}=e,l=Le(e,["nativeEvent","data","offsetX","offsetY"]);if(r)return;const u=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.x,f=o.x.map(u),[h,d]=a.map([f,.5]),p=t.getRenderBounds(),g=p.min[0],v=p.min[1];W(Object.assign(Object.assign({},l),{offsetX:void 0!==s?s:g+h,offsetY:void 0!==c?c:v+d,_x:u}))},q=()=>{K$({root:t,single:b,emitter:h,nativeEvent:!1})},V=()=>{Z(),H()},U=()=>{X()},X=()=>{_||(t.addEventListener("pointerdown",W),t.addEventListener("pointerenter",W),t.addEventListener("pointermove",W),t.addEventListener("pointerleave",(e=>{p$(t,e)||G(e)})),t.addEventListener("pointerup",G))},Z=()=>{_||(t.removeEventListener("pointerdown",W),t.removeEventListener("pointerenter",W),t.removeEventListener("pointermove",W),t.removeEventListener("pointerleave",G),t.removeEventListener("pointerup",G))};return X(),h.on("tooltip:show",Y),h.on("tooltip:hide",q),h.on("tooltip:disable",V),h.on("tooltip:enable",U),()=>{Z(),h.off("tooltip:show",Y),h.off("tooltip:hide",q),h.off("tooltip:disable",V),h.off("tooltip:enable",U),A?K$({root:t,single:b,emitter:h,nativeEvent:!1}):H()}}function pW(t,{elements:e,coordinate:n,scale:r,render:i,groupName:o,sort:a,filter:s,emitter:c,wait:l=50,leading:u=!0,trailing:f=!1,groupKey:h=t=>t,single:d=!0,position:p,enterable:g,datum:v,view:y,mount:m,bounding:b,theme:x,offset:w,shared:k=!1,body:M=!0,disableNative:E=!1,preserve:O=!1,css:_={}}){const S=e(t),A=Jn(S,h),T=at((e=>{const l=fW({root:t,event:e,elements:S,coordinate:n,scale:r,shared:k});if(!l)return void K$({root:t,single:d,emitter:c,event:e});const u=h(l),f=A.get(u);if(!f)return;const v=1!==f.length||k?nW(f,r,o,void 0,x):function(t){const{__data__:e}=t,{title:n,items:r=[]}=e,i=r.filter(Zo).map((e=>{var{color:n=tW(t)}=e,r=Le(e,["color"]);return Object.assign(Object.assign({},r),{color:n})})).map(J$);return Object.assign(Object.assign({},n&&{title:n}),{items:i})}(f[0]);if(a&&v.items.sort(((t,e)=>a(t)-a(e))),s&&(v.items=v.items.filter(s)),uW(v))return void K$({root:t,single:d,emitter:c,event:e});const{offsetX:E,offsetY:O}=e;M&&Z$({root:t,data:v,x:E,y:O,render:i,event:e,single:d,position:p,enterable:g,mount:m,bounding:b,css:_,offset:w}),c.emit("tooltip:show",Object.assign(Object.assign({},e),{nativeEvent:!0,data:Object.assign(Object.assign({},v),{data:Go(l,y)})}))}),l,{leading:u,trailing:f}),P=e=>{K$({root:t,single:d,emitter:c,event:e})},N=()=>{E||(t.addEventListener("pointerdown",T),t.addEventListener("pointermove",T),t.addEventListener("pointerleave",P),t.addEventListener("pointerup",P))},C=()=>{E||(t.removeEventListener("pointerdown",T),t.removeEventListener("pointermove",T),t.removeEventListener("pointerleave",P),t.removeEventListener("pointerup",P))},L=({nativeEvent:e,offsetX:n,offsetY:r,data:i})=>{if(e)return;const{data:o}=i,a=C$(S,o,v);if(!a)return;const s=a.getBBox(),{x:c,y:l,width:u,height:f}=s,h=t.getBBox();T({target:a,offsetX:void 0!==n?n+h.x:c+u/2,offsetY:void 0!==r?r+h.y:l+f/2})},j=({nativeEvent:e}={})=>{e||K$({root:t,single:d,emitter:c,nativeEvent:!1})};return c.on("tooltip:show",L),c.on("tooltip:hide",j),c.on("tooltip:enable",(()=>{N()})),c.on("tooltip:disable",(()=>{C(),Q$({root:t,single:d})})),N(),()=>{C(),c.off("tooltip:show",L),c.off("tooltip:hide",j),O?K$({root:t,single:d,emitter:c,nativeEvent:!1}):Q$({root:t,single:d})}}function gW(t){const{shared:e,crosshairs:n,crosshairsX:r,crosshairsY:i,series:o,name:a,item:s=()=>({}),facet:c=!1}=t,l=Le(t,["shared","crosshairs","crosshairsX","crosshairsY","series","name","item","facet"]);return(t,a,u)=>{const{container:f,view:h}=t,{scale:d,markState:p,coordinate:g,theme:v}=h,y=cW(p,"seriesTooltip"),m=cW(p,"crosshairs"),b=h$(f),x=lW(o,y),w=lW(n,m);if(x&&function(t){return Array.from(t.values()).some((t=>{var e;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)&&t.tooltip}))}(p)&&!c)return dW(b,Object.assign(Object.assign({},l),{theme:v,elements:l$,scale:d,coordinate:g,crosshairs:w,crosshairsX:lW(lW(r,n),!1),crosshairsY:lW(i,w),item:s,emitter:u}));if(x&&c){const e=a.filter((e=>e!==t&&e.options.parentKey===t.options.key)),o=u$(t,a),c=e[0].view.scale,f=b.getBounds(),h=f.min[0],d=f.min[1];return Object.assign(c,{facet:!0}),dW(b.parentNode.parentNode,Object.assign(Object.assign({},l),{theme:v,elements:()=>o,scale:c,coordinate:g,crosshairs:lW(n,m),crosshairsX:lW(lW(r,n),!1),crosshairsY:lW(i,w),item:s,startX:h,startY:d,emitter:u}))}return pW(b,Object.assign(Object.assign({},l),{datum:m$(h),elements:l$,scale:d,coordinate:g,groupKey:e?t=>t.__data__.x:void 0,item:s,emitter:u,view:h,theme:v,shared:e}))}}F$.props={reapplyWhenUpdate:!0},z$.props={reapplyWhenUpdate:!0},$$.props={reapplyWhenUpdate:!0},G$.props={reapplyWhenUpdate:!0},H$.props={reapplyWhenUpdate:!0},Y$.props={reapplyWhenUpdate:!0},q$.props={reapplyWhenUpdate:!0},gW.props={reapplyWhenUpdate:!0};const vW="legend-category";function yW(t){return t.getElementsByClassName("legend-category-item-marker")[0]}function mW(t){return t.getElementsByClassName("legend-category-item-label")[0]}function bW(t){return t.getElementsByClassName("items-item")}function xW(t){return t.getElementsByClassName(vW)}function wW(t){return t.getElementsByClassName("legend-continuous")}function kW(t){let e=t.parentNode;for(;e&&!e.__data__;)e=e.parentNode;return e.__data__}function MW(t,{legend:e,channel:n,value:r,ordinal:i,channels:o,allChannels:a,facet:s=!1}){return Re(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=[],data:l=[]}=t,u=e.findIndex((({type:t})=>t.startsWith("group")||t.startsWith("bin"))),f=[...e];l.length&&f.splice(u+1,0,{type:"filter",[n]:{value:r,ordinal:i}});const h=Object.fromEntries(o.map((t=>[t,{domain:c.scale[t].getOptions().domain}])));return Q({},t,Object.assign(Object.assign({transform:f,scale:h},!i&&{animate:!1}),{legend:!s&&Object.fromEntries(a.map((t=>[t,{preserve:!0}])))}))}));return Object.assign(Object.assign({},t),{marks:l})})),yield l()}))}function EW(t,e){for(const n of t)MW(n,Object.assign(Object.assign({},e),{facet:!0}))}function OW(){return(t,e,n)=>{const{container:r}=t,i=e.filter((e=>e!==t)),o=i.length>0,a=t=>kW(t).scales.map((t=>t.name)),s=[...xW(r),...wW(r)],c=s.flatMap(a),l=at(o?EW:MW,50,{trailing:!0}),u=s.map((e=>{const{name:s,domain:u}=kW(e).scales[0],f={legend:e,channel:s,channels:a(e),allChannels:c};return e.className===vW?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:Qo(h,"marker")},p={unselected:Qo(h,"label")},{setState:g,removeState:v}=M$(d,void 0),{setState:y,removeState:m}=M$(p,void 0),b=Array.from(e(t));let x=b.map(i);const w=()=>{for(const t of b){const e=i(t),o=n(t),a=r(t);x.includes(e)?(v(o,"unselected"),m(a,"unselected")):(g(o,"unselected"),y(a,"unselected"))}};for(const e of b){const n=()=>{P$(t,"pointer")},r=()=>{N$(t)},c=t=>Re(this,void 0,void 0,(function*(){const n=i(e),r=x.indexOf(n);-1===r?x.push(n):x.splice(r,1),yield o(x),w();const{nativeEvent:c=!0}=t;c&&(x.length===b.length?a.emit("legend:reset",{nativeEvent:c}):a.emit("legend:filter",Object.assign(Object.assign({},t),{nativeEvent:c,data:{channel:s,values:x}})))}));e.addEventListener("click",c),e.addEventListener("pointerenter",n),e.addEventListener("pointerout",r),l.set(e,c),u.set(e,n),f.set(e,r)}const k=t=>Re(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;if(e)return;const{data:n}=t,{channel:r,values:i}=n;r===s&&(x=i,yield o(x),w())})),M=t=>Re(this,void 0,void 0,(function*(){const{nativeEvent:e}=t;e||(x=b.map(i),yield o(x),w())}));return a.on("legend:filter",k),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",k),a.off("legend:reset",M)}}(r,{legends:bW,marker:yW,label:mW,datum:t=>{const{__data__:e}=t,{index:n}=e;return u[n]},filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!0});l(o?i:t,n)},state:e.attributes.state,channel:s,emitter:n}):function(t,{legend:e,filter:n,emitter:r,channel:i}){const o=({detail:{value:t}})=>{n(t),r.emit({nativeEvent:!0,data:{channel:i,values:t}})};return e.addEventListener("valuechange",o),()=>{e.removeEventListener("valuechange",o)}}(0,{legend:e,filter:e=>{const n=Object.assign(Object.assign({},f),{value:e,ordinal:!1});l(o?i:t,n)},emitter:n,channel:s})}));return()=>{u.forEach((t=>t()))}}}function _W(){return(t,e,n)=>{const{container:r,view:i,options:o}=t,a=xW(r),s=l$(r),c=t=>kW(t).scales[0].name,l=t=>{const{scale:{[t]:e}}=i;return e},u=O$(o,["active","inactive"]),f=_$(s,m$(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=bW(t),o=l(r),a=Jn(s,(t=>o.invert(t.__data__[r]))),{state:d={}}=t.attributes,{inactive:p={}}=d,{setState:g,removeState:v}=M$(u,f),y={inactive:Qo(p,"marker")},m={inactive:Qo(p,"label")},{setState:b,removeState:x}=M$(y),{setState:w,removeState:k}=M$(m),M=t=>{for(const e of i){const n=yW(e),r=mW(e);e===t||null===t?(x(n,"inactive"),k(r,"inactive")):(b(n,"inactive"),w(r,"inactive"))}},E=(t,i)=>{const o=e(i),c=new Set(a.get(o));for(const t of s)c.has(t)?g(t,"active"):g(t,"inactive");M(i);const{nativeEvent:l=!0}=t;l&&n.emit("legend:highlight",Object.assign(Object.assign({},t),{nativeEvent:l,data:{channel:r,value:o}}))},O=new Map;for(const t of i){const e=e=>{E(e,t)};t.addEventListener("pointerover",e),O.set(t,e)}const _=t=>{for(const t of s)v(t,"inactive","active");M(null);const{nativeEvent:e=!0}=t;e&&n.emit("legend:unhighlight",{nativeEvent:e})},S=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)},A=t=>{const{nativeEvent:e}=t;e||_({nativeEvent:!1})};t.addEventListener("pointerleave",_),n.on("legend:highlight",S),n.on("legend:unhighlight",A);const T=()=>{t.removeEventListener(_),n.off("legend:highlight",S),n.off("legend:unhighlight",A);for(const[t,e]of O)t.removeEventListener(e)};h.push(T)}return()=>h.forEach((t=>t()))}}function SW(t,e){const[n,r,i,o]=t,[a,s,c,l]=e;return!(a>i||c<n||s>o||l<r)}function AW(t){const{width:e,height:n}=t.getBBox();return[0,0,e,n]}function TW(t,e){for(const[n,r]of Object.entries(e))t.style(n,r)}const PW=Py((t=>{const e=t.attributes,{x:n,y:r,width:i,height:o,class:a,renders:s={},handleSize:c=10,document:l}=e,u=Le(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=Qo(ta(u,"handleNW","handleNE"),"handleN"),{render:p=h}=d,g=Le(d,["render"]),v=Qo(u,"handleE"),{render:y=h}=v,m=Le(v,["render"]),b=Qo(ta(u,"handleSE","handleSW"),"handleS"),{render:x=h}=b,w=Le(b,["render"]),k=Qo(u,"handleW"),{render:M=h}=k,E=Le(k,["render"]),O=Qo(u,"handleNW"),{render:_=h}=O,S=Le(O,["render"]),A=Qo(u,"handleNE"),{render:T=h}=A,P=Le(A,["render"]),N=Qo(u,"handleSE"),{render:C=h}=N,L=Le(N,["render"]),j=Qo(u,"handleSW"),{render:R=h}=j,I=Le(j,["render"]),D=t=>()=>{const e=Py((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({})},B=uy(t).attr("className",a).style("transform",`translate(${n}, ${r})`).style("draggable",!0);B.maybeAppend("selection","rect").style("draggable",!0).style("fill","transparent").call(TW,Object.assign(Object.assign({width:i,height:o},ta(u,"handle")),{transform:void 0})),B.maybeAppend("handle-n",D(p)).style("x",f).style("y",-f).style("width",i-c).style("height",c).style("fill","transparent").call(TW,g),B.maybeAppend("handle-e",D(y)).style("x",i-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(TW,m),B.maybeAppend("handle-s",D(x)).style("x",f).style("y",o-f).style("width",i-c).style("height",c).style("fill","transparent").call(TW,w),B.maybeAppend("handle-w",D(M)).style("x",-f).style("y",f).style("width",c).style("height",o-c).style("fill","transparent").call(TW,E),B.maybeAppend("handle-nw",D(_)).style("x",-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(TW,S),B.maybeAppend("handle-ne",D(T)).style("x",i-f).style("y",-f).style("width",c).style("height",c).style("fill","transparent").call(TW,P),B.maybeAppend("handle-se",D(C)).style("x",i-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(TW,L),B.maybeAppend("handle-sw",D(R)).style("x",-f).style("y",o-f).style("width",c).style("height",c).style("fill","transparent").call(TW,I)}));function NW(t,e){var{brushed:n=()=>{},brushended:r=()=>{},brushcreated:i=()=>{},brushstarted:o=()=>{},brushupdated:a=()=>{},extent:s=AW(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=Le(e,["brushed","brushended","brushcreated","brushstarted","brushupdated","extent","brushRegion","reverse","fill","fillOpacity","stroke","selectedHandles"]);let g=null,v=null,y=null,m=null,b=null,x=!1;const[w,k,M,E]=s;P$(t,"crosshair"),t.style.draggable=!0;const O=(t,e,n)=>{if(o(n),m&&m.remove(),b&&b.remove(),g=[t,e],l)return _();S()},_=()=>{b=new Gg({style:Object.assign(Object.assign({},p),{fill:u,fillOpacity:f,stroke:h,pointerEvents:"none"})}),m=new PW({style:{x:0,y:0,width:0,height:0,draggable:!0,document:t.ownerDocument},className:"mask"}),t.appendChild(b),t.appendChild(m)},S=()=>{m=new PW({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(m)},A=(t=!0)=>{m&&m.remove(),b&&b.remove(),g=null,v=null,y=null,x=!1,m=null,b=null,r(t)},T=(t,e,r=!0)=>{const[i,o,a,u]=function(t,e,n,r,i){const[o,a,s,c]=i;return[Math.max(o,Math.min(t,n)),Math.max(a,Math.min(e,r)),Math.min(s,Math.max(t,n)),Math.min(c,Math.max(e,r))]}(t[0],t[1],e[0],e[1],s),[f,h,d,p]=c(i,o,a,u,s);return l?N(f,h,d,p):P(f,h,d,p),n(f,h,d,p,r),[f,h,d,p]},P=(t,e,n,r)=>{m.style.x=t,m.style.y=e,m.style.width=n-t,m.style.height=r-e},N=(t,e,n,r)=>{b.style.d=`\n M${w},${k}L${M},${k}L${M},${E}L${w},${E}Z\n M${t},${e}L${t},${r}L${n},${r}L${n},${e}Z\n `,m.style.x=t,m.style.y=e,m.style.width=n-t,m.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"}},L=t=>R(t)||j(t),j=t=>{const{id:e}=t;return-1!==d.indexOf(e)&&new Set(Object.keys(C)).has(e)},R=t=>t===m.getElementById("selection"),I=e=>{const{target:n}=e,[r,i]=g$(t,e);if(!m||!L(n))return O(r,i,e),void(x=!0);L(n)&&(y=[r,i])},D=e=>{const{target:n}=e,r=g$(t,e);if(!g)return;if(!y)return T(g,r);if(R(n))return(t=>{const e=(t,e,n,r,i)=>t+e<r?r-e:t+n>i?i-n:t,n=t[0]-y[0],r=t[1]-y[1],i=e(n,g[0],v[0],w,M),o=e(r,g[1],v[1],k,E),a=[g[0]+i,g[1]+o],s=[v[0]+i,v[1]+o];T(a,s)})(r);const[i,o]=[r[0]-y[0],r[1]-y[1]],{id:a}=n;if(C[a]){const[t,e,n,r]=C[a].vector;return T([g[0]+i*t,g[1]+o*e],[v[0]+i*n,v[1]+o*r])}},B=e=>{if(y){y=null;const{x:t,y:n,width:r,height:i}=m.style;return g=[t,n],v=[t+r,n+i],void a(t,n,t+r,n+i,e)}v=g$(t,e);const[n,r,o,s]=T(g,v);x=!1,i(n,r,o,s,e)},F=t=>{const{target:e}=t;m&&!L(e)&&A()},z=e=>{const{target:n}=e;m&&L(n)&&!x?R(n)?P$(t,"move"):j(n)&&P$(t,C[n.id].cursor):P$(t,"crosshair")},$=()=>{P$(t,"default")};return t.addEventListener("dragstart",I),t.addEventListener("drag",D),t.addEventListener("dragend",B),t.addEventListener("click",F),t.addEventListener("pointermove",z),t.addEventListener("pointerleave",$),{mask:m,move(t,e,n,r,i=!0){m||O(t,e,{}),g=[t,e],v=[n,r],T([t,e],[n,r],i)},remove(t=!0){m&&A(t)},destroy(){m&&A(!1),P$(t,"default"),t.removeEventListener("dragstart",I),t.removeEventListener("drag",D),t.removeEventListener("dragend",B),t.removeEventListener("click",F),t.removeEventListener("pointermove",z),t.removeEventListener("pointerleave",$)}}}function CW(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 LW(t,e,n){return CW(t,e,n).map((t=>t.options))}function jW(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,v=Le(e,["elements","selectedHandles","siblings","datum","brushRegion","extent","reverse","scale","coordinate","series","key","bboxOf","state","emitter"]);const y=n(t),m=i(t),b=m.flatMap(n),x=_$(y,o),w=Qo(v,"mask"),{setState:k,removeState:M}=M$(p,x),E=new Map,{width:O,height:_,x:S=0,y:A=0}=d(t),T=s||[0,0,O,_],P=()=>{for(const t of[...y,...b])M(t,"active","inactive")},N=(t,e,n,r)=>{var i;for(const t of m)null===(i=t.brush)||void 0===i||i.remove();const o=new Set;for(const i of y){const{min:a,max:s}=i.getLocalBounds(),[c,l]=a,[u,f]=s;SW([c,l,u,f],[t,e,n,r])?(k(i,"active"),o.add(h(i))):k(i,"inactive")}for(const t of b)o.has(h(t))?k(t,"active"):k(t,"inactive")},C=()=>{for(const t of y)M(t,"inactive");for(const t of E.values())t.remove();E.clear()},L=(e,n,r,i)=>{const o=t=>{const e=t.cloneNode();return e.__data__=t.__data__,t.parentNode.appendChild(e),E.set(t,e),e},a=new Ug({style:{x:e+S,y:n+A,width:r-e,height:i-n}});t.appendChild(a);for(const t of y){const e=E.get(t)||o(t);e.style.clipPath=a,k(t,"inactive"),k(e,"active")}},j=NW(t,Object.assign(Object.assign({},w),{extent:T,brushRegion:a,reverse:c,selectedHandles:r,brushended:t=>{const e=f?C:P;t&&g.emit("brush:remove",{nativeEvent:!0}),e()},brushed:(t,e,n,r,i)=>{const o=iT(t,e,n,r,l,u);i&&g.emit("brush:highlight",{nativeEvent:!0,data:{selection:o}});(f?L:N)(t,e,n,r)},brushcreated:(t,e,n,r,i)=>{const o=iT(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=iT(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=oT(o,r),c=oT(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);j.move(r,i,o,a,!1)};g.on("brush:highlight",R);const I=({nativeEvent:t}={})=>{t||j.remove(!1)};g.on("brush:remove",I);const D=j.destroy.bind(j);return j.destroy=()=>{g.off("brush:highlight",R),g.off("brush:remove",I),D()},j}function RW(t){var{facet:e,brushKey:n}=t,r=Le(t,["facet","brushKey"]);return(t,i,o)=>{const{container:a,view:s,options:c}=t,l=h$(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 jW(l.parentNode.parentNode,Object.assign(Object.assign({elements:()=>u$(t,i),datum:m$(f$(t,i).map((t=>t.view))),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:[n,a,s,c],state:O$(f$(t,i).map((t=>t.options)),f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r))}const p=jW(l,Object.assign(Object.assign({elements:l$,key:t=>t.__data__.key,siblings:()=>function(t,e,n){return CW(t,e,n).map((t=>h$(t.container)))}(t,i,n),datum:m$([s,...CW(t,i,n).map((t=>t.view))]),brushRegion:(t,e,n,r)=>[t,e,n,r],extent:void 0,state:O$([c,...LW(t,i,n)],f),emitter:o,scale:h,coordinate:d,selectedHandles:void 0},u),r));return l.brush=p,()=>p.destroy()}}function IW(t,e,n,r,i){const[,o,,a]=i;return[t,o,n,a]}function DW(t){return RW(Object.assign(Object.assign({},t),{brushRegion:IW,selectedHandles:["handle-e","handle-w"]}))}function BW(t,e,n,r,i){const[o,,a]=i;return[o,e,a,r]}function FW(t){return RW(Object.assign(Object.assign({},t),{brushRegion:BW,selectedHandles:["handle-n","handle-s"]}))}const zW="axis-hot-area";function $W(t){return t.getElementsByClassName("axis")}function WW(t){return t.getElementsByClassName("axis-line")[0]}function GW(t){return function(t){return t.getElementsByClassName("axis-main-group")[0]}(t).getLocalBounds()}function HW(t,e){var{cross:n,offsetX:r,offsetY:i}=e,o=Le(e,["cross","offsetX","offsetY"]);const a=GW(t),s=WW(t),[c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=2*(f-l);return{brushRegion:BW,hotZone:new Ug({className:zW,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 YW(t,e){var{offsetY:n,offsetX:r,cross:i=!1}=e,o=Le(e,["offsetY","offsetX","cross"]);const a=GW(t),s=WW(t),[,c]=s.getLocalBounds().min,[l,u]=a.min,[f,h]=a.max,d=h-u;return{brushRegion:IW,hotZone:new Ug({className:zW,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)]}}function qW(t){return(e,n,r)=>{const{container:i,view:o,options:a}=e,s=h$(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=Le(e,["axes","elements","points","horizontal","datum","offsetY","offsetX","reverse","state","emitter","coordinate"]);const p=r(t),g=n(t),v=_$(p,a),{setState:y,removeState:m}=M$(u,v),b=new Map,x=Qo(d,"mask"),w=t=>Array.from(b.values()).every((([e,n,r,i])=>t.some((([t,o])=>t>=e&&t<=r&&o>=n&&o<=i)))),k=g.map((t=>t.attributes.scale)),M=t=>t.length>2?[t[0],t[t.length-1]]:t,E=new Map,O=()=>{E.clear();for(let t=0;t<g.length;t++){const e=k[t],{domain:n}=e.getOptions();E.set(t,M(n))}};O();const _=(t,e)=>{const n=[];for(const t of p){const e=i(t);w(e)?(y(t,"active"),n.push(t)):y(t,"inactive")}E.set(t,A(n,t)),e&&f.emit("brushAxis:highlight",{nativeEvent:!0,data:{selection:(()=>{if(!T)return Array.from(E.values());const t=[];for(const[e,n]of E){const r=k[e],{name:i}=r.getOptions();"x"===i?t[0]=n:t[1]=n}return t})()}})},S=t=>{for(const t of p)m(t,"active","inactive");O(),t&&f.emit("brushAxis:remove",{nativeEvent:!0})},A=(t,e)=>{const n=k[e],{name:r}=n.getOptions(),i=t.map((t=>{const e=t.__data__;return n.invert(e[r])}));return M(rT(n,i))},T=g.some(o)&&g.some((t=>!o(t))),P=[];for(let t=0;t<g.length;t++){const e=g[t],n=o(e)?YW:HW,{hotZone:r,brushRegion:i,extent:a}=n(e,{offsetY:s,offsetX:c,cross:T,zIndex:999,fill:"transparent"});e.parentNode.appendChild(r);const u=NW(r,Object.assign(Object.assign({},x),{reverse:l,brushRegion:i,brushended(n){b.delete(e),0===Array.from(b.entries()).length?S(n):_(t,n)},brushed(n,r,i,o,s){b.set(e,a(n,r,i,o)),_(t,s)}}));P.push(u)}const N=(t={})=>{const{nativeEvent:e}=t;e||P.forEach((t=>t.remove(!1)))},C=(t,e,n)=>{const[r,i]=t,a=L(r,e,n),s=L(i,e,n)+(t=>t.getStep?t.getStep():0)(e);return o(n)?[a,-1/0,s,1/0]:[-1/0,a,1/0,s]},L=(t,e,n)=>{const{height:r,width:i}=h.getOptions(),a=e.clone();return o(n)?a.update({range:[0,i]}):a.update({range:[r,0]}),a.map(t)},j=t=>{const{nativeEvent:e}=t;if(e)return;const{selection:n}=t.data;for(let t=0;t<P.length;t++){const e=n[t],r=P[t],i=g[t];if(e){const n=k[t];r.move(...C(e,n,i),!1)}else r.remove(!1)}};return f.on("brushAxis:remove",N),f.on("brushAxis:highlight",j),()=>{P.forEach((t=>t.destroy())),f.off("brushAxis:remove",N),f.off("brushAxis:highlight",j)}}(i,Object.assign({elements:l$,axes:$W,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:m$(o),state:O$(a,["active",["inactive",{opacity:.5}]]),coordinate:u,emitter:r},t))}}function VW(t){var{hideX:e=!0,hideY:n=!0}=t,r=Le(t,["hideX","hideY"]);return(t,i,o)=>{const{container:a,view:s,options:c,update:l,setState:u}=t,f=h$(a);let h=!1,d=!1,p=s;const{scale:g,coordinate:v}=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=Qo(Le(e,["filter","reset","brushRegion","extent","reverse","emitter","scale","coordinate","selection","series"]),"mask"),{width:d,height:p}=t.getBBox(),g=o||[0,0,d,p],v=function(t=300){let e=null;return n=>{const{timeStamp:r}=n;return null!==e&&r-e<t?(e=r,!0):(e=r,!1)}}(),y=NW(t,Object.assign(Object.assign({},h),{extent:g,brushRegion:i,reverse:a,brushcreated:function(t,e,r,i,o){t===r&&e===i||(o.nativeEvent=!0,n(u(t,e,r,i),o),y.remove())}}));function m(t){v(t)&&(t.nativeEvent=!0,r(t))}t.addEventListener("click",m);const b=({nativeEvent:t,data:e})=>{if(t)return;const{selection:r}=e;n(r,{nativeEvent:!1})};return s.on("brush:filter",b),()=>{y.destroy(),s.off("brush:filter",b),t.removeEventListener("click",m)}}(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 iT(t,e,n,r,i,o)},filter:(t,r)=>Re(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=>Q({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:v},{maskFill:"#777",maskFillOpacity:"0.3",maskStroke:"#fff",unhighlightedOpacity:.5,reverse:!1}),r))}}function UW(t){return VW(Object.assign(Object.assign({hideX:!0},t),{brushRegion:IW}))}function XW(t){return VW(Object.assign(Object.assign({hideY:!0},t),{brushRegion:BW}))}function ZW(t,e,n,r=!1,i="x",o="y"){const{marks:a}=t,s=a.map((t=>{var a,s;return Q({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 KW(t,e,n){const[r,i]=t,o=n?t=>1-t:t=>t;return rT(e,[nT(e,o(r),!0),nT(e,o(i),!1)])}function QW(t){return[t[0],t[t.length-1]]}function JW({initDomain:t={},className:e="slider",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,v=h.getElementsByClassName(e);if(!v.length)return()=>{};let y=!1;const{scale:m,coordinate:b,layout:x}=d,{paddingLeft:w,paddingTop:k,paddingBottom:M,paddingRight:E}=x,{x:O,y:_}=m,S=Kc(b),A=t=>{const e="vertical"===t?"y":"x",n="vertical"===t?"x":"y";return S?[n,e]:[e,n]},T=new Map,P=new Set,N={x:t.x||O.getOptions().domain,y:t.y||_.getOptions().domain};for(const t of v){const{orientation:e}=t.attributes,[l,u]=A(e),h=`${n}${G(l)}:filter`,d="x"===l,{ratio:v}=O.getOptions(),{ratio:b}=_.getOptions(),x=t=>{if(t.data){const{selection:e}=t.data,[n=QW(N.x),r=QW(N.y)]=e;return d?[rT(O,n,v),rT(_,r,b)]:[rT(_,r,b),rT(O,n,v)]}const{value:n}=t.detail;return[KW(n,m[l],S&&"horizontal"===e),N[u]]},C=at((e=>Re(this,void 0,void 0,(function*(){const{initValue:r=!1}=e;if(y&&!r)return;y=!0;const{nativeEvent:o=!0}=e,[a,s]=x(e);if(N[l]=a,N[u]=s,o){const t=d?a:s,n=d?s:a;f.emit(h,Object.assign(Object.assign({},e),{nativeEvent:o,data:{selection:[QW(t),QW(n)]}}))}g(t,(t=>Object.assign(Object.assign({},ZW(t,{[l]:{domain:a,nice:!1}},n,i,l,u)),{paddingLeft:w,paddingTop:k,paddingBottom:M,paddingRight:E}))),yield p(),y=!1}))),o,{leading:a,trailing:s}),L=e=>{const{nativeEvent:n}=e;if(n)return;const{data:i}=e,{selection:o}=i,[a,s]=o;t.dispatchEvent(new Np("valuechange",{data:i,nativeEvent:!1}));const c=d?oT(a,O):oT(s,_);r(t,c)};f.on(h,L),t.addEventListener("valuechange",C),T.set(t,C),P.add([h,L]);const j=c(t);j&&t.dispatchEvent(new Np("valuechange",{detail:{value:j},nativeEvent:!1,initValue:!0}))}return()=>{for(const[t,e]of T)t.removeEventListener("valuechange",e);for(const[t,e]of P)f.off(t,e)}}}const tG="g2-scrollbar";function eG(t={}){return(e,n,r)=>{const{view:i,container:o}=e;if(!o.getElementsByClassName(tG).length)return()=>{};const{scale:a}=i,{x:s,y:c}=a,l={x:[...s.getOptions().domain],y:[...c.getOptions().domain]};s.update({domain:s.getOptions().expectedDomain}),c.update({domain:c.getOptions().expectedDomain});return JW(Object.assign(Object.assign({},t),{initDomain:l,className:tG,prefix:"scrollbar",hasState:!0,setValue:(t,e)=>t.setValue(e[0]),getInitValues:t=>{const e=t.slider.attributes.values;if(0!==e[0])return e}}))(e,n,r)}}function nG(t,e,n){return`<${t} style="${Object.entries(n).map((([t,e])=>`${function(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}(t)}:${e}`)).join(";")}">${e}</${t}>`}const rG={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 iG(t){return"text"===t.nodeName&&!!t.isOverflowing()}function oG(t){var{offsetX:e=8,offsetY:n=8}=t,r=Le(t,["offsetX","offsetY"]);return t=>{const{container:i}=t,[o,a]=i.getBounds().min,s=Qo(r,"tip"),c=new Set,l=t=>{const{target:r}=t;if(!iG(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 Bg({className:"poptip",style:{innerHTML:nG("div",d,Object.assign(Object.assign({},rG),s)),x:f,y:h}});i.appendChild(p),r.tip=p,c.add(p)},u=t=>{const{target:e}=t;iG(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()))}}}oG.props={reapplyWhenUpdate:!0};const aG={breadCrumbFill:"rgba(0, 0, 0, 0.85)",breadCrumbFontSize:12,breadCrumbY:12,activeFill:"rgba(0, 0, 0, 0.5)"};function sG(t={}){const{originData:e=[],layout:n}=t,r=Le(t,["originData","layout"]),i=Q({},aG,r),o=Qo(i,"breadCrumb"),a=Qo(i,"active");return t=>{const{update:r,setState:i,container:s,options:c}=t,l=function(t){return uy(t).select(`.${GT}`).node()}(s),u=c.marks[0],{state:f}=u,h=new Ig;l.appendChild(h);const d=(t,c)=>Re(this,void 0,void 0,(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 Zg({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 Zg({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===lt(t)-1&&u.remove(),l}));c.forEach(((t,e)=>{if(e===lt(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(rt(t,["style","path"]),rt(t,["style","depth"]))}))}))}!function(t,e){[...xW(t),...wW(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=rt(t,["id"]);return e&&(e.match(`${o}/`)||o.match(e))})).map((t=>({value:0===t.height?rt(t,["value"]):void 0,name:rt(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=n_(t,l,{value:"value"})[0]}else r=e.filter((t=>1===t.depth));const i=[];return r.forEach((({path:t})=>{i.push(j(t))})),Q({},t,{data:r,scale:{color:{domain:i}}})}));return Object.assign(Object.assign({},r),{marks:a})})),yield r(void 0,["legendFilter"])})),p=t=>{const n=t.target,{markType:r,nodeName:i,attributes:o}=n||{};if("rect"!==r&&i!==tu.TEXT)return;const a=i===tu.TEXT&&!0===rt(o,"isTreemapLabel")?(t=>t.attributes.key.split("-")[0])(n):(t=>rt(t,["__data__","key"]))(n),s=A(e,(t=>t.id===a));rt(s,"height")&&d(rt(s,"path"),rt(s,"depth"))};l.addEventListener("click",p);const g=M(Object.assign(Object.assign({},f.active),f.inactive)),v=()=>{R$(l).forEach((t=>{const n=rt(t,["style","cursor"]),r=A(e,(e=>e.id===rt(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 k(e,(function(e){it.call(t,e)&&(n[e]=t[e])})),n}(t.attributes,g);t.addEventListener("mouseenter",(()=>{t.attr(f.active)})),t.addEventListener("mouseleave",(()=>{t.attr(Q(e,f.inactive))}))}}))};return v(),l.addEventListener("mousemove",v),()=>{h.remove(),l.removeEventListener("click",p),l.removeEventListener("mousemove",v)}}}const cG={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},lG="movePoint",uG=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")))},fG=t=>{const e=t.target,{markType:n}=e;"line"===n&&e.attr("lineWidth",e.attr("_lineWidth")),"interval"===n&&e.attr("opacity",e.attr("_opacity"))},hG=(t,e,n)=>{t.forEach(((t,r)=>{t.attr("stroke",e[1]===r?n.activeStroke:n.stroke)}))},dG=(t,e,n,r)=>{const i=new Gg({style:n}),o=new Zg({style:r});return e.appendChild(o),t.appendChild(i),[i,o]},pG=(t,e)=>{if(!rt(t,["options","range","indexOf"]))return;const n=t.options.range.indexOf(e);return t.sortedDomain[n]},gG=(t,e,n)=>{const r=L$(t,e),i=L$(t,n)/r;return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i]};function vG(t={}){const{selection:e=[],precision:n=2}=t,r=Le(t,["selection","precision"]),i=Object.assign(Object.assign({},cG),r||{}),o=Qo(i,"path"),a=Qo(i,"label"),s=Qo(i,"point");return(t,r,i)=>{const{update:c,setState:l,container:u,view:f,options:{marks:h,coordinate:d}}=t,p=h$(u);let g,v=R$(p),y=e;const{transform:m=[],type:b}=d,x=!!A(m,(({type:t})=>"transpose"===t)),w="polar"===b,k="theta"===b,M=!!A(v,(({markType:t})=>"area"===t));M&&(v=v.filter((({markType:t})=>"area"===t)));const E=new Ig({style:{zIndex:2}});p.appendChild(E);const O=()=>{i.emit("element-point:select",{nativeEvent:!0,data:{selection:y}})},_=t=>{const e=t.target;y=[e.parentNode.childNodes.indexOf(e)],O(),T(e)},S=t=>{const{data:{selection:e},nativeEvent:n}=t;if(n)return;y=e;const r=rt(v,[null==y?void 0:y[0]]);r&&T(r)},T=t=>{const{attributes:e,markType:r,__data__:d}=t,{stroke:p}=e,{points:v,seriesTitle:m,color:b,title:_,seriesX:S,y1:P}=d;if(x&&"interval"!==r)return;const{scale:N,coordinate:C}=(null==g?void 0:g.view)||f,{color:L,y:j,x:R}=N,I=C.getCenter();let D;E.removeChildren();const B=(t,e,n,r)=>Re(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),Q({},o,{data:l,animate:!1})}));return Object.assign(Object.assign({},o),{marks:s})})),yield c("elementPointMove")}));if(["line","area"].includes(r))v.forEach(((e,r)=>{const i=R.invert(S[r]);if(!i)return;const c=new Cg({name:lG,style:Object.assign({cx:e[0],cy:e[1],fill:p},s)}),l=((t,e)=>{const n=rt(t,["__data__","seriesItems",e,"0","value"]),r=rt(t,["__data__","seriesIndex",e]),{__data__:{data:i,encode:o,transform:a}}=t.parentNode,s=A(a,(({type:t})=>"normalizeY"===t)),c=rt(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([S[r],0]),d=null==m?void 0:m.length;u.attr("cursor","move"),y[1]!==r&&(y[1]=r,O()),hG(E.childNodes,y,s);const[p,x]=dG(E,c,o,a),k=t=>{const i=e[1]+t.clientY-D[1];if(M)if(w){const o=e[0]+t.clientX-D[0],[a,s]=gG(I,h,[o,i]),[,u]=C.output([1,j.output(0)]),[,f]=C.invert([a,u-(v[r+d][1]-s)]),g=(r+1)%d,y=j$([v[(r-1+d)%d],[a,s],m[g]&&v[g]]);x.attr("text",l(j.invert(f)).toFixed(n)),p.attr("d",y),c.attr("cx",a),c.attr("cy",s)}else{const[,t]=C.output([1,j.output(0)]),[,o]=C.invert([e[0],t-(v[r+d][1]-i)]),a=j$([v[r-1],[e[0],i],m[r+1]&&v[r+1]]);x.attr("text",l(j.invert(o)).toFixed(n)),p.attr("d",a),c.attr("cy",i)}else{const[,t]=C.invert([e[0],i]),o=j$([v[r-1],[e[0],i],v[r+1]]);x.attr("text",j.invert(t).toFixed(n)),p.attr("d",o),c.attr("cy",i)}};D=[f.clientX,f.clientY],window.addEventListener("mousemove",k);const _=()=>Re(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),window.removeEventListener("mousemove",k),u.removeEventListener("mouseup",_),Y(x.attr("text")))return;const e=Number(x.attr("text")),n=pG(L,b);g=yield B(i,e,n,["line","area"]),x.remove(),p.remove(),T(t)}));u.addEventListener("mouseup",_)})),E.appendChild(c)})),hG(E.childNodes,y,s);else if("interval"===r){let e=[(v[0][0]+v[1][0])/2,v[0][1]];x?e=[v[0][0],(v[0][1]+v[1][1])/2]:k&&(e=v[0]);const i=(t=>{const e=rt(t,["__data__","y"]),n=rt(t,["__data__","y1"])-e,{__data__:{data:r,encode:i,transform:o},childNodes:a}=t.parentNode,s=A(o,(({type:t})=>"normalizeY"===t)),c=rt(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 Cg({name:lG,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=pG(L,b),[f,h]=dG(E,c,o,a),d=t=>{if(x){const r=e[0]+t.clientX-D[0],[o]=C.output([j.output(0),j.output(0)]),[,a]=C.invert([o+(r-v[2][0]),e[1]]),s=j$([[r,v[0][1]],[r,v[1][1]],v[2],v[3]],!0);h.attr("text",i(j.invert(a)).toFixed(n)),f.attr("d",s),c.attr("cx",r)}else if(k){const r=e[1]+t.clientY-D[1],o=e[0]+t.clientX-D[0],[a,s]=gG(I,[o,r],e),[l,u]=gG(I,[o,r],v[1]),d=C.invert([a,s])[1],p=P-d;if(p<0)return;const g=function(t,e,n=0){const r=[["M",...e[1]]],i=L$(t,e[1]),o=L$(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],v[2],v[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-D[1],[,o]=C.output([1,j.output(0)]),[,a]=C.invert([e[0],o-(v[2][1]-r)]),s=j$([[v[0][0],r],[v[1][0],r],v[2],v[3]],!0);h.attr("text",i(j.invert(a)).toFixed(n)),f.attr("d",s),c.attr("cy",r)}};D=[s.clientX,s.clientY],window.addEventListener("mousemove",d);const p=()=>Re(this,void 0,void 0,(function*(){if(u.attr("cursor","default"),u.removeEventListener("mouseup",p),window.removeEventListener("mousemove",d),Y(h.attr("text")))return;const e=Number(h.attr("text"));g=yield B(_,e,l,[r]),h.remove(),f.remove(),T(t)}));u.addEventListener("mouseup",p)})),E.appendChild(c)}};v.forEach(((t,e)=>{y[0]===e&&T(t),t.addEventListener("click",_),t.addEventListener("mouseenter",uG),t.addEventListener("mouseleave",fG)}));const P=t=>{const e=null==t?void 0:t.target;e&&(e.name===lG||v.includes(e))||(y=[],O(),E.removeChildren())};return i.on("element-point:select",S),i.on("element-point:unselect",P),u.addEventListener("mousedown",P),()=>{E.remove(),i.off("element-point:select",S),i.off("element-point:unselect",P),u.removeEventListener("mousedown",P),v.forEach((t=>{t.removeEventListener("click",_),t.removeEventListener("mouseenter",uG),t.removeEventListener("mouseleave",fG)}))}}}var yG={},mG={};function bG(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function xG(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 wG(t,e){var n=t+"",r=n.length;return r<e?new Array(e-r+1).join(0)+n:n}function kG(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),r=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":function(t){return t<0?"-"+wG(-t,6):t>9999?"+"+wG(t,6):wG(t,4)}(t.getUTCFullYear())+"-"+wG(t.getUTCMonth()+1,2)+"-"+wG(t.getUTCDate(),2)+(i?"T"+wG(e,2)+":"+wG(n,2)+":"+wG(r,2)+"."+wG(i,3)+"Z":r?"T"+wG(e,2)+":"+wG(n,2)+":"+wG(r,2)+"Z":n||e?"T"+wG(e,2)+":"+wG(n,2)+"Z":"")}function MG(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 mG;if(l)return l=!1,yG;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())!==mG;){for(var f=[];r!==yG&&r!==mG;)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?kG(t):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,e){var n,i,o=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?function(t,e){var n=bG(t);return function(r,i){return e(n(r),i,t)}}(t,e):bG(t)}));return o.columns=i||[],o},parseRows:r,format:function(e,n){return null==n&&(n=xG(e)),[n.map(a).join(t)].concat(i(e,n)).join("\n")},formatBody:function(t,e){return null==e&&(e=xG(t)),i(t,e).join("\n")},formatRows:function(t){return t.map(o).join("\n")},formatRow:o,formatValue:a}}function EG(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;OG&&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 OG=new Date("2019-01-01T00:00").getHours()||new Date("2019-07-01T00:00").getHours(),_G=t=>{const{value:e,format:n=e.split(".").pop(),delimiter:r=",",autoType:i=!0}=t;return()=>Re(void 0,void 0,void 0,(function*(){const t=yield fetch(e);if("csv"===n){const e=yield t.text();return MG(r).parse(e,i?EG:Yo)}if("json"===n)return yield t.json();throw new Error(`Unknown format: ${n}.`)}))};_G.props={};const SG=t=>{const{fields:e,key:n="key",value:r="value"}=t;return t=>{return(i=e)&&0!==Object.keys(i).length?t.flatMap((t=>e.map((e=>Object.assign(Object.assign({},t),{[n]:e,[r]:t[e]}))))):t;var i}};function AG(t){return null!=t&&!Number.isNaN(t)}SG.props={};const TG=t=>{const{callback:e=AG}=t;return t=>t.filter(e)};TG.props={};const PG=t=>{const{callback:e}=t;return t=>Array.isArray(t)?[...t].sort(e):t};PG.props={};const NG=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)))};NG.props={};const CG=t=>e=>{if(!t||(n=t,0===Object.keys(n).length))return e;var n;return e.map((e=>Object.entries(e).reduce(((e,[n,r])=>(e[t[n]||n]=r,e)),{})))};CG.props={};const LG=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)))};LG.props={};const jG=t=>{const{value:e}=t;return()=>e};jG.props={};const RG=t=>{const{callback:e=Yo}=t;return t=>e(t)};RG.props={};const IG=t=>{const{callback:e=Yo}=t;return t=>Array.isArray(t)?t.map(e):t};IG.props={};const DG=Math.PI/180,BG=2048;function FG(t){return t.text}function zG(){return"serif"}function $G(){return"normal"}function WG(t){return t.value}function GG(){return 90*~~(2*Math.random())}function HG(){return 1}function YG(){}function qG(t,e,n,r){if(e.sprite)return;const i=t.context,o=t.ratio;i.clearRect(0,0,2048/o,BG/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*DG),r=Math.cos(e.rotate*DG),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>=2048&&(a=0,s+=c,c=0),s+l>=BG)break;i.translate((a+(t>>1))/o,(s+(l>>1))/o),e.rotate&&i.rotate(e.rotate*DG),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,2048/o,BG/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[2048*(s+n)+(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 VG(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 UG(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 XG(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 ZG(t){const e=t[0]/t[1];return function(t){return[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]}}function KG(t){const e=[];let n=-1;for(;++n<t;)e[n]=0;return e}function QG(){return document.createElement("canvas")}function JG(t){return"function"==typeof t?t:function(){return t}}const tH={archimedean:ZG,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 eH(){let t=[256,256],e=FG,n=zG,r=WG,i=$G,o=GG,a=HG,s=ZG,c=Math.random,l=YG,u=[],f=null,h=1/0,d=QG;const p=$G,g={};function v(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||!VG(n,e,t[0]))&&(!r||XG(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,y]=t,m=function(t){t.width=t.height=1;const e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=2048/e,t.height=BG/e;const n=t.getContext("2d");return n.fillStyle=n.strokeStyle="red",n.textAlign="center",n.textBaseline="middle",{context:n,ratio:e}}(d()),b=g.board?g.board:KG((t[0]>>5)*t[1]),x=u.length,w=[],k=u.map((function(t,s,c){return t.text=e.call(this,t,s,c),t.font=n.call(this,t,s,c),t.style=p.call(this,t,s,c),t.weight=i.call(this,t,s,c),t.rotate=o.call(this,t,s,c),t.size=~~r.call(this,t,s,c),t.padding=a.call(this,t,s,c),t})).sort((function(t,e){return e.size-t.size}));let M=-1,E=g.board?[{x:0,y:0},{x:s,y:y}]:void 0;function O(){const e=Date.now();for(;Date.now()-e<h&&++M<x;){const e=k[M];e.x=s*(c()+.5)>>1,e.y=y*(c()+.5)>>1,qG(m,e,k,M),e.hasText&&v(b,e,E)&&(l.call(null,"word",{cloud:g,word:e}),w.push(e),E?g.hasImage||UG(E,e):E=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=t[0]>>1,e.y-=t[1]>>1)}g._tags=w,g._bounds=E,M>=x&&(g.stop(),l.call(null,"end",{cloud:g,words:w,bounds:E}))}return f&&clearInterval(f),f=setInterval(O,0),O(),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=KG((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=JG(t)},g.font=function(t){n=JG(t)},g.fontWeight=function(t){i=JG(t)},g.rotate=function(t){o=JG(t)},g.canvas=function(t){d=JG(t)},g.spiral=function(t){s=tH[t]||t},g.fontSize=function(t){r=JG(t)},g.padding=function(t){a=JG(t)},g.random=function(t){c=JG(t)},g.on=function(t){l=JG(t)},g}const nH={fontSize:[20,60],font:"Impact",padding:2,rotate:function(){return 30*(~~(6*Math.random())-3)}};function rH(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 iH=(t,e)=>n=>Re(void 0,void 0,void 0,(function*(){const r=Object.assign({},nH,t,{canvas:e.createCanvas}),i=eH();var o,a;yield(o=i,a=r,{set(t,e,n){if(void 0===a[t])return this;const r=e?e.call(null,a[t]):a[t];return n?n.call(null,r):"function"==typeof o[t]?o[t](r):o[t]=r,this},setAsync(t,e,n){return Re(this,void 0,void 0,(function*(){if(void 0===a[t])return this;const r=e?yield e.call(null,a[t]):a[t];return n?n.call(null,r):"function"==typeof o[t]?o[t](r):o[t]=r,this}))}}).set("fontSize",(t=>{const e=n.map((t=>t.value));return function(t,e){if("function"==typeof t)return t;if(Array.isArray(t)){const[n,r]=t;if(!e)return()=>(r+n)/2;const[i,o]=e;return o===i?()=>(r+n)/2:({value:t})=>(r-n)/(o-i)*(t-i)+n}return()=>t}(t,[mr(e),vr(e)])})).set("font").set("fontStyle").set("fontWeight").set("padding").set("rotate").set("size").set("spiral").set("timeInterval").set("random").set("text").set("on").set("canvas").setAsync("imageMask",rH,i.createMask),i.words([...n]);const s=i.start(),[c,l]=r.size,u=[{x:0,y:0},{x:c,y:l}],{_bounds:f=u,_tags:h,hasImage:d}=s,p=h.map((t=>{var{x:e,y:n,font:r}=t,i=Le(t,["x","y","font"]);return Object.assign(Object.assign({},i),{x:e+c/2,y:n+l/2,fontFamily:r})})),[{x:g,y:v},{x:y,y:m}]=f,b={text:"",value:0,opacity:0,fontSize:0};return p.push(Object.assign(Object.assign({},b),{x:d?0:g,y:d?0:v}),Object.assign(Object.assign({},b),{x:d?c:y,y:d?l:m})),p}));function oH(t){return"string"==typeof t?e=>e[t]:t}iH.props={};const aH=t=>{const{join:e,on:n,select:r=[],as:i=r,unknown:o=NaN}=t,[a,s]=n,c=oH(s),l=oH(a),u=er(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)),{}))}))};aH.props={};const sH=t=>{const{start:e,end:n}=t;return t=>t.slice(e,n)};sH.props={};var cH={exports:{}},lH={exports:{}};!function(t){var e=t.exports;t.exports.isNumber=function(t){return"number"==typeof t},t.exports.findMin=function(t){if(0===t.length)return 1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.min(e,t[n]);return e},t.exports.findMax=function(t){if(0===t.length)return-1/0;for(var e=t[0],n=1;n<t.length;n++)e=Math.max(e,t[n]);return e},t.exports.findMinMulti=function(t){for(var n=e.findMin(t[0]),r=1;r<t.length;r++)n=Math.min(n,e.findMin(t[r]));return n},t.exports.findMaxMulti=function(t){for(var n=e.findMax(t[0]),r=1;r<t.length;r++)n=Math.max(n,e.findMax(t[r]));return n},t.exports.inside=function(t,e,n){return t<=n&&n<=e}}(lH),function(t){var e=Math.log(2),n=t.exports,r=lH.exports;function i(t){return 1-Math.abs(t)}t.exports.getUnifiedMinMax=function(t,e){return n.getUnifiedMinMaxMulti([t],e)},t.exports.getUnifiedMinMaxMulti=function(t,e){e=e||{};var n=!1,i=!1,o=r.isNumber(e.width)?e.width:2,a=r.isNumber(e.size)?e.size:50,s=r.isNumber(e.min)?e.min:(n=!0,r.findMinMulti(t)),c=r.isNumber(e.max)?e.max:(i=!0,r.findMaxMulti(t)),l=(c-s)/(a-1);return n&&(s-=2*o*l),i&&(c+=2*o*l),{min:s,max:c}},t.exports.create=function(t,e){if(e=e||{},!t||0===t.length)return[];var o=r.isNumber(e.size)?e.size:50,a=r.isNumber(e.width)?e.width:2,s=n.getUnifiedMinMax(t,{size:o,width:a,min:e.min,max:e.max}),c=s.min,l=s.max-c,u=l/(o-1);if(0===l)return[{x:c,y:1}];for(var f=[],h=0;h<o;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}(i,a),p=d[a],g=d[a-1]-d[a-2],v=0;t.forEach((function(t){var e=function(t){return Math.floor((t-c)/u)}(t);if(!(e+a<0||e-a>=f.length)){var n=Math.max(e-a,0),i=e,o=Math.min(e+a,f.length-1),s=n-(e-a),l=e+a-o,h=d[-a-1+s]||0,y=d[-a-1+l]||0,m=p/(p-h-y);s>0&&(v+=m*(s-1)*g);var b=Math.max(0,e-a+1);r.inside(0,f.length-1,b)&&(f[b].y+=1*m*g),r.inside(0,f.length-1,i+1)&&(f[i+1].y-=2*m*g),r.inside(0,f.length-1,o+1)&&(f[o+1].y+=1*m*g)}}));var y=v,m=0,b=0;return f.forEach((function(t){m+=t.y,y+=m,t.y=y,b+=y})),b>0&&f.forEach((function(t){t.y/=b})),f},t.exports.getExpectedValueFromPdf=function(t){if(t&&0!==t.length){var e=0;return t.forEach((function(t){e+=t.x*t.y})),e}},t.exports.getXWithLeftTailArea=function(t,e){if(t&&0!==t.length){for(var n=0,r=0,i=0;i<t.length&&(r=i,!((n+=t[i].y)>=e));i++);return t[r].x}},t.exports.getPerplexity=function(t){if(t&&0!==t.length){var n=0;return t.forEach((function(t){var e=Math.log(t.y);isFinite(e)&&(n+=t.y*e)})),n=-n/e,Math.pow(2,n)}}}(cH);var uH=cH.exports;const fH=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(Jn(t,(t=>n.map((e=>t[e])).join("-"))).values());return r.map((t=>{const n=uH.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})}))}};function hH(t){const e=new Array(t);for(let n=0;n<t;++n)e[n]=0;return e}function dH(t,e){return hH(t).map((()=>hH(e)))}function pH(t,e){let n=0;for(let r=0;r<t.length;++r)n+=t[r]*e[r];return n}function gH(t){return Math.sqrt(pH(t,t))}function vH(t,e,n){for(let r=0;r<e.length;++r)t[r]=e[r]*n}function yH(t,e,n,r,i){for(let o=0;o<t.length;++o)t[o]=e*n[o]+r*i[o]}function mH(t,e,n,r,i,o,a){const s=n.fx,c=pH(n.fxprime,e);let l=s,u=s,f=c,h=0;function d(u,h,d){for(let p=0;p<16;++p)if(i=(u+h)/2,yH(r.x,1,n.x,i,e),l=r.fx=t(r.x,r.fxprime),f=pH(r.fxprime,e),l>s+o*i*c||l>=d)h=i;else{if(Math.abs(f)<=-a*c)return i;f*(h-u)>=0&&(h=u),u=i,d=l}return 0}i=i||1,o=o||1e-6,a=a||.1;for(let p=0;p<10;++p){if(yH(r.x,1,n.x,i,e),l=r.fx=t(r.x,r.fxprime),f=pH(r.fxprime,e),l>s+o*i*c||p&&l>=u)return d(h,i,u);if(Math.abs(f)<=-a*c)return i;if(f>=0)return d(i,h,l);u=l,h=i,i*=2}return i}function bH(t,e,n){let r={x:e.slice(),fx:0,fxprime:e.slice()},i={x:e.slice(),fx:0,fxprime:e.slice()};const o=e.slice();let a,s=1;const c=(n=n||{}).maxIterations||20*e.length;r.fx=t(r.x,r.fxprime);const l=r.fxprime.slice();vH(l,r.fxprime,-1);for(let e=0;e<c;++e){if(s=mH(t,l,r,i,s),n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:s}),s){yH(o,1,i.fxprime,-1,r.fxprime);const t=pH(r.fxprime,r.fxprime);yH(l,Math.max(0,pH(o,i.fxprime)/t),l,-1,i.fxprime),a=r,r=i,i=a}else vH(l,r.fxprime,-1);if(gH(r.fxprime)<=1e-5)break}return n.history&&n.history.push({x:r.x.slice(),fx:r.fx,fxprime:r.fxprime.slice(),alpha:s}),r}fH.props={};const xH=1e-10;function wH(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=OH(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(MH(t,e[n])>e[n].radius+xH)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=MH(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+=kH(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(MH(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-xH,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 kH(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function MH(t,e){return Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}function EH(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 kH(t,t-(n*n-e*e+t*t)/(2*n))+kH(e,r)}function OH(t,e){const n=MH(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}]}function _H(t,e){(e=e||{}).maxIterations=e.maxIterations||500;const n=e.initialLayout||TH,r=e.lossFunction||PH;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=function(t,e,n){const r=(n=n||{}).maxIterations||200*e.length,i=n.nonZeroDelta||1.05,o=n.zeroDelta||.001,a=n.minErrorDelta||1e-6,s=n.minErrorDelta||1e-5,c=void 0!==n.rho?n.rho:1,l=void 0!==n.chi?n.chi:2,u=void 0!==n.psi?n.psi:-.5,f=void 0!==n.sigma?n.sigma:.5;let h;const d=e.length,p=new Array(d+1);p[0]=e,p[0].fx=t(e),p[0].id=0;for(let n=0;n<d;++n){const r=e.slice();r[n]=r[n]?r[n]*i:o,p[n+1]=r,p[n+1].fx=t(r),p[n+1].id=n+1}function g(t){for(let e=0;e<t.length;e++)p[d][e]=t[e];p[d].fx=t.fx}const v=(t,e)=>t.fx-e.fx,y=e.slice(),m=e.slice(),b=e.slice(),x=e.slice();for(let e=0;e<r;++e){if(p.sort(v),n.history){const t=p.map((t=>{const e=t.slice();return e.fx=t.fx,e.id=t.id,e}));t.sort(((t,e)=>t.id-e.id)),n.history.push({x:p[0].slice(),fx:p[0].fx,simplex:t})}h=0;for(let t=0;t<d;++t)h=Math.max(h,Math.abs(p[0][t]-p[1][t]));if(Math.abs(p[0].fx-p[d].fx)<a&&h<s)break;for(let t=0;t<d;++t){y[t]=0;for(let e=0;e<d;++e)y[t]+=p[e][t];y[t]/=d}const e=p[d];if(yH(m,1+c,y,-c,e),m.fx=t(m),m.fx<p[0].fx)yH(x,1+l,y,-l,e),x.fx=t(x),x.fx<m.fx?g(x):g(m);else if(m.fx>=p[d-1].fx){let n=!1;if(m.fx>e.fx?(yH(b,1+u,y,-u,e),b.fx=t(b),b.fx<e.fx?g(b):n=!0):(yH(b,1-u*c,y,u*c,e),b.fx=t(b),b.fx<m.fx?g(b):n=!0),n){if(f>=1)break;for(let e=1;e<p.length;++e)yH(p[e],1-f,p[0],f,p[e]),p[e].fx=t(p[e])}}else g(m)}return p.sort(v),{fx:p[0].fx,x:p[0]}}((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}const SH=1e-10;function AH(t,e,n){return Math.min(t,e)*Math.min(t,e)*Math.PI<=n+SH?Math.abs(t-e):function(t,e,n,r){const i=(r=r||{}).maxIterations||100,o=r.tolerance||1e-10,a=t(e),s=t(n);let 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(let n=0;n<i;++n){c/=2;const n=e+c,r=t(n);if(r*a>=0&&(e=n),Math.abs(c)<o||0===r)return n}return e+c}((function(r){return EH(t,e,r)-n}),0,t+e)}function TH(t,e){let n=function(t,e){const n=e&&e.lossFunction?e.lossFunction:PH,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+SH>=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=AH(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=AH(o.radius,t.radius,f[i].size),s=OH({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||PH;if(t.length>=8){const i=function(t,e){e=e||{};const n=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=dH(e.length,e.length),i=dH(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=AH(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=gH(s.map(gH))/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){h=bH(u,hH(2*s.length).map(Math.random),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)vH(e.history[o].x,l);return p}(t,e);r(i,t)+1e-8<r(n,t)&&(n=i)}return n}function PH(t,e){let n=0;for(let r=0;r<e.length;++r){const i=e[r];let o;if(1==i.sets.length)continue;if(2==i.sets.length){const e=t[i.sets[0]],n=t[i.sets[1]];o=EH(e.radius,n.radius,MH(e,n))}else o=wH(i.sets.map((function(e){return t[e]})));n+=(i.hasOwnProperty("weight")?i.weight:1)*(o-i.size)*(o-i.size)}return n}function NH(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}const CH=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=_H(r);let c;return r.map((t=>{const n=t[e];return Object.assign(Object.assign({},t),{[a]:({width:t,height:e})=>{c=c||NH(s,t,e,i);const r=n.map((t=>c[t]));let o=function(t){const e={};wH(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}})}))}};CH.props={};const LH=()=>t=>(console.log("G2 data section:",t),t);LH.props={};const jH=t=>{const{field:e="y",alpha:n=.6,as:r=e}=t;return t=>{const i=t.map((t=>t[e])),o=function(t,e){if(e<0||e>1)throw new Error("alpha must be between 0 and 1.");if(0===t.length)return[];let n=t[0];const r=[];for(const i of t){if(null==i){r.push(i),console.warn("EMA:The value is null or undefined",t);continue}null==n&&(n=i);const o=n*e+(1-e)*i;r.push(o),n=o}return r}(i,n);return t.map(((t,e)=>Object.assign(Object.assign({},t),{[r]:o[e]})))}};jH.props={};function RH(t){const{min:e,max:n}=t;return[[e[0],e[1]],[n[0],n[1]]]}function IH(t,e,n=.01){const[r,i]=t,[o,a]=e;return r>=o[0]-n&&r<=a[0]+n&&i>=o[1]-n&&i<=a[1]+n}const DH=t=>{const{priority:e}=t;return t=>{const n=[];return e&&t.sort(e),t.forEach((t=>{c$(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]}(RH(e),RH(t.getLocalBounds()))));r?s$(t):n.push(t)})),t}};function BH([t,e],[n,r]){return r>t&&e>n}function FH(){const t=new Map;return[e=>t.get(e),(e,n)=>t.set(e,n)]}function zH(t){const e=t.cloneNode(!0),n=e.getElementById("connector");n&&e.removeChild(n);const{min:r,max:i}=e.getRenderBounds();return e.destroy(),{min:r,max:i}}const $H=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]=FH(),[s,c]=FH(),[l,u]=FH(),[f,h]=FH();for(const e of t){const{min:t,max:n}=zH(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)=>Rn(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])&&!BH(f(i),f(o));)a+=1;if(o){const t=s(i),n=l(i),a=s(o),u=a-(t+n);if(u<r){const n=(r-u)/2;e=Math.max(e,n),c(i,t-n),c(o,a+n)}}}if(e<n)break}for(const e of t)e.style.y+=s(e)-o(e);return t}};function WH(t){let e=t/255;return e=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),e}function GH(t,e,n){return.2126*WH(t)+.7152*WH(e)+.0722*WH(n)}function HH(t,e){if(!t||!e||t===e)return 1;const{r:n,g:r,b:i}=t,{r:o,g:a,b:s}=e,c=GH(n,r,i),l=GH(o,a,s);return(Math.max(c,l)+.05)/(Math.min(c,l)+.05)}function YH(t,e){const n=yr(e,(e=>HH(t,function(t){return"object"==typeof t?t:lh(t)}(e))));return e[n]}const qH=t=>{const{threshold:e=4.5,palette:n=["#000","#fff"]}=t;return t=>(t.forEach((t=>{const r=t.attr("dependentElement").parsedStyle.fill;HH(t.parsedStyle.fill,r)<e&&t.attr("fill",YH(r,n))})),t)},VH=()=>t=>(t.forEach((t=>{c$(t);const e=t.attr("bounds"),n=function(t,e,n=.01){const[r,i]=t;return!(IH(r,e,n)&&IH(i,e,n))}(RH(t.getLocalBounds()),e);n&&s$(t)})),t),UH=()=>(t,{canvas:e,layout:n})=>(t.forEach((t=>{c$(t);const{max:e,min:r}=t.getRenderBounds(),[i,o]=e,[a,s]=r,c=((t,e)=>{const[[n,r],[i,o]]=e,[[a,s],[c,l]]=t;let u=0,f=0;return a<n?u=n-a:c>i&&(u=i-c),s<r?f=r-s:l>o&&(f=o-l),[u,f]})([[a,s],[i,o]],[[n.x,n.y],[n.x+n.width,n.y+n.height]]);t.style.connector&&t.style.connectorPoints&&(t.style.connectorPoints[0][0]-=c[0],t.style.connectorPoints[0][1]-=c[1]),t.style.x+=c[0],t.style.y+=c[1]})),t);function XH(){return{"data.fetch":_G,"data.inline":jG,"data.sortBy":LG,"data.sort":PG,"data.filter":TG,"data.pick":NG,"data.rename":CG,"data.fold":SG,"data.slice":sH,"data.custom":RG,"data.map":IG,"data.join":aH,"data.kde":fH,"data.log":LH,"data.wordCloud":iH,"data.ema":jH,"transform.stackY":xa,"transform.binX":Fs,"transform.bin":Bs,"transform.dodgeX":Ha,"transform.jitter":Xa,"transform.jitterX":Za,"transform.jitterY":Ka,"transform.symmetryY":Qa,"transform.diffY":Ja,"transform.stackEnter":Ya,"transform.normalizeY":qa,"transform.select":is,"transform.selectX":os,"transform.selectY":as,"transform.groupX":ms,"transform.groupY":bs,"transform.groupColor":xs,"transform.group":ys,"transform.sortX":ks,"transform.sortY":Es,"transform.sortColor":Ms,"transform.flexX":Os,"transform.pack":Rs,"transform.sample":$s,"transform.filter":Ws,"coordinate.cartesian":e,"coordinate.polar":r,"coordinate.transpose":o,"coordinate.theta":a,"coordinate.parallel":l,"coordinate.fisheye":u,"coordinate.radial":c,"coordinate.radar":f,"coordinate.helix":i,"encode.constant":h,"encode.field":p,"encode.transform":d,"encode.column":g,"mark.interval":PM,"mark.rect":CM,"mark.line":IM,"mark.point":BM,"mark.text":zM,"mark.cell":WM,"mark.area":HM,"mark.link":qM,"mark.image":UM,"mark.polygon":ZM,"mark.box":QM,"mark.vector":tE,"mark.lineX":iE,"mark.lineY":nE,"mark.connector":aE,"mark.range":uE,"mark.rangeX":hE,"mark.rangeY":pE,"mark.path":ZE,"mark.shape":b_,"mark.density":SS,"mark.heatmap":TS,"mark.wordCloud":bS,"palette.category10":LS,"palette.category20":jS,"scale.linear":IS,"scale.ordinal":DS,"scale.band":RS,"scale.identity":BS,"scale.point":FS,"scale.time":zS,"scale.log":$S,"scale.pow":WS,"scale.sqrt":qS,"scale.threshold":GS,"scale.quantile":HS,"scale.quantize":YS,"scale.sequential":VS,"scale.constant":US,"theme.classic":QS,"theme.classicDark":eA,"theme.academy":rA,"theme.light":KS,"theme.dark":tA,"component.axisX":RA,"component.axisY":IA,"component.legendCategory":WA,"component.legendContinuous":VA,"component.legends":dT,"component.title":tT,"component.sliderX":cT,"component.sliderY":lT,"component.scrollbarX":fT,"component.scrollbarY":hT,"animation.scaleInX":pT,"animation.scaleOutX":gT,"animation.scaleInY":vT,"animation.scaleOutY":yT,"animation.waveIn":LT,"animation.fadeIn":mT,"animation.fadeOut":bT,"animation.zoomIn":jT,"animation.zoomOut":RT,"animation.pathIn":IT,"animation.morphing":CT,"animation.growInX":DT,"animation.growInY":BT,"interaction.elementHighlight":F$,"interaction.elementHighlightByX":z$,"interaction.elementHighlightByColor":$$,"interaction.elementSelect":G$,"interaction.elementSelectByX":H$,"interaction.elementSelectByColor":Y$,"interaction.fisheye":V$,"interaction.chartIndex":q$,"interaction.tooltip":gW,"interaction.legendFilter":OW,"interaction.legendHighlight":_W,"interaction.brushHighlight":RW,"interaction.brushXHighlight":DW,"interaction.brushYHighlight":FW,"interaction.brushAxisHighlight":qW,"interaction.brushFilter":VW,"interaction.brushXFilter":UW,"interaction.brushYFilter":XW,"interaction.sliderFilter":JW,"interaction.scrollbarFilter":eG,"interaction.poptip":oG,"interaction.treemapDrillDown":sG,"interaction.elementPointMove":vG,"composition.spaceLayer":KC,"composition.spaceFlex":QC,"composition.facetRect":pL,"composition.repeatMatrix":xL,"composition.facetCircle":_L,"composition.timingKeyframe":AL,"labelTransform.overlapHide":DH,"labelTransform.overlapDodgeY":$H,"labelTransform.overflowHide":VH,"labelTransform.contrastReverse":qH,"labelTransform.exceedAdjust":UH}}function ZH(){return{"composition.geoView":PI,"composition.geoPath":TL}}function KH(){return{"data.arc":GE,"data.cluster":hS,"mark.forceGraph":uS,"mark.tree":mS,"mark.pack":l_,"mark.sankey":FE,"mark.chord":UE,"mark.treemap":a_}}function QH(){return{"data.venn":CH,"mark.boxplot":m_,"mark.gauge":OS,"mark.wordCloud":bS,"mark.liquid":CS}}function JH(){return Object.assign(Object.assign(Object.assign(Object.assign({},ZH()),KH()),QH()),XH())}function tY(t,e){return class extends t{constructor(t){super(Object.assign(Object.assign({},t),{lib:e}))}}}const eY={};const nY=t=>t?parseInt(t):0;function rY(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 iY{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 rY(this,(n=>{t===n.attr("key")&&(e=n)})),e}getNodesByType(t){const e=[];return rY(this,(n=>{t===n.type&&e.push(n)})),e}getNodeByType(t){let e=null;return rY(this,(n=>{e||t===n.type&&(e=n)})),e}call(t,...e){return t(this.map(),...e),this}getRoot(){let t=this;for(;t&&t.parentNode;)t=t.parentNode;return t}}const oY=["width","height","depth","padding","paddingLeft","paddingRight","paddingBottom","paddingTop","inset","insetLeft","insetRight","insetTop","insetBottom","margin","marginLeft","marginRight","marginTop","marginBottom","autoFit","theme","title","interaction"],aY="__remove__",sY="__callback__";function cY(t){return Object.assign(Object.assign({},t.value),{type:t.type})}function lY(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||nY(e.width),r=t.clientHeight||nY(e.height);return{width:n-(nY(e.paddingLeft)+nY(e.paddingRight)),height:r-(nY(e.paddingTop)+nY(e.paddingBottom))}}(e);a=t||a,s=n||s}return a=n||a,s=r||s,{width:Math.max(I(a)?a:1,1),height:Math.max(I(s)?s:1,1),depth:o}}function uY(t){const e=function(t){if(null!==t.type)return t;const e=t.children[t.children.length-1];for(const n of oY)e.attr(n,t.attr(n));return e}(t),n=[e],r=new Map;for(r.set(e,cY(e));n.length;){const t=n.pop(),e=r.get(t),{children:i=[]}=t;for(const t of i)if(t.type===sY)e.children=t.value;else{const i=cY(t),{children:o=[]}=e;o.push(i),n.push(t),r.set(t,i),e.children=o}}return r.get(e)}function fY(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 oY)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 oY)void 0!==n[e]&&(t[e]=n[e],delete n[e]);return Object.assign(Object.assign({},t),{children:[n]})}return e}function hY(t,e,n){if("function"==typeof t){const e=new iY;return e.value=t,e.type=sY,e}const{type:r,children:i}=t,o=Le(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 dY(t,e){const{type:n,children:r}=e,i=Le(e,["type","children"]);t.type===n||void 0===n?ia(t.value,i):"string"==typeof n&&(t.type=n,t.value=i)}function pY(t,e,n,r){if(!t)return;const i=[[t,e]];for(;i.length;){const[t,e]=i.shift(),o=hY(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 gY(t,e,{key:n=e}){t.prototype[e]=function(t){return 0===arguments.length?this.attr(n):this.attr(n,t)}}function vY(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 yY(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 mY(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(na(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 bY(t,e,{ctor:n}){t.prototype[e]=function(t){const r=this.append(n);return"mark"===e&&(r.type=t),r}}function xY(t,e,{ctor:n}){t.prototype[e]=function(){return this.type=null,this.append(n)}}function wY(t){return e=>{for(const[n,r]of Object.entries(t)){const{type:t}=r;"value"===t?gY(e,n,r):"array"===t?vY(e,n,r):"object"===t?yY(e,n,r):"node"===t?bY(e,n,r):"container"===t?xY(e,n,r):"mix"===t&&mY(e,n)}return e}}function kY(t){return Object.fromEntries(Object.entries(t).map((([t,e])=>[t,{type:"node",ctor:e}])))}const MY={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"}},EY=Object.assign(Object.assign({},MY),{tooltip:{type:"mix"},viewStyle:{type:"object"}}),OY=Object.assign(Object.assign({},MY),{labelTransform:{type:"array"}});let _Y=class extends iY{changeData(t){var e;const n=this.getRoot();if(n)return this.attr("data",t),(null===(e=this.children)||void 0===e?void 0:e.length)&&this.children.forEach((e=>{e.attr("data",t)})),null==n?void 0:n.render()}getView(){const t=this.getRoot(),{views:e}=t.getContext();if(null==e?void 0:e.length)return e.find((t=>t.key===this._key))}getScale(){var t;return null===(t=this.getView())||void 0===t?void 0:t.scale}getScaleByChannel(t){const e=this.getScale();if(e)return e[t]}getCoordinate(){var t;return null===(t=this.getView())||void 0===t?void 0:t.coordinate}getTheme(){var t;return null===(t=this.getView())||void 0===t?void 0:t.theme}getGroup(){const t=this._key;if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}show(){const t=this.getGroup();t&&!t.isVisible()&&c$(t)}hide(){const t=this.getGroup();t&&t.isVisible()&&s$(t)}};_Y=je([wY(OY)],_Y);let SY=class extends iY{changeData(t){const e=this.getRoot();if(e)return this.attr("data",t),null==e?void 0:e.render()}getMark(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(!e)return;const{markState:n}=e,r=Array.from(n.keys()).find((t=>t.key===this.attr("key")));return n.get(r)}getScale(){var t;const e=null===(t=this.getRoot())||void 0===t?void 0:t.getView();if(e)return null==e?void 0:e.scale}getScaleByChannel(t){var e,n;const r=null===(e=this.getRoot())||void 0===e?void 0:e.getView();if(r)return null===(n=null==r?void 0:r.scale)||void 0===n?void 0:n[t]}getGroup(){const t=this.attr("key");if(!t)return;return this.getRoot().getContext().canvas.getRoot().getElementById(t)}};SY=je([wY(EY)],SY);const AY="G2_CHART_KEY";class TY extends _Y{constructor(t){const{container:e,canvas:n,renderer:r,plugins:i,lib:o,createCanvas:a}=t;super(Le(t,["container","canvas","renderer","plugins","lib","createCanvas"]),"view"),this._hasBindAutoFit=!1,this._rendering=!1,this._trailingClear=null,this._trailing=!1,this._trailingResolve=null,this._trailingReject=null,this._previousDefinedType=null,this._onResize=U((()=>{this.forceFit()}),300),this._renderer=r||new aN,this._plugins=i||[],this._container=function(t){if(void 0===t){const t=document.createElement("div");return t[aY]=!0,t}if("string"==typeof t)return document.getElementById(t);return t}(e),this._emitter=new uN,this._context={library:Object.assign(Object.assign({},o),eY),emitter:this._emitter,canvas:n,createCanvas:a},this._create()}render(){if(this._rendering)return this._addToTrailing();this._context.canvas||this._createCanvas(),this._bindAutoFit(),this._rendering=!0;const t=new Promise(((t,e)=>e$(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).then((()=>{if(this._trailingClear){const t=this.options();this._trailingClear(),this._trailing&&this.options(t)}})).catch(r).then((()=>{this._trailingClear=null,this._renderTrailing()})),e}options(t){if(0===arguments.length)return uY(this);const{type:e}=t;return e&&(this._previousDefinedType=e),function(t,e,n,r,i){const o=[[null,t,fY(t,e,n,r,i)]];for(;o.length;){const[t,e,n]=o.shift();if(e)if(n){dY(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 pY(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(t=!0){if(this._rendering)return this._trailingClear=()=>{this.clear(t)},void this._reset();this.options();this.emit(fN.BEFORE_CLEAR),this._reset(),n$(0,this._context,!1,t),this.emit(fN.AFTER_CLEAR)}destroy(){this.options();this.emit(fN.BEFORE_DESTROY),this._unbindAutoFit(),this._reset(),n$(0,this._context,!0),this._container[aY]&&function(t){const e=t.parentNode;e&&e.removeChild(t)}(this._container),this.emit(fN.AFTER_DESTROY)}forceFit(){this.options.autoFit=!0;const{width:t,height:e}=lY(this.options(),this._container);if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(fN.BEFORE_CHANGE_SIZE);const n=this.render();return n.then((()=>{this.emit(fN.AFTER_CHANGE_SIZE)})),n}changeSize(t,e){if(t===this._width&&e===this._height)return Promise.resolve(this);this.emit(fN.BEFORE_CHANGE_SIZE),this.attr("width",t),this.attr("height",e);const n=this.render();return n.then((()=>{this.emit(fN.AFTER_CHANGE_SIZE)})),n}getDataByXY(t,e={}){const{shared:n=!1,series:r,facet:i=!1,startX:o=0,startY:a=0}=e,{canvas:s,views:c}=this._context,{document:l}=s,{x:u,y:f}=t,{coordinate:h,scale:d,markState:p,data:g,key:v}=c[0],y=l.getElementsByClassName($T),m=n?t=>t.__data__.x:t=>t,b=Jn(y,m),x=h$(l.getElementsByClassName(WT)[0]),w=t=>Array.from(t.values()).some((t=>{var e,n;return(null===(e=t.interaction)||void 0===e?void 0:e.seriesTooltip)||(null===(n=t.channels)||void 0===n?void 0:n.some((t=>"series"===t.name&&void 0!==t.values)))})),k=lW(r,w(p)),M=t=>rt(t,"__data__.data",null);try{if(k&&w(p)&&!i){const{selectedData:t}=hW({root:x,event:{offsetX:u,offsetY:f},elements:y,coordinate:h,scale:d,startX:o,startY:a}),e=g.get(`${v}-0`);return t.map((({index:t})=>e[t]))}const t=m(fW({root:x,event:{offsetX:u,offsetY:f},elements:y,coordinate:h,scale:d,shared:n})),e=b.get(t);return e?e.map(M):[]}catch(t){const e=s.document.elementFromPointSync(u,f);return e?M(e):[]}}_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 SY{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 _Y{constructor(){super({},e)}};return n=je([wY(kY(this._marks))],n),[e,n]})));for(const t of Object.values(this._compositions))wY(kY(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=AY}=t,{width:n,height:r,depth:i}=lY(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}=lY(this.options(),this._container);this._plugins.push(new cN),this._plugins.forEach((t=>this._renderer.registerPlugin(t))),this._context.canvas=new fv({container:this._container,width:t,height:e,renderer:this._renderer})}_addToTrailing(){var t;null===(t=this._trailingResolve)||void 0===t||t.call(this,this),this._trailing=!0;return new Promise(((t,e)=>{this._trailingResolve=t,this._trailingReject=e}))}_bindAutoFit(){const t=this.options(),{autoFit:e}=t;this._hasBindAutoFit?e||this._unbindAutoFit():e&&(this._hasBindAutoFit=!0,window.addEventListener("resize",this._onResize))}_unbindAutoFit(){this._hasBindAutoFit&&(this._hasBindAutoFit=!1,window.removeEventListener("resize",this._onResize))}}const PY=tY(TY,Object.assign({},JH()));t.AREA_CLASS_NAME=qT,t.Academy=rA,t.Bin=Bs,t.BinX=Fs,t.COMPONENT_CLASS_NAME=HT,t.Chart=PY,t.ChartEvent=fN,t.Classic=QS,t.ClassicDark=eA,t.Dark=tA,t.DiffY=Ja,t.DodgeX=Ha,t.ELEMENT_CLASS_NAME=$T,t.Filter=Ws,t.FlexX=Os,t.Group=ys,t.GroupColor=xs,t.GroupX=ms,t.GroupY=bs,t.Jitter=Xa,t.JitterX=Za,t.JitterY=Ka,t.LABEL_CLASS_NAME=YT,t.LABEL_LAYER_CLASS_NAME=zT,t.Light=KS,t.LinearAxis=LA,t.MAIN_LAYER_CLASS_NAME=FT,t.MASK_CLASS_NAME="mask",t.MaybeDefaultX=Ia,t.MaybeDefaultY=Da,t.MaybeFunctionAttribute=$a,t.MaybeGradient=Ga,t.MaybeIdentityX=Ra,t.MaybeIdentityY=ja,t.MaybeKey=Pa,t.MaybeSeries=Na,t.MaybeSize=Ta,t.MaybeStackY=ka,t.MaybeTitle=Oa,t.MaybeTooltip=Ba,t.MaybeTuple=Wa,t.MaybeTupleX=La,t.MaybeTupleY=Ca,t.MaybeVisualPosition=za,t.MaybeZeroPadding=Fa,t.MaybeZeroX=_a,t.MaybeZeroY=Sa,t.MaybeZeroY1=jn,t.MaybeZeroZ=Aa,t.NormalizeY=qa,t.PLOT_CLASS_NAME=GT,t.Pack=Rs,t.Runtime=TY,t.Sample=$s,t.Select=is,t.SelectX=os,t.SelectY=as,t.Selection=fy,t.SortColor=Ms,t.SortX=ks,t.SortY=Es,t.StackEnter=Ya,t.StackY=xa,t.SymmetryY=Qa,t.VIEW_CLASS_NAME=WT,t.corelib=XH,t.dataOf=Go,t.extend=tY,t.geolib=ZH,t.graphlib=KH,t.plotlib=QH,t.register=function(t,e){var n,r;t.startsWith("symbol.")?(n=t.split(".").pop(),r=e,dm.set(n,r)):Object.assign(eY,{[t]:e})},t.render=e$,t.renderToMountedElement=function(t,e={},n=()=>{},r=t=>{throw t}){var i;const{width:o=640,height:a=480}=t,s=Jz(t),{group:c=new Ig,emitter:l=new uN,library:u}=e;(null==c?void 0:c.parentElement)||Uo("renderToMountedElement can't render chart to unmounted group.");const f=uy(c);return e.group=c,e.emitter=l,e.canvas=e.canvas||(null===(i=null==c?void 0:c.ownerDocument)||void 0===i?void 0:i.defaultView),l.emit(fN.BEFORE_RENDER),Ez(Object.assign(Object.assign({},s),{width:o,height:a}),f,e).then((()=>{var t;null===(t=e.canvas)||void 0===t||t.requestAnimationFrame((()=>{l.emit(fN.AFTER_RENDER),null==n||n()}))})).catch((t=>{null==r||r(t)})),c},t.select=uy,t.selectG2Elements=l$,t.selectPlotArea=h$,t.seriesOf=function(t){const e=Wo(t).__data__,{scale:n}=e;return Ho(n,t.__data__)},t.stdlib=JH,Object.defineProperty(t,"__esModule",{value:!0})}));
|